Commit graph

136,983 commits

Author SHA1 Message Date
Daniel Leung
4e54b2f37f tests: mem_protect/stack_random: more randomness for intel_adsp
Due to CONFIG_DCACHE_LINE_SIZE=64, the stack is always aligned
on 64 bytes. With data cache line size and the default of
CONFIG_STACK_POINTER_RANDOM=64 in test, there is not much
randomness as any added offset (<= 64) would be rounded up to
64 bytes due to stack alignment. For the added offset to stack
pointer to actually mean something, CONFIG_STACK_POINTER_RANDOM
has to be larger.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 09:25:33 +01:00
Daniel Leung
04dd427bf1 xtensa: cleanup crt1.S
Removes some unused macros.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 09:25:33 +01:00
Charles Hardin
b38a46bade drivers: ethernet: lan9250: add in the reset gpio configurate
The reset gpio field was in the config structure but was not coded
into the initialization path. So, add the appropriate code to handle
the gpio setup when it is defined in the device tree.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-12-09 09:25:15 +01:00
Charles Hardin
855631aeba drivers: ethernet: lan9250: add support for a random mac address
Extend the lan9250 driver to support using a local administered
unicast random mac address during init. This follows the device tree
settings for zephyr_random_mac_address from other ethernet drivers
for the added support.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-12-09 09:25:15 +01:00
Vladislav Kulikov
286cefbb30 smf: improve sibling transitions speed
Sibling transitions are now detected in smf_set_state() when source and
destination share the same parent, removing the need for states to flag
the sibling transition explicitly.

Restore include/zephyr/smf.h and lib/smf/Kconfig to match main so this
change only carries the functional update in lib/smf/smf.c, and add a
micro-benchmark test. For accurate statistics, run the test on a board.

Micro-benchmark setup
- Board: NUCLEO-F746ZG (STM32F746, ~192 MHz)
- 200000 iterations per state transition
- Simple HSM (letters are nodes; R is root):

=== SMF transition micro-benchmark ===
        R
      /   \
     A     B
    / \   / \
   C   D E   F
  / \         \
 G   H         J

Current smf_set_state:
======================
Sibling Transitions
(A->B) : 459 cycles/transition (2390 ns)
(C->D) : 482 cycles/transition (2510 ns)
(G->H) : 522 cycles/transition (2718 ns)

Other Transitions
(G<->G) : 237 cycles/transition (1234 ns)
(C->G) : 343 cycles/transition (1786 ns)
(A->H) : 452 cycles/transition (2354 ns)
(G->D) : 651 cycles/transition (3390 ns)
(D->E) : 752 cycles/transition (3916 ns)
(J->D) : 893 cycles/transition (4651 ns)
(J->G) : 1077 cycles/transition (5609 ns)

New smf_set_state:
==================
Sibling Transitions
(A->B) : 356 cycles/transition (1854 ns)(22% faster)
(C->D) : 356 cycles/transition (1854 ns)(26% faster)
(G->H) : 356 cycles/transition (1854 ns)(32% faster)

Other Transitions
(G<->G) : 258 cycles/transition (1343 ns)(9% slower)
(C->G) : 356 cycles/transition (1854 ns)(4% slower)
(A->H) : 464 cycles/transition (2416 ns)(3% slower)
(G->D) : 707 cycles/transition (3682 ns)(9% slower)
(D->E) : 797 cycles/transition (4151 ns)(6% slower)
(J->D) : 970 cycles/transition (5052 ns)(9% slower)
(J->G) : 1157 cycles/transition (6026 ns)(8% slower)

This change makes sibling transitions
deterministic and cheaper (356 cycles on nsim),
at the cost of a small increase for deeper/LCA
transitions (~7–9%). This is a net win for state machines
that mostly hop between siblings.

Signed-off-by: Vladislav Kulikov <vlad_kulikov_c@pm.me>
2025-12-08 22:27:54 -05:00
Laurentiu Mihalcea
e8d8979386 firmware: scmi: nxp: add "nxp" to the CPU protocol definitions
The SCMI CPU protocol is in fact a vendor extension from NXP. The current
naming used for the CPU protocol definitions (i.e. functions, structures,
macros) follows that of the SCMI standard protocols, which might be
misleading.

Include "nxp" in the name of all of the CPU protocol definitions.

This change was performed mechanically using "git grep" and "sed -i"
with some manual intervention.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2025-12-08 22:27:38 -05:00
Dennis Grijalva
61938e7460 mgmt: mcumgr: make mcumgr handler variable const
Ensure mcumgr handler variables are consts in order to make ld happy and
not emit the "LOAD segment with RWX permissions" warning

Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
2025-12-08 22:27:04 -05:00
Fabio Baltieri
4ab97f565e sys: getopt: drop the gcd definition
This is available in util.h since 646f255373 and the existing one
creates a collision and build breakage. Just drop it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-12-08 22:26:48 -05:00
Dmitrii Sharshakov
8f0df404c2 tests: subsys: ipc: ipc_sessions: add _no_unbound tests for bsim
Also cover these code paths.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 15:02:29 -05:00
Dmitrii Sharshakov
7c1b95f435 tests: subsys: ipc: ipc_sessions: run on nrf5340bsim
Improve CI coverage.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 15:02:29 -05:00
Dmitrii Sharshakov
8f4f1fa5fa ipc: icmsg: fix unbound for POSIX
Make sure unbound works on nrf5340bsim.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 15:02:29 -05:00
Dmitrii Sharshakov
3411facb24 tests: subsys: ipc: ipc_sessions: decrement before sending
Once the primary CPU receives the block, it will immediately try to ask
the remote for blocks left to send.

On real hardware, this would typically work fine, since the IRQ
round-trip allows remote to finish the loop iteration.

However on nrf5340bsim the host answers immediately, receiving wrong
data and failing the test.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 15:02:29 -05:00
Dmitrii Sharshakov
c125d2dc96 tests: subsys: ipc: ipc_sessions: fix wrong sizeof usage
Fix clangd warnings around use of sizeof on pointers.

No functional change.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 15:02:29 -05:00
Dmitrii Sharshakov
bd982008fe tests: subsys: ipc: break busy loops
Busy loops without any way to yield to the kernel are not recommended,
and here it causes a multicore BabbleSim simulation to stall.

Co-authored-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 15:02:29 -05:00
Phi Bang Nguyen
646f255373 sys: util: Add gcd and lcm utilities
Add helpers to compute Greates Common Divisor (GCD) and Least Common
Multiple (LCM).

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
2025-12-08 15:01:46 -05:00
Phi Bang Nguyen
1f31da3398 sys: util: Add SIGN macro
Add a macro to determine the sign of a value.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
2025-12-08 15:01:46 -05:00
Phi Bang Nguyen
53f4f22968 west.yml: Update hal_stm32 revision for SIGN fix
Update the revision to include SIGN macro fix

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2025-12-08 15:01:46 -05:00
Firas Sammoura
a9500f3846 tests: riscv: Implement unit tests for change permissions function
This commit implements a new unit test suite to validate the
`z_riscv_pmp_change_permissions` function.

Signed-off-by: Firas Sammoura <fsammoura@google.com>
2025-12-08 15:01:37 -05:00
Firas Sammoura
7dc9e87f6c riscv: pmp: Add API to change region permissions at runtime
The new function 'z_riscv_pmp_change_permissions' provides a mechanism
to modify the Read, Write, and Execute (R/W/X) permissions of an
existing PMP region based on its memory attribute index.

Signed-off-by: Firas Sammoura <fsammoura@google.com>
2025-12-08 15:01:37 -05:00
Tom Chang
ab7a558f19 drivers: espi: npcx: workaround for missed IRQ1/12 on NPCX9M7FB
When the firmware wrote data to KBC/AUX output buffer, the hardware
automatically generated IRQ1/12 to notify the host. After the host read
the data, the EC received an output buffer empty (OBE) interrupt to
indicate that the next byte could be written. However, on the NPCX9M7FB,
this mechanism may cause IRQ1/12 to be missed if the firmware write new
data immediately after detecting that the output buffer is empty,
resulting in incorrect behavior.
To avoid missing IRQ1/12, the flow is changed so that it first checks
VWIRE_AVAIL to ensure no pending VW events. If no VW event is pending,
the firmware writes data to the output buffer and explicitly asserts
IRQ1/12 to notify the host. After the host reads the data and the OBE
interrupt triggers, the firmware clears IRQ1/12.
This updated sequence prevents IRQ1/12 from being lost and ensure
correct notification behavior.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2025-12-08 15:01:15 -05:00
Dennis Grijalva
9dbe4bed29 kernel: make static thread data variable const
Ensure static thread data variables are consts in order to make ld happy
and not emit the "LOAD segment with RWX permissions" warning

Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
2025-12-08 15:01:01 -05:00
Tom Burdick
dc512c820b MAINTAINERS: Update maintainership for myself
Transition my MAINTAINERS file statuses to align better with my new role
at Infineon. I loved my time at Intel and am forever thankful to have
been part of an amazing team. I look forward to leading Infineon in the
project.

Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
2025-12-08 15:00:37 -05:00
Mateusz Junkier
fb8a1ec9f3 Twister: fix serial port timeout
Fix for 1d70b70. Original code used start_time (set before flashing)
to calculate serial port wait timeout, which caused wait loop
to include flash duration, leading to exceed overall timeout.
Added serial_wait_start timestamp for avoid
including flash time in serial port enumeration timeout.
Make timeout dynamic (20% of flash_timeout, minimum 10s).

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
2025-12-08 13:19:16 -05:00
Jisheng Zhang
1292d6e11a drivers: console: support building for SoCs with no MMU
The device_map() is not defined for SoCs with no MMU, add the
device_map() macro when !DEVICE_MMIO_IS_IN_RAM to support building for
SoCs with no MMU.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
2025-12-08 13:15:53 -05:00
Hake Huang
b3dff9bbbc tests: twister: using --no-rebuild in west flash
west flash deprecates --skip-rebuild to --no-rebuild

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2025-12-08 13:12:04 -05:00
Jordan Yates
d020049f01 scripts: twisterlib: main: trim run duration
Display the total run duration to two decimal points instead of ~14,
similar to the other displayed timestamps.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-12-08 13:11:44 -05:00
Jordan Yates
d1cd982f8f scripts: twisterlib: display testplan build duration
Display how long it takes to build the testplan in the logs. This can
be useful since the duration to bulid the plan can vary wildly depending
on the arguments given. Without this information, it is difficult to
tell (from CI logs) whether a long execution time is from actually
building and running the tests, or just generating the testplan.

For example, in a downstream repo:
```
./zephyr/scripts/twister --integration -iv -T . --dry-run

INFO    - Building initial testsuite list...
INFO    - Built testsuite list in 10.58 seconds
```
vs
```
./zephyr/scripts/twister --integration -iv -T . --dry-run \
--vendor nordic --vendor zephyr

INFO    - Building initial testsuite list...
INFO    - Built testsuite list in 201.01 seconds
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-12-08 13:11:44 -05:00
Pieter De Gendt
e622bdafe0 docs: releases: 4.4: Add entry for DT_CHILD_BY_UNIT_ADDR_INT
Add a DeviceTree section and entries for the new C macros.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 13:09:24 -05:00
Pieter De Gendt
73ab6b6ffb include: zephyr: drivers: adc: Replace FOREACH with CHILD_BY_UNIT_ADDR_INT
The macro to initialise a struct adc_dt_spec instance uses a FOREACH macro,
which can be problematic when nesting in other FOREACH macros, for example
in driver implementations.

Replace it with DT_CHILD_BY_UNIT_ADDR_INT.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 13:09:24 -05:00
Pieter De Gendt
4208bd7fcc tests: lib: devicetree: api: Add test cases for DT_CHILD_BY_UNIT_ADDR_INT
Introduce test cases to the devicetree API test suite for
DT_CHILD_BY_UNIT_ADDR_INT and DT_INST_CHILD_BY_UNIT_ADDR_INT.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 13:09:24 -05:00
Pieter De Gendt
91278bdddf devicetree: Add DT_CHILD_BY_UNIT_ADDR_INT
Allow fetching child node identifiers by integer unit address.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 13:09:24 -05:00
Martin Hoff
da6cd1a474 test: benchmarks: update timing cycle to ns conversion function
SYS_CLOCK_HW_CYCLES_TO_NS_AVG is not correct since we are tracking
cpu tick and SYS_CLOCK_HW_CYCLES_TO_NS_AVG convert it with the clock
frequency.
This patch used the correct conversion function (same api as function
to get the timestamp).

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-12-08 13:09:08 -05:00
Anas Nashif
d7a8f29ce7 tests: twister: keep this workflow for pytest only
Do not use this workflow for running tests, it should be limited to
blackbox tests only testing command line already happens somewhere else.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-12-08 13:08:57 -05:00
Ayush Singh
61fba0cbb3 tests: subsys: mgmt: mcumgr: smp_client: Fix test
- Do not use uninitialized smp_client for allocations.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-12-08 11:41:30 -05:00
Ayush Singh
4f98eede4b mcumgr: client: Allow specifying server address
- Currently, it is not possible to use mcumgr client with smp server
  since there is no way to specify smp server address for requests.
- This patch series adds support for creating smp_client_object
  containing information regarding the host server. This design allows
  multiple smp_client_object to exist for the same underlying smp_udp
  transport, making it much easier to use the same udp socket for multiple
  OTAs.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-12-08 11:41:30 -05:00
Zhaoxiang Jin
aa7efb4744 tests: power_mgmt_soc: enable test for frdm_mcxn236
Enable power_mgmt_soc test for NXP frdm_mcxn236 board.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-08 11:40:34 -05:00
Zhaoxiang Jin
3114d7751b soc: nxp/mcxn: Add power management support for MCXN236
Add power management support for MCXN/MCXN236.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-08 11:40:34 -05:00
Zhaoxiang Jin
999e3ab204 dts: nxp_mcxn23x: Add power-states for MCXN23x devices
1. Add power-states for MCXN23x devices
2. Add power management related device nodes to MCXN23x,
including spc, cmc vbat, and wuu.
3. Add 'zephyr,cortex-m-idle-timer' node in frdm_mcxn236.dts

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-08 11:40:34 -05:00
Zhaoxiang Jin
6cfd51e35b dts: nxp,spc: Add wakeup-delay property for nxp spc
When a different VDD_CORE level is configured in low
power modes (LP_CFG register) compared to active modes
(ACTIVE_CFG register), the LPWKUP_DELAY register must
be configured to a minimum value.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-08 11:40:34 -05:00
Zhaoxiang Jin
439d8f2a97 modules: hal_nxp: pull in spc, cmc and vbat driver for mcxn/a
pull in spc, cmc and vbat driver for mcxn/a

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-08 11:40:34 -05:00
Felipe Neves
035156ea50 sensors: as5048: add initial support for AS5048 angle sensor
Which is a contactless angle sensor that communicates over
SPI.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2025-12-08 11:39:37 -05:00
Markus Becker
dedc526ee5 boards: m5stack: Add support for M5Stack NanoC6
This adds support for M5Stack NanoC6, an ESP32-C6 based development board
with a tiny form factor.

Based off https://github.com/zephyrproject-rtos/zephyr/pull/74697 and
adapted to match other Espressif C6 devices currently in tree.

Signed-off-by: Markus Becker <markushx@gmail.com>
2025-12-08 11:39:29 -05:00
David Jewsbury
c7eccea629 drivers: mspi_dw: nrf_qspi_v2: Update to align nrfx 4.0.1
New nrfx release makes including nrf.h invalid.

Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
2025-12-08 11:39:17 -05:00
Dmitrii Sharshakov
8725972764 samples: tfm_ipc: remove old overlay for nrf9160dk
The region sizes already match ones in nrf91xx_partition.dtsi,
and the overlay has not been adapted to the new partition DT updates.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-12-08 11:39:06 -05:00
Alberto Escolar Piedras
7d933a4ad2 ci: bsim tests: net: Explicitly define the BOARD
Instead of relying on this board being the default.
Let's explicitly set it in the script.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-12-08 11:38:58 -05:00
Alberto Escolar Piedras
0096ff2e2a ci: bsim tests: run_parallel: Print in which board we failed a test
In the console log, print out in which board the test failed, so it
is easier for developers, so they don't need to scroll up to the
beginning of the batch to see it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-12-08 11:38:58 -05:00
Pieter De Gendt
c7e7f6be24 doc: releases: migration: 4.4: Add shell_set_bypass update
Add an entry for the shell API change for shell_set_bypass.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 09:39:05 -05:00
Pieter De Gendt
d7cd700ad0 tests: shell: Add shell_set_bypass test
Add a test to the shell testsuite for validating shell_set_bypass.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 09:39:05 -05:00
Pieter De Gendt
3695b2c0ca shell: Add user data argument to shell_set_bypass
Allow passing some context to the shell bypass callback function by
providing a void pointer user data argument.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 09:39:05 -05:00
Arunprasath P
7a975accfd tests: dma: microchip: Add board overlay file
Add board overlay file for pic32cx_sg41_cult to enable dma
test cases to run on this board

Signed-off-by: Arunprasath P <arunprasath.p@microchip.com>
2025-12-08 09:38:40 -05:00