We only need to dereference translate_config once to get the current
region_config we are working with, do this once at the start of the
sections that use it multiple times.
The compiler should optimize the multiple fetches anyway, so this
is purely for code readability.
Signed-off-by: Andrew Davis <afd@ti.com>
Instead of tracking if a matching address has been found and then
doing the translation after, we can loop until one is found and
do the translation and return immediately.
This saves having to keep a "found" variable, and makes the code
shorter and more readable IMHO. Do this here.
Signed-off-by: Andrew Davis <afd@ti.com>
Do not check virt being NULL as 0 is a valid address that can be
translated. Phys on the other hand is an output pointer that will be
assigned to and so cannot be NULL, check this instead to prevent a
NULL pointer dereference later.
Note that phys is allowed to be NULL, so this is not an invalid argument.
It can set to NULL when the caller wants to check if a virtual address is
mapped but does not care about the address itself. In that case -EFAULT
should be returned if the virtual address is not mapped, 0 otherwise.
For RAT, all addresses not translated are still valid and mapped as
pass-through, so we always return 0 in this check case.
Signed-off-by: Andrew Davis <afd@ti.com>
These struct and definitions are only used internally by this driver,
move them out of the public interface header and into the driver source.
Signed-off-by: Andrew Davis <afd@ti.com>
The struct address_trans_region_config is already defined, no reason
to pass this in as a void pointer then cast it later. Pass it in
as a struct pointer.
Signed-off-by: Andrew Davis <afd@ti.com>
This helper function is only used once and is way too small to need
to be factored into its own function. Inlining it greatly reduces
code size and complexity.
While merging, move the ASSERT()S out of the loop, they only need
checked once.
Signed-off-by: Andrew Davis <afd@ti.com>
video_format_cap needs to be terminated with a NULL entry
to allow looping over the formats.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
native_posix has been removed, so let's remove its support from
kconfig for this driver.
Also let's replace its mention in the help message.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Correct the introduction comment, removing the native_posix mention,
and something which did not apply for several years.
Also remove an unnecessary include.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Including renaming the kconfig option
NATIVE_POSIX_TIMER into NATIVE_SIM_TIMER deprecating the first one.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Current system INTID calcualtion only worked for SoCs whose extended
interrupts started from IRQ 0.
Otherwise, FSL_FEATURE_IRQSTEER_IRQ_START_INDEX should be added for
system INTID.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
The sensor does not always finish responding within 200 ms.
This is the sometimes the case when using the sensor calibrate command `X`.
Response delay up to 212 ms has been measured with a logic analyzer.
Increase the max response delay to 300 ms to fix the issue.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
During calibration feature development the following loop was used for
testing:
```shell
CMD="sensor attr_set explorir_m co2 calibration 1234"
while : ; do echo "$CMD" > /dev/ttyACM0; sleep .8; done
```
At some point calibration would fail and all following calibration commands
would fail.
Reset buffer and semaphore just before terminating the command to better
mitigate disturbance from previous failed command.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Rename the driver from uart_native_posix to uart_native_pty.
Including renaming the DTS compatible, and kconfig options, deprecating
the old ones.
And refactor the driver, generalizing it, so we can have any number of
instances.
Note that, unfortunately generalizing to N instances cannot be done
without a degree of backwards compatibility breakage: This driver was
born with all its configuration and selection of the instances based on
kconfig.
When the driver was made to use DT, it was done in a way that required
both DT and kconfig needing to manually coherently enable the 2nd UART.
This has now been fixed, which it means only DT is used to decide how
many instances are avaliable, and UART_NATIVE_POSIX_PORT_1_ENABLE is
just ignored.
Including:
* Deprecate UART_NATIVE_WAIT_PTS_READY_ENABLE: the options is always on
now as it has no practical drawbacks.
* Deprecate UART_NATIVE_POSIX_PORT_1_ENABLE: DTS intanciation defines it
being available now.
* Rename a few functions and in general shorten pseudo-tty/pseudo-
terminal to PTY instead of PTTY.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Pend until requested event is set before clearing it. Without that
check event could be cleared too early and APP core is not waken up.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The HCI IPC endpoint bound timeout value was hardcoded and set
to 1000 ms. This value may be differ between platforms, for
exampel due to extended boot time.
The default value used was a bit short for multicore SoCs
that usually may wait for some other service reposnes for
similar time. That may lead to timeout error while other
end of an endpoint was slightly late. Change the default
duration to 2000 ms to give more room for possible delays.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
- Add support for Fetch/Get API.
- Add support for Read/Decode API.
- Add config settings through device-tree.
- Add bus support for SPI (although easily extensible to others as
based on RTIO).
Fetch/Get API tested with accel_polling sample.
Read/Decode API tested with sensor_shell sample.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
It is no longer possible to use other signatures other than
`int fn(const struct device *)`. Just cast the device pointer,
safe in this context because CONFIG_DEVICE_MUTABLE=y.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This patch adds an initial driver for the WCH DMA
controller. All hardware features and most interface
features are implemented.
Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
Added the abililty to set the IPv4 addres, gateway and netmask from the
command line when running a native_posix build.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
The udc_skeleton driver incorrectly calls `K_THREAD_STACK_DEFINE` with
`CONFIG_UDC_SKELETON` instead of `CONFIG_UDC_SKELETON_STACK_SIZE`. This
causes stack overflows when developing a driver based on this code.
Fix the call to `K_THREAD_STACK_DEFINE`.
Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
Adds a check, that the phy device in the device tree, referenced
by the phy-handle property, is enabled.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The implementation for erasing pages in the flash_sam.c driver
indicated a successful erase after exceeding the last page to be
erased successfully. Since the last page has no proceeding page,
the succeeded status was not set.
This fix switches around the status to be set as succeeded before
erase begins, to have the succeeded status cleared if page unlock
or erase fails.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
As the RP2350B has more than 32 GPIO pins,
we changed the configuration so that it is split into two ports.
To do this, we created a `raspberrypi,pico-gpio-port` node and
moved the previous `raspberrypi,pico-gpio-port` functions to it.
This became a child node of `raspberrypi,pico-gpio-port`, and
`raspberrypi,pico-gpio-port` will remain a gpio mapper.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Update the NEORV32 SoC, peripheral drivers, and board to support NEORV32
v1.11.1. Notable changes include:
- Optional RISC-V ISA Kconfigs are now selected on the board level.
- Peripheral registers are now automatically reset in hardware, no need for
software initialization code.
- The NEORV32 GPIO controller now supports 32 pins, not 64. Interrupt
support will be submitted in a separate PR.
- Default board configuration has 64k RAM and is clocked at 18 MHz.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The ADP5585_GPO_OUT_MODE_A is used when configuring initial output
during pin configuration, causing pins configured HIGH is incorrectly
configured as open-drain. Replacing the reg with ADP5585_GPO_DATA_OUT
fixes the issue.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Currently, in Renesas adc driver, channel_count is used
as the maximum index of the channels can be supported.
However, the value input in dts of "channel_count"
represents the total number of supported channels.
After consideration, we have decided to remove this
reduntant property.
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Including renaming the DTS binding and kconfig options
deprecating the old one.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Refactor the userchan driver into a top and a bottom part.
The bottom is the one which interacts with the host and is built
with the host libC, while the top is built with the embedded code
and whatever libC that is built with.
Errors (errno) is converted between the top and bottom to ensure they
are coherent with the local libC.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Now that native_posix has been removed, this driver only needs to
support native_sim. Let's stop using the transitional headers which
supported both.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
* Sort includes by groups each alphabetically:
- standard lib
- zephyr
- private
* Move log registration to be after all includes.
Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
Rename the driver files, binding and kconfig options, while deprecating
the old binding and kconfig options.
Uses in tree are replaced.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The HCI IPC driver is not reliable and can lead to lost ACL data if
built without Controller-to-Host ACL flow control.
This commit prevents building HCI IPC driver and hci_ipc sample without
CONFIG_BT_HCI_ACL_FLOW_CONTROL.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
DWC2 thread must acquire UDC mutex before accessing shared resources
(peripheral registers and software data structures). Whenever software
enqueues a buffer, the caller first obtains mutex, adds the buffer to
the list, posts event to wake up DWC2 thread and releases mutex. If DWC2
thread has higher priority than the task currently holding a mutex,
there will be two completely unnecessary task switches: DWC2 will switch
in, try to obtain mutex, and then the control will be returned to the
mutex holder.
Avoid the unnecessary task switches by locking scheduler prior to
obtaining the mutex and unlocking scheduler after releasing the mutex.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Adds one RX thread per instance. Previously, only one global RX thread was
used resulting in crashes due to the thread instance being overwritten by
other instances.
Signed-off-by: Nils Ruf <nils.ruf@endress.com>