Commit graph

16404 commits

Author SHA1 Message Date
raiden00pl
f3a4011a20 arch/{rp2040|rp23xx}: remove ADC option from Kconfig
Remove duplicated "config ADC" option which is already defined in drivers/analog/Kconfig.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-23 10:41:54 -03:00
raiden00pl
35818c5f87 arch/arm: add missing itm_syslog.h include
add missing itm_syslog.h include for archs that use itm_syslog_initialize()
to fix compiler errors:

  error: implicit declaration of function 'itm_syslog_initialize'

Issue reported by rentzboy in https://github.com/apache/nuttx/issues/16017

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-19 12:17:28 -03:00
Ville Juven
3764ed06df arch/mcx-nxxx: Add LPTMR register descriptions
Add register definitions to control LPTMR (Low Power Timer)

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-03-19 20:00:38 +08:00
Ville Juven
c1726898fa arch/mcx-nxxx: Add SYSCON_CLOCKCTRL register definition
Adds register definitions to control FRO clock

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-03-19 20:00:38 +08:00
Kyle Wilson
46411495ef arch/arm/STM32H5: Initial ICACHE Support
Add support for the STM32H5 ICACHE peripheral. The CortexM33 does not have typical embedded icache and dcache. Instead STM32H5 provides the ICACHE as a separate peripheral that needs to be configured. This commit adds the stm32h5 specific icache driver. This driver named functions like those in <nuttx/cache.h>. However since the CortexM33 does not have cache itself, ARCH_ICACHE is not enabled. Therefore these stm32h5 specific functions were developed.

Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
2025-03-10 13:24:02 +08:00
Daniel Martín Gómez
9ab9b31682 arch/arm/src/stm32f0l0g0: Fix SPI reads when nbits is 8
I found an issue when using SPI with nbits=8: SPI reads return unreliable
results because SPI ignores nbits value and always performs 16-bit reads.

Signed-off-by: Daniel Martín Gómez <danielmartingomez@geotab.com>
2025-03-08 00:19:45 +08:00
Michal Lenc
9a02572e8e arch/arm/samv7/spi: fix ifdelay setup in spi_setdelay call
ifdelay description (delay between frames) matches the DLYBCT field
(delay between consecutive transfers without removing chip select)
much better compared to stopdelay (delay between last CLK and CS
innactive). The option for stopdelay does not seem to be configurable
in SAMv7 peripheral.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-06 09:20:16 +01:00
Lup Yuen Lee
2afeefc805 arch/arm, risc-v: Fix typos in Code Comments
This PR fixes the typos in the Code Comments of chip.h, allocateheap.c
and start.c. The typos were discovered here:
- https://github.com/apache/nuttx/pull/15921

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-03 14:05:06 +01:00
Sydeney Araujo
89ddf9e7b9 arch/arm/tiva: Refactor complementary PWM mode configuration
This commit improves the configuration of complementary PWM mode for
Tiva C-Series microcontrollers by moving the complementary flag
definition directly into each channel structure.

Changes made:
- Renamed 'complementary_generation' to 'complementary' for clarity.
- Moved complementary mode configuration into the static PWM
  channel structures.
- Replaced runtime conditional checks with compile-time configuration
  using '#ifdef CONFIG_TIVA_PWM_COMPLEMENTARY_Gx'.
- Improved readability and maintainability of the PWM driver.

These modifications ensure a more efficient initialization process,
reduce runtime conditionals, and align better with NuttX coding practices.

Signed-off-by: Sydeney Araujo <sydney.wagner39@gmail.com>
2025-02-28 11:07:19 -03:00
Michal Lenc
4e70cc1e69 samv7/pwm: add support for PWMIOC_FAULTS_FETCH_AND_CLEAR ioctl
This ioctl fetches and clears PWM faults.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-27 11:47:51 -03:00
Ville Juven
8ab87c582b arch/mcx-nxxx: Add GPIO interrupt support
Add support for GPIO interrupts.
2025-02-26 10:18:22 -03:00
Ville Juven
d7811c4b6e arch/mcx-nxxx: Enable GPIO clocks.
For the I/O pins to work, the clock gate needs to be opened.
2025-02-26 10:18:22 -03:00
Ville Juven
1d57ed7807 arch/mcx-nxxx: Add GPIO port 0
The port numbers go from 0-7 (and up) for this architecture; port 0 was
missing.
2025-02-26 10:18:22 -03:00
leocafonso
f4b6cf2b9f arch/ra4: Add support for Renesas RA4M1 MCU
Add basic support for RA4M1.
The following perpheral are added:
* GPIO
* SCI (UART)
* Clock (Just internal clock - HOCO)

Signed-off-by: leocafonso <leocafonso@gmail.com>
2025-02-25 13:14:48 -03:00
SPRESENSE
96de2e20c1 arch: cxd56xx: Improve i2c initialize function
During I2C communication between non-Spresense devices is performed,
the I2C bus may freeze after initialization of the Spresense I2C.
As a workaround, switch the pin mode to I2C at the end of the i2c
initialization function.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-02-25 10:55:20 +01:00
SPRESENSE
d521b926aa arch: cxd56xx: Improve i2c reset function
During I2C communication between non-Spresense devices is performed,
the I2C bus may freeze after initialization of the Spresense I2C.
As a workaround, add clock gating process and disable GPIO input
to the I2C reset function.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-02-25 10:55:20 +01:00
SPRESENSE
eef122260b arch: cxd56xx: Update delay value for subcore
Update delay value for subcore referred by up_mdelay function.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-02-25 14:46:10 +08:00
Michal Lenc
54954e55b5 samv7/pwm: fix incorrect write of CMRx register
DTE (dead time enable) is the 17th bit in CMRx (channel mode) register.
Function pwm_set_polarity did however read and write this register as
16 bit large, therefore dead time generation was always disabled.
This fixes the issue, pwm_set_polarity now reads the register as 32
large.

Also set the initial value of CMRx correctly in pwm_setup().

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-23 23:21:44 +01:00
Michal Lenc
7ccd6e9041 samv7/pwm: add support for latched fault inputs
This adds configuration option for every fault input, that can be
latched (kept even after the input value is below the threshold) or
volatile (PWM is automatically enabled once the output polarity goes
back to the normal state).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-23 07:49:34 -03:00
Ville Juven
17a80e90bd arch/mcx-nxxx: Add support for NXP MCX-N236 CPU
This adds minimal support for NXP MCX-N236 CPU. Peripherals supported are:
- GPIO
- PINMUX
- CLOCK
- LPUART

An example board, FRDM-MCXN236 is also added, with a basic profile that
boots into nsh.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-02-22 16:12:06 -03:00
chao an
27d5a1b4b7 arm/memory_barrier: fix build warning on GCC14
nuttx/include/arch/spinlock.h:66:9: warning: "UP_DSB" redefined
   66 | #define UP_DSB() __asm__ __volatile__ ("dsb sy" : : : "memory")
      |         ^~~~~~
In file included from nuttx/include/arch/barriers.h:37,
                 from nuttx/include/arch/spinlock.h:34:
nuttx/include/arch/armv8-m/barriers.h:42:9: note: this is the location of the previous definition
   42 | #define UP_DSB()  arm_dsb(15)
      |         ^~~~~~
nuttx/include/arch/spinlock.h:67:9: warning: "UP_DMB" redefined
   67 | #define UP_DMB() __asm__ __volatile__ ("dmb st" : : : "memory")
      |         ^~~~~~
nuttx/include/arch/armv8-m/barriers.h:41:9: note: this is the location of the previous definition
   41 | #define UP_DMB()  arm_dmb()
      |         ^~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-18 09:04:54 -05:00
buxiasen
af0aa78cbc arm-a/shm: fix issue when use shm in arm-a
When the l1entry first add to shm, mssing l1entry add.
shm mmu flags should use udata flags.
l1entry record in shm[] and should not use ~SECTION_MASK

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-02-15 18:44:26 -03:00
buxiasen
71888c5c5f arm-v7a: fix mmu record list occupation when more than 1M
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-02-15 18:44:26 -03:00
Andre Heinemans
e7fdaeb61d imx9: scmi: update to scmi 3.2 spec 2025-02-15 12:28:10 -03:00
Ramin Seyed-Moussavi
70d092061d arch/arm/max326xx: add max32690 gpio driver
definitions for the max32660 moved to max32660_gpio.h

the max32690 has much more options for the gpios
so this is a complete new driver
2025-02-15 10:23:01 -03:00
Michal Lenc
c70a322ec7 samv7/sam_1wire.c: fix compilation warnings
chip/sam_1wire.c:921:7: warning: implicit declaration of function 'sam_usart0_enableclk' [-Wimplicit-function-declaration]
  921 |       sam_usart0_enableclk();

The same warning applied for other uart/usart peripherals configured
as 1 wire.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-15 09:51:29 -03:00
Alan Carvalho de Assis
3594f9d879 stm32: Add support to TIOCGICOUNT ioctl
This commit adds support to TIOCGICOUNT for STM32, this way a
userspace application can collect information about UART errors.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-14 18:24:47 +01:00
Peter van der Perk
4907607f3a imx95: make gpio irq configurable per bank
This avoids receiving interrupt from unused GPIO banks
2025-02-14 11:37:04 -03:00
Xiang Xiao
31e92f3bb5 Revert "use small lock in following files:"
This reverts commit d84ba608a1.
2025-02-13 14:15:43 +08:00
Xiang Xiao
2301fd5d25 Revert "Use small lock to protect usbdev and endpoint in arch ARM."
This reverts commit e177ff9c0c.
2025-02-13 14:15:43 +08:00
Xiang Xiao
6d2f81f490 Revert " Use small lock to protect timer related resources in arch ARM."
This reverts commit 5f77da4c51.
2025-02-13 14:15:43 +08:00
Xiang Xiao
52d0b4ccf4 Revert "Use small lock to protect resources related to cpufifo."
This reverts commit 8b5ea40a2b.
2025-02-13 14:15:43 +08:00
Xiang Xiao
96093574fc Revert "Use small lock to protect resources related to lpi2c."
This reverts commit 0b542ff824.
2025-02-13 14:15:43 +08:00
Xiang Xiao
0021e7731a Revert "Because sched_lock is now called in spin_lock_irqsave, there is no need to call it explicitly."
This reverts commit b0af946b7a.
2025-02-13 14:15:43 +08:00
Xiang Xiao
18156742f1 Revert "Use small lock to protect resources related to i2c master and slave."
This reverts commit 2c4fe28d4e.
2025-02-13 14:15:43 +08:00
Xiang Xiao
61620affe6 Revert "Use small lock to protect resources related to i2c."
This reverts commit 919ed2e3d4.
2025-02-13 14:15:43 +08:00
Xiang Xiao
43a47f49dc Revert "Use small lock to protect resources related to irq in arch ARM."
This reverts commit c754019f5a.
2025-02-13 14:15:43 +08:00
Xiang Xiao
2f7120e4bc Revert "Fix compile error."
This reverts commit 60df0cd6da.
2025-02-13 14:15:43 +08:00
Xiang Xiao
83c2bcb33a Revert "Use small lock to protect resources related to ethernet."
This reverts commit 60125038fc.
2025-02-13 14:15:43 +08:00
Xiang Xiao
259f25b2ce Revert "Fix wrong variable name. lock -> eth_lock"
This reverts commit c8f8a61f89.
2025-02-13 14:15:43 +08:00
Jacob Dahl
3dcedd507b h7: eth: add checks for PHYID in stm32_phyinit
Fixes bug where stm32_phyinit will succeed even when no PHY is connected. This is because there is no check that a PHY is actually communicating and returning data.

Update include/nuttx/net/mii.h

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2025-02-12 15:00:19 -03:00
Ramin Seyed-Moussavi
381d3fe64f arch/arm/max326xx: add max32690 icc updates
Add updates for MAX32690 Instruction Cache Controller to enhance device support in NuttX architecture.
2025-02-11 12:27:10 -03:00
Ramin Seyed-Moussavi
e99c516a91 arch/arm/max326xx: add max32690 memorymappings
Adds memory mappings for the MAX32690 to extend support for this device in the NuttX architecture.
2025-02-11 12:27:10 -03:00
Ramin Seyed-Moussavi
a691ed84d2 arch/arm/max326xx: add max32690 global control bit definitions
Adds definitions for the global control bits of the MAX32690 to improve support for this device in the NuttX architecture.
2025-02-11 12:27:10 -03:00
Ramin Seyed-Moussavi
a4cfd5f9da arch/arm/max326xx: add max32690 irq and peripheral clock definitions
Add IRQ and peripheral definitions for MAX32690 to enhance device support in NuttX architecture.
2025-02-11 12:27:10 -03:00
Yanfeng Liu
35e5612bce arch/armv7-r: select ARM_THUMB
This selects ARM_THUMB for ARMV7R per ARM document:
https://developer.arm.com/documentation/dui0471

Thanks to hujun260 for spotting this, now ostest works.

Why it helps is still to be clarified, the `arm_signal_handler.S`
might require this THUMB option.

To keep ARM_THUMB as option, this only selects it for
PROTECTED as per anchao's suggestion.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
ab877b5c93 arm/qemu-armv7r: add heap alloc
This adds up_allocate_heap() support for PROTECTED mode so that
kernel and user heap sizes match memory.ld linker script.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
79c2f4f394 arch/armv7-r: fix SYS_task_start
This fixes task start syscall in PROTECTED mode, following that
of armv7-m so that hello and getprime programs can run smoothly.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
b7fc3aa034 arch/qemu: cortex-r5 PROTECTED support
This adds MPU and userspace handling in QEMU chips so that to
boot PROTECTED target qemu-armv7r:pnsh.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
1cecf6791d arch/armv7-r: add undefined mpu_region_s
This copies struct mpu_region_s from armv7-m to fix PROTECTED mode
build error: `invalid use of undefined type 'struct mpu_region_s'`

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00