Commit graph

126,787 commits

Author SHA1 Message Date
Declan Snyder
8167efa28b soc: nxp: imxrt7xx: Split soc code files
Instead of one soc.c with all the code, split into files for each area
of concern.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:51 +02:00
Declan Snyder
6cb2bf551d soc: imxrt7xx: Split Kconfig files to CPU folders
For better organization, split the Kconfig files into one per each CPU.

Also, there was a bug where MFD was made to depend on flexcomm being
enabled, when really it probably meant to just default y if flexcomm is
enabled.

Leave Kconfig.soc in one file for the SOC.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:51 +02:00
Declan Snyder
40edefb4cf drivers: mcux_os_timer: Optimize counter timeout set
We can both optimize and clean up the code by using short circuit logic
and static variables instead of stack variables.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:42 +02:00
Declan Snyder
513b1645e0 drivers: mcux_os_timer: Refactor ISR
Refactor ISR by:
1) making a helper function to put the tickful calculation in, to reduce
   an indentation level and cognitively separate this case while reading
2) Rewrite the calculations to simplify them. More info on that below.

Math changes:
- In the ISR, there was a variable called "now" which represented the
current cycle count of the timer. last_count was updated using a
calculation based on the number of elapsed ticks
and the hardware cycles per second value. However, this is
redundant because mathematically, this is equivalent to "now". So the
variable can just be set to now.
Proof is that the previous calculation was (in programming language):
(1) last_count = last_count + elapsed_ticks * CYC_PER_TICK
So let's rewrite this as the following to be clear about the different
values we are talking about here (in math language):
(2) count[t] = count[t-1] + elapsed_ticks * CYC_PER_TICK
We calculated elapsed ticks in the function as:
(3) elapsed_ticks = (now - last_count) / CYC_PER_TICK
(4) elapsed_ticks = (now - count[t-1]) / CYC_PER_TICK
Rearranging (2), we see
(5) elapsed_ticks = ( count[t] - count[t-1] ) / CYC_PER_TICK
Substituting this into (4), we get:
(6) ( count[t] - count[t-1] ) / CYC_PER_TICK =
			(now - count[t-1]) / CYC_PER_TICK
Doing simple algebra, you can see we result with:
(7) count[t] = now
So therefore, we can simplify the programming expression to
(8) last_count = now

- The other change is regarding the calculation of the next tick match
  value for tickful kernel mode. The previous calculation was doing:
(1) next = now + CYC_PER_TICK
We know that last_count is equivalent to now, at this point in the code
with the first change:
(2) next = last_count + CYC_PER_TICK
And then, for some reason, we are adding yet another CYC_PER_TICK to
next if (next - now) < MIN_DELAY. The reason for that I do not
understand, but let's write that down:
(3) next - now < MIN_DELAY
Now rewrite (2) as (4) and (3) as (5):
(4) count[t+1] = count[t] + CYC_PER_TICK
(5) count[t+1] - count[t] < MIN_DELAY
And now we substitute (4) into (5):
(6) count[t] + CYC_PER_TICK - count[t] < MIN_DELAY
And simplify:
(7) CYC_PER_TICK < MIN_DELAY
So actually no runtime calculations are needed here, this is a
hardcoding. The reason for this calculation I don't know, but we can
simplify the code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:42 +02:00
Declan Snyder
992f6fb774 mcux_os_timer: Refactor elapsed ticks calculation
There are a couple places where effectively the exact same calculation
is done. Refactor to share code to do this calculation to make it easier
to read, and explode the code to multiple statements to be even easier
to follow the calculation. Compiler will likely optimize the same way
when opt enabled. Rename dticks variable to be more explicit what that
means (elapsed ticks).

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:42 +02:00
Declan Snyder
d26f3b41b3 drivers: timer: mcux_os_timer: General refactor
Refactor to remove nesting and consolidate lines of code.

I also ran clang format but that actually did not change very much in
addition to what I had already changed manually.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:42 +02:00
Yongxu Wang
341ee11749 modules: hal_nxp: add trdc_1 driver component
Added CONFIG_TRDC_MCUX_TRDC_1 to involve mcux trdc_1 driver

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
2025-08-22 06:52:33 +02:00
Yongxu Wang
c79d8f3347 modules: hal_nxp: set sentinel device driver state as on
Some SoCs such as iMX8ULP and iMX93 use sentinel controller
for secure system management, this change ensures the device
driver is available by default.

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
2025-08-22 06:52:33 +02:00
Yongxu Wang
9a4ab3252d soc: nxp: imx93: m33: enable trdc setting across all execution modes
This update ensures that TRDC settings are correctly applied
when user space is enabled. By default, the M33 core operates
in privileged mode.

However, when user threads are scheduled, the system transitions
to unprivileged mode. The TRDC configuration is adjusted to support
this behavior, maintaining secure and functional access control
for both privileged and unprivileged execution contexts.

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
2025-08-22 06:52:33 +02:00
Zhaoxiang Jin
115b0e0dc8 driver: regulator: Improve nxp vref driver.
1.Remove the code that sets the UTRIM register to 0,
because UTRIM is automatically loaded with a factory-trimmed
value, zeroing will affect the accuracy. Only need to clear
VREF UTRIM[TRIM2V1] at the initialization stage.

2. VREF does not have NXP_VREF_MODE_INTERNAL_REGULATOR mode,
the internal voltage regulator and chop oscillator are used
to suppress power supply noise and reduce voltage offset,
so remove the NXP_VREF_MODE_INTERNAL_REGULATOR mode.
there are only three modes in VREF, the first is the standby
mode (CSR[BUF21EN] = 0, CSR[HI_PWR_LV] = X), the second is
low power mode (CSR[BUF21EN] = 1, CSR[HI_PWR_LV] = 0), and
the third is high power mode (CSR[BUF21EN] = 1, CSR[HI_PWR_LV] = 1).

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-22 06:52:21 +02:00
Zhaoxiang Jin
fa348d8e1b dts: bindings/regulator: Add new properties for nxp vref
1. Added new boolean type 'nxp,internal-voltage-regulator-en'
and 'nxp,chop-oscillator-en' properties for 'nxp,vref'.
The user can use these properties to improve the stability
and accuracy of the VREF output voltage.

2. Added properties 'nxp,current-compensation-en' and
'nxp,internal-voltage-regulator-en' and 'nxp,chop-oscillator-en'
for LPC55S3x, MCXN23x, MCXN94x, and MCXW7x VREF node.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-22 06:52:21 +02:00
Zhaoxiang Jin
8ffc36ce63 tests: voltage: Improve nxp boards hardware settings
1.The VREFO is internally connected to the ADC channel,
so can change the measurement channel to simplify the
test process.

2.Change the VREF mode to NXP_VREF_MODE_HIGH_POWER as the
'NXP_VREF_MODE_INTERNAL_REGULATOR' mode is removed.

3.Increase ADC sample time to improve ADC accuracy

4.Adjust tolerance-microvolt to a suitable value,
20000uv is a more suitable value for NXP VREF,
the actual VREF tolerance-microvolt can be smaller
than this value, but hardware differences may cause
this case to fail to run on some boards.

5.Add frdm_mcxn236 and frdm_mcxw71 to test platform.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-22 06:52:21 +02:00
Zhaoxiang Jin
eb27e42c16 drivers: regulator/pca9420: Correct wrong maximum index.
PCA9420 LDO1 range maximum index is 0x8U not 0x9U.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-22 06:52:21 +02:00
Benjamin Cabé
d3f1b82f98 include: drivers: usb: bc12: fix doxygen comments
Trivial fixes to doxygen documentation of BC 1.2 header

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-22 03:32:39 +02:00
Duy Nguyen
d2f4497ec7 boards: renesas: ek_ra6m5: added mikrobus and arduino labels
Added mikrobus_serial, mikrobus_i2c, mikrobus_spi, mikrobus_header,
arduino_header, arduino_serial, arduino_i2c and arduino_spi node
labels to EK-RA6M4 device tree board definition, allowing
compatible shield boards to be used.

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-08-22 03:32:26 +02:00
Peter Marheine
a0374a16ec dt-bindings: rp2350: correct PWM names for GPIOs 40..47
The macros for PWM output on these GPIOs had names that referred to PWM
channels that do no exist on this chip- it only has 12 channels, where
channels 8..11 are exposed on both GPIOs 32..39 and 40..47.

Signed-off-by: Peter Marheine <peter@taricorp.net>
2025-08-22 03:32:16 +02:00
Peter Marheine
26ab6d858e soc: rp2350: support PWM channels >8
RP2350 adds four more PWM slices from the eight available on RP2040,
which are only broken out to package pins on RP2350B. This change fixes
the driver to support the correct number of slices on RP2350.

Tested by confirming that PWM can correctly be configured on GPIO 44 of
RP2350B.

Signed-off-by: Peter Marheine <peter@taricorp.net>
2025-08-22 03:32:16 +02:00
Peter Marheine
bc9b80cb02 soc: rp2350: correctly handle GPIOs >31
RP2350 has 48 GPIOs, where only the first 30 are broken out to pins on
RP2350A (same as RP2040) and the remaining 18 are only usable on RP2350B.
This change makes the soc pinctrl driver support GPIOs above 31, where
previously it was impossible to configure GPIOs 32 through 47.

Tested on RP2350B, confirming that GPIO44 can be correctly configured for
PWM.

Signed-off-by: Peter Marheine <peter@taricorp.net>
2025-08-22 03:32:16 +02:00
Robert Lubos
faa507ef6c net: Fix misc Kconfig style issues in networking area
Fix misc Kconfig style issues in networking area.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-08-21 20:12:48 +02:00
Benjamin Cabé
7236e9f45c include: drivers: espi: doxygen housekeeping
Add missing doxygen comments

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-21 20:12:25 +02:00
Aditi Bhaskar
3edce47faf samples: drivers: uart: async_api: Remove overlay
- Remove overlay and conf for cyw920829m2evk_0 since it is superfluous

Signed-off-by: Aditi Bhaskar <aditi.bhaskar@infineon.com>
2025-08-21 20:12:15 +02:00
Peter Mitsis
fedbe50b20 portability: cmsis: Base Event Flags on k_event
Updates the implementation of the osEventFlags APIs to use
Zephyr kernel events instead of polling.

Fixes #92899

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-08-21 20:11:57 +02:00
Tim Lin
9cf0d669e5 drivers/espi: ite: Use structured evt_data for PVT, PVT2, and PVT3 events
Replace direct assignment of evt.evt_data with structured access via
espi_evt_data_pvt. This change separates the incoming evt_data into
type and data fields.

This update alse includes support for handling PVT, PVT2, and PVT3
events using the structured event data.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-08-21 20:11:42 +02:00
Tim Lin
5e3f1dbaa6 drivers/espi: Add structure for evt_data in peripheral PVT events
Introduce a new bit field structure "espi_evt_data_pvt" to represent
the evt_data field in PVT IO related eSPI peripheral events.

With this change, callback functions handling eSPI events can extract
both the data and its associated type from evt_data.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-08-21 20:11:42 +02:00
Rory Piper
ea1245eb92 drivers: flash_stm32h7: Fix REAL_FLASH_SIZE_KB size
For devices other than the stm32h745/747/755/757 that use
dual-core cortex-M4/cortex-M7, do not multiply flash
controller size by 2. Single-core stm32h7x devices define
their flash-controllers dtsi as a single area, not two banks.
Use the presence of the bank2-flash-size prop to determine if
this is a dual-core stm3h7x or not.

Signed-off-by: Rory Piper <rory.piper@signal-fire.com>
2025-08-21 20:11:19 +02:00
Benjamin Cabé
071b571ba4 include: mgmt: mcumgr: doc: massive doxygen makeover
This cleans up the doxygen documentation for the MCUmgr subsystem
(consolidated the doxygen groups, added some missing docs, added proper
@name'd sections where appropriate, etc).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-21 18:43:57 +02:00
Philémon Jaermann
917e518e04 dts: arm: Remove AES from the u575
Which does not have HW support for it, as stated by ST here:
https://www.st.com/en/microcontrollers-microprocessors/stm32u575-585.html

"
The STM32U575 portfolio offers from 1 to 2 Mbytes of flash memory
and from 48- to 169-pin packages.
The STM32U585 is available with 2 Mbytes of flash memory and provides
an additional encryption accelerator engine (AES, PKA, and OTFDEC).
"

All the U5 SoC have a hash HW accelerator (even the ones which don't
have crypto support: U535XX, U575XX, U59XXX and U5FXXX).
The hash node is therefore moved directly inside the stm32u5.dtsi.

Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
2025-08-21 18:42:47 +02:00
Benjamin Cabé
318989f388 Bluetooth: Mesh: doc: document Health Fault values
add doxygen comments to the Mesh health fault macros

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-21 18:42:37 +02:00
Arthur Gay
4008f5c9c2 drivers: disk: sdmmc_stm32: Add API to retrieve SD card CID register
Introduce a new API function in the sdmmc_stm32 driver that allows
applications to access the Card Identification (CID) register of the
SD/MMC card. This functionality, already available in the SPI-based SD
and MMC subsystems, was previously missing from the STM32 SDMMC driver.

This enhancement enables use cases such as verifying the correct SD card
during manufacturing, ensuring that OEMs use the specified SD card, and
preventing mismatches.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2025-08-21 18:42:26 +02:00
Tanguy Raufflet
40d6ee6057 stm32mp257f_ev1_stm32mp257fxx_m33.dts: add i2c node
This commit adds the i2c8 node to the device tree for the
STM32MP257F-EV1 board. This node corresponds to the i2c exposed by the
GPIO expansion connector [1] and not used by the cortex A35.

[1]: https://wiki.st.com/stm32mpu/wiki/STM32MP257x-EV1_-_hardware_description

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
2fcab45e93 boards: st: stm32mp257f_ev1_stm32mp257fxx_m33.yaml: update documentation
The I2C is now supported.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
65d3117c3c dts: arm: st: stm32mp2_m33.dtsi: add i2c nodes
Add I2C nodes in non-secure context to dtsi.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
697fe436e9 drivers: i2c: Kconfig.stm32: enable combined interrupt for STM32MP2
According to the STM32MP2 reference manual, the I2C controller uses
a single interrupt line for all events (EV + ERR), so the combined
interrupt must be enabled for the STM32MP2 series.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
457d1ca58f drivers: clock_stm32_ll_mp2: add i2c clock
Add I2C clocks rate reading to the STM32MP2 clock driver.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
256f648c28 dt-bindings: stm32mp2_clock.h: add clock for i2c peripherals
Add clock bindings for I2C peripherals for the STM32MP2 series.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
fb854d3a05 dts: arm: st: stm32mp2_m33.dtsi: add node gpioz
Add GPIO Z node to the device tree for STM32MP2 SoC.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
bec960356c drivers: gpio: stm32: add gpioz support for the STM32MP2
Add support for GPIOZ in the STM32 GPIO driver.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
6325b73739 drivers: pinctrl: stm32: add gpioz pinctrl support for STM32MP2
The STM32MP2 series needs gpioz pinctrl support to be able to use
the GPIOZ pins.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Tanguy Raufflet
5046fdb858 modules: hal_stm32: update the HAL to integrate I2C8 clock configuration
Update hal_stm32 to include the modifications allowing to read the I2C8
clock frequency in the same way as I2C1-7.

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
2025-08-21 18:41:59 +02:00
Sylvio Alves
34eb58c043 espressif: fix Kconfig style issues
Fix Kconfig style issues in Espressif files.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-08-21 18:41:52 +02:00
Jake Greaves
ba4bb91b1b drivers: serial: STM32U5 series lpuart
Allow LPUART to function and wakeup the device from STOP modes

Signed-off-by: Jake Greaves <jake.greaves@analog.com>
2025-08-21 17:13:36 +02:00
Vinayak Kariappa Chettimada
4ec8980022 Bluetooth: Controller: Fix BT_CTLR_ADV_ADI_IN_SCAN_RSP
Fix to rename BT_CTRL_ADV_ADI_IN_SCAN_RSP to
BT_CTLR_ADV_ADI_IN_SCAN_RSP.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-21 17:13:30 +02:00
Vinayak Kariappa Chettimada
e4df18b51b Bluetooth: Controller: Fix bt_ctrl to bt_ctlr abbreviation
The Controller is abbreviated as CTLR in contrast to CTRL
which is used in the context of Link Layer Control
Procedures.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-21 17:13:30 +02:00
Ivan Wagner
f5c99047da samples: boards: st: wkup_pins: add overlay for Nucleo-WBA55CG
Added wakeup pins sample for nucleo-wba55cg board.

Signed-off-by: Ivan Wagner <ivan.wagner@tecinvent.ch>
2025-08-21 17:09:24 +02:00
Ivan Wagner
d8d98aa2e2 soc: st: stm32wba: add support for sys_poweroff
Adding sys_poweroff to WBA family. It switches to standby
(non-retention) mode. It can be woken up by any wakeup source.

Signed-off-by: Ivan Wagner <ivan.wagner@tecinvent.ch>
2025-08-21 17:09:24 +02:00
Ivan Wagner
27cc32a076 dts: arm: st: stm32wba: added power control peripheral
Added support for wakeup pins (events).

Signed-off-by: Ivan Wagner <ivan.wagner@tecinvent.ch>
2025-08-21 17:09:24 +02:00
Sven Ginka
410ce46578 drivers: ethernet: vsc8541: fix init
added missing config.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-08-21 17:06:21 +02:00
Guillaume Gautier
abe9a57018 tests: drivers: pwm: loopback: add overlays for stm32n6570_dk
Enable two timers and PWM in STM32N6570-DK board dts.
Add overlays to test the pwm_loopback test on STM32N6570-DK board.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-08-21 17:05:57 +02:00
Guillaume Gautier
db1453bdb1 tests: drivers: counter: basic_api: add overlays for stm32n6570_dk
Add overlays to run the counter_basic_api test on STM32N6570-DK board.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-08-21 17:05:57 +02:00
Guillaume Gautier
78fa4f0142 drivers: clock: n6: prevent clock configuration if NO_SEL is used
For STM32N6, when a device clock source is defined with NO_SEL, do not
configure it.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-08-21 17:05:57 +02:00