Commit graph

16496 commits

Author SHA1 Message Date
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
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
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
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
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
wangzhi16
35a62b7d5e Revert "Reduce the size of tcb by four bytes."
This reverts commit 893c5e92c2.
2025-05-27 16:30:35 +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
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
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
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
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
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
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
Serg Podtynnyi
e54d5fffd6 arch/arm/rp23xx: add missing fpu init for smp cores
On SMP systems we should enable FPU on each core

FPU extenstion support must be enabled on each core as stated on 4.6.5
arm m33 devices generic user guide

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-07 22:03:15 -03:00
Serg Podtynnyi
7c203a96af arch/arm/rp23xx: update USB PLL/VCO/FBDIV and usb setup
RP2350 datasheet and upstream pico-sdk suggests higher VCO freq to
better output stability.
Increase the VCO and update PLL divs according to specs and calculation.
Higher VCO freq is more stable, lower VCO freq is more power friendly.
Also it's possible to use 120/6/5 with VCO 1440MHz for USB PLL to even
higher output stability.
USB setup changes from rp2040
Must clear the MAIN_CTRL.PHY_ISO bit at startup and after power down
events.

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-08 03:02:06 +02:00
Tyler Bennett
9fca766bd4 arch/arm/stm32f0l0g0: Add STM32G0 Flash driver.
Add arch files and Kconfig options to interface with the progmem
driver on STM32G0 MCUs.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-05-07 21:37:25 -03:00
Tim Hardisty
f967a69748 arch/arm/sama5: Add code to report the reset reason
This adds the necessary code and function to allow a board to determine the reason for a reset. This is useful in NXboot, for example.

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-05-07 02:03:00 +08:00
Serg Podtynnyi
95cc862794 arch/arm/rp23xx: fix watchdog, enable TICK blocks
On the RP2350, the watchdog receives its tick input from the
system-level ticks block, unlike the RP2040, where the watchdog includes
its own tick generator. Enable the TICK blocks, update the watchdog
routines.

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-05 23:58:10 +08:00
Matteo Golin
ac583fc585 arch/arm/rp2040/gpio: Allow simultaneous selection of multiple interrupt modes.
The RP2040 chip supports 4 different GPIO interrupt modes. They can be
configured to be used simultaneously, although previously the NuttX
support only allowed one type of interrupt to be enabled per GPIO pin.
This allows up to all four to be selected without changing previous
behaviour.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-05 23:48:21 +08:00
Serg Podtynnyi
bc8a7f713d arch/arm/rp23xx: add dsp/fpu extensions support
Each Arm Cortex-M33 processor in RP2350 is configured with Single
precision FPU and DSP extension
2025-05-05 09:35:39 +08:00
Lars Kruse
fa719f52f6 fix(stm32h7): malformed compiler error message
The malformed compiler error message was added in the initial commit of
the stm32_rptun module (2fffd7dad6).
2025-05-05 09:32:31 +08:00
Lars Kruse
9afc9868f6 fix(kinetis): malformed define KINETIS_NSPI
The malformed defines were introduced in commit 91dd3306c8.
They affect only the following chips:
* MK64FX512VMD12
* MK64FN1M0VMD12
2025-05-05 09:32:31 +08:00
raiden00pl
dbeba61c3c arch/nrf53/nrf53_sdc.c: fix broken RPMSG HCI server
BT device should not be registered when RPMGS HCI server is enabled.
Broken server since 31605b6335.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-05 09:28:35 +08:00
Serg Podtynnyi
464c0831ce arch/arm/rp23xx: fix not restart after TX error
Fix a bug that I2C driver can not transfer after TX abort error.
It caused by remaining NO_STOP flag status.
same as done in commit 0df0a10 for cxd56xx

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-03 11:17:37 +08:00
Tyler Bennett
c84f7c630f arch/stm32f0l0g0: Add support for STM32G0B1xx
Adds Kconfig and modifies chip.h for STM32G0B1xx options.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-05-02 15:01:45 +02:00
buxiasen
726683485f arch/arm/heap: add mmu.h fix not defined error when BUILD_KERNEL
fix PGTABLE_SIZE not defined in sama5d4-ek/knsh
Error: common/arm_allocateheap.c:177:11: error: 'PGTABLE_SIZE' undeclared (first use in this function); did you mean 'PGTABLE_L2_SIZE'?
  177 |   size -= PGTABLE_SIZE * CONFIG_SMP_NCPUS;
      |           ^~~~~~~~~~~~

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-04-28 22:17:43 +08:00
buxiasen
05beacc799 arch/arm/heap: reserved memory for mmu table
When using ARCH_PGPOOL_PBASE, always have to reserver mmu table,
not be used for kernel heap

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-04-28 22:17:43 +08:00
buxiasen
1f8eb18e1d arch/arm/goldfish: fix mmu not enabled when smp
If smp enabled, mmu default disabled in arm_head.S,
We have to re-enable it in arm_boot per-chip.
Causing knsh-smp failed with user-space memory access

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-04-28 22:17:43 +08:00