Commit graph

23695 commits

Author SHA1 Message Date
Ville Juven
c17f99438e imx9/smp: Add boiler plate code to enable SMP with iMX9.X
This adds SMP support for iMX9.X CPUs

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-06-12 15:28:18 -03:00
Alessio Tudisco
78dffd72f8 arch/arm/stm32f7: Add missing RCC include
Adds "stm32_rcc.h" include into "stm32_capture.c" to fix the compile error related to undeclared RCC stuff.
2025-06-12 19:09:34 +08:00
raiden00pl
c37a270cda arch/stm32f0l0g0/stm32_tim.c: fix compilation when TIM6/TIM7 is missing
Fix compilation when TIM6/TIM7 is missing for stm32-m0.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-12 10:00:30 +08:00
raiden00pl
5437dabbff arch/stm32f0l0g0: remove references to CONFIG_STM32F0L0G0_FORCEPOWER
this is copy-paste from stm32, but CONFIG_STM32F0L0G0_FORCEPOWER
is not used in stm32f0l0g0

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-12 09:59:53 +08:00
raiden00pl
ba00fa6478 arch/stm32c0: add FDCAN support
add FDCAN support for stm32c0 family.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-09 15:26:12 -03:00
Kerogit
25876e327e arch/avr: fix atomic load functions from arch_atomic.c
For AVR, atomic functions generated by LOAD macro turn into load surrounded
by up_irq_save and up_irq_restore. The generated code was incorrect as can
be seen from disassembly of __atomic_load_4:

in   r18, 0x3f ; store interrupts enabled flag
cli            ; disable interrupts
out  0x3f, r18 ; restore the flag
movw r30, r24  ; copy parameter (address) to pointer register
ld   r22, Z    ; indirect load to return value registers
ldd  r23, Z+1
ldd  r24, Z+2
ldd  r25, Z+3
ret            ; return

The interrupts are disabled to be immediately re-enabled, the load only takes
place after that.

Both up_irq_save and up_irq_restore are defined in inline assembly. Other
architectures (x86/486, Risc-V) mark this assembly with clobbers: memory.
Doing the same thing for AVR alleviates the problem:

in      r18, 0x3f ; store interrupts enabled flag
cli               ; disable interrupts
movw    r30, r24  ; copy address
ld      r22, Z    ; load
ldd     r23, Z+1
ldd     r24, Z+2
ldd     r25, Z+3
out     0x3f, r18 ; restore interrupts enabled flag
ret               ; return

Besides compiling the code and checking the assembly, this was tested
with a custom stress application on AVR128DA28.

Assembly of up_irq_enable is marked in the same way with regards to clobbers.

This patch also removes two functions that are not called from anywhere
(up_irq_disabled, putsreg)

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-09 21:42:21 +08:00
raiden00pl
13ac3d5e57 arch/arm/src/stm32f0l0g0: UID support for F0, L0 and C0
add UID support for F0, L0 and C0

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-09 08:33:42 -03:00
kywwilson11
60c9c66839 Added support obtaining the unique id for the stm32g0x1.
Changed copyright to apache copyright. Altered stm32_uid function to take uint32_t pointer instead of a twelve byte uint8_t array. Refined code in stm32_uid.c.

Fixed style and indentation.

Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
2025-06-09 09:49:26 +02:00
Peter van der Perk
e9b7dee55a arch/arm/imxrt: Serial add RXDMA support for singlewire mode
In singlewire mode the ops were only for non-dma usecases. But if rxdma is enabled we can use that.
For TXDMA it's not possible because we've to change pin direction immediately after transmission is done.
2025-06-09 09:45:42 +02:00
Jukka Laitinen
dd07367f4e arch/riscv/Kconfig: Remove select "ARCH_PERF_EVENTS" from Kconfig
There is no more linking error for MPFS after the flagging is corrected in
drivers/timers/arch_alarm.c

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-06-06 17:31:10 +08:00
Jukka Laitinen
56ad0d6837 arch: Flag all definitions of up_perf_* functions with CONFIG_ARCH_HAVE_PERF_EVENTS
Use the flag CONFIG_ARCH_HAVE_PERF_EVENTS to detect whether the architecture specific code
provides the up_perf_* functions. Now it is mixed with CONFIG_ARCH_PERF_EVENTS, which should
select just whether the perf events (perf_*) are enabled for the configuration.

- drivers/timers/arch_alarm.c: Don't compile the up_perf_* functions here if the
  CONFIG_ARCH_HAVE_PERF_EVENTS is defined
- arch/*/*_perf.c: Change CONFIG_ARCH_PERF_EVENTS -> CONFIG_ARCH_HAVE_PERF_EVENTS to
  select whether architecture specific up_perf_* functions are provided

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-06-06 17:31:10 +08:00
George Poulios
67c7a4018a arm64/imx9: Support & configure RGMII-ID on RTL8211F
For the RTL8211F PHY, configuration of RX/TXDLY was missing.
At least on my i.MX93 EVK, this is necessary for transmission
to work (RXDLY defaults to true on the PHY).

This commit brings support for RGMII internal delay configuration
(on or off for both directions) and enables it on the i.MX93 EVK
board. The introduced Kconfig is set to default to 'n', to avoid
breaking the functionality of other, out-of-tree boards based on
i.MX93, running the RTL8211F PHY, or to avoid introducing
unnecessary code on boards running other PHYs.

Configuration of internal delay on other PHYs is not
implemented, and results in a warning (but no error).

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-06-05 08:58:24 +02:00
George Poulios
e382e2d525 arm64/imx9: Add missing ENET1 RGMII TXC pin muxing
MUX_ENET1_TXC was missing from both the EVK board
definition and the IO muxing configuration function
of the ENET1 driver. As a result, transmission does
not work (unless the muxing is set by default in some
board? -not the case with EVK). This commit adds the
configuration and adds the definition to i.MX93 EVK.

WARN: other, out-of-tree i.MX93 boards need to define
MUX_ENET1_TXC accordingly, otherwise build will break.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-06-05 08:58:24 +02:00
Jukka Laitinen
0ac580cb7a arch/risc-v/mpfs: Add optimized perf timer functions for mpfs
Add up_perf_ functions for MPFS, which don't rely on alarm/oneshot interface.

Also add optimized up_udelay and up_ndelay functions, which use the MTIMER
directly to measure time; making them accurate and more multithreading friendly.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-06-04 20:48:03 -03:00
simbit18
bcfcf03066 arch/arm/src/mcx-nxxx/CMakeLists.txt: Aligned Cmake with Make
Aligned Cmakefile with Make.defs PR #16469

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-03 10:07:39 -03:00
simbit18
ad93c6c399 arch/risc-v/src/qemu-rv/CMakeLists.txt: removed repeated addition of the file qemu_rv_userspace.c
9897ef3cdb/arch/risc-v/src/qemu-rv/CMakeLists.txt (L44)

aligned with the make.def file

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-03 10:03:49 -03:00
Michal Lenc
b0342c87ee arch/arm/src/samv7/sam_serial_spi.c: set correct SPI mode during init
Bitfield CPHA has to be set to run SPI in mode 0. This is a default mode,
therefore it should be set during the peripheral initialization.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-06-02 23:10:44 +08:00
Ville Juven
436c814c2e mcx-nxxx: Add LPI2C driver for mcx-nxxx architecture
This adds a LPI2C driver for the mcx-nxxx chip, and the necessary board
definitions for the frdm-mcxn236 evaluation kit.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-06-02 23:09:59 +08:00
Peter van der Perk
7104a51411 arch/arm/imxrt: rt117x fix TCM/OCRAM ECC backdoor access
FlexRAM peripheral was incorrectly clocked and turned during
M7 sleep. This patch fixes clock setting and ensure that clock
stays on during M7 for backdoor access from for example eDMA
2025-05-30 08:51:46 +08:00
Theodore Karatapanis
c6f4310331 arch/arm64/imx9: Guard EL3-only features when booting at EL1
Boards that run the i.MX9 bootloader at EL1 must not touch EL3-only
configuration. Add Kconfig guards so that:

* DDR training (IMX9_DDR_TRAINING)
* FIQ decode support (ARM64_DECODEFIQ)

are selected only when ARCH_ARM64_EXCEPTION_LEVEL == 3.

Code in arm64_chip_boot() is also guarded with ARCH_ARM64_EXCEPTION_LEVEL == 3

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-28 14:39:55 -03:00
raiden00pl
194b635739 arch: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:17:15 +08:00
wangjianyu3
e57cfc3778 arm64/toolchain: Add -fstack-usage for stack analysis
After `CONFIG_STACK_USAGE` enabled, no "*.su" file was generated, tools/showstack.sh output nothing.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-27 23:11:38 +08:00
Peter van der Perk
073e58a83f arch/arm/imxrt: support ramvectors in ITCM memory
This is done by initializing the ramvectors earlier in start so that
we can access the ITCM before the MPU gets configured
2025-05-27 20:46:36 +08:00
Peter van der Perk
6556d4e123 arch/arm/imxrt: MPU reset on startup and TCM size fixes
On rt10xx chips the MPU didn't got reset, which is needed for use
with bootloaders. Furthermore the TCM sizes where fixed now we use
kconfig symbol to set the size respectively. Also we mark ITCM as
RO/RO so we can't change data we executed from.
2025-05-27 20:46:36 +08:00
Kerogit
5f736ee160 arch/avr: make linker print memory usage if GCC is used
This option provides useful overview of used memory
and should have no downsides.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-05-27 20:46:22 +08:00
Kerogit
78b0a98747 arch/avr/src/avrdx: typo fix in avrdx_serial.c
Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-05-27 20:46:22 +08:00
Kerogit
fa7f81c34e arch/avr: fix up_saveusercontext
The up_saveusercontext function leverages USER_SAVE macro,
which is ordinarily used as a first half of the context switch.
This macro is therefore unsuitable to be used standalone,
it pops return address from the stack and does not return.

This patch adds missing instructions to do what would otherwise
be done by the second half of the context switch.

Tested by compiling and verifying the disassembly - the function
no longer falls through to the next function in the program memory,
push/pop instructions are balanced and stack contents preserved

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-05-27 20:46:22 +08:00
wangzhi16
35a62b7d5e Revert "Reduce the size of tcb by four bytes."
This reverts commit 893c5e92c2.
2025-05-27 16:30:35 +08:00
Vlad Pruteanu
82effd4b2f xtensa/esp32: Add support for hardware accelerated SHA
This enables the use of the cryptographic accelerator within
the ESP32. The support algorithms are: SHA1, SHA256, SHA384
and SHA512.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2025-05-26 15:23:51 +08:00
Matteo Golin
3feb9985a5 bcm2711/spi: Create interrupt-based SPI driver.
This implements an interrupt-based SPI driver for the BCM2711 SPI
interfaces (excluding auxiliary SPI interfaces). Only tested on SPI0
since proprietary firmware does not initialize any other SPI interfaces,
and doing so will require reverse engineering.
2025-05-24 12:47:43 -03:00
p-szafonimateusz
7cb09d96e3 arch/sim/sim_canchar.c: fix compilation when CAN FD is disabled
Fix case for CAN character driver in simulator when CANFD is disabled
and ch_edl field is not present in CAN header.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-24 21:28:51 +08:00
Michal Lenc
9c4593e183 arch/arm/src/samv7/sam_us.c: disable interrupts for flash access
Interrupts should be disabled during the access to the user signature
area in internal flash memory, otherwise the system might be halted.

This applies also for read operation as this is performed with a
special flash commands on  a special part of memory.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-05-24 21:27:41 +08:00
Lars Kruse
e5b675d4dc refactor: fix spelling in private field names
Fix some misspelled field names.
These field names seem to be used only in private contexts.
Thus, the probability of external code accessing these fields is very
low.
In the rare case of external usage, compile time errors will easily
direct users to the new field name.
2025-05-24 09:44:22 -03:00
Lars Kruse
3dc53adb28 arch | boards | drivers: fix whitespace issues for switch case statements 2025-05-23 10:48:41 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Tyler Bennett
3cf0abbfee arch/stm32h5: Fix FLASH bank logic during erase operations.
Properly select physical bank for block erase based on block number.

Previously, it would configure flash erase bank select based on the logical bank. If banks were swapped, and user application
tried to erase the first block of logical bank 2 (expecting to erase starting at 0x08100000), it would actually erase starting
at 0x0800000. This is fixed in this commit.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-05-22 09:47:15 +08:00
Lwazi Dube
2a7174601f boards/sama5d3-xplained: Use common usb host waiter.
Delete the board-specific usb host waiters and use the common code.
2025-05-20 09:32:22 +02:00
Serg Podtynnyi
df8a889bd0 arch/arm/rp23xx: resets: do not reset USBCTL, SYSCFG
Do not reset USB, syscfg, as this disturbs USB-to-SWD on core 1
From upstream pico-sdk runtime init

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-19 12:27:18 -03:00
Kerogit
8126a8119f arch/avr: reworked eliminating unused sections with GCC
After a mailing list suggestion, the indirection that enabled
ARCH_TOOLCHAIN_GCC only when user requested it is removed.

The indirection was a safety measure for chips and boards with linker
scripts that (possibly) do not handle keeping for example .vectors
section even if the linker considers it unreferenced.

Instead, all existing configurations now disable
CONFIG_DEBUG_OPT_UNUSED_SECTIONS to prevent the linker from removing
any code. (Preserving previous behaviour.) This can be removed again
at some point after making sure that corresponding linker script
only removes code that is truly unused.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-05-19 22:29:58 +08:00
simbit18
9520f5bfc8 [nxstyle]: fix Inconsistency in function headers style
added to the end of the header a new line *

added space

Doc Function Headers
https://nuttx.apache.org/docs/latest/contributing/coding_style.html#function-headers

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-19 20:20:46 +08:00
Serg Podtynnyi
e5bf4fc5c4 arch/arm/rp23xx: xosc: Update startup delay calculation
Use upstream function to calculate XOSC startup delay

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-16 23:07:18 +08:00
Martin Vajnar
a3d0411c24 Select SENSORS_QENCODER as dependency for Quadrature Encoder mode of PCNT unit 2025-05-16 11:10:29 -03:00
Martin Vajnar
abac610d13 xtensa|espressif: Unify Quadrature Encoder handling among units 2025-05-16 11:10:29 -03:00
Theodore Karatapanis
fcbd3099aa arch/arm64/imx9: Extend ELE API with RNG support
- Add ELE command to initialize the ELE RNG context.
- Add ELE command to poll the readiness of the RNG
- Add ELE command to obtain random numbers.
- Replace AHAB_ prefixes with ELE_
- Cleanup header includes
- Added some explanatory comments on .../hardware/imx9_ele.h

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-16 06:30:18 -03:00
michal matias
e115c4364e arch/risc-v/src/common/espressif/esp_pcnt.c: counter accumulation fix
Even when enabled, the PCNT counter doesn't accumulate into the 32-bit value.
Instead, a value in range [PCNT_LOW_LIMIT, PCNT_HIGH_LIMIT] is always returned.
This is due to interrupt events associated with limit overflows are disabled on the periphery,
therefore the ISR responsible for the accumulation never gets called.

Fixed by enabling the associated interrupt events.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-05-16 10:36:00 +08:00
Lars Kruse
4568110d63 fix misspelled names in locally scoped code
These misspelled words are used in strictly local scopes.
Renaming these variables should not cause any problems.
2025-05-15 10:12:12 +08:00
Eren Terzioglu
ea8744631a arch/xtensa: Update common layer version for esp32s3
Update common layer version for esp32s3 to fix warnings when building

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-14 19:38:21 +02:00
Eren Terzioglu
e9e3a0ecf7 arch/xtensa: Add dedicated GPIO support for esp32[-s2|-s3]
Add dedicated GPIO support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-14 19:38:21 +02:00
Eren Terzioglu
b7bbb56338 arch/risc-v: Add Dedicated GPIO support for esp32[c3|c6|h2]
Add Dedicated GPIO support for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-14 19:38:21 +02:00
p-szafonimateusz
cc5d6fcb41 arch/sim/Kconfig: fix codespell issues
arch/sim/Kconfig: fix codespell issues

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-14 21:50:15 +08:00