Commit graph

58497 commits

Author SHA1 Message Date
buxiasen
fb221e4d0d sama5/memory: align va&pa method to up_addrenv_x
Align prototype and make more easy to understand.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
Windrow14
b05ec7729d drivers/mmcsd/mmcsd_sdio.c: use dma to receive setup if dma is enabled
Call SDIO_DMARECVSETUP instead of SDIO_RECVSETUP if CONFIG_SDIO_DMA
is defined, aligning with other callings of in mmcsd_sdio.c.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2025-05-11 20:28:55 +08:00
wangjianyu3
5fc950e608 drivers/sensor: Fix spell errors of uorb.h
../nuttx/tools/checkpatch.sh -c -u -m -g d611304d61a79f581210584813a5b2894b838490..HEAD
Used config files:
    1: .codespellrc
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:307: afte ==> after
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:405: multipled ==> multiplied
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:416: multipled ==> multiplied
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:432: provies ==> provides, proves
    /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:1173: subcribers ==> subscribers
    Error: Process completed with exit code 1.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-11 20:28:17 +08:00
wangjianyu3
fda251aad0 drivers/sensor: Add timestamp for GNSS data
Add timestamp for GNSS measurements and clock, for matching.

When recovering the combination of `GnssMeasurement` and `GnssClock` into
[GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/
           refs/heads/android14-release/include/hardware/gps.h#1748),
the reason for splitting is that the uORB buffer is not large enough to
accommodate `GnssData`, since different topics cannot guarantee the
same timing when publishing and subscribing data, we need an index to match.

WARNING: A new member "timestamp" of type uint64_t has been added at
the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock".

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-11 20:28:17 +08:00
ouyangxiangzhen
36a4d5feaf sched/wqueue: Improve performance of the work_queue.
This commit improve the performance of the work_queue by reducing
unnecessary wdog timer setting.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-05-11 10:47:13 +08:00
ouyangxiangzhen
f442a41102 sched/wqueue: Fix work_cancel_sync.
This commit fixed work_cancel_sync at a very rare boundary case. When a worker thread re-enqueues the work data structure during the execution of work, the user thread cannot directly dequeue the work in work_cancel_sync. Instead, it should wait until all workers' references to the work data structure have been eliminated after dequeuing.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-05-11 10:47:13 +08:00
EmomaxD
d611304d61 style: fix typos in comment.
- Corrected the typo in the comment of the arch/arm/src/arm/arm_cache.S file.
- Standardized the cache terminology, changing "D-cache" and "I-cache" to "Dcache" and "Icache" for consistency with existing code style.

Signed-off-by: EmomaxD <emreleno@gmail.com>
2025-05-10 12:02:23 +08:00
Serg Podtynnyi
185c55e16d arch/arm/rp23xx: remove spinlock from up_txint
spin lock/unlock introduced before sometimes got stuck on tx

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-09 19:21:51 +08:00
Theodore Karatapanis
0011f165ff style: fix typos required by ci-cd
- Added "infor" to .codespellrc ignore-words-list.
  This term is used by NXP's ROMAPI naming conventions and is not a typo
  in this context.
- This prevents CI/CD codespell checks from failing due to false positives.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-09 19:21:17 +08:00
Theodore Karatapanis
5d63c3e460 arch/arm64: Allow non MMU builds.
MMU initialization is redundant for bootloaders(BL2) that load TF‑A(BL31).
TF-A will ignore and overwrite any MMU configuration performed by BL2.
Additionally the MMU comes with a large memory footprint (~50 KB)
which could be precious for such setups.

When the MMU is disabled all the memory is treated as device memory and
all alignment faults generate exceptions (as opposed to normal memory when
MMU is enabled). For that reason we need to add -fno-builtin when compiling
with CONFIG_ARCH_USE_MMU != y to prevent alignment faults.

- Guard MMU initialization with CONFIG_ARCH_USE_MMU
- If CONFIG_ARCH_USE_MMU is not set add -fno-builtin which prevents alignment errors.
- Deliberately didn't try to replace CONFIG_ARCH_HAVE_MMU with CONFIG_ARCH_USE_MMU
  occurrences, because this will break a lot of build targets that assume MMU without
  guarding the MMU initialization.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-09 19:21:17 +08:00
Theodore Karatapanis
d278c6cb15 arch/arm64/imx9: Add ROMAPI and AHAB support for i.MX9
This adds support for the i.MX9 ROMAPI, allowing boot in a more
device agnostic and portable manner. The ROMAPI "natively" allows to:
- Query the boot device for information.
- Copy data from the boot device to RAM.

An extra functionality was added to ROMAPI to calculate
offsets of sequential AHAB containers.

The AHAB functionality is built on top of raw ELE primitives and allows to:
- Authenticate a container image.
- Release the authenticated container.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-09 19:21:17 +08:00
Theodore Karatapanis
3c48031ec3 arch/arm64/imx9: Extend ELE API for container authentication
This extends ELE API to:
- Authenticate i.MX container header.
- Verify container images.
- Release resources of the authenticated containers.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-09 19:21:17 +08:00
Eren Terzioglu
9a59cf4004 Documentation/xtensa: Add SDM docs for esp32[-|-s2|-s3]
Add SDM docs for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Eren Terzioglu
4b36d69630 boards/xtensa: Add SDM peripheral board layer support for esp[-|-s2|-s3]
Add SDM perpiheral board layer support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Eren Terzioglu
39465d2156 arch/xtensa: Add SDM peripheral support for esp32[-|-s2|-s3]
Add SDM peripheral support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Eren Terzioglu
bf2a7ad49a Documentation/risc-v: Add SDM peripheral docs for esp32[-c3|-c6|-h2]
Add SDM peripheral docs for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Eren Terzioglu
521e1b15b6 boards/risc-v: Add board layer support of SDM for esp32[-c3|-c6|-h2]
Add SDM board layer support for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Eren Terzioglu
466e63d554 arch/risc-v: Add SDM support for esp32[-c3|-c6|-h2]
Add SDM peripheral support for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Serg Podtynnyi
622a45183e Documentation: update rp23xx page for recent changes
DMA, FPU/DSP, watchdog, chip tags

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-09 19:17:00 +08:00
Matteo Golin
81060b6721 rp2040/gpio: Fix debug assertion for interrupts.
The previous interrupt implementation allowed only one single interrupt
mode to be selected. The debug assertion is now updated to allow the
entire range of possible interrupt combinations (a 4-bit field), up to
0xf.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-09 15:54:45 +08:00
Rodrigo Sim
7a64c86c1b boards/risc-v/esp32c6 Add initial support to Seeed Studio XIAO ESP32c6
This commit introduces initial support for the Seeed Studio XIAO ESP32C6
board. Five configurations are available:
- nsh: Basic NuttShell support over UART0
- usbnsh: Basic NuttShell support over USB
- gpio: NuttShell over USB + GPIO
- wifi: NuttShell over USB + Wifi support

Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-05-09 12:54:50 +08:00
Rodrigo Sim
c133dd58a0 Documentation/ Add Seeed Studio XIAO ESP32C6 Board
This commit adds the documentation for the Seeed Studio XIAO ESP32C6
board. It includes examples for NSH, USBNSH, GPIOs and Wifi.

Signed-off-by: Rodrigo Sim rcsim10@gmail.com
2025-05-09 12:52:21 +08:00
George Poulios
16143b82b3 Documentation/guides/optee: Add an OP-TEE guide
The guide:
 - explains the different OP-TEE transports available
   in NuttX
 - gives brief instructions on how to enable the OP-TEE
   driver
 - documents the IOCTLs supported, and
 - shows typical usage in a NuttX app

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
b103a64a87 drivers/misc/optee: Add SMC backend for arm archs
So far NuttX has supported OP-TEE interfacing over
local and RPMsg sockets. This commit introduces support
for direct invocation of OP-TEE through arm SMCs. The
SMC transport is enabled through CONFIG_DEV_OPTEE_SMC.

This SMC implementation has been tested only with arm64,
OP-TEE rev 4.4.

Note that it does not support reverse direction RPCs,
i.e. from the Secure World to the Normal World to
something like optee supplicant. A basic RPC handling
skeleton is provided with implementation for some
basic functions (alloc/free mem, and foreign interrupts)
but no supplicant command handling.

(+one minor change s/parm/param in arch/arm64/include/syscall
to satisfy the spellchecker during PR)

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
a2b8c9d1d8 drivers/misc/optee.c: Add shm registration support
Adds support for SHM_REGISTER IOCTL. Registration can
be requested both against the driver (for automatic cleanup)
and against the secure OS (for sharing).

Introduces also `optee_{msg,free}_alloc()` to allocate
aligned memory for message arguments depending on the
`alignment` specified in the driver's private data. For
alignment greater than word size, memory is allocated on the
heap, otherwise it's allocated on the stack (similar to the
previous implementation but using `alloca()` instead).

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
8546fb080d drivers/misc/optee.c: Add memory sanity checks
Besides a few checks for NULL IOCTL argument values, this
commits introduces also a check to ensure that user specified
memory (mainly IOCTL arguments) indeed belongs to the user.
This is applicable only with `CONFIG_ARCH_ADDRENV`.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
5c8e5d2ef2 drivers/misc/optee.c: Close session on open error
Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
da0586c7e3 drivers/misc/optee.c: Decouple transport from driver
Prepares the ground for introducing new transports to
the OP-TEE driver. "transports" as in alternatives to
RPMsg and local network.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
Serg Podtynnyi
bc4a52f910 arch/arm/rp23xx: update serial code smp fixes from cxd56
Most of the code is the same, update to recent fixes

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-08 11:39:24 -03:00
Jukka Laitinen
e4d5c78008 Fix signal delivered to a wrong thread
When using pthread_kill, the signal should be delivered to the
specified thread. Current implementation, however, may add the
signal to the groups pending list, if the signal is masked at the
time of dispatch. From the group's pending list it can be delivered
to any thread of the group, which is wrong.

Fix this by adding a new field "FAR struct tcb_s *tcb" to
"struct sigpendq", marking if the signal needs to be delivered
to a specific thread. Use NULL for the value if delivery to any
thread in the group is ok.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 21:32:35 +08:00
Jukka Laitinen
efc0f400bb sched/signal/sig_dispatch.c: Correct spelling in comments, waitting ==> waiting
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 21:32:08 +08:00
Jukka Laitinen
a0efb1fefe sched/signal: Move dynamic allocation of pending signals to a safe place
The kmm_alloc can break the critical section, if it sleeps on the
heap mutex. If we run out of pending signal structures, allocate more
right after entering the critical section but before checking if the signal
needs to be added to the pending queue.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 21:32:08 +08:00
Jukka Laitinen
77df55db45 sched/signal: Move nxsig_find_action outside of critical section
The TCB used in find_action is locked by spinlock, so it doesn't belong
inside critical section. Just find the possible action already in the
beginning of nxsig_tcbdispatch.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 21:32:08 +08:00
Matteo Golin
e67247843d arm/sam34/boards/sam4e-ek: Migrate README to RST.
Migrate README.txt documentation to RST format as part of #11077.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-08 19:27:23 +08:00
Matteo Golin
ebe850841d arm/sam34/boards/sam3u-ek: Migrate README to RST.
Migrated README.txt documentation to RST format as part of #11077.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-08 19:27:23 +08:00
Matteo Golin
9504ebd4f5 arm/sam34/boards/boards/sam4l-xplained: Migrate README to RST
Migrate README.txt documentation to RST format as part of #11077.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-08 19:27:23 +08:00
Matteo Golin
b460d26b7c arm/sam34/boards/sam4s-xplained: Migrate README to RST
Migrate README documentation to RST format as part of #11077.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-08 19:27:23 +08:00
Matteo Golin
84cd5f87c4 arm/sam34/boards/sam4s-xplained-pro: Migrate README.txt to RST
Migrate README.txt documentation to RST format as part of #11077.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-08 19:27:23 +08:00
Matteo Golin
ddc3fb3589 arm/sam34/boards/flipnclick-sam3x: Migrate README.txt to RST.
Migrate README.txt documentation to RST format as part of #11077.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-08 19:27:23 +08:00
Jukka Laitinen
156469f158 Clean up the nxmutex library
- Remove the redundant holder, as nxsem now manages hoder TID
- Remove DEBUGASSERTIONS which are managed in nxsem
- Remove the "reset" handling logic, as it is now managed in nxsem
- Inline the simplest functions

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 16:00:05 +08:00
Jukka Laitinen
ffb49a25fb Enable mutex fast path for sem_wait and nxsem_wait also when priority inheritance is enabled
This enables the mutex fast path for nxsem_wait, nxsem_trywait and nxsem_post also when
the priority inheritance is enabled.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 16:00:05 +08:00
Jukka Laitinen
b6f2729730 Integrate nxmutex support fully into nxsem
This puts the mutex support fully inside nxsem, allowing
locking the mutex and setting the holder with single atomic
operation.

This enables fast mutex locking from userspace, avoiding taking
critical_sections, which may be heavy in SMP and cleanup
of nxmutex library in the future.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 16:00:05 +08:00
Jukka Laitinen
5c188b6625 sched/semaphore: Remove tcb from the SEM_WAITLIST when the task is deleted
The task which is deleted should be removed from the semaphores waitlist,
if the task happens to be blocked.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 16:00:05 +08:00
Jukka Laitinen
c325ab98c4 boards/nucleo-f302r8/qenco: Disable CONFIG_LIBC_FLOATINGPOINT to free up flash space
The board has got only 64KB of flash, and is on the limit. Removing printf floating point
support frees up ~3kB of flash.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 16:00:05 +08:00
Serg Podtynnyi
0ea2c0d17b sched/queue: fix typo in dq_insert_mid macro
Was only used in nxsched_process_delivered

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-08 15:59:50 +08:00
Kerogit
1a8fba827a arch/avr/src/avrdx: added support for AVR128DA64 and AVR128DB64 chips
This patch adds definitions for listed chips. No other changes are needed
as the chips are similar to the previously supported AVR128DA28 and all
that is needed is some definitions for extra peripherals.
2025-05-08 15:58:18 +08:00
Kerogit
bf76231f3c boards/avr/avrdx/breadxavr: support for buttons handled by input driver
This patch registers board buttons in input driver as /dev/buttons
and provides functions required by the driver
2025-05-08 15:58:18 +08:00
Kerogit
065910c7d3 arch/avr/src/avrdx: added I/O interrupt multiplexer
AVR DA/DB family chips have single interrupt vector for all changes
on an I/O port. This poses problem when multiple drivers want to claim
the same interrupt (might happen for example with button and discrete
joystick drivers using pins on the same port.)

The I/O multiplexer solves it by providing interface similar
to irq_attach. However, it allows registration of multiple handlers
for the same interrupt vector with additional information recording
which pins should be serviced by each handler.

Only handler for pins that triggered the interrupt is then called.
2025-05-08 15:58:18 +08:00
Kerogit
821fea2c2b arch/avr/src/avrdx: introduce header file for I/O port constants
Maps letter-marked I/O ports to numbers in alphabetical order.
2025-05-08 15:58:18 +08:00
Kerogit
ca7941eec7 arch/avr/avrdx: added support for serial driver
This patch adds support for using generic serial driver
with AVR DA/DB family of MCUs.
2025-05-08 15:58:18 +08:00