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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>