Commit graph

23845 commits

Author SHA1 Message Date
Jukka Laitinen
4baad0aa22 arch/risc-v/src/mpfs/mpfs_clockconfig.c: Flag out code only used in bootloader
This removes the need to have all the DDR/clock configuration related
"LIBERODEFS" flags defined, when not building a standalone/coldboot
configuration

All of this code is unused when not building with CONFIG_MPFS_BOOTLOADER

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-25 23:37:55 +08:00
Thiago Finelon
e87c43b798 arch/xtensa/esp32s3: Add EXT1 wakeup support in power management
Introduce EXT1 wakeup functionality to the ESP32-S3 power management
subsystem. With this feature, the ESP32-S3 can wake up from PM_STANDBY
or PM_SLEEP when one or more RTC GPIOs trigger the EXT1 condition.

Changes include:
- Added EXT1 wakeup configuration and preparation logic in rtc code.
- Integrated EXT1 handling in pmstandby() and pmsleep().
- New board-level Kconfig options under ESP32-S3 DevKit menu:
  - CONFIG_PM_EXT1_WAKEUP: enable EXT1 wakeup support
  - CONFIG_PM_EXT1_WAKEUP_RTC_GPIO<n>: select RTC GPIOs as wake sources
  - CONFIG_PM_EXT1_WAKEUP_TRIGGER_MODE: choose wakeup on HIGH or LOW level
- Fixing Kconfig style
- Fixing comments standard
- Adding PM documentation for esp32s3-devkit

Impact:
- No build impact unless CONFIG_PM_EXT1_WAKEUP is enabled.
- When enabled, ESP32-S3 can wake from low-power states via RTC GPIOs.
- No new public API introduced; controlled via board Kconfig.

Tested on ESP32-S3 DevKit:
- Configured GPIO4 and GPIO5 as EXT1 wake sources.
- Verified wakeup from light sleep and deep sleep on external signals.
- Wakeup reason correctly reported as EXT1.

Signed-off-by: Thiago Finelon <thiago.sfinelon@gmail.com>
2025-08-24 11:32:10 -03:00
Jukka Laitinen
67d0b975a5 arch/arm64/gicv3: Improve initialization in warm reboot case
- In case of warm reboot, clear active and pending interrupts from GICv3
and also from the CPU interface.
- Fix default IGROUPMODR to the reset value (0)
- Move gic_wait_rwp calls to after modifying ICENABLER
- Improve some comments

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-24 11:31:37 -03:00
Jukka Laitinen
80cb2cf9c6 arch/xtensa/esp32,esp32s3: Start the "spiflash_op" thread with correct affinity
Set the affinity of the task before activating it. There is no parameter
or other interface in "kthread_create" to set the affinity mask,
like in "pthread_create".

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-22 15:46:47 -03:00
lipengfei28
d45dfb8a9e arch/arm64: porting config iomux use scmi form arm imx95
pinctrl use same format scmi and config regs

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-22 20:54:05 +08:00
lipengfei28
c90349348e arch/arm64: porting config clock use scmi form arm imx95
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-22 20:54:05 +08:00
lipengfei28
909d9f1351 arch/arm64: porting mu drv and scmi from arm imx9
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-22 20:54:05 +08:00
nuttxs
46bbde02b1 esp32/esp32_spiflash.c: during the SPI Flash erasure operation, task
scheduling (yield) is added to prevent the Watchdog Timer from
triggering a reset due to timeout

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-22 20:47:03 +08:00
“wangchengdong”
e2cdb7ef34 arch/tricore: add up_trigger_irq
Add up_trigger_irq in arch/tricore/src/common/tricore_irq.c
  Select ARCH_HAVE_IRQTRIGGER in config ARCH_TC3XX
2025-08-22 15:04:06 +08:00
Niccolò Maggioni
f43c943ebe arch/arm/rp2040: Silence "LOAD segment with RWX permissions" linker warnings
This arch uses code relocation to SRAM through a XIP unit, so forcing segment
permissions manually in the linker script could create unforeseen issues.
A quick fix is setting the "--no-warn-rwx-segments" linker option just for
for the incriminated stage2 bootloader binary.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:27:12 +08:00
nuttxs
0ff26f0850 esp32/esp32_partition.c: based on the latest revision, in the ESP32 compilation
environment, uint32_t is defined as long unsigned int (i.e., unsigned long)

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-22 00:26:46 +08:00
“wangchengdong”
057b483350 include/nuttx/compiler.h:
fix nooptimiziation_function definition problem for tricore gnu compiler
arch/tricore:
	move tricore_csa2addr and tricore_addr2csa definition from include/arch.h to include/irq.h to fix build error
2025-08-21 08:34:13 -03:00
v-tangmeng
7e258621df arch/arm: Add missing barriers.h
This commit adds the missing `barriers.h` for arm.

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2025-08-21 08:32:52 -03:00
“wangchengdong”
8f5c0d5da3 arch: Add Cmake build support for raspberrypi-4b board & bcm2711 chip
Add:
arch/arm64/src/bcm2711/CMakeLists.txt
boards/arm64/bcm2711/raspberrypi-4b/CMakeLists.txt
boards/arm64/bcm2711/raspberrypi-4b/src/CMakeLists.txt
2025-08-21 17:43:31 +08:00
Niccolò Maggioni
093f4d3688 arch/arm/rp2040: Update include paths for pico-sdk 2.2.0
Version 2.2.0 of the SDK unified some headers under a new path.
Now both the old and the new paths are searched during compilation.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-20 12:24:35 -03:00
simbit18
015e013447 arch/arm: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
2025-08-19 19:44:31 -03:00
Tiago Medicci Serrano
d250808c1c esp32s3/elf: Fix ELF loader on ESP32-S3 when using external PSRAM
Prior to this commit, it wasn't possible to load ELF modules from
the external PSRAM. There were two main issues about it: 1) copying
data using the instruction bus was being used instead of the data
bus (this, per si, isn't a problem, but requires special attention
regarding data alignment), and 2) the cache was not being properly
cleaned and flushed to properly access the loaded data using the
instruction bus.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-20 02:23:03 +08:00
Tiago Medicci Serrano
60ca804b56 esp32s3: Fix bug related to the PSRAM-allocated task stack
If both SPI Flash support (`CONFIG_ESP32S3_SPIFLASH`) and PSRAM
(`CONFIG_ESP32S3_SPIRAM`) are enabled, the PSRAM can only be
assigned to the user's heap (`CONFIG_ESP32S3_SPIRAM_USER_HEAP`).
Additionaly, `CONFIG_ESP32S3_SPI_FLASH_SUPPORT_PSRAM_STACK` must be
set because the system will end up allocating tasks' stacks from
the external PSRAM. This has an impact when dealing with SPI flash
operations because the cache must be disabled and the running task
should not rely on any data from the PSRAM. To accomplish that, It
offloads the SPI flash operation to a work queue (which, by
definition, allocates its heap from the kernel heap).

The same (assigning the PSRAM to the user's heap) is valid when the
Wi-Fi is enabled because the lower-half driver requires data being
allocated from the internal memory (which can only be achieved by
allocating from the kernel heap when both the kernel and user heaps
exists).

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-20 02:23:03 +08:00
Stepan Pressl
637f15ff3c Make/Toolchain.defs: add the AR_EXTRACT command
Use this command to extract archives.
Not all architectures are modified, only those commands I know
or could be logically deducted from the rest were added.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-08-19 09:47:44 +08:00
Ville Juven
67b17cb4d7 mpfs/mpfs_usb.c: Fix interrupt handling in SMP mode
The interrupt handler accesses the device as well as the driver's private
data. Thus, must take the big kernel lock in SMP mode to protect them.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-18 20:27:20 +08:00
Ville Juven
72bba3b2ee mpfs_emmcsd/coremmc.c: Fix interrupt handling in SMP mode
In SMP mode one CPU can be executing the MMC interrupt while another CPU
disables (e.g. via watchdog timeout). As it is disabled the other CPU
assumes it's safe to start configuring the device after this.

This causes a leak in the driver's private data as well as a mutual
exclusion leak on the device itself.

Fix this by aborting any triggered interrupt by checking whether it's
even enabled.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-18 20:27:20 +08:00
Antoine Juckler
53d7fab355 arch/stm32f7: Fix I2C4 SDA pin assignment.
Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-08-17 21:41:33 +08:00
Serg Podtynnyi
2437771de5 boards/risc-v/rp23xx-rv/common: update board reset via BOOTROM functions
Update board reset with BOOTROM functions calls
 - normal reboot
 - reboot to bootloader

normal reboot and reboot bootloader now possible from nsh

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-08-16 08:56:21 -03:00
Eero Nurkkala
581d667f72 risc-v/mpfs: usb: don't try nonexistent ep int flags
Currently the irq handler checks many reserved bits, which is
a waste of resources:

1. pending_rx_ep bit 0 is reserved (always 0)
2. pending_rx_ep and pending_tx_ep have only bits 1, 2, 3 and 4
   defined, no need to scan MPFS_USB_NENDPOINTS (9) bits as the
   rest are reserved

Fix this by checking only the relevant bits.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-16 08:41:59 -03:00
Eren Terzioglu
21787b49f0 arch/xtensa/esp32s2: Remove duplicated lines to fix warning
Remove duplicated lines to fix build warning for esp32s2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-16 08:41:18 -03:00
Jukka Laitinen
85f6f4bca2 arch/risc-v/src/mpfs/mpfs_userspace.c: Map MTIME into userspace reserved IO area in protected build
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-15 09:18:34 -03:00
Jari Nippula
93c1e0c633 arch/risc-v/src/mpfs/mpfs_emmcsd: ignore WRCOMPLETE
As emmcsd driver does not support separate WRCOMPLETE interrupt the
SDIOWAIT_WRCOMPLETE event shall not be waited.
The SDIOWAIT_TRANSFERDONE event indicates that both "transfer done"
and "write complete" events are completed.
2025-08-15 02:23:23 +08:00
Jari Nippula
31f691e9ed arch/risc-v/src/mpfs/mpfs_coremmc: MPFS_FPGA_FIC0_CLK defined as config value 2025-08-15 02:23:23 +08:00
Jari Nippula
96298efac8 arch/risc-v/src/mpfs/mpfs_coremmc: clock, buswidth and fifo depth fixed
4bit bus width support and FIC0 clock is 125MHz
VR register fifo depth bitfields 5:4 instead of 3:2
2025-08-15 02:23:23 +08:00
Jari Nippula
5020572871 arch/risc-v/src/mpfs/mpfs_coremmc: Remove data line check from sendcmd
mpfs_sendcmd() shall not wait for data lines ready before
sending commands to the card. This prevents mmcsd driver
to poll card busy status prior to next activity after
a write operation.
2025-08-15 02:23:23 +08:00
Côme VINCENT
5cc01bb562 arm/stm32h7: update makefile for capture & config name
Add capture source files to the makefile pipeline.
STM32H7_CAP to STM32H7_TIMX_CAP for clarity.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-14 20:46:37 +08:00
Côme VINCENT
bebcfa0f46 docs(h743zi/capture): add capture driver docs
Add documentation for changes made in #16809.
Add an example defconfig for a nsh build with the capture example.
Replace the STM32H7_CAP option with just CAPTURE as the guard for the
lower half driver.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-14 20:46:37 +08:00
Niccolò Maggioni
7ea3f8e333 arch/arm/rp2040: Support non-sequential ADC channels and standardize internal function names
Enabling a higher channel of the internal ADC had the effect of
initializing the lower ones as well. Now that happens only if
actively requested.

Also, the functions for handling the internal ADC did not follow
the typical naming used by comparable modules for the same arch
and were renamed for coherence. Informational logging calls were
also made slightly more useful and discernible in case of having
multiple ADCs.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:23:17 +08:00
Niccolò Maggioni
fa9f771a0f arch/arm/rp2040: Implement GPIO output override functionality
Add support for the RP2040's GPIO output override capabilities.
Implementation inspired by the uniqueid functions for the same arch.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:21:35 +08:00
Jukka Laitinen
8a157d7514 arch/arm64_schedulesigaction.c: Fix signal delivery in EL1 when MMU is enabled
When delivering a signal to a kernel task, or in CONFIG_BUILD_FLAT with MMU
enabled, the REG_SCTLR_EL1 needs to be stored for exception return.

Otherwise 0 is restored to the register at exception return, MMU is switched off
and the  system crashes.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-13 23:12:30 +08:00
Ari Kimari
6f38806a5d arch/arm64/imx9: Fix first trace
Swap board init and uart init.
Reason is that trace might be used on board init.

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-08-13 10:59:46 -03:00
Niccolò Maggioni
1dfe1f16c6 arch/arm/rp2040: Fix Kconfig ADC options names
The string "RPC2040", presumably a typo, was used in place of "RP2040".

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 13:18:32 +02:00
Niccolò Maggioni
be71e3d019 arch/arm/rp2040: Fix typos in ADC and GPIO macros usage
The strings "RPC2040" and "RP2040_IO_BANK0_GPIO0", presumably typos,
were used in place of respectively "RP2040" and "RP2040_IO_BANK0_GPIO".

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 13:18:32 +02:00
Côme VINCENT
a4b17a2d14 arch/stm32h7: Fix timer capture
This patch fixes an incorrect call to stm32_cap_initialize() in
stm32_bringup.c: the call was made without the channel parameter.
Instead of adding the channel in the call, the channel is selected by
stm32_cap_gpio() (first available channel).

This patch also fixes incorrect driver registration in
drivers/timers/capture.c: the driver was registered with the wrong
name (/dev/cap -> /dev/capture). Also added more error checking in
cap_register_multiple().

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-12 20:21:14 +08:00
lipengfei28
5bba78ef85 arch/arm64: imx9 add pci dma space and pci outbound space
pci dma space used for pci inbound addr
pci outbound and outbound space need create page table

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-11 23:24:04 +08:00
Serg Podtynnyi
2e7f75f6e0 arch/risc-v/rp23xx-riscv: Add rp23xx RISC-V cores support (Hazard3)
Chip name   : rp23xx-rv
Board name  : raspberrypi-pico-2-rv
Arch        : risc-v

Changes from ARM rp23xx impl

- Linker script update
- ASM head start
- Update chip start
- New Hazard3 registers
- Remove rp23xx chip hw spinlocks/testset
- New irq handling (external IRQ interrupt Hazard3)
- New timerisr based on RISC-V std MTIME and alarm arch
- No SMP yet
- Tickless option
- Double size for idle, irq and main stacks
- Board reset via watchdog trigger

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-08-11 08:56:27 +08:00
Alan Carvalho de Assis
d218334baa boards/arcx-socket-grid: Add support to USBHOST and USBDISK
This PR add support to USBHOST on iMXRT1052 ARCX-Socket-Grid board
and add a USBDISK board config example.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Alan Carvalho de Assis
33e25738e5 arch/imxrt: Removed not defined imxrtimxrt_virtramaddr_async_setup
This function prototype was defined as static but the function
never was created or used.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Alan Carvalho de Assis
732a31c2bf arch/arm/imxrt: Fix incorrect symbol on imxtrt_ehci
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Alan Carvalho de Assis
e26936b262 arch/arm/imxrt: Fix missing symbols on Kconfig
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
kywwilson11
821b067a60 arch/arm/stm32h5: Fix STM32H5 FDCAN Driver and Add Test Files
Primary Changes
1. Add Kconfig options to select FDCAN1 and FDCAN2.
2. Fix Make.defs to use CONFIG_STM32H5_FDCAN_CHARDRIVER
3. Add FDCAN clock seleection code to stm32h5xx_rcc.c
4. Add fdcan1 config for nucleo-h563zi board.
5. Add FDCAN clock configuration and GPIOs to nucleo-h563zi board.h.
6. Added supporting code (stm32_can.c, stm32_bringup.c changes)
   for fdcan1 config.

Changed can device to start at 0. FDCAN1  = /dev/can0, FDCAN2 = /dev/can1. Enable FDCAN mode for nucleo-h563zi:fdcan1 config.

Removed ampersand from comment block
2025-08-08 19:50:28 +02:00
Côme VINCENT
2771df6250 arch/arm/stm32h7: Port timer capture driver from stm32
This commit introduces a timer capture driver for the STM32H7 series
ported from the STM32 F series.

The main changes include:
- A new generic timer capture driver for STM32H7.
- A lower-half driver to integrate with the NuttX capture subsystem.
- Kconfig options to enable and configure capture for various timers.
- Pin definitions for TIM1-4 capture inputs on the nucleo-h743zi.
- An update to `cap_register_multiple` to handle multiple device registration.
- An update to `stm32_bringup` to register the capture drivers.

The current implementation is based on a driver originally for PWM input,
and as such, it calculates duty cycle and frequency. It is also limited
to a single capture channel per timer.

The original implementation's `stm32_cap_init` in
`arch/arm/src/stm32h7/stm32_capture.c` has been modified to accept a
channel number instead of using a hardcoded 0 through
`STM32_CAP_CHANNEL_COUNTER`.

This serves as a foundation for future development of more comprehensive
input capture capabilities on STM32H7 platforms.

Tested by polling and reading `/dev/cap0-4` with
`ioctl(fds[i], CAPIOC_FREQUENCE, freq)` while sending a square wave signal to
appropriate pins and checking frequency.

Also tested by bypassing upper half driver and setting up capture on
TIM4 channels 1-4 as explained in #16762.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-07 10:46:39 -03:00
Eren Terzioglu
1c0e1698cd bugix/risc-v/esp32c6: Fix build error of LP_I2C
Fix build error of LP_I2C for esp32c6

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-05 08:00:12 -03:00
Konstantin Tyurin
85923c1797 arch/arm/stm32f0l0g0/: Fix I2C IRQ numbers
This patch sets a correct interrupt vector number
for each I2C controller.

Signed-off-by: Konstantin Tyurin <konstantin@pluraf.com>
2025-08-05 12:18:14 +02:00
Jukka Laitinen
9cda3ce216 arch/*/*_sigdeliver.c: Fix a race condition is signal delivery for SMP
This fixes the same issue for other targets, which was already fixed for
xtensa in commit 50d94863.

After the signals have been delivered, the local irqs need to be
disabled until the context switch. But just calling
leave_critical_section(regs[xx]) will enable them if they were
enabled in the context.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-04 21:11:13 +08:00