Commit graph

23676 commits

Author SHA1 Message Date
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
p-szafonimateusz
df76246c03 arch/sim/Kconfig: simulated CAN depends on LINUX host
simulated CAN depends on LINUX host now

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-14 21:50:15 +08:00
simbit18
ea47f0cf42 [Kconfig]: Fix Kconfig style
Remove spaces from Kconfig files
Add comments
Add TABs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-14 21:15:14 +08:00
Serg Podtynnyi
3966097453 arch/arm/src/rp23xx: allow to use armv8m systick lowerhalf
Add ability to use arv8m systick lowerhalf driver
Fix wrong macro for systick current register in initialize

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-14 21:14:45 +08:00
Serg Podtynnyi
6fc7f53f46 arch/arm/rp23xx: wdog: Ensure setup before register phase
The watchdog auto-monitor sets up during the register phase,
so we should be prepared before calling register.

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-14 07:18:46 -03:00
p-szafonimateusz
5bf3110777 arch/sim/sim_canchar.c: notify upper-half driver that tx done
add missing can_txdone() callback after message is send

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-14 03:05:56 +08:00
Jukka Laitinen
e78a33464e arch/sim/src/sim/sim_oneshot.c: Fix spelling in comments, "Ths" -> "This"
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-13 21:05:12 +08:00
Jukka Laitinen
bf870e51ba arch/sim/sim_oneshot: Calculate next oneshot time in ticks instead of timespec
This removes drift in tick start times, when the base time is always rounded to
tick boundary.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-13 21:05:12 +08:00
buxiasen
5d9a1aaf75 armv7a/mmu: update from l1entry replace to TTBR0 update
The l1entry replace cause huge time when text/data is big,
Need 16KB per task to hold l1table.
Also critical_section no longer required, as table per-task maintained.

For complex goldfish emulator scarios can speed up:
     enter_nsh/application_init_done,
from 23.517300/05:07.067500
to   01.501500/00:06.587300
at least 10 times faster.

As we don't have do x_NPAGES swap out etc.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
7b90b78b52 arch/arm/mmu: unify all uint32_t & uintptr_t
Only keep cp15 API use uint32_t, other mmu all use uintptr_t

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
68008aa9d7 arch/arm/armv7-a: add mmu_l1_setpgtable
Decrease the direct access of cp15, use mmu interface replace

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
94ea4efe4c arch/arm/arm-v7a: fix comment typo
Catched by codespell

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
cd7a8f73eb comments: update text typo pre-empted to preempted
Or will be catch by codespell, when do checkpatch.sh

Also fix the relative comment file changed.

include/nuttx/scsi.h
drivers/syslog/ramlog.c
excluded as we have to modify field name in struct

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
172c707a02 arch/arm/arm_cache: remove not required critical_section
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
cdbe91aeb9 armv7a: rename and implement va2pa & pa2va
Notice: the up_addrenv_pa_to_va is not correct, it will be complex if we
search all address to lookup all virtual address according to physical
address.
Use up_addrenv_x method as common interface across va & pa

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
buxiasen
d00ee139f9 arch/arm/src: fix warning of up_addrenv_va_to_pa
chip/sam_memories.c: In function 'sam_physramaddr':
chip/sam_memories.c:936:14: warning: implicit declaration of function 'up_addrenv_va_to_pa' [-Wimplicit-function-declaration]
  936 |       return up_addrenv_va_to_pa((FAR void *)virtramaddr);
      |              ^~~~~~~~~~~~~~~~~~~

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
wangzhi16
4e4acce514 arch/arm: fix compile error.
BUILD CMD: ./tools/configure.sh -l sama5d3x-ek/nx; make -j`nproc`

chip/sam_memories.c:705:17: note: each undeclared identifier is reported only once for each function it appears in
 chip/sam_memories.c:706:27: error: 'CONFIG_SAMA5_DDRCS_PGHEAP_SIZE' undeclared (first use in this function); did you mean 'CONFIG_SAMA5_DDRCS_HEAP_SIZE'?
 706 | poolend = poolstart + CONFIG_SAMA5_DDRCS_PGHEAP_SIZE;
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | CONFIG_SAMA5_DDRCS_HEAP_SIZE
 make[1]: *** [Makefile:168: sam_memories.o] Error 1
 make[1]: Target 'libarch.a' not remade because of errors.
 make: *** [tools/LibTargets.mk:170: arch/arm/src/libarch.a] Error 2
 make[1]: Target 'libsched.a' not remade because of errors.
 make: *** [tools/LibTargets.mk:71: sched/libsched.a] Error 2
 make: Target 'all' not remade because of errors.
 ~/nuttx/tools/testbuild.sh: line 385: ~/nuttx/../nuttx/nuttx.manifest: No such file or directory

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-05-12 15:01:37 +08:00
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
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