Compare commits

...

1224 commits

Author SHA1 Message Date
b61bded0f9 drivers: console: add a QingKeV2 Debug console driver
Signed-off-by: Michael Hope <mlhx@google.com>
2024-11-26 19:21:02 +01:00
Daniel Leung
b7b4de8afe uart: refactor internal bits from public API header file
This refactors internal bits out of the public API header file
and into its own file. This includes:

* Driver API struct which is only used by driver implementations
  but not by users of API.
* Inline implementations of various APIs.
* Inline z_impl_*.

These are implementation details that do not need to live within
the public API header file. This de-clutters the public header
file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-26 14:47:01 +00:00
Adam Kondraciuk
be1f40547f soc: nordic: nrf54h: disable IRQ before PM config
IRQs must be disabled before starting any procedures to prepare
for low-power states.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-26 14:46:55 +00:00
Adam Kondraciuk
e786c1f849 dts: arm: nordic: Add power states for nRF54H20
Add `idle` and `s2ram` power states for nRF54H20 cpuapp and cpurad.
Also the substate `idle_cache_disable` added.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-26 14:46:55 +00:00
Adam Kondraciuk
9b252855fd soc: nordic: Add LRCCONF management
Due to the possibility of simultaneous accesess to LRCCONF registers,
additional management is required.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-26 14:46:55 +00:00
Dominik Kilian
d5262b2113 modules: hal_nordic: Allow app mem from net core in serialized 802.15.4
Currently, the serialization module for 802.15.4 enabled
the network core without giving it access to application
core memory in trusted execution mode. This commit
grands this access.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2024-11-26 14:46:47 +00:00
Tomi Fontanilles
4b9c58806b tests: portability: cmsis_rtos_v2: do not disable 64-bit timeouts
Some code that automatically gets embedded on some platforms relies
on having `CONFIG_TIMEOUT_64BIT` enabled.
Do not force disabling that Kconfig option in the test configuration,
as that will make the test fail to compile on those platforms.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-11-26 14:46:38 +00:00
Robin Kastberg
a63926d44a cmake: linker_script: update common-ram.cmake
CMAKE_LINKER_GENERATOR common-ram.cmake is out of date.
This updates it to keep it up to date with common-ram.ld

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2024-11-26 14:46:24 +00:00
Karsten Koenig
a4fcd5e9e0 dts: bindings: arm: nordic: tddconf: Add etrbuffer
Introduce etrbuffer in the tddconf bindings to support flexible
placement in the memory map.

Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
2024-11-26 14:45:22 +00:00
Simon Hein
61f2b117a9 SCA: Get options file value for sysbuild invokation
Get eclair specific option file variable via zephyr_get.
This is also needed if the sca is invoked with sysbuild so it uses
the intended file.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-11-26 14:45:09 +00:00
Tomasz Moń
cb1e7d6b6b nrf_usbd_common: Do not trigger DMA in low power mode
DMA transfers do not execute when the USBD peripheral is in Low Power
mode. Make sure that there is no DMA active transfer when entering Low
Power mode and that new DMA transfers are not started when in Low Power
mode because the transfer won't ever finish.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-11-26 14:45:01 +00:00
Tomasz Moń
4dfae0b0d1 drivers: udc_nrf: Handle Suspend and Resume in thread
Low Power mode can only be entered when there are no active DMA
transfers. Move the Suspend and Resume processing to thread to allow
waiting for the DMA available semaphore in USB Suspend handler.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-11-26 14:45:01 +00:00
Dominik Ermel
e04f6d0e84 tests: flash_map: Fix tests configurations
Kconfig that enables integrity check has been moved to
test configurations that test it.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-26 14:44:54 +00:00
Andrej Butok
fd5df64454 samples: smp_svr: Add frdm_mcxn947 to allow list for USB and UDP
Adds frdm_mcxn947 to the smp_svr sample allow list,
for overlay-udp.conf and usb.overlay.

Signed-off-by: Andrej Butok <Andrey.Butok@nxp.com>
2024-11-26 14:44:38 +00:00
Pieter De Gendt
f475f3c8cc ci: compliance: Exclude ClangFormat
Stop running ClangFormat in CI as it confuses (first time) contributors
more than it helps.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 14:44:29 +00:00
Sean Nyekjaer
08a8e4c79f boards: others: candlelightfd: add board picture
Provide a picture of the candlelightFD board

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
2024-11-26 14:44:21 +00:00
Chaitanya Tata
7658adf758 root: Remove temp file
Commit e512151474c("manifest: hal_nordic: Pull nRF Wi-Fi removal")
mistakenly added a temporary local file.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-26 14:44:07 +00:00
Pieter De Gendt
d2a6e9d701 scripts: ci: tags: Add zephyr-keep-sorted check
The tag entries should be sorted, add zephyr-keep-sorted check and sort
accordingly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 14:43:47 +00:00
de19a13c34 runners: add minichlink
This commit adds a runner wrapper for the 'minichlink' program which
offers a free, open mechanism to use the CH-LinkE programming dongle for
the CH32V003.

https://github.com/cnlohr/ch32v003fun/tree/master/minichlink

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
ab66361f4d boards: add ch32v003evt
This commit adds support for the CH32V003EVT board which features a
32-bit general-purpose RISC-V MCU.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
ee8990e2e0 drivers: add the gpio driver for wch ch32v003
This commit adds the gpio driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
ef475cbf71 drivers: add the pfic interrupt controller
This commit adds the pfic interrupt controller driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
01a9061d67 drivers: add the ch32v00x usart driver
This commit adds the usart driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
7e810abc05 drivers: add the ch32v00x systick driver
This commit adds the systick driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
c1c0413eed drivers: add the ch32v00x clock controller
This commit adds the clock driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
6d3348bd83 drivers: add ch32v00x pinctrl support
This commit adds the pinctrl driver for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
936c78e8ba soc: add wch_ch32v003 soc files
This commit adds the soc support for WCH CH32V003.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
ab3fb336c4 dts: add the ch32v003 dtsi
This commit adds the dtsi and bindings for the WCH CH32V003 which is a
32-bit general-purpose RISC-V MCU.

Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
Dhiru Kholia
9e2867a76d west: add the hal_wch
This is used for WCH chips including the CH32V003.

Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2024-11-26 14:41:46 +00:00
Jilay Pandya
6d87bd65ae drivers: stepper: fix fake stepper controller cid issues
Fix: Write to const-qualified field. (WRITE_CONST_FIELD)
- #81915, #81920, #81922, #81924, #81932, #81940, #81941
- #81946, #81947, #81959, #81961, #81970, #81973, #81977

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-26 10:37:35 +00:00
Jilay Pandya
92fce644e5 drivers: stepper: tmc5041: fix cid issues
fix cid issues related to unchecked return values.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-26 10:37:27 +00:00
Chen Xingyu
de1643d8fb net: mqtt: Fix error of size_t formatting with PRIu16
This addresses the following warning building with `CONFIG_64BIT=y`:

    error: format '%hu' expects argument of type 'int', but argument X has
    type 'size_t' {aka 'long unsigned int'}

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-11-26 10:37:20 +00:00
Ivan Iushkov
75fc0a0776 Bluetooth: Host: deprecate bt_le_set_auto_conn()
bt_le_set_auto_conn() function is not working as
expected. Also, it doesn't have any test coverage
and any usage in sample applications.
The function is deprecated
Fixes #81597

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-11-26 10:37:12 +00:00
Arkadiusz Balys
a53cb73587 boards: nordic: Rearrange ram0x regions.
The ram0x partitions seem to be not compliant with nRF54H20
architecture and it causes that in the application dts overlay file
it is difficult to extend cpuapp_ram0x_region without modifying
whole layout.

It is better to place cpurad_ram0x_region at the beginning at
2f010000 address and then cpuapp_ram0x_region right after that.
Thanks to that, if the application needs to have more than 256 kB
of RAM, in the application dts overlay file, a user can increase
cpuapp_ram0x_region size up to 2f0be000.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
2024-11-26 10:37:06 +00:00
Khoa Nguyen
6dd7e14942 boards: renesas: add missing properties for spi node
Add missing "pinctrl-names" and "status" properties for
the spi1 node in ek_ra8m1.dts to able to test spi_loopback
on ek_ra8m1

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-26 10:36:55 +00:00
Khoa Nguyen
0fd6c97f98 drivers: spi: Add condition check for close before open spi
Add condition check for close before open to prevent
invalid pointer access

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-26 10:36:55 +00:00
Jamie McCrae
b4e9806462 boards: nordic: nrf9131ek: Remove PINCTRL
Removes PINCTRL setting which is not needed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-26 10:36:39 +00:00
Pieter De Gendt
520deb32cb cmake: Remove deprecated global CSTD property
Remove the global CSTD property as it has been deprecated for 2 releases.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 10:36:33 +00:00
Pieter De Gendt
85b991af5a tests: bindesc: reading: Remove usage of deprecated global CSTD
Replace global CSTD property with kconfig options.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 10:36:33 +00:00
Krzysztof Chruściński
eae3891303 tests: drivers: uart: uart_elementary: Add runtime PM configuration
Add configuration that uses device runtime PM.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-26 10:36:21 +00:00
Krzysztof Chruściński
13ed9e4210 drivers: serial: nrfx_uarte: Fix runtime PM for interrupt driven API
TX part of interrupt driven API was not calling PM device runtime
API. Additionally, when txstopped occurred after poll out it was
not handled correctly.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-26 10:36:21 +00:00
Chaitanya Tata
60dbb6fa4f modules: hostap: Move Enterprise configs under Enterprise
These are only for Enterprise.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-26 10:36:11 +00:00
Chaitanya Tata
9e63357355 modules: hostap: TLS is only needed for Enterprise
Move TLS MbedTLS wrapper to Enterprise only.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-26 10:36:11 +00:00
Chaitanya Tata
6316e40053 modules: hostap: Fix indentation
Cmake uses spaces (2) as the indentation.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-26 10:36:11 +00:00
Marvin Ouma
9211abcde6 tests: posix: common: separate posix xsi system logging to standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves syslog into a singular
testsuite at tests/posix/xsi_system_logging app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-26 08:45:43 +01:00
Jordan Yates
91e006cb7c sensor: bme280: bme280_wait_until_ready timeout
Add a timeout to the `bme280_wait_until_ready` loop to ensure that we
never get stuck in this loop even if the bus enters an error condition.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-26 08:45:29 +01:00
Anas Nashif
ba5330e2ac ci: twister: for correctness, rename DAILY -> WEEKLY
We run on a weekly basis, not daily.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-26 08:45:16 +01:00
Anas Nashif
088670d605 ci: twister: report filter suites in weekly run
For analysis purposes, report filtered in weekly run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-26 08:45:16 +01:00
Pieter De Gendt
43b112a309 scripts: west_commands: runners: Fix jlink unbound cmd
Commit e2a32d8b0ca596afeae48739c43817f693720a88 introduced an unbound
cmd issue for jlink flashing.

Fixed by moving cmd assignment outside of condition.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-26 08:45:06 +01:00
Anas Nashif
f90ce01d4a kernel: sched: use arch_current_thread instead of _current
_current is deprecated, use arch_current_thread()
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-25 19:06:57 -05:00
Valerio Setti
95aaa97dc3 mbedtls: add Kconfig to select the number of key slot in PSA Crypto core
Adding new CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT to select the number
of key slots in PSA Crypto core. The default value is 16. Be aware
that key slots consume RAM memory even if unused, so the proper value
should be a compromise between the number of slots required by
the application and the available RAM in the system.

This commit also:
- updates tests/crypto/secp256r1/mbedtls.conf to showcase how to
  use this new symbol to reduce RAM footprint.
- tests/bsim/bluetooth/mesh/overlay_psa.conf to support all the
  keys used in the test.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-26 00:12:56 +01:00
Valerio Setti
2f6ea8ed77 mbedtls: add Kconfig symbol CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS
Adding the Kconfig symbol CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS
to allow Mbed TLS's PSA Crypto core to use static key buffers
to store key's material. This helps reducing heap memory
usage and, potentially, it also discard code implementing
heap memory management if there's no other module in the build
that makes use of it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-26 00:12:56 +01:00
Valerio Setti
f0944a2b4d manifest: mbedtls: include patch for static key slots
Update the Mbed TLS revision so as to take in a patch which
allows to use static key slot buffers for the PSA Crypto core
instead of dynamic (i.e. heap based) ones.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-26 00:12:56 +01:00
Lucas Tamborrino
cdbd2b5558 soc: espressif: Add hardware initialization
Bring hardware initialization to zephyr code base.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-11-26 00:12:45 +01:00
Emil Dahl Juhl
2df905dc2c samples: led: lp5569: demo write_channels
Add a simple demonstration of the led_write_channels api on the lp5569
driver sample.
The demonstration simply turns on all of the channels with a single call to
led_write_channels. Then the same is done for turning off the channels.
Thus, it doesn't add much visually, but it shows the usage of the api.

Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
2024-11-26 00:12:37 +01:00
Emil Dahl Juhl
d6ac9e8424 drivers: led: lp5569: implement write_channels api
The lp5569 has multiple pwm outputs, and thus implementing the
write_channels api to set multiple values in a single call makes sense.

Implement the write_channels function with a basic range check on the
channel range.
Since the lp5569 supports auto-increment, all of the channels can be
written in one i2c transfer, starting from the pwm register of the
start_channel.

Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
2024-11-26 00:12:37 +01:00
Emil Dahl Juhl
45744b436f drivers: led: lp5569: enable auto-increment
The lp5569 controller supports auto-increment for its registers. This is by
default enabled in the chip, but the driver actively disabled it.

Since auto-increment is useful for writing multiple consecutive registers,
enable the feature. The driver, however, doesn't perform such consecutive
writes and thus the existing behavior is not altered.

Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
2024-11-26 00:12:37 +01:00
Andy Ross
b3ff9ae82b kernel/sched: Optimize handling for suspend(_current)
k_thread_suspend() is an async API intended to stop any thread in any
state from any context.  Some apps just want to use it to "suspend
myself", which is a much (!) simpler operation.  Detect that specific
usage as a performance case.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-26 00:12:28 +01:00
Daniel Leung
22de29e768 soc: intel_adsp/ace: put syscall helpers in vector code section
This puts the syscall helpers into the vector code section, and
is a tiny TLB optimization. Before this, worst case scenario is
that there would 2 instruction TLB misses when both the syscall
helpers and the vector code pages are not in TLB cache. With
this change, there would be at most 1 instruction TLB miss as
now the syscall helper and the vector code (which includes
exception handling code and xtensa_do_syscall()) are now in
the same page, and the same TLB entry.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-26 00:12:18 +01:00
Anas Nashif
b207035851 tests: add integration_platforms and misc optimizations
Add integration_platforms to many tests that use platform_allow to
manage scope of pull_request CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-26 00:12:07 +01:00
Winston Arrocena
51708a760f boards: st: dts: fix slot0_partition address error
The B_L4S5I_IOT01A Discovery kit does not boot up when using --sysbuild.
The error is caused by slot0_partition which is assigned an address of
0x1000 which overlaps with the boot_partition. Setting the address to
0x10000 fixed it.

Signed-off-by: Winston Arrocena <we.arrocena@gmail.com>
2024-11-26 00:11:54 +01:00
Fin Maaß
1e3b106435 drivers: ethernet: phy_mii rename functions
rename internal reg_* functions.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-26 00:11:43 +01:00
Martin Åberg
b88d0bf8c7 soc: Enable SVT on GR716A by default
GR716A has limited instruction memory capacity. Enabling SVT
saves 3.5 KiB.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2024-11-25 21:53:55 +01:00
Martin Åberg
fbd9dd4526 SPARC: Add support for single-vector trapping (SVT)
This adds support for the single-vector trapping (SVT) model, defined by
SPARC-V8 Embedded (V8E) Architecture Specification. SVT is available in
most LEON processors.

With single-vector trapping enabled, all traps are vectored through a
single trap vector (TBR.A) rather than one 16-byte entry for each trap
type. This improves memory utilization because the full 4 KiB trap table
is not needed.

This implementation uses a two-level of lookup table to find the handler
for the trap type (0..255).
- Execution time is constant.
- Condition flags are preserved.
- The implementation footprint is 60 bytes .text and 284 bytes .rodata.
  For comparison, a non-SVT table is always 4096 .text.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2024-11-25 21:53:55 +01:00
Jean-Christophe Pince
dd5874b924 jlink: custom flashing support
Allows to use a custom flashing script with jlink runners.

Signed-off-by: Jean-Christophe Pince <jean.christophe.pince@qorvo.com>
2024-11-25 21:53:43 +01:00
Andries Kruithof
bb3bab7a34 Bluetooth: Audio: implement the distribute broadcast code procedure
Implemenation of the distribute broadcast code CAP procedure, as well
as unittesting

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-11-25 21:52:53 +01:00
Ian Morris
37fcadc6b3 boards: renesas: da14695_dk_usb: added mikrobus node labels
Added mikrobus_header, mikrobus_i2c, mikrobus_spi and mikrobus_serial
node labels to da14695_dk_usb device tree board definition, allowing
compatible shield boards to be used. Also fixed minor issues with
pin assignment and header labelling.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-11-25 21:52:34 +01:00
Emil Gydesen
322b177549 samples: Bluetooth: Reduce heap for hci_ipc
Reducing the heap requirement for the hci_ipc sample from
8KiB to 4KiB. It has been tested in various configurations to
work with 2300, but 4KiB was used to provide some leeway for
future updates.

The heap requirement is not documented, and it is unclear why
values lower than 2300 (not exact number) won't boot, and should
be investigated further.

Memory has become a very scarce resource for especially the ISO
builds for the nRF5340, which is why this is getting reduced.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 21:52:15 +01:00
Kai Vehmanen
a14ae39e74 driver: ssp: remove use of out-of-tree CONFIG_INTEL_MN
The SSP driver has odd dependency to outside definition of
CONFIG_INTEL_NM. This is in practise tied to SSP hardware
version and always enabled for SSP block version 1.0.

Use the new SSP_IP_VER define to replace the CONFIG_INTEL_MN
preprocssor checks. Also modify the board test case to
remove the obsolete config setting.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-11-25 21:51:56 +01:00
Anas Nashif
5b29fff725 tests: workqueue: avoid filters
Use Kconfig to configure watchdog instead of using expensive filters.

Also disable CONFIG_TEST_HW_STACK_PROTECTION for this test so we do not
have to create special cases.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-25 21:51:36 +01:00
Anas Nashif
a8b788d344 tests: mem_map: reduce runtime filters
Improve CI performance improving filtering and coverage selection.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-25 21:51:36 +01:00
Matthias Alleman
e7c353bf14 posix: fpu: Fix compiler error when enabling fpu on posix boards
Enabling CONFIG_FPU and CONFIG_FPU_SHARING requires the
definition of `arch_float_disable` and `arch_float_enable`.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2024-11-25 21:50:58 +01:00
Ahmed Zamouche
305ceba920 drivers: eth: enc28j60: Misc fixes
- Bank select mask should be 0x03:

| b7    | b6    | b5    | b4     | b3    | b2   | b1     | b0     |
|------:|------:|------:|-------:|------:|-----:|-------:|-------:|
| TXRST | RXRST | DMAST | CSUMEN | TXRTS | RXEN | BSEL1  | BSEL0  |

See  **REGISTER 3-1: ECON1: ETHERNET CONTROL REGISTER 1**

- ENC28J60_BIT_PHCON2_HDLDIS should be 0x0100

|b15| b14   |b13   |b12|b11|b10    |b9|b8     |b7|b6|b5|b4|b3|b2|b1|b0|
|--:|------:|-----:|--:|--:|------:|-:|------:|-:|-:|-:|-:|-:|-:|-:|-:|
| - |FRCLNK |TXDIS |r  |r  |JABBER |r |HDLDIS |r |r |r |r |r |r |r |r |

see **REGISTER 6-5: PHCON2: PHY CONTROL REGISTER 2**

- remove duplicate definitions

ENC28J60Data Sheet:
https://ww1.microchip.com/downloads/en/DeviceDoc/39662c.pdf

Signed-off-by: Ahmed Zamouche <ahmed.zamouche1@assaabloy.com>
2024-11-25 17:43:57 +01:00
Jerzy Kasenberg
1d4b1ade43 tests: drivers: spi: Fix nrf52840 overlay
spi-max-frequency was missing in overlay

Now it's set to 8 MHz as per datasheet

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-11-25 17:43:48 +01:00
Jerzy Kasenberg
75d3f45d5a tests: drivers: spi: spi_slave: Fix memory corruption
This fixes memory corruption of delayable work when
tests executes unsupported function.

When test (e.g. only_rx_in_chunks) is executed it starts
delayed work for master functionality (with 10 ms delay).
Later when slave function is tried and reports that
function is unsupported, test is terminated (task ends)
but work is still scheduled.

When next test starts it clears work that is already
scheduled:

static void before(void *not_used)
{
	ARG_UNUSED(not_used);

	memset(&tdata, 0, sizeof(tdata));

this leads to memory corruption and system work queue
tries to remove work but it never does since head/next
pointers are zeroed at that time.

This just adds after function that cancels work
regardless if it was scheduled or not.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-11-25 17:43:48 +01:00
Alvis Sun
c9a95ddbdd drivers: i3c: npcx: add npcx i3c target driver
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-11-25 17:43:41 +01:00
Alvis Sun
9976f8a8a9 dts: i3c: npcx: add target mode property and port configuration
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-11-25 17:43:41 +01:00
Alvis Sun
f517929a11 include: i3c: npcx: remove unnecessary soc functions.
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-11-25 17:43:41 +01:00
Alvis Sun
bb03d1a472 include: i3c: target_device: add target driver buffer mode
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-11-25 17:43:41 +01:00
Chaitanya Tata
e512151474 manifest: hal_nordic: Pull nRF Wi-Fi removal
Pulls PR that removed nRF Wi-Fi.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Chaitanya Tata
b8cab9e144 drivers: wifi: Fix blobs handling
The blobs are now part of nrf_wifi module, and remove the manual check
and add verifying the blobs and their integrity using helper function.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Chaitanya Tata
da26d02d63 nrf_wifi: Move shim files from driver to module
The shim files should be part of the Zephyr module directory within
Zephyr, as they are coupled with the module implementation which os OS
agnostic.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Chaitanya Tata
459f972785 drivers: nrf_wifi: Remove OSAL code handling
This is now taken care by the Zephyr module shim.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Chaitanya Tata
180df6675e modules: nrf_wifi: Add a new module for nRF70 Wi-Fi
This is a Zephyr shim for the nrf-wifi module.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Chaitanya Tata
f7dc9f82d2 drivers: nrf_wifi: Fix the path to OSAL code
The OSAL code now lives in it's own repo nrf_wifi.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Chaitanya Tata
139ce48c8b nrf_wifi: Fix the directory name
Following the naming convention add an underscore and update path in the
maintainers file too.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Sean Nyekjaer
0950aa47b1 boards: others: add candleLightFD USB to CAN FD adapter board
Add support for the open-hardware candleLight FD USB to CAN FD board.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
2024-11-25 17:43:27 +01:00
Jamie McCrae
7857599bf8 tests: mgmt: mcumgr: os_mgmt_info: Fix return type
Fixes returning a define from a different enum which throws an
error with clang

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-25 17:43:17 +01:00
Marek Matej
410e929459 boards: Remove defconfig value
Remove ENTROPY_GENERATOR defconfig as it is pulled in automatically when
needed.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-25 17:43:10 +01:00
Emil Gydesen
96b487186f Bluetooth: ISO: Removed unused pool and funcs/macros
The iso_tx_pool was unused because all the functions
and macros that used it were unused.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 17:42:59 +01:00
Trung Hieu Le
2ff984a888 drivers: video: sw_generator: Disable the driver if a real camera presents
Do not enable the video sw generator if a real camera is present. This
helps to save some spaces and to avoid unrelated code going
into the built image.

Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-11-25 17:42:49 +01:00
Krzysztof Chruściński
114d9b34e2 soc: nordic: nrf53: Update default value of NRF53_SYNC_RTC
Most likely there is no point of synchronizing RTC if net core is
not enabled. Same for the bootloader.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-25 17:42:39 +01:00
Mahesh Mahadevan
bda04093fb boards: frdm_mcxn947: Delete enable of GPIO5 clock
There is no bit to enable GPIO5 clock in the clock control
register.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-25 17:42:25 +01:00
Adam Wojasinski
c36b3c0296 MAINTAINERS: fix area Networking issue assignment
Replacing "area: Networking" with "area: PTP" to prevent from
including myself in issues and PRs that are related to every
piece of Networking code. Insted I'll be included only in PTP
related issued/PRs.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-11-25 14:46:23 +01:00
Lothar Felten
f982d180ad boards: lilygo: ttgo_t8s3: initial support
adds initial support for Lilygo TTGO T8-S3 board

Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
2024-11-25 14:43:01 +01:00
Ali Hozhabri
4875f29b65 west.yml: Update hal_stm32
Modify west.yaml to update hal_stm32.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
bdef48fde2 boards: st: Enable BLE for nucleo_wb09ke & nucleo_wb05kz
Enable BLE feature for Nucleo-WB09KE and Nucleo-WB05KZ.

Dedicate 32KB and 8KB at the end of flash memory to storage partition on
Nucleo-WB09KE and Nucleo-WB05KZ respectively.

Add ble tag to the both devices yaml file.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
b2d4c2e2b1 soc: stm32: stm32wb0x: Disable BT_AUTO_PHY_UPDATE & BT_AUTO_DATA_LEN_UPDATE
Put the default value for BT_AUTO_PHY_UPDATE and BT_AUTO_DATA_LEN_UPDATE
to "n" at SOC level since they cause "controller busy" due to starting
several parallel BLE procedures during connection by
"perform_auto_initiated_procedures" function. At the moment, ST controller
does not support parallelism, i.e. host should not initiate a new procedure
before previous one is completed.

Disable CONFIG_BT_HCI_ACL_FLOW_CONTROL at SOC level.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
c8d034cf0b soc: stm32: stm32wb0x: Dedicate RAM section for BLE part
Dedicate RAM section on STM32WB0x for BLE part based on the number
of radio tasks and device type.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
9e26341a61 dts: arm: st: wb0: Add BLE feature to STM32WB0x at SOC level
Add BLE feature to STM32WB0x series at SOC level.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
d42fc7ae21 drivers: bluetooth: hci: Add Bluetooth HCI driver for STM32WB0x
Add Bluetooth HCI driver for STM32WB0x series.

Modify CMakeLists.txt to compile the driver based on its kconfig parameter.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
5c753c0fbf dts: bindings: bluetooth: Add yaml file required by STM32WB0x HCI driver
Add a yaml file required by STM32WB0x bluetooth HCI driver.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
944963933a bluetooth: Kconfig: Introduce Kconfig parameter for STM32WB0x series
Introduce Kconfig parameter for STM32WB0x HCI Bluetooth driver.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Mario Paja
73bd431293 samples: dac: add arduino_giga_r1 overlay
This PR adds arduino giga r1 overlay in the dac sample.
Arduino Giga R1 has a 3.5mm audio jack connected to the
dac.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2024-11-25 14:42:39 +01:00
Marcio Ribeiro
65547044e6 drivers: touch/rtc/wdt: esp32: fix conflict among device drivers
allows use of touch_sensor, rtc_counter, and wdt simultaneously by enabling
ESP_INTR_FLAG_SHARED when calling esp_intr_alloc()

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-11-25 14:42:32 +01:00
Ryan McClelland
f5946a546d manifest: update cmsis-dsp to v1.16.2
Update cmsis-dsp module to v1.16.2

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-25 14:42:07 +01:00
TOKITA Hiroshi
88149afff7 soc: raspberrypi: Drop PINCTRL from Kconfig.defconfig
The `Kconfig.defconfig` is not good place for put `select PINCTRL`.
Drop `select PINCTL` from `Kconfig.defconfig` and add it at each
driver's Kconfig.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-25 14:42:01 +01:00
Ryan McClelland
1e47b6a2b9 kernel: fix K_SEM_DEFINE type-limits warning
A warning could be generated when compiling with -Wtype-limits. This
works around the warning which could happen if initial_count is 0 and
count_limit is K_SEM_MAX_LIMIT.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-25 14:41:51 +01:00
Jordan Yates
4e7feddd87 tests: bsim: support snippets
Support specifying a snippet when compiling bsim applications.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-25 14:41:43 +01:00
Jordan Yates
b13985d806 boards: nrf_bsim: add default soc_secure_mem_read
Add the default implementation of `soc_secure_mem_read` from
`nordic/common/soc_secure.h`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-25 14:41:43 +01:00
Marek Matej
2dc2cdea75 dts: espressif: Add flash size options to partition tables
Update the partition table list with 16MB and 32MB options.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-25 14:41:33 +01:00
Emil Gydesen
b535f18240 Bluetooth: Audio: Fix incorrect ret doc for cfg_meta_get_lang
The function does not return the language, but rather stores
the lang in the provided lang param.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 14:41:21 +01:00
Emil Gydesen
83677f551f Bluetooth: Shell: Set conn to NULL before bt_conn_le_create
bt_conn_le_create logs a warning if the provided conn is
non-NULL which was the case here. Simply set it to
NULL as it is a local variable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 14:41:14 +01:00
Jeppe Odgaard
c9dc58178a drivers: adc: adc_ad559x: implement double range option
Optionally write to ad559x register bit which increases ADC input range
from 0V to 2 x Vref.

Create an ADC API per instance since the double range option and thus
`ref_internal` is instance specific.

The functionality has been tested via double range DAC and wiring IO1 and
IO3:
```
$ dac setup ad5593dac 1 12
$ adc ad5593adc resolution 12
$ adc ad5593adc channel id 3
$ dac write_value ad5593dac 1 0
$ adc ad5593adc read 3
read: 1
$ dac write_value ad5593dac 1 1024
$ adc ad5593adc read 3
read: 1021
$ dac write_value ad5593dac 1 2048
$ adc ad5593adc read 3
read: 2044
$ dac write_value ad5593dac 1 3072
$ adc ad5593adc read 3
read: 3069
$ dac write_value ad5593dac 1 4095
$ adc ad5593adc read 3
read: 4091
```

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Jeppe Odgaard
57626655df dts: bindings: adc: ad559x: add double range option
Add boolean option to use 2 x voltage reference as upper ADC input range.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Jeppe Odgaard
c6aafd7eb5 drivers: dac: ad559x: implement double range option
Optionally write to ad559x register bit which increases DAC output range
from 0V to 2 x Vref.

The functionality has been tested on AD5593r.
The voltage at 4095 has been measured to 5.01 volts.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Jeppe Odgaard
d34f56c175 dts: bindings: dac: ad559x: add double range option
Add boolean option to use 2 x voltage reference as upper DAC output range.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Jeppe Odgaard
8933e6cefa drivers: ad559x: fix mfd_ad559x_i2c_read_reg
Reading a register requires 0x70 to be ORed with the register address.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
TOKITA Hiroshi
b7badee6aa tests: drivers: build_all: audio: Add config for st,mpxxdtyy
Add configuration to add `st,mpxxdtyy` to build test.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-25 12:16:53 +01:00
TOKITA Hiroshi
0bc0dd7767 tests: drivers: build_all: audio: Add i2c-devices to build test
Add build tests for the following devices.

- ti,tas6422dac
- ti,tlv320dac

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-25 12:16:53 +01:00
TOKITA Hiroshi
0cbfd2a75e drivers: i2s: Add dummy driver for vnd,i2s
Add dummy driver for "vnd,i2s" to use in build_all tests.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-25 12:16:53 +01:00
TOKITA Hiroshi
6394b261ec drivers: audio: wm8904: Fix missing default y in AUDIO_CODEC_WM8904
The `default y`, which is coupled with
`depends on DT_HAS_WOLFSON_WM8904_ENABLED` to link the settings with
DeviceTree, which was missing, so I added it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-25 12:16:53 +01:00
Pieter De Gendt
32c59004bf doc: develop: modules: Add a section about package managers
Add a description and example on how modules can describe pip
dependencies.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 12:16:43 +01:00
Pieter De Gendt
6d103d73a4 doc: gsg: Update with west packages command for pip
Update the entry where Python dependencies are installed, use
west packages.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 12:16:43 +01:00
Pieter De Gendt
2ad915284b scripts: west_commands: Add packages command
Add a new west command as helper for package management of Zephyr
and modules.

The first package manager to get supported is pip, where west projects
can list individual packages or requirements files in their module file.

A convenience --install argument is added to install the packages instead.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 12:16:43 +01:00
Hou Zhiqiang
91593fc899 soc: nxp: imx95: A55: enable SDK cache driver
Enable the SDK cache driver for A core.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-11-25 12:16:33 +01:00
Yangbo Lu
962b0bcac4 drivers: ethernet: phy_mii: add link down log
It's expected there is log info for both link up and link down.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-11-25 12:16:28 +01:00
Gerard Marull-Paretas
e6b24df0af soc: nordic: nrf54h: gpd: use nrf_gpio_pin_retain_enable|disable
Instead of raw register access.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-11-25 12:16:17 +01:00
Gerard Marull-Paretas
fa46eec157 drivers: gpio: nrf: use nrf_gpio_pin_retain_enable|disable
Instead of raw register access.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-11-25 12:16:17 +01:00
Gerard Marull-Paretas
4036d6edb3 drivers: pinctrl: nrf: use nrf_gpio_pin_retain_enable|disable
Instead of raw register access.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-11-25 12:16:17 +01:00
Carles Cufi
b06bf51459 boards: nrf54l15dk: Enable tests and samples for the L05 and L10
This is a follow-up to 21475774fc,
extending the number of tests and samples that use the new L05 and L10.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-25 10:08:07 +01:00
Khoa Nguyen
992db7d1e8 samples: drivers: counter: Support test alarm for RA6, RA4, RA2
Add overlay to support test alarm for:
ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4, ek_ra6m5, fpb_ra6e1,
ek_ra4w1, ek_ra4m2, ek_ra4m3, ek_ra2a1.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 10:07:37 +01:00
Khoa Nguyen
109c00ee6d boards: renesas: Add counter doc for RA6, RA4, RA2
Add doc for AGT counter for:
ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4, ek_ra6m5, fpb_ra6e1,
ek_ra4w1, ek_ra4m2, ek_ra4m3, ek_ra2a1.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 10:07:37 +01:00
Khoa Nguyen
b1daa13109 dts: arm: renesas: Add AGT counter support for RA6, RA4, RA2
- Add dts node to support AGT counter for:
ra6-cm4, ra6-cm33 (eccept r7fa6e2bx),
ra4-cm4, ra4-cm33 (eccept r7fa4e2b93cfm),
ra2xx.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 10:07:37 +01:00
Emil Gydesen
420cafc1f5 samples: Bluetooth: ISO: Update conn and adv intervals
Update the connection and advertising intervals of the
broadcast and connected ISO samples (including benchmark
samples) to work better with the selected SDU intervals
and the resulting ISO intervals.

For the ISO connected benchmark the order of CIG and ACl
has changed, so that we create the CIG before connecting
the ACL for the purpose of providing as much information
as possible to the controller.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 10:07:30 +01:00
Dino Li
40c95e34b8 it8xxx2/shi: wrap pm policy state get/put
When CONFIG_ASSERT is enabled, assertion for unbalanced state lock
get/put is triggered. This commit leverages shi drivers from other
SoCs to resolve the assertion.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-11-25 10:07:20 +01:00
Pieter De Gendt
bf2db7afc0 python: Format and sort imports
ruff check --select I001 --fix applied to all python files that had
this as only issue.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 10:07:13 +01:00
Wilfried Chauveau
85f36aae51 boards: twister: update boards' twister metadata files
Following the update of the schema, this updates all boards with the new
structure.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-11-25 08:31:28 +01:00
Wilfried Chauveau
7cc70f01f1 scripts: twisterlib: Enable multiple simulator support in twister
This change introduces the ability in twister to select which
emulation/simulation tool to use on the command line.

If none is specified, it will select the first in the list.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-11-25 08:31:28 +01:00
Grzegorz Swiderski
f0646d3da4 edtlib: Express Node.matching_compat and Node.binding_path as @property
This simplifies the code and makes it clearer that both properties are
defined in terms of the Binding object matched to a given DT node.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-11-25 08:31:18 +01:00
Jakub Michalski
43f917111b posix: add pthread specific data deallocation test
This commit adds test to assert that thread specific data is deallocated
on thread termination.

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2024-11-25 08:31:08 +01:00
Jakub Michalski
044b702b90 posix: fix pthread thread specific data cleanup
It was never deallocationg pthread_key_data nor it was removing the node
with it from list

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2024-11-25 08:31:08 +01:00
Daniel Leung
3d3ffa2c05 soc: intel_adsp/ace30: do not map 0x0
The MMU mapping in SoC covers 0x0 which prevents catching NULL
pointer accesses. Since there are no hardware registers at
the very first page of memory, we move the starting point one
page later.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-25 08:30:57 +01:00
Dino Li
e59289d899 soc/it8xxx2: disable USB debug path at default
This change disables USB debug path at default, in order to prevent SoC
from entering debug mode when there is signal toggling on GPH5/GPH6.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-11-25 08:30:48 +01:00
Maochen Wang
9f72e651b5 hostap: fix Matter over Wi-Fi build warning
Fix the build warning that 'method may be used uninitialized' when
build Matter over Wi-Fi.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-25 08:30:43 +01:00
Maochen Wang
30763cfc4a drivers: wifi: nxp: default use hostapd AP
For NXP Wi-Fi, default use hostapd based AP.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-25 08:30:38 +01:00
Maochen Wang
b18541768b hostap: distinguish suppliant AP and hostapd AP
To make AP related code/config more clear and clean, use
CONFIG_WIFI_NM_WPA_SUPPLICANT_AP for supplicant based AP case,
and use CONFIG_WIFI_NM_HOSTAPD_AP for hostapd based AP case.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-25 08:30:38 +01:00
Chris Friedt
2a1fa8e4c7 tests: posix: getopt: move filter to testcase.yml common area
Similar to #81766, move the filter to the common area.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-25 01:02:50 +01:00
Chris Friedt
b0352db95c tests: posix: rwlocks: move filter to testcase.yml common area
Similar to #81766, move the filter to the common area.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-25 01:02:50 +01:00
Khoa Nguyen
8d7ae89c23 tests: drivers: spi: Support test spi_loopback for RA6, RA4, RA2
Add overlay and add config to support test spi_loopback for:
ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4, ek_ra6m5, ek_ra6e2,
fpb_ra6e1, fpb_ra6e2, ek_ra4w1, ek_ra4m2, ek_ra4m3, ek_ra4e2,
ek_ra2a1.

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 01:02:35 +01:00
Khoa Nguyen
c8077e3552 boards: renesas: Add SPI support for Renesas RA6, RA4, RA2
- Add SPI support for ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4,
ek_ra6m5, ek_ra6e2, fpb_ra6e1, fpb_ra6e2, ek_ra4e2, ek_ra4m2,
ek_ra4m3, ek_ra4w1, ek_ra2a1

- Add SPI support doc for these board

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 01:02:35 +01:00
Tri Nguyen
2e2cf835ed dts: arm: renesas: Add SPI support for RA6, RA4, RA2
Add device node support SPI driver for ra6-cm4, ra6-cm33,
ra4-cm4, ra4-cm33, ra2xx MCU

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 01:02:35 +01:00
Khoa Nguyen
c312b322ad drivers: spi: Add support SPI driver for Renesas RA6, RA4, RA2
- Add SPI driver support for RA
- RA2A1 not support slave select keeping level so disable it
in Kconfig

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-25 01:02:35 +01:00
Brandon Allen
4f46b38843 docs: kernel: iterable_section: add #include to linker example
if you do not include #include <zephyr/linker/iterable_sections.h>
you will get a build error

Signed-off-by: Brandon Allen <bwallen1997@outlook.com>
2024-11-25 01:02:03 +01:00
Yong Cong Sin
b1def7145f arch: deprecate _current
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Yong Cong Sin
1a752e8a35 arch: riscv: implement ARCH_HAS_CUSTOM_CURRENT_IMPL with GP
Implement `arch_curr_thread()` & `arch_set_curr_thread()`
with the global pointer (GP) register.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Yong Cong Sin
d26c712258 arch: add new interfaces to set/get the current thread of current CPU
Add the following arch-specific APIs:
- arch_curr_thread()
- arch_set_curr_thread()

which allow SMP architectures to implement a faster "get current
thread pointer" than the default provided by the kernel. The 'set'
function is required for the 'get' to work, more on that later.

When `CONFIG_ARCH_HAS_CUSTOM_CURRENT_IMPL` is selected, calls to
`_current` & `k_sched_current_thread_query()` will be redirected to
`arch_curr_thread()`, which ideally should translate into a single
instruction read, avoiding the current
"lock > read CPU > read current thread > unlock" path in SMP
architectures and thus greatly improves the read performance.

However, since the kernel relies on a copy of the "current thread"s on
every CPU for certain operations (i.e. to compare the priority of the
currently scheduled thread on another CPU to determine if IPI should be
sent), we can't eliminate the copy of "current thread" (`current`) from
the `struct _cpu` and therefore the kernel now has to invoke
`arch_set_curr_thread()` in addition to what it has been doing. This
means that it will take slightly longer (most likely one instruction
write) to change the current thread pointer on the current
CPU.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Ilya Tagunov
9f2a7a7ca2 lib: libc: arcmwdt: avoid double definition of clock_t and clockid_t
The clock_t and clockid_t types are already defined in ARC MWDT headers,
so they should not be defined again in Zephyr headers.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
80a9b12a50 include: posix: remove an unreachable clockid_t definition
The clockid_t definition in question is not reachable anymore
because at least one of _CLOCKID_T_DECLARED and __clockid_t_defined
macros is already defined by that point, always making the check fail.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
390a7f8950 lib: libc: arcmwdt: move ssize_t definition from the toolchain header
Until POSIX layer decoupling is done, we still need the size_t type
definition across the codebase, but it should come through sys/types.h
and not through toolchain-specific headers.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
9d229e5c18 tests: lib: c_lib: add the proper dependency for asctime_r and ctime_r
As the test uses reentrant time functions like asctime_r or ctime_r,
it should select POSIX_C_LANG_SUPPORT_R. Otherwise there are build
failures observed with the default test configuration if these
functions are not provided by the toolchain.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
1f5fbe231a kconfig: assume the host libc provides POSIX reentrant functions
This change is needed to avoid including Zephyr-specific implementations
of POSIX reentrant functions while building natively. One can safely
assume that the host libc indeed provides its own implementations of
the said functions.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
c8511c1ea0 lib: libc: arcmwdt: add declarations for reentrant time functions
ARC MWDT library does not contain implementations for the reentrant
POSIX time functions, so common Zephyr implementations end up being
used instead. However, there are no declarations, so we just add them
here, unguarded, until a better place is found.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
de18565e2a lib: libc: arcmwdt: replace the fileno macro
The fileno macro defined in ARC MWDT headers conflicts with the fileno()
function defined in lib/posix/options/device_io.c. We should undefine it
and replace with a POSIX-compliant declaration and a weak definition.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Dominik Ermel
eb4f2fb44a drivers/flash/nrf_rram: Add get_size implementation.
Commit adds flash_get_size callback to the driver.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
383bcc790c drivers/flash/soc_flash_nrf_mram: Add get_size implementation
Commit adds flash_get_size callback to the driver.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
021ef9e5c3 tests/flash/common: Set test device size for NRF platforms
Set expected size for nrf platforms.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
a6ef37ca8e drivers/flash/spi_nor: Add flash_get_size API call
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
b4a9f1d67a drivers/flash/flash_sam: Add flash_get_size API call
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
6efba38e97 drivers/flash/flexspi_x25um51345g: Add flash_get_size API call
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
9a162e0b79 drivers/flash/flexspi_nor: Add flash_get_size API call
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
6a06c10f3f drivers/flash/gecko: Add flash_get_size API call
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
31dcaa2611 drivers/flash/stm32_qspi: Add flash_get_size
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
f39940b86c drivers/flash/at45: Add flash_get_size API call
The commit adds implementation of flash_get_size to the flash driver.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
8acf0a1ecf drivers/flash/nrf_qspi_nor: Add flash_get_size API call
The commit adds implementation of get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
b0584b7d08 drivers/flash/nrf: Add flash_get_size API call
The commit adds implementation of flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
6298fed7d4 drivers/flash/flash_simulator: Add flash get_page_size API call
The commit adds implementation of flash_get_size,

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
c03f256fba tests/drivers/flash: Add test case for flash_get_size
Add flash_get_size commit and Kconfig option for test to set the
expected size of device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
852c992da5 tests/drivers/flash_api: Flash API tests
The commit adds test for flash_get_size.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Dominik Ermel
13fa2331da drivers/flash: Flash API: device size getter
The commit adds flash_get_size  API functions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Manuel Martin
93541e21a4 drivers: display: gc9x01x: fix correct mipi buffer size
mipi api allows only buffers where pitch is equal to width.
buffers with smaller width get split into multiple transmissions
but mipi buffer size was set incorrectly.

Signed-off-by: Manuel Martin <martiman89+github@gmail.com>
2024-11-23 15:29:15 +01:00
James Roy
72d34496dc subsystem: bluetooth: Fix uninitialized variable
Fix uninitialized sec_idx variables scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-23 15:29:03 +01:00
Pieter De Gendt
86a8dacaa1 scripts: west_commands: Fix MissingProgram import
MissingProgram should be exported in __all__.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-23 15:28:33 +01:00
Daniel DeGrasse
3d6dde4832 doc: releases: migration-guide-4.1: document change to mipi-dbi binding
Document change to mipi-dbi device binding, and provide users with
example of how to transition to the new mipi-mode property.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-23 02:01:47 +01:00
Daniel DeGrasse
c565c2c6f6 drivers: mipi-dbi: use string for mipi-mode property
Use a string for the mipi-mode property over an integer value, as this
significantly improves the readability of the MIPI DBI device binding.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-23 02:01:47 +01:00
Josuah Demangeon
d6b8912ad9 scripts: ci: check_compliance: ruff: avoid mixing stdout and stderr
The python subprocess call had a stdout=subprocess.PIPE parameter that
redirects standard output to a pipe, and a stderr=subprocess.STDOUT
parameter that redirected stderr to the pipe. This mixed JSON and
non-JSON output together, and issued an exception. Fixing with
stderr=subprocess.DEVNULL to ignore standard error and only keep the
JSON output.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-11-23 02:01:28 +01:00
Daniel DeGrasse
c6cf9b9e8b drivers: mipi_dbi: mipi_dbi_nxp_lcdic: fix reset pulse calculation
Reset pulse count can be up to 512 before we would be unable to support
it using the peripheral. Use a uint32_t for the count, so that even long
reset pulses will still be calculated correctly. Add code to warn about
reset pulse requests that are too long.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-22 22:47:36 +00:00
Daniel DeGrasse
c0e5769a52 drivers: mipi_dbi: mipi_dbi_nxp_lcdic: allow config of timer bases
The NXP LCDIC peripheral contains two internal timers, with configurable
periods. These times are used to determine delays within the peripheral,
such as the reset and tearing enable signal delays. Allow these periods
to be set within the devicetree for the peripheral.

Raise the period where required for display drivers that need a value
other than the reset setting

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-22 22:47:36 +00:00
TOKITA Hiroshi
2e66ce193c include: dt-bindings: misc: nordic: Fix include-guard
The implementation of include-guard is incomplete, so I fixed it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-22 22:47:30 +00:00
Benjamin Cabé
f24cb62579 usbc: fix typo in shell usage string
statuc->status

Authored-By: Markus Becker <Markus.Becker@tridonic.com>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-22 22:47:23 +00:00
Florian Weber
7adeac1b12 drivers: i2c: tca9544a
Extend tca954x (tca9546a, tca9548a) driver to support tca9544a i2c MUX.
(different bitmask and flag for enable bit in register)

Signed-off-by: Florian Weber <Florian.Weber@live.de>
2024-11-22 22:47:17 +00:00
Joakim Andersson
2fe54b4476 include: gpio: Add isr_ok to interrupt configure API
Add isr_ok property to the interrupt configure API.
For level-triggered interrupt the interrupt may have to be disabled
until a thread context can process it and clear the interrupt trigger.

The function is documented as returning an error if it would block.
Drivers in zephyr already do this, so if this is not ISR safe function
then they need to be fixed.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-11-22 22:47:07 +00:00
Miika Karanki
d851bb9e86 modules: lz4: add configurability
- Add possibility to disable functions that use heap. This is to
  reduce code size and prevent accidental use of heap.

- Add possibility to compile xxhash library, "Extremely Fast Hash
  algorithm" in. It might be sometimes needed as a standalone,
  but especially lz4frame requires it.

- Add possibility to compile also hc and lz4frame modules. The
  config options include possibility to configure will heap or
  stack be used. Defaults are set according to lz4's current
  defaults.

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2024-11-22 22:46:59 +00:00
Martino Facchin
054d60fb1c video: gc2145: fix set_fmt()
Trivial fix for bound check

Signed-off-by: Martino Facchin <m.facchin@arduino.cc>
2024-11-22 13:04:22 -06:00
Rex Chen
b4035e83d4 net: wifi: shell: add enterprise support for sap
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb
support for sap.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-11-22 13:03:53 -06:00
Fin Maaß
ef9cc18fcf mgmt: hawkbit: don't require HWINFO
don't require HWINFO, when HAWKBIT_CUSTOM_DEVICE_ID.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-22 13:02:29 -06:00
Anas Nashif
5fc66f67b9 ci: twister: capture branch when publishing results
This way we can filter by branches in the dashboard.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-22 13:01:24 -06:00
Anas Nashif
1c6066baea ci: twister: prep: add a more vebose name
Expand onn the workflow name

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-22 13:01:24 -06:00
Anas Nashif
aba2274fae ci: twister: publish only main branch jobs
This workflow is wrongly being triggered by pushed to branches.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-22 13:01:24 -06:00
Daniel DeGrasse
cc8ab68432 doc: migration-guide-4.1: add note about PORT pinctrl compatible change
Add note about compatible change for NXP PORT IP. Also, update
references to the DT compatible within board docs.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-22 13:01:02 -06:00
Daniel DeGrasse
42cc35f941 soc: nxp: consolidate nxp port pinctrl headers
NXP PORT IP instantiations often have different features absent, IE
input buffer, open drain, or slew rate support. Check if the relevant
PCR register bitmasks are defined in the common pin control file, and
define the bitmasks to 0x0 (no effect) if they are not. This allows us
to further consolidate the pinctrl_soc.h headers for SOCs using the PORT
IP.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-22 13:01:02 -06:00
Daniel DeGrasse
a36c7ddb36 drivers: pinctrl: rename nxp,kinetis-pinctrl to nxp,port-pinctrl
The NXP PORT pinmuxing peripheral is reused across the MCX, S32, and
Kinetis lines. Rename the compatible from the family-specific
nxp,kinetis-pinctrl to a more generic nxp,port-pinctrl to reflect the
actual name for the IP block used within reference manuals.

Update the NXP HAL revision to include a change to use the new Kconfig
name for the PORT pinctrl driver

Update the MAINTAINERS.yml path, as there are no longer any NXP drivers
matching the string "drivers/*/*kinetis*

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-22 13:01:02 -06:00
Marek Matej
78c1def4db boards: esp32xx: Use common partition tables
* Replace copies of fixed-partitions nodes in related boards by
referencing the apropriate partition table from the available list.
* For better reference the `partitions_*.dtsi` file has boot offset,
purpose and the flash size encoded in the file name. Default flash size
is considered to be 4MB.
* Added the flash size node for the boards which are not based on the
module.
* Removed flash size registry from the esp32.*common.dtsi

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-22 17:45:24 +01:00
Maochen Wang
407259462c hostap: use the correct config for EAP_SERVER
Should use EAP_SERVER and EAP_SERVER_IDENTITY as the correct config,
for the WPS case of AP.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-22 17:44:08 +01:00
Maochen Wang
13f473d7eb hostap: add WPS PBC and PIN for AP mode
add WPS PBC and PIN for AP mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-22 17:44:08 +01:00
Erwan Gouriou
358396e831 samples: subsys: nvs: stm32 overlays fixup
Don't try to delete partitions that doesn't exist anymore

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
555d97ea3d tests: drivers: flash: common: Remove stm32 specific test
It's same test as "default", but more restrictive target wise.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
201a0b6ba9 test: drivers: flash: common: Copied size can't exceed page.size
flash_copy() is performed on a page.size span but following flash_read()
verification step is performed on EXPECTED_SIZE length (512).

This doesn't work on devices where page.size is lower than EXPECTED_SIZE,
such as STM32L1 where page size is 256.

To fix this, perform verification on the smalest value between page.size
and EXPECTED_SIZE.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
3583492890 boards: st: nucleo_f429zi: Rework flash partition
STM32F4 series flash layout is as follows:
    	{.pages_count = 4, .pages_size = KB(16)},
    	{.pages_count = 1, .pages_size = KB(64)},
    	{.pages_count = 7, .pages_size = KB(128)}

Since NVS subsys requires 2 sectors of max 32K in total, provide a
flash partition which respects this constraint using 2 of the 16K sectors
in the beginning of the layout.

Provide a compatible flash partition usable with mcuboot, but keep the
storage partition commented as its usage is not compatible with use w/o
mcuboot enabled (in this case main image starts as offset 0 which conflicts
with storage partition).

Note that it isn't possible either to get main image starting directly
in the 128K sectors w/o bootloader as boot flash address can't be
configured.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
73126c1f48 tests: psa: its: Extend Timeout
These tests could be long on slow targets


Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
5d2547564a boards: st: nucleo_l152re: Rework storage partition
NVS susbsystem requires a slot covering 2 sectors of flash, which
should be at minimum 8K on L1 series which provides 4K sectors.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
6fa0bf47b6 boards: st: nucleo_g07xrb: Rework storage partition
NVS susbsystem requires a slot covering 2 sectors of flash, which
should be at minimum 4K on G0 series which provised 2K sectors.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
ffcaabe84a boards: st: disco_l475_iot1: Rework flash partition
Rework flash partition to provide a storage partition and 2 image slots.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
cc4b384ad2 boards: st: b_l4s5i_iot01a: Rework flash partition
Rework flash partition to make use of the whole 2M of flash.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Erwan Gouriou
8da1aa13fc boards: st: nucleo_f207zg: Rework flash partition
STM32F2 series flash layout is as follows:
	{.pages_count = 4, .pages_size = KB(16)},
	{.pages_count = 1, .pages_size = KB(64)},
	{.pages_count = 7, .pages_size = KB(128)}

Since NVS subsys requires 2 sectors of max 32K in total, provide a
flash partition which respects this constraint using 2 of the 16K sectors
in the beginning of the layout.

Provide a compatible flash partition usable with mcuboot, but keep the
storage partition commented as its usage is not compatible with use w/o
mcuboot enabled (in this case main image starts as offset 0 which conflicts
with storage partition).

Note that it isn't possible either to get main image starting directly
in the 128K sectors w/o bootloader as boot flash address can't be
configured.


Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-22 17:43:54 +01:00
Vladislav Pejic
aad4c69068 drivers: sensor: adxl367: Added RTIO stream
Updated ADXL367 driver with RTIO stream functionality.
RTIO stream is using both FIFO threshold and FIFO full triggers.
Together with RTIO stream, RTIO async read is also implemented.
Supported FIFO_CHANNEL configurations:
- XYZ
- X
- Y
- Z
- XYZT
- XT
- YT
- ZT
Configurations with external ADC are currently not supported.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-11-22 17:43:36 +01:00
Vinayak Kariappa Chettimada
398b91543f samples: Bluetooth: hci_ipc: Fix Newton's Cradle, reduce RAM usage
The required ISO Tx buffers have to match the Read Buffer
Size values, otherwise the difference in the value cause a
similar amount of buffers to be stalled in the IPC driver.

Use reduced HEAP size to make room for increase in RAM
usage.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-22 17:43:04 +01:00
Vinayak Kariappa Chettimada
98130afd0a tests: bsim: Bluetooth: Fix simulation length be greater than wait time
Fix some test simulation length be greater than wait time.
These tests completed within 12 seconds, 15 second wait
time is a good value with included margin and a 20 second
simulation time.

These tests failed on this PR CI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-22 17:43:04 +01:00
Vinayak Kariappa Chettimada
9df4b548ba Bluetooth: Controller: Ext Adv Auxiliary PDUs with ticks_slot_window
Add implementation for Extended Advertising Auxiliary PDUs
to use ticks slot window feature.

This will allow the periodic scheduling of AUX_ADV_IND PDUs
to drift upto 10 ms advertising delay minus the ticks_slot
time reservation of the AUX_ADV_IND PDU when overlapping
with other states/roles that cannot be moved around, to
avoid skipping them.

Having an active Extended Advertising simultaneously with
an ISO Synchronized Receiver or Connected ISO connection
will now have less ISO SDU loss when using 10 ms ISO
intervals.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-22 17:43:04 +01:00
Vinayak Kariappa Chettimada
b838b17755 Bluetooth: Controller: Introduce ticker reschedule with drift
Introduce ticker reschedule with drift so that role like
AUX_ADV_IND can start after overlapping states and roles
using time reservations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-22 17:43:04 +01:00
Vinayak Kariappa Chettimada
ec39d6257e Bluetooth: Controller: Fix to reschedule before overlap when yielding
Fix to reschedule before overlap and be collision resolved
in the next periodic interval for tickers using slot window
yield.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-22 17:43:04 +01:00
Francois Ramu
22b6839981 samples: sensor: sensors for trigger without trigger
Exclude stm32 platforms with accel0 or magn0
for running the samples/sensor for trigger
as their sensor driver does not have trigger set.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-22 17:42:32 +01:00
Francois Ramu
2e2396ded1 boards: st: Fix memory mapping and size for STM32L4plus
Align the total SRAM size for STM32L47x/L48x/L49x/L4Ax
boards. Those MCUs with up to 320 Kbytes SRAM:

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-22 17:42:25 +01:00
Francois Ramu
4864481499 dts: arm: st: Fix memory mapping and size for STM32L4plus
Split and fix the total SRAM size for STM32L4Px/L4Qx/L4Rx/L4Sx
device. Those MCUs with up to 640 Kbytes SRAM:
This is 640KB for the STM32L4Rxxx and STM32L4Sxxx devices :
• 192 Kbytes SRAM1 + 64 Kbytes SRAM2 + 384 Kbytes SRAM3
This is 320KB for the STM32L4P5xx and STM32L4Q5xx devices :
• 128 Kbytes SRAM1 + 64 Kbytes SRAM2 + 128 Kbytes SRAM3

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-22 17:42:25 +01:00
Francois Ramu
fb152f458b boards: st: Fix memory mapping and size for STM32L47x/8x/9x/ax
Align the total SRAM size for STM32L47x/L48x/L49x/L4Ax
boards. Those MCUs with up to 320 Kbytes SRAM:
    • 96 Kbytes SRAM1 and 32 Kbyte SRAM2 on STM32L47x/L48x.
    • 256 Kbyte SRAM1 and 64 Kbyte SRAM2 on STM32L49x/L4Ax

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-22 17:42:25 +01:00
Francois Ramu
2eb875618b dts: arm: st: Fix memory mapping and size for STM32L47x/8x/9x/ax
Split and fix the total SRAM size for STM32L47x/L48x/L49x/L4Ax
device. Those MCUs with up to 320 Kbytes SRAM:
• 96 Kbytes SRAM1 and 32 Kbyte SRAM2 on STM32L47x/L48x.
• 256 Kbyte SRAM1 and 64 Kbyte SRAM2 on STM32L49x/L4Ax
The sram0 node at address 0x20000000 and sram1 at address 0x10000000

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-22 17:42:25 +01:00
Jukka Rissanen
5531692bcc tests: net: socket: udp: Add IP_LOCAL_PORT_RANGE socket option tests
Make sure that the IP_LOCAL_PORT_RANGE socket option works
as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-22 17:42:08 +01:00
Jukka Rissanen
b0b20229b0 net: sockets: Add support for IP_LOCAL_PORT_RANGE socket option.
Add support for IP_LOCAL_PORT_RANGE socket option. The option
supports both IPv4 and IPv6 sockets although the type is IPPROTO_IP.

The option can be used to enforce the ephemeral port number selection
to be in certain range.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-22 17:42:08 +01:00
Maochen Wang
bb276802ae MAINTAINERS: Add MaochenWang1 as a collaborator to Wi-Fi
Have contributed regularly to Wi-Fi, please see following:
https://github.com/zephyrproject-rtos/zephyr/pulls?q=is%3Apr+is%3Aclosed+author%3AMaochenWang1

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-22 17:41:21 +01:00
Aymeric Aillet
dd446a724f soc: renesas: rcar: Remove CONFIG_PINCTRL
Remove CONFIG_PINCTRL from rcar defconfig files
Fixes: #78619

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2024-11-22 17:41:02 +01:00
Aymeric Aillet
d41ce536c5 drivers: rcar: Select CONFIG_PINCTRL
Select PINCTRL for drivers: pwm, sdhc, serial

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2024-11-22 17:41:02 +01:00
Pieter De Gendt
7f0f28fecc ruff: Remove resolved excluded linter issues
All linter issues in scripts/west_commands/runners are fixed and can be
removed from the exclusion list.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
336c7dadac scripts: west_commands: runners: Fix line-too-long (E501)
Wrap long lines to max 100 characters.

See https://docs.astral.sh/ruff/rules/line-too-long/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
775db0e63a scripts: west_commands: runners: Fix f-string (UP032)
Replace .format() calls with f-strings.

See https://docs.astral.sh/ruff/rules/f-string/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
bf7f41d880 scripts: west_commands: runners: Sort and format imports (I001)
Apply sorting and formatting rules on imports.

See
https://docs.astral.sh/ruff/rules/unsorted-imports/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
93457b42f9 scripts: west_commands: runners: Fix unused/deprecated imports (F401/UP035)
Remove some imports that are no longer needed.

See
https://docs.astral.sh/ruff/rules/unused-import/
https://docs.astral.sh/ruff/rules/deprecated-import/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
acb2eaacbd scripts: west_commands: runners: Fix non-pep604-annotation (UP007)
Replace Optional types with the | operator.

https://docs.astral.sh/ruff/rules/non-pep604-annotation/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
907a0db599 scripts: west_commands: runners: Fix non-pep585-annotation (UP006)
Use standard library variants for list, dict, tuple, set

See https://docs.astral.sh/ruff/rules/non-pep585-annotation/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
523015b6ef scripts: west_commands: runners: raise-without-from-inside-except (B904)
Pass exceptions up the chain.

See https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
f7902bc817 scripts: west_commands: runners: Fix bare except (E722 & B904)
Catch explicit exceptions and pass them them to the ValueError

See
https://docs.astral.sh/ruff/rules/bare-except/
https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
1e1c7f7c16 scripts: west_commands: runners: Fix mutable-argument-default (B006)
Do not use mutable default arguments.

See https://docs.astral.sh/ruff/rules/mutable-argument-default/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
8055145ad3 scripts: west_commands: runners: Fix super-call-with-parameters (UP008)
Simplify super() calls.

See https://docs.astral.sh/ruff/rules/super-call-with-parameters/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
07342d9b81 scripts: west_commands: runners: Fix if-with-same-arms (SIM114)
Simplify if statements with same arms.

See https://docs.astral.sh/ruff/rules/if-with-same-arms/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
cd02de5df9 scripts: west_commands: runners: Fix reimplemented-builtin (SIM110)
Convert for loop to use any().

See https://docs.astral.sh/ruff/rules/reimplemented-builtin/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
0f54805faa scripts: west_commands: runners: Fix suppressible-exception (SIM105)
Use contextlib to suppress an error.

See https://docs.astral.sh/ruff/rules/suppressible-exception/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
df794b5493 scripts: west_commands: runners: Conditional import
Convert except: pass statement so the conditional import results in a
NoneType.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
7f72dd3a0f scripts: west_commands: runners: Fix f-string-missing-placeholders (F541)
Constant strings should not be f-strings.

See https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
c0d08e5212 scripts: west_commands: runners: Fix not-is-test (E714)
Make the "not is" more readable.

See https://docs.astral.sh/ruff/rules/not-is-test/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
02fac6e1c0 scripts: west_commands: runners: Fix multiple statements on one line (E701)
Place if and conditional statements on separate lines.

https://docs.astral.sh/ruff/rules/multiple-statements-on-one-line-colon/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
3a55e8a52f scripts: west_commands: runners: Fix set-attr-with-constant (B010)
Do not use setattr for constants.

See https://docs.astral.sh/ruff/rules/set-attr-with-constant/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
e42d30ef6c scripts: west_commands: runners: Fix printf-string-formatting (UP031)
Replace printf-style string format.

See https://docs.astral.sh/ruff/rules/printf-string-formatting/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
d562731096 scripts: west_commands: runners: Fix redundant-open-modes (UP015)
Don't pass default open mode.

See https://docs.astral.sh/ruff/rules/redundant-open-modes/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
fc5286fe25 scripts: west_commands: runners: Fix useless-object-inheritance (UP004)
Remove object inheritance.

See https://docs.astral.sh/ruff/rules/useless-object-inheritance/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
dbaf01ef28 scripts: west_commands: runners: Ignore open file without ctx (SIM115)
Add noqa to a complex statement with multiple open/close statements.

See https://docs.astral.sh/ruff/rules/open-file-with-context-handler/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
2e39674344 scripts: west_commands: runners: Fix needless-bool (SIM103)
Return the result instead of the if statements.

See https://docs.astral.sh/ruff/rules/needless-bool/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
d397b01338 scripts: west_commands: runners: Fix collapsible-if (SIM102)
Combine multiple nested if statements.

See https://docs.astral.sh/ruff/rules/collapsible-if/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
133665e55a scripts: west_commands: runners: Fix unused-import (F401)
Removed unused import.

See https://docs.astral.sh/ruff/rules/unused-import/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
ddbba0ef4c scripts: west_commands: runners: Fix mixed-spaces-and-tabs (E101)
Use spaces for indentation.

See https://docs.astral.sh/ruff/rules/mixed-spaces-and-tabs/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
a48e37608f scripts: west_commands: runners: Ignore missing abstract decorator (B027)
The empty function is intentional.

https://docs.astral.sh/ruff/rules/empty-method-without-abstract-decorator/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
e8294b4590 scripts: west_commands: runners: Fix assert-false (B011)
Prefer AssertionError instead of assert False.

See https://docs.astral.sh/ruff/rules/assert-false/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
25be1501ab scripts: west_commands: runners: Fix pylint unbound issues
Variables are possibly unbound, initialize to None.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Pieter De Gendt
aae018be87 scripts: west_commands: runners: Remove obsolete pylint ignores
These ignores were added with an older version of pylint and are
either removed or ignored by default.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-22 17:40:37 +01:00
Anas Nashif
1f17c761e5 ci: test_plan: call with --no-detailed-test-id
add --no-detailed-test-id to call of test_plan. Was missed in previous
commit.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-22 17:40:25 +01:00
Anas Nashif
c14b022bea ci: twister: add --no-detailed-test-id
Switch to short test identifier in reporting.
Part of a series of changes to improve reporting and remove duplication
and clutter when running twister.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-22 08:27:16 -05:00
Dmitrii Golovanov
e11aecaed5 twister: fix Ztest C++ test names extraction from ELF
Fix Ztest test function name extraction from ELF symbols
for C++ compiled binaries where symbol names need additional
'demangling' to match with corresponding test names.

The `c++filt` utility (part of binutils) is called for
demangling when it is needed.

Twister test suite extension and adjustment.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-22 08:26:59 -05:00
Dmitrii Golovanov
18451bca44 doc: twister: Update test naming and application diagram
Update Test Application diagram as well as Test Scenario and
Test Case naming conventions to make them more clear and aligned
to Ztest suite name included as a part of Test Case name.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-22 08:26:59 -05:00
Dmitrii Golovanov
a72244f2d0 twister: ztest: harness: Fix missed TestCase statuses
Fix a problem of Ztest suite names not taken into account by Twister
to identify a TestCase, so in some situations a Ztest test's status
was not assigned to the proper TestCase and it remains 'None'
whereas the actual status value lost, eventually the resulting total
execution counters not correct.

The issue was observed in these situations:
 * Ztest application with multiple test suites having same test names.
 * Ztest suite is 'skipped' entirely on execution with all its tests.

The proposed solution extends Twister test case name for Ztest to
include Ztest suite name, so the resulting identifier looks like:
   `<test_scenario_name>.<ztest_suite_name>.<ztest_name>`

The above naming scheme now requires ztest_suite_name part to be
provided for `--sub-test` command line option.

Testcase identifiers in twister.json and testplan.json will also
include ztest_suite_name component.

The Twister Ztest(Test) Harness is improved to track all state changes
known from the test application's log for Ztest suites and test cases,
so now it parses log output from a Ztest application more scurpulously.
Regular expressions to match log records are extended and optimized
to compile them only once and, in some cases, fixed (suite summary).

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-22 08:26:59 -05:00
Lucien Zhao
74d1f60faf boards: mimxrt1180_evk: Enable PWM for RT1180 EVK
Enables PWM for RT1180 EVK. Tested with sample led_pwm

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-22 08:26:32 -05:00
Lucien Zhao
18a2a63a25 dts: arm: nxp: rt118x: add flexpwm instances
add 4 flexpwm instances
update clock driver to adapt flexpwm clock structure

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-22 08:26:32 -05:00
Dominik Kilian
81bb231fd0 ipc: icbmsg: Reduce block alignment to 32-bits
The ICBMsg backend divides its memory into
blocks. Each block is aligned to data cache
alignment. Is it not required, since adjacent
blocks has the same data flow direction (either
read-only or write-only). This commit changes
it to 32-bits making wasted memory significantly
reduced.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2024-11-22 08:26:22 -05:00
Martino Facchin
4fe6d47683 boards: arduino_nicla_vision: fix hardware information
The board shares many features with other Arduinos based on STM32H747
(like the HSE in bypass mode).
Once https://github.com/zephyrproject-rtos/zephyr/pull/76542 is merged,
PF1550 support should be added too to allow switching IO voltage
from 3v3 to 1v8

Signed-off-by: Martino Facchin <m.facchin@arduino.cc>
2024-11-22 08:26:15 -05:00
Filip Kokosinski
585fb2a61b boards/arduino/portenta_h7: enable USART1 on M4
Right now, USART1 is enabled on the M7 target variant by default, leaving
M4 without a UART to use; this is the way this port was originally
contributed.

Since then, USB was enabled on M7, changing the console backend from USART1
to USB CDC ACM; the M4 target was left unchanged.

This commit enabled USART1 on the M4 variant and disabled it on the M7
variant, so that the M4 variant can use it as its console backend.

Note that, for the M4 variant, USART1 has been assigned to `zephyr,console`
and `zephyr,shell-uart` since this port was contributed, even though USART1
was always disabled on M4.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-22 08:25:54 -05:00
Benedikt Schmidt
b4893c46ce drivers: fpga: use defaults in iCE40 binding
Replace the DT_INST_PROP_OR statements with defaults
in the devicetree binding of the iCE40.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-22 08:25:44 -05:00
Chen Xingyu
1dd6d0db67 tests: subsys: mgmt: Fix warning of size_t formatting with %.*s
This addresses the following warning building with `CONFIG_64BIT=y`:

    error: field precision specifier '.*' expects argument of type 'int',
    but argument X has type 'size_t' {aka 'long unsigned int'}

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-11-22 08:25:31 -05:00
Chen Xingyu
bb94c63fa2 samples: subsys: ipc: Fix warning of size_t formatting with %.*s
This addresses the following warning building with `CONFIG_64BIT=y`:

    error: field precision specifier '.*' expects argument of type 'int',
    but argument X has type 'size_t' {aka 'long unsigned int'}

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-11-22 08:25:31 -05:00
Chen Xingyu
50f23500b8 net: Fix warning of size_t formatting with %.*s
This addresses the following warning building with `CONFIG_64BIT=y`:

    error: field precision specifier '.*' expects argument of type 'int',
    but argument X has type 'size_t' {aka 'long unsigned int'}

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-11-22 08:25:31 -05:00
Andrej Butok
ae5609aef2 samples: smp_svr: Move bluetooth tag to bt_tests
Move "bluetooth" tag and harness from the common section
of the smp_svr sample.yaml file to "bluetooth" specific test cases.

Signed-off-by: Andrej Butok <Andrey.Butok@nxp.com>
2024-11-22 08:23:18 -05:00
Chris Friedt
932e8708b1 tests: posix: single_process: correct typo and filter
What looks to be a copy-paste typo was not caught in
code review.

Change .rwlocks to nothing and move the filter to the
common area.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-22 08:22:30 -05:00
Johan Hedberg
da713a2b86 doc: release-notes-4.1: Mention removal of deprecated HCI API
Mention the removed deprecated Bluetooth HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-22 11:37:12 +01:00
Johan Hedberg
30d1d0e526 Bluetooth: Host: Remove deprecated HCI driver API
Remove the deprecated HCI driver API which was provided by the hci_driver.h
header file. The deprecation happened in Zephyr 3.7, so the API can now be
removed for Zephyr 4.1.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-22 11:37:12 +01:00
Johan Hedberg
3063f18942 Bluetooth: Host: Remove unnecessary hci_driver.h includes
None of these files actually use anything from the hci_driver.h header
file.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-22 11:37:12 +01:00
Alberto Escolar Piedras
4558056f81 tests/bsim: Also runtime test the UART drivers for the nrf54l15
To increase coverage.

Note that we call twister separatedly for this target, due to the 54l15
overlays using UARTE20 which is indexed in simulation as "2", but as
the nrf52833 does not have 3 instances. So "-uart2_loopback" is not
a valid option for a 52833 executable.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
9c386cab93 tests uart_pm: Enable for nrf54l15bsim
Enable this test in the simulated nrf5340 and provide
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
eec736355c tests uart_mix_fifo_poll: Enable for nrf54l15bsim
Enable this test in the simulated nrf54l15 and provide
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
dd2f4117e3 tests uart_async_api: Enable in nrf54l15bsim//cpuapp
Enable this test in the simulated nrf54l15 by providing
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
890f13426e doc boards nrfbsim: Mention the UARTE as supported for nrf54l15
Include in the list of supported peripherals the UARTE for the
simulated nrf54l15

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
ca46c7c816 boards nrfbsim: Enable UART(E) peripherals for nrf54l15bsim
The HW models now support this peripheral for this target.
Let's enable it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Jukka Rissanen
c2802618df tests: net: socket: tcp: Add min_flash to the test config
Add minimum flash requirement to the tests. This will effectively
exclude nrf5340dk/nrf5340/cpuapp/ns as it does not have
enough flash for the application.

Fixes #81608

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-22 11:33:52 +01:00
Yong Cong Sin
45ebd390cf arch: riscv: reg: include required header
Include `zephyr/sys/util.h` for the `STRINGIFY()` macro.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-22 11:32:22 +01:00
Emil Lindqvist
067a35f2fb display: stm32: implement display_get_framebuffer API
This commit implements the display_get_framebuffer API function in
the STM32 LTDC display driver

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-11-22 11:31:24 +01:00
Anas Nashif
28796076d8 tests: kernel: common: optimize filters
Optimize filters and remove build_on_all, this option is already used in
the synchronization sample which has more coverage on small platforms.

Since we only build, it does provide basic sanitcheck for the kernel as
well.

This reduces testplan on PRs and push events by almost 1000 entries that
would only be built or filtered at runtime.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-21 19:22:35 -05:00
Benedikt Schmidt
b0a1dddde3 drivers: fpga: fix waveform for iCE40 configuration in SPI mode
The datasheet of the iCE40 specifies that there should be a leading and
trailing clocks phase during its configuration with SPI. Due to the
limitations of the SPI interface, and probably also due to a lock of
support for such a feature for instance in the STM32 SPI peripheral,
this is achieved with additional SPI transfers before and after the
actual image. Unfortunately, this by default also affects the slave
select GPIO, which has to stay high during these phases.
This fixes this behaviour via not passing the slave select GPIO
to the SPI driver and manipulating this GPIO manually.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-21 19:22:20 -05:00
Mahesh Mahadevan
21d0a3b699 tests: pwm: Add support for SCTimer PWM on FRDM-MCXN947
Add overlay files to enable test of PWM over SCTimer.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-21 19:22:07 -05:00
Mahesh Mahadevan
488e4bbf5f boards: frdm_mcxn947: Add SCTimer support
Add support for SCTimer

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-21 19:22:07 -05:00
Mahesh Mahadevan
12486ca7e2 dts: mcxn947: Add SCTimer support
Add SCTimer node

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-21 19:22:07 -05:00
Krzysztof Chruściński
f235ddb2cf tests: drivers: uart: async_api: Add uart120 instance to nrf54h20dk
Add second instance to be tested on nrf54h20dk. uart120 is a fast UARTE
which works on fixed pin locations. It is not available for cpuppr core.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-21 20:12:13 +01:00
Krzysztof Chruściński
d2b69a4ec7 tests: drivers: uart: async_api: Rework for multi instance
Rework the test to be able to run on multiple instances.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-21 20:12:13 +01:00
Krzysztof Chruściński
bc007fd53b tests: drivers: uart: async_api: Add missing static keyword
Multiple variable in the test were missing static keyword.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-21 20:12:13 +01:00
Krzysztof Chruściński
760bba6d24 drivers: serial: nrfx_uarte: Fix pin retention
b6d45423c6 Added support for pin retention but it was added
only to the case when device PM is used. There is another mode
in which UARTE is disabled when idle (low power mode) and in
that case pin retention must also be added.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-21 20:12:13 +01:00
Hongquan Li
41e33573e8 drivers: wifi: esp_at: Fix serial receive interrupt can't exit
If a character is received immediately after modem_iface_uart_init called,
the modem_iface_uart_isr function will not read the data in the serial port
fifo register as the context has not been registered at this time,
which will result in the program not being able to exit the interrupt,
so the context should registered before the serial port is initialised.

Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
2024-11-21 20:12:00 +01:00
Benedikt Schmidt
53ae195f0d drivers: fpga: replace runtime checks with buildtime asserts in iCE40
Replace NULL checks for the set and clear registers with BUILD_ASSERTs
in the iCE40 device instantiation.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-21 20:11:47 +01:00
Emil Gydesen
07b7802460 doc: Bluetooth: Audio: Shell: Make shell docs a bit more consistent
Make the headers of the audio shell documentation files consistent.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 20:11:13 +01:00
Emil Gydesen
b20784dfbb docs: Bluetooth: Move documentating for shell out of API
The API directory really isn't the best place for shell
documentation, which isn't API.

Created a new directory for Bluetooth shell documentation
and moved the ISO and LE Audio docs in there.

The existing bluetooth-shell.rst file was also split into
several new files, so that it follows the same structure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 20:11:13 +01:00
Jukka Rissanen
39889c0023 net: if: Do not report error if we are already in promisc mode
If we are already in promiscuous mode, then do not report error
in that case.

Fixes #81605

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-21 20:11:01 +01:00
Pieter De Gendt
f05deb1aa4 python: Format trivial files where only newlines were missing
Apply formatting on files that only needed adding newlines.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-21 20:10:51 +01:00
Muhammad Waleed Badar
9a804572a3 samples: rtc: Generic RTC sample
This sample app set and read date/time from the Real-Time Clock.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2024-11-21 14:49:19 +01:00
Dominik Ermel
77ebf82b3e storage: flash_map: Don't generate flash area when no device
Change in default flash map generation, where partitions hanging of
disabled devices will not have flash area generated.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-21 14:48:44 +01:00
Chaitanya Tata
bbfb546e57 modules: hostap: Add external crypto support
Add an option for platforms or forks to provide their own hostap
compatible crypto implementation. This may include proprietary or
platform specific stuff that may or may not be upstreamed to Zephyr.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-21 14:48:14 +01:00
Grzegorz Chwierut
e0bd7e7c87 twister: Allow sharing hardware platform between variants
Extended hardware map to share a single board between variants.
To run tests for different variants on the same board
without re-configuring the hardware map file for each variant,
one can use a `platform` atribute as a list of names.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-11-21 14:48:03 +01:00
Emil Gydesen
b4f3763c31 tests: Bluetooth: Audio: Use same recv_cb for all tests
This commit changes the BSIM tests to use the same recv callback
for all tests. The purpose of this is to reduce code duplication
and make it easier to maintain the tests.

This also changes the recv_cb so that in case of any error we log
the most recently received SDU, which should provide more
information about why a test failed in case of RX error.

PBP had to be updated a bit to support the audio_stream
struct.

Also modifies a check and log in bap_stream that was less than
helpful to determine if it was the stream or the endpoint that
was NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 14:47:49 +01:00
Seppo Takalo
bc4f026ea9 net: lib: coap_client: Const pointers in request
CoAP client does not modify any of the members, so
change all pointers to const.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Seppo Takalo
2066cf6a3d net: lib: coap_client: Release non-confirmable requests
Non-confirmable CoAP requests need lifetime tracking as well
so we can free the structure after a timeout.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Seppo Takalo
6c169668e9 net: lib: coap_client: Fix timeout for separate response
When waiting for response after receiving the empty Ack, client
actually used way too timeout.
CoAP timeout only holds the timeout value in ms. t0 is the starting time.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Seppo Takalo
23345d203e tests: coap_client: Add test for non-confirmable request
Add test for sending multiple non-confirmable requests.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Seppo Takalo
d64748cc52 tests: coap_client: Refactor tests
Refactor tests to be a bit shorter, so its easier to read
and copy-paste for a new testcase

All idioms like "ret = somecall(); zasser.." are replaced with just
"zassert_ok(some_call());"

Commonly used structures are global and initialized once.

To avoid cross-test side-effects, suite_after-function is added
to cleanup all requests.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Seppo Takalo
34a6d5a5dc tests: coap_client: Proper slow-down
Use real-time scheduler with 100x speedup, so timeouts are
accurate enough, but still fast for tests to run.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Matthias Hauser
035251d7da boards: we: Add board orthosie1ev
Added new board file of Wurth Electronic board Orthosie-I

Signed-off-by: Matthias Hauser <matthias.hauser@we-online.de>
2024-11-21 14:47:02 +01:00
Omkar Kulkarni
b160063efb Tests: Bluetooth: mesh_shell: Update prj.conf
Updates and aligns the project config file to enable usage of multiple
keys so that users are not required to manually update the project
config file for testing most common mesh scenarios requiring multiple
netkeys and appkeys.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-11-21 14:46:47 +01:00
Omkar Kulkarni
95fff388ba Bluetooth: Mesh: Shell: Align commands
Aligns subnet bridge related commands according to conventions used for
rest of the shell commands. Also updates documentations to reflect the
change.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-11-21 14:46:31 +01:00
James Roy
ae256e1f6c boards: openisa: Remove CONFIG_PINCTRL from the boards defconfig
Removed 'CONFIG_PINCTRL' from openisa board defconfig.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-21 14:46:19 +01:00
Ilya Tagunov
36c9777be8 llext: fix unaligned access for ARC
We hit some unaligned access faults running our internal tests.
Not every 32-bit instruction is 32-bit aligned; some are 16-bit aligned.
Make all reads and writes potentially unaligned to be on the safe side.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-21 14:46:08 +01:00
Fin Maaß
d18f4256ee drivers: fpga: fix log level
Use CONFIG_FPGA_LOG_LEVEL for the fpga
log modules.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-21 11:02:23 +00:00
Erwan Gouriou
2d81351517 drivers: ethernet: stm32: Use MDIO API only if enabled by DTS
Not all STM32 series support Zephyr MDIO API yet, while the API is enabled
by default.
To preserve compatibility, put MDIO API related code under the condition
of "st,stm32-mdio" compatible enablement.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-21 11:02:14 +00:00
Pierrick Guillaume
f716973785 init: fix soc and board hooks doxygen comments
Documentation for *init_hooks were not generated on doc website.
This was due to ill-formed doc-strings for those hooks.

Signed-off-by: Pierrick Guillaume <pierguill@gmail.com>
2024-11-21 11:02:07 +00:00
Chris Friedt
b85e1981c3 west: runners: update the rtt implementation for openocd
Previously, rtt start would always fail because the target
(i.e. firmware) had not been started.

```
Info : rtt: Searching for control block 'SEGGER RTT'
Info : rtt: No control block found
```

When the command is 'rtt', run the binary via gdb before calling
'rtt start'. Firmware calls `SEGGER_RTT_Init()` shortly after
init which allows OpenOCD to find the RTT control block.

Similarly, only start the 'rtt server' after calling
'rtt start' to avoid any potential race conditions
internally within OpenOCD.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Chris Friedt
9a8ae21a3c west: runners: openocd: mitigate pylint R0201 warning
Previously, there was a warning that the to_num() method can
(and probably should) be unbound from OpenOcdBinaryRunner.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Chris Friedt
c71e339773 west: runners: jlink: print RTT server port
Similar to how print_gdbserver_message() prints GDB server info
when "west debug" is run, print RTT server info when "west rtt"
is run.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Chris Friedt
d6f32bb339 cmake: flash: update cmake to support rtt target
Add support for the rtt target so that users can run

`west build -p auto -b <board> -t rtt <app>`

similarly to the way that users can now do so with the debug
target, since the rtt target is supposed to be used in a similar
way.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Sebastian Głąb
f0eba33258 samples: boards: nordic: coresight_stm: Test STM dictionary mode
Extend STM logger test.
Use nrfutil trace to decode STM logs in dictionary mode.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-11-21 11:01:43 +00:00
Carles Cufi
21475774fc boards: nordic: nRF54L15DK: Add basic support for the L05 and L10 ICs
The nRF54L05 and nRF54L10 are identical to the nRF54L15 except for their
memory sizes. Add support for emulating those ICs on the nRF54L15DK.
This commit only adds support for the main application core. Support for
the FLPR core may be added later.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Carles Cufi
1b84958f5a boards: nordic: nrf54l15dk: Rename the board common file
Use the rather logical convention for the name that is applied to other
Nordic boards: <board>_common.dtsi for definitions that are common to
the board itself (LEDs, buttons, etc).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Carles Cufi
e78832034f soc: nordic: Introduce the nRF54L05 and nRF54L10
These two new ICs are variants of the nRF54L15 with different memory
sizes:

- nRF54L05: 500KB RRAM, 96KB RAM
- nRF54L10: 1022KB RRAM, 192KB RAM
- nRF54L15: 1524KB RRAM, 256KB RAM

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Carles Cufi
0b3a15016b soc: nordic: nRF54L: Consolidate common Kconfig options
There are many common options to all ICs of the 54L series. Consolidate
them in a single entry so that they do not need to be re-typed for each
SoC series member.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Alberto Escolar Piedras
4294814a23 Bluetooth: Controller: nRF: Support MDK 8.68
TASK_SHUTDOWN was deprecated in newer SOCs and now removed
in MDK 8.68 (nrfx 3.9.0)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Alberto Escolar Piedras
ef55d65449 manifest: Update nRF hw models to version compatible with nrfx3.9
Update the HW models module to:
3cfca0192ff84da919e9bc7978bcc2239cd6a395

This includes 2 changes:
* 3cfca01 UART: Model more accurately TASKS_FLUSH behaviour
* 25cbd28: 54L15: Change CLOKPOWER IRQ line (MDK 8.68, nrfx 3.9.0)

    WARNING! This change breaks backwards compatibility with SW
    which expected this line to be 270 for 54L15 devices,
    and therefore with MDKs < 8.68 & nrfx < 3.9.0.
    This change requires updating to the MDK >=8.68 and nrfx >=3.9.0
    if building using the 54L15 models.
    52 and 53 models are not affected.

    Change the CLOCK_POWER interrupt line from 270 to 261.
    This has changed in the latest MDK (8.68) and the new
    value is used in the latest nrfx (3.9.0) drivers.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Alberto Escolar Piedras
30f0d85fa0 manifest: Update nRF hw models to latest
Update the HW models module to:
42737c8ec8485987c7c9b0262b136de623e1ded2

Including the following:
42737c8 TIMER: Support devices without TASK_SHUTDOWN nrfx3.9 MDK 8.68
5fe6873 54 UARTE: Add frametimeout functionality
dc086d7 UARTE: Add basic 54 support
b046745 UARTE: Support better not having UART functionality
1c5f58c README: Mention the nRF54L15 models cover the L10 and L05
597c7d0 TEMP: Also build hal replacement for 54 and define NRF_TEMP_NS/S
fb2ca83 Makefile: Let's build libraries (specially HAL) as pic
200a1e3 Makefiles: move some common options to common snippet

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Carles Cufi
e92323f0c4 manifest: hal_nordic: Update to nrfx 3.9.0
See https://github.com/zephyrproject-rtos/hal_nordic/pull/257.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-21 09:26:38 +01:00
Håvard Reierstad
0b35b38ef5 Bsim: Bluetooth: Mesh: Add multicast bridge tests
Adds two new tests for the Subnet Bridge feature, testing group and
virtual addresses as destinations. The tests are based on the existing
`brg_simple.sh` test, with the addition of a new node and a new subnet
to make sure that messages are bridged to multiple subnets, but only
subnets that have a corresponding entry in the bridging table.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-21 09:25:11 +01:00
Håvard Reierstad
77e017306e Bsim: Bluetooth: Mesh: Rename/refactor send_ra
Renames `bt_mesh_test_send_ra` to `bt_mesh_test_send_data` and changes
the corresponding callback funciton as it is used outside of the replay
attack tests, and can be used to send custom data. The function is
extended to accept a UUID parameter to allow sending data to virtual
addresses.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-21 09:25:11 +01:00
Lothar Felten
e7c3434685 boards: lilygo: ttgo_lora32: enable SDHC support
device tree:
enable support for the SDHC controller to use the micro SD card slot

documentation:
- added instructions for SD card and OLED samples
- added links to code samples

defconfig:
added CONFIG_ESP32_USE_UNSUPPORTED_REVISION=y to
ttgo_lora32_esp32_procpu_defconfig

The chip on the board is a ESP32 chip revision 1.
The board will not boot, it displays the following warning at boot:

I (35) boot: chip revision: v1.0
E (38) boot: You are using ESP32 chip revision (1) that is unsupported.
While it may work, it could cause unexpected behavior or issues.
E (50) boot: Proceeding with this ESP32 chip revision is not recommended
unless you fully understand the potential risk and limitations.
E (62) boot: If you choose to continue, please enable the
'CONFIG_ESP32_USE_UNSUPPORTED_REVISION' in your project configuration.
E (73) boot: HW init failed, aborting

In order to prevent a boot loop, CONFIG_ESP32_USE_UNSUPPORTED_REVISION=y
was added to the defconfig.

Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
2024-11-21 09:21:56 +01:00
Kai Vehmanen
58df2533bb drivers: dma: intel-adsp-hda: coding style fix
Align to coding style and use braces for all if blocks.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-11-21 09:21:04 +01:00
Kai Vehmanen
1bafbf4f1d drivers: dma: intel-adsp-hda: optimize L1 exit handling in ISR
Use the existing 'atomic' bitmask to speed up ISR processing for
CONFIG_DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT. This bitmask is used
to track enabled DMA channels.

In the common case, only a few DMA channels are active and low
channels are allocated first. Take advantage of this and not
iterate over all DMA channels of all all host devices. Rather
break out as soon as L1 exit handling is done for all enabled
channels.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-11-21 09:21:04 +01:00
Emil Gydesen
ccfd16e2c2 doc: releases: Add BT LE audio Kconfig options to migration guide
Add the list of affect Kconfig options to the migration guide.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
7a72280d01 Bluetooth: HAS: Change select UTF8 to depends on
Change the select to a depends on for the Kconfig options
for HAS and HAS_CLIENT.

This is an effort to reduce the number of selects used by
LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
c4fbe38219 Bluetooth: BAP: Depend on BT_PER_ADV_SYNC instead of select
Change the select of BT_PER_ADV_SYNC and BT_EXT_ADV to
depends on. This is an effort to reduce the use of
select for Kconfig options.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
4c86a5cc8d Bluetooth: BAP: Depend on BT_PAC_{SNK,SRC} instead of select
Modify ASCS and BAP Broadcast sink to depend on the PAC options
instead of selecting them.

Since Kconfig does not support "depends on X if Y",
a select for PAC_{SRC,SNK} is used depending on
ASCS_ASE_{SRC,SNK}.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
c0f86011cb Bluetooth: BAP: Depend on BT_ISO_SYNC_RECEIVER instead of select
The BAP Kconfigs option now depends on
BT_ISO_BROADCASTER instead of selecting it.

This is an effort to reduce the use of select in LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
d22c7b0cf2 Bluetooth: BAP: Depend on BT_ISO_BROADCASTER instead of select
The BAP_BROADCAST_SOURCE Kconfig option now depends on
BT_ISO_BROADCASTER instead of selecting it.

This is an effort to reduce the use of select in LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
9b653540b8 Bluetooth: BAP: Use def_bool instead of select for BT_AUDIO_RX/TX
Remove the selects and use  def_bool for BT_AUDIO_RX and
BT_AUDIO_TX.

This is part of an effort to reduce select in Kconfig.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
df6b5981bf Bluetooth: Audio: depends on GATT instead of select
Modify the Kconfig options to depend on the GATT
features rather than selecting them.

This is part of an effort to reduce the amount of
selects we use in LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Emil Gydesen
6f86adbc0d Bluetooth: BAP: Use def_bool instead of select for BT_BAP_UNICAST
Remove the selects from BT_BAP_UNICAST_SERVER and BT_BAP_UNICAST_CLIENT
and use a def_bool for BT_BAP_UNICAST.

This is part of an effort to reduce select in Kconfig.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-21 09:19:47 +01:00
Daniel DeGrasse
c071e27e2d boards: fix dependency for LV_COLOR_SWAP_16 to use configdefault
Use configdefault when enabling LV_COLOR_SWAP_16 within boards and
shield definitions, to avoid OR'ing the dependencies for the Kconfig
symbol. Otherwise, a user manually selecting LV_COLOR_DEPTH will
encounter build errors as LV_COLOR_SWAP_16 may be enabled when
LV_COLOR_DEPTH_16 is not selected

Fixes #81546

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-21 09:19:19 +01:00
Yong Cong Sin
027c79add7 doc: posix: option_groups: add section for POSIX_FILE_SYSTEM_R
Add section for POSIX_FILE_SYSTEM_R which contains only `readdir_r()`.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-21 09:18:09 +01:00
Dhruv Menon
20678f9ad5 doc: i2c: Update I2C specification link
The prior link to the I2C specification was broken and no longer
accessible. Updated the link to a valid and current URL

Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
2024-11-21 09:17:50 +01:00
Jakub Rzeszutko
1aaf08f7f1 lib: shell: replace strtol with strtoul in cmd_load for address parsing
Addresses in cmd_load() should always be unsigned. Previously, strtol()
was used, which is limited to signed long values, causing issues with
addresses >= 0x80000000. This commit replaces strtol() with strtoul(),
ensuring proper handling of the full 32-bit address space.

Fixes #81343

Signed-off-by: Aaron Fontaine <aaron.fontaine@dojofive.com>
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2024-11-21 09:17:08 +01:00
Mahesh Mahadevan
76b6e6b1d7 MAINTAINERS: Update maintainer for release notes
Update to the 4.1 Release managers

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-21 09:14:29 +01:00
Volodymyr Fialko
0d66091cce riscv: pmp: don't reconfigure modes
Previously PMP was avaible only with Multithreading, since it's now
available without MT - add extra checks to prevent user/kernel mode
reconfiguration.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-20 16:04:15 -05:00
Lucien Zhao
850d471b95 boards: nxp: mimxrt1180_evk: add flexspi1 support
USE_HYPERRAM macro defined shouldn't be placed under
CONFIG_BOOT_FLEXSPI_NOR.

Add flexspi1 pinmux pinctrl and flash partitions

Add flash partitions and correct flash parameter.

This commit was tested with samples: flash_shell on cm33/cm7 cores

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-20 16:00:02 -05:00
Lucien Zhao
6463dd610d drivers: clock_control:: Update ccm_rev2 clock driver for RT118X
flexspi_clock_set_freq can be applied for RT118X series.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-20 16:00:02 -05:00
Lucien Zhao
bfc607e38d dts: arm: nxp: rt118x: add flexspi instance support
add flexspi2 and rename flexspi1 to flexspi to adapt
flexspi.c driver under soc/nxp/rt118x folder.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-20 16:00:02 -05:00
Lucien Zhao
a8f5958c78 soc: nxp: imxrt: imxrt118x: add flexspi support
add flexspi.c file to get flexspi clock rate.

Enable flexspi1 clock if don't boot from flash.

Use custom fixed mpu_regions.c file to config MPU for CM7

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-20 16:00:02 -05:00
Federico Di Gregorio
1f5a1b50fa boards: opta: ADC support
A valid device tree configuration is provided for the ADCs of the 8 input
channels and the sample adc_dt works out of the box. Obviously this is
not the only possible configuration but it provides a good template for
further customization without the need to lookup the ADC GPIOs and
connections in the schematics.

Signed-off-by: Federico Di Gregorio <fog@dndg.it>
2024-11-20 15:59:53 -05:00
Federico Di Gregorio
f8ab959d7e boards: opta: RS485 support
This set of changes enables the RS485 hardware connected to usart3 and
provides some overlays that allow for easily running the modbus
rtu_client and rtu_server samples on Opta.

Signed-off-by: Federico Di Gregorio <fog@dndg.it>
2024-11-20 15:59:53 -05:00
Federico Di Gregorio
32309f8124 boards: opta: device tree cleanup
Some changes to cleanup and clarify some device tree nodes:

* removed wrong sdram2 definition
* added all internal flash slots accessible from M4
* added all internal flash slots accessible from M7
* removed CONFIG_UART_LINE_CTRL because not needed by USB CDC ACM

Signed-off-by: Federico Di Gregorio <fog@dndg.it>
2024-11-20 15:59:53 -05:00
Federico Di Gregorio
cf45ab85d2 boards: opta: ethernet reorganization
This set of changes reorganize the ethernet configuration by removing the
use a regulator to enable the PHY: the correct GPIO pin is set in code
only if the network has been configured via CONFIG_NET_L2_ETHERNET.

Signed-off-by: Federico Di Gregorio <fog@dndg.it>
2024-11-20 15:59:53 -05:00
Valerio Setti
516886be1b mbedtls: MBEDTLS_ENTROPY_POLL_ZEPHYR default on if MBEDTLS_ENTROPY_C
As long as MBEDTLS_ENTROPY_C is enabled, Mbed TLS needs to
poll some entropy source to gather data that will then be
processed by CTR/HMAC-DRBG modules. This means that in most
of the cases, once MBEDTLS_ENTROPY_C is enabled then also
MBEDTLS_ENTROPY_POLL_ZEPHYR needs to be enabled. This was
done manually until now, as the long list of samples/tests
demonstrate.

This commit solves this dependency by defaulting
MBEDTLS_ENTROPY_POLL_ZEPHYR to on as soon as
MBEDTLS_ENTROPY_C is set. As a consequence, all manual
enablement of MBEDTLS_ENTROPY_POLL_ZEPHYR in samples/tests
are removed.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-20 15:59:40 -05:00
Valerio Setti
08bd9c72bd mbedtls: use CSPRNG whenever possible as PSA random source
The main problem of MBEDTLS_PSA_CRYPTO_LEGACY_RNG is that it
brings in some legacy modules (entropy + ctr_drbg/hmac_drbg)
which means extra ROM/RAM footprint.
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG instead simply calls to the
CSPRNG which makes it definitely smaller.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-20 15:59:40 -05:00
Valerio Setti
ac6d834272 mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA
Auto-select MBEDTLS_CIPHER_AES_ENABLED when AES support is requested
through PSA (i.e. CONFIG_PSA_WANT_KEY_TYPE_AES) and the PSA support is
provided through Mbed TLS itself (i.e. CONFIG_MBEDTLS_PSA_CRYPTO_C).

This mimic what happens in Mbed TLS at build time: if AES support
is required through PSA, but there's no one else providing it
(i.e. no TF-M in Zephyr) then provide this support through legacy
AES module.

This is useful in samples/tests so that the user can simply use the
PSA_WANT symbol to ask for AES support in PSA crypto and then tune
the AES features (ex: CONFIG_MBEDTLS_AES_ROM_TABLES) without the need
to also define CONFIG_MBEDTLS_CIPHER_AES_ENABLED.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-20 15:59:40 -05:00
Tarang Raval
31eee15fcd dts: arm: rpi_pico: remove #define from dts
Removing direct #define usage in the DTSI file and converting these
definitions to use a dt-bindings header instead.

Relocates the RPI_PICO_DEFAULT_IRQ_PRIORITY definition to a DTSI file and
introduces an override.dtsi file. The override file is used when no other
override file is present, allowing for better flexibility and compliance
with Zephyr’s DTS structure.

Fixes: #79719

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-20 15:59:03 -05:00
Declan Snyder
9863dc9fd8 drivers: nxp_enet: Add get_config for ipv6 chksum
Previously, ipv6 being disabled was a dependency of the hw acceleration
of the checksums for the nxp enet driver, because this ethernet has an
errata causing icmpv6 checksum to not be supported. Now, there is a new
config type in ethernet api for checksum types, so we can re-enable
hardware acceleration for ipv6 by implementing this type in the
get_config api in this driver.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-20 15:58:47 -05:00
Marvin Ouma
91749dfeb3 tests: posix: common: separate posix xsi streams to standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves stropts into a singular
testsuite at tests/posix/xsi_streams app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-20 15:58:26 -05:00
Daniel Leung
55ad66a30c tests: ztest/base: fix incorrect userspace filtering
The filter here should be used to filter for capability:
whether the platform configuration supports userspace. And if
it does support userspace, we then enable CONFIG_TEST_USERSPACE
(and thus CONFIG_USERSPACE) for testing. We should not be
filtering for whether userspace is enabled, but should really
be filtering for whether userspace is supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-20 15:58:15 -05:00
Daniel Leung
df4883ad23 tests: thread_error_case: fix incorrect userspace filtering
The filter here should be used to filter for capability:
whether the platform configuration supports userspace. And if
it does support userspace, we then enable CONFIG_TEST_USERSPACE
(and thus CONFIG_USERSPACE) for testing. We should not be
filtering for whether userspace is enabled, but should really
be filtering for whether userspace is supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-20 15:58:15 -05:00
Marek Matej
98d0a2bb34 soc: espressif: esp32c6 split cached area
Split the cached area and assign both parts IROM and DROM meaning. This
is necessary to overcome the esptool section merging issues.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-20 15:58:07 -05:00
James Roy
aeaf32aada stm32: Fix wrong binding target for RTC_SEL in stm32u0
Change the stm32u0 clock from CSR_REG to BDCR_REG.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-20 15:57:52 -05:00
Marcin Niestroj
538753d51b boards: st: nucleo_h533re: configure SPI on Arduino headers
This allows to use the board right away with samples and shields depending
on Arduino SPI.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-20 15:57:34 -05:00
Martin Stumpf
50509c34cc lvgl: Flush thread can have preemptive priority
The LVGL flush thread was hard-coded to be cooperative.
For long-running actions like data transfer to the display,
this is problematic as it might block high-frequency actions like
USB or input events.

Hence, make it configurable to be preemptive, and rename it to match the
similar Kconfig values like CONFIG_SDL_THREAD_PRIORITY.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-20 15:57:21 -05:00
Chaitanya Tata
0f1f01f9f4 net: l2: wifi: Fix the minimum value
802.11 doesn't have specific constraints, it just says that listen
interval should be >=0 and it a 2 byte field.

3 as a typical DTIM value from nRF chipsets, so, remove the hardware
specific line and just set a failure.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-20 15:57:06 -05:00
Chaitanya Tata
c5585af4c4 wifi: Add units to listen interval
Listen interval as per 802.11 has units as "beacon intervals" i.e., 1
means 1 beacon interval duration (or short beacon interval duration if
short beacon is enabled).

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-20 15:57:06 -05:00
Dhruv Menon
e6ea761cd7 doc: nxp: Update image of mimxrt1062_fmurt6
The prior image was of poor quality, making it difficult to interpret.
Updated the image with a higher-quality version.

Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
2024-11-20 15:56:55 -05:00
Alberto Escolar Piedras
f79d879d50 tests: Thread-Metric: Fix filter description
Correct the description of why we exclude the POSIX arch

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-20 15:56:16 -05:00
Anas Nashif
c1b8cd7db1 ci: twister_prep: do not double check for event
We already do the check for the job.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-20 15:53:58 -05:00
Anas Nashif
5b51632103 ci: twister: fix setting of output for workflow_call
Fix setting of output variables of workflow_call.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-20 15:53:58 -05:00
Anas Nashif
0c88010d0d Reapply "ci: twister: use workflow_call for prep job"
This reverts commit fd4c7bbbc2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-20 15:53:58 -05:00
Anas Nashif
dc14a212eb ci: twister: check event using correct context
Check for event using correct github context.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-20 15:53:58 -05:00
Yong Cong Sin
6843240196 drivers: intc: plic: use per-instance spinlock
Instead of doing an `irq_lock()`, use per-instance spinlock instead.

Refactored out an unlocked version of `local_irq_is_enabled`
from `riscv_plic_irq_is_enabled()` to achieve that.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-20 08:26:02 -05:00
Volodymyr Fialko
1310856348 tests: riscv: test PMP stack guards
Test if PMP protected regions prevents write access.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2024-11-20 08:25:49 -05:00
Volodymyr Fialko
9eee2eaee6 riscv: pmp: enable stackguard without multithreading
Without multithreading only two stacks present: ISR and main.
As any stack they also could overflow, so it make sense to add stack
guard for them also.

Remove stack guard dependency on multithreading and mark
`Z_RISCV_STACK_GUARD_SIZE` bytes at the beginning of stack as read-only
region with PMP entry.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2024-11-20 08:25:49 -05:00
Noemie Gillet
2253a26c10 drivers: nsos: support for AF_PACKET
Handle AF_PACKET family.

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-20 08:24:08 -05:00
Noemie Gillet
10bb61ee7d drivers: nsos: support for AF_UNIX
Handle AF_UNIX family sockets for NSOS offloaded driver
Note that the size of struct sockaddr_un is done conditionnaly based on
CONFIG_NET_NATIVE_OFFLOADED_SOCKETS
Also, NET_SOCKADDR_PTR_MAX_SIZE needs to be updated only if
CONFIG_NET_SOCKETS_PACKET is not set. Otherwise, for a AF_PACKET socket,
a struct net_context variable can be corrupted, as local would have be on
16 bytes instead of 20 bytes.

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-20 08:24:08 -05:00
cyliang tw
355d032baa boards: nuvoton: numaker: Drop PINCTRL from board defconfig
To remove CONFIG_PINCTRL from board side for numaker boards.
The Drivers using Pinctrl should be turning Pinctrl on
instead of the responsibility of the board.

Fixes #78619

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-11-20 08:23:58 -05:00
Andi Gerl
9c2421444b net: lwm2m: add set_socketoptions cb to pull context LwM2M context
The pull context LwM2M client's set_socketoptions callback is currently
unused and can't be set by a user. Add a public API to set the
pull context's client's set_socketoptions callback.

Signed-off-by: Andi Gerl <andi.gerl@exacttechnology.com>
2024-11-20 08:23:44 -05:00
Jerzy Kasenberg
e6c9e9a2dd i2c: target: eeprom_target: Fix buffer write
When larger buffer index was introduced only function:
eeprom_target_write_received() was updated to handle
address-width = 16

This adds the same functionality when buffered API is used,
enabled by CONFIG_I2C_TARGET_BUFFER_MODE.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-11-20 08:23:37 -05:00
Mahesh Mahadevan
2894c765a2 github: Update security page for v4.0.0 release
Updates the GitHub security page with the current supported versions
after the v4.0.0 release.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-20 08:23:14 -05:00
Anas Nashif
1c596b8b77 boards: mps3_corstone300_fvp_ns: disable twister
Disable board temporarily as it fetches code from external repositories.

Related issue #81656

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-20 08:22:52 -05:00
Guennadi Liakhovetski
cbb6199e67 LLEXT: no repeated linking with inline relocations
When linking and relocations are performed on the ELF object itself
with no copying, also global binding linking can break references.
Disable linking globally for such cases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-20 10:17:06 +00:00
Guennadi Liakhovetski
827909b7b9 LLEXT: Xtensa: don't generate FLIX commands
The LLEXT linker for Xtensa cannot relocate FLIX commands, disable
them in extensions only until we have a solution. Note, that this
only affects extensions, the main Zephyr binary is still built with
FLIX commands.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-20 10:17:06 +00:00
Mara Furland
30fa48558e boards: qorvo: add DWM3001CDK support
Add support for the decawave DWM3001C board from qorvo

Signed-off-by: Mara Furland <mara@fur.land>
2024-11-20 10:16:58 +00:00
Lingao Meng
6d6d4565d3 kernel: workq: Fix function format to avoid CI Warning
formating

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-11-20 10:15:20 +00:00
Lingao Meng
836fa88cbd kernel: work: Add missing ASSERT for args
Add missing ASSERT for dwork & queue.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-11-20 10:15:20 +00:00
Lingao Meng
2a3b28a3f5 kernel: work: Remove meanless foreach for work
Since call this function both in
```C
	k_spinlock_key_t key = k_spin_lock(&lock);

	bool need_flush = work_flush_locked(work, flusher);

	k_spin_unlock(&lock, key);
```

So, there are no flag_get change.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-11-20 10:15:20 +00:00
Jakub Wasilewski
8e881959a4 boards: hifive_unmatched: add support for S7 and U74 targets
Add `hifive_unmatched//s7` (earlier selected by default, using
`hifive_unmatched`) and `hifive_unmatched//u74` targets.

Define work-area for other 4 cores in openocd.cfg

Update twister platform white/black lists, to support new targets

Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-20 10:15:03 +00:00
Jakub Wasilewski
2423c87d54 boards: hifive_unleashed: add support for E51 and U54 targets
Add `hifive_unleashed//e51` (earlier selected by default, using
`hifive_unleashed`) and `hifive_unleashed//u54` targets.

Define work-area for other 4 cores in openocd.cfg

Update twister platform white/black lists, to support new targets

Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-20 10:15:03 +00:00
Jakub Wasilewski
84434ba006 arch: riscv: add Kconfig option for imprecise FPU state tracking
According to the RISC-V Instruction Set Manual: Volume II, Version 20240411
(Section 3.1.6.6), some implementations may choose to track the dirtiness
of the floating-point register state imprecisely by reporting the state to
be dirty even when it has not been modified. This option reflects that.

Also add a filter in `tests/arch/riscv/fpu_sharing/` based on imprecise
FPU state tracking

Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-20 10:15:03 +00:00
Jakub Wasilewski
939e94076d boards: hifive_unleashed: switch zephyr SRAM region from DDR to L2LIM
Switch from `ram0` to `l2lim` in `zephyr, sram` in board DTS

Add `l2lim` in `support/hifive_unleashed.resc` and targets l2lim
as a work-area in `openocd_hifive_unleashed.cfg`

Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-20 10:15:03 +00:00
TOKITA Hiroshi
43db55a79b drivers: clock_contrl: Remove renesas,ra-clock-generation-circuit driver
Remove the renesas,ra-clock-generation-circuit driver, which is no longer
needed after migrating to the FSP-based implementation.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
f0219c35da drivers: pinctrl: Remove renesas,ra-pinctrl driver
Remove the renesas,ra-pinctrl driver, which is no longer
needed after migrating to the FSP-based implementation.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
8fe5544948 boards: arduino: uno_r4: remove CONFIG_PINCTRL from defconfig of uno_r4
This PR fixes #78619 for the Arduino UNO R4 Minima/Wifi board.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
ffe6099fed boards: arduino: uno_r4: Migrate to FSP
Update configuration for migrate to FSP

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
6376ee15be boards: mikroe: clicker_ra4m1: Migrate to FSP
Update configuration for migrate to FSP

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
183273ed3f dts: arm: renesas: ra4: Use renesas,ra-cgc-pclkblock driver
Switch the clock controller driver to renesas,ra-cgc-pclkblock
which can be used with FSP.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
397c48a13e dts: arm: renesas: ra4: Use renesas,ra-pinctrl-pfs driver
Switch the pinctrl driver to renesas,ra-pinctrl-pfs which can be
used with FSP.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
af2021ea4c soc: renesas: ra: ra4m1: Adapts the Option Setting Memory to FSP.
Since the Option Setting Memory area is set in FSP, the Kconfig value
switches between using the FSP implementation or the existing
Option Setting Memory implementation.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
c968d4eb81 soc: renesas: ra: ra4m1: Migrate to FSP-based configuration
Change to use FSP to integrate with other Renesas RA series.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
Anas Nashif
3364a35f05 Revert "irq: multilevel: compile 3rd level IRQ APIs only when enabled"
This reverts commit 2152b8e414.

This commit is breaking CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 22:40:13 -05:00
Anas Nashif
c3b2f44173 ci: testplan: do not deal with arch changes
This is generating lots of duplication and unnecessary builds when
multiple arches are being changed. Let's stick to basic coverage which
should be enough for PRs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 22:25:18 -05:00
Jordan Yates
b8360ad5ee sys_clock: extra time defines
Add additional time defines to round out the `SEC_PER_*` family.
These are easier to type than `SEC_PER_MIN * MIN_PER_HOUR` and
`SEC_PER_MIN * MIN_PER_HOUR * HOUR_PER_DAY`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-19 20:05:08 -05:00
Alberto Escolar Piedras
d703d9077f doc: 4.1 release & migration guide: Add native deprecation
Mention that CONFIG_NATIVE_APPLICATION &
CONFIG_NATIVE_SIM_NATIVE_POSIX_COMPAT have been deprecated.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-19 20:04:55 -05:00
Alberto Escolar Piedras
b77d896ff6 boards native_sim: Deprecate CONFIG_NATIVE_SIM_NATIVE_POSIX_COMPAT
This option existed only to make the transition from native_posix to
native_sim easier. As native_posix is going to be removed in v4.2
we deprecate this option now, so it will also be removed.

We also switch this option to default to false already now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-19 20:04:55 -05:00
Alberto Escolar Piedras
c4b7b684dc boards native: Deprecate CONFIG_NATIVE_APPLICATION
This option is used in tree only by native_posix, which is deprecated
and being replaced by native_sim. But may be used also in out of tree
targets.
As part of the native_posix deprecation, and therefore the lack of
testing this feature would have in the future, we are also deprecating
this option.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-19 20:04:55 -05:00
Yong Cong Sin
2152b8e414 irq: multilevel: compile 3rd level IRQ APIs only when enabled
This revert the idea of 3fa7d78 from #78845.

The 3rd level IRQ APIs won't compile when
CONFIG_3RD_LEVEL_INTERRUPT_BITS=0.

Updated testcase accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-19 20:04:32 -05:00
Sylvio Alves
fecf909a2a revert "boards: m5stack/m5stack_cores3: disable in twister"
This reverts commit 410c8a57e0 so that
m5stack_cores3 can be tested properly.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-19 20:03:55 -05:00
Sylvio Alves
d2a0c3315e boards: m5stack_cores3: update documentation
Modify this board docs to meet latest changes.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-19 20:03:55 -05:00
Sylvio Alves
6672e673b3 boards: m5stack_cores3: fix board configuration
This board has a few issues handled by this PR:
- Fix DTS entries to meet necessary flash partitions
- Fix wrong kconfig entries realted to SoC model

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-19 20:03:55 -05:00
Anas Nashif
fd4c7bbbc2 Revert "ci: twister: use workflow_call for prep job"
This reverts commit ac08acafdd.

Pull requests not working as expected.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 19:49:21 -05:00
Anas Nashif
2f0fcdf81c ci: twister: do not fail if there are no artifacts
Do not fail if we can't download any artifacts, i.e. when job is
cancelled.

Only publish on push/schedule

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 19:49:21 -05:00
Pieter De Gendt
1be5c157d9 scripts: ci: check_compliance: Add python lint/format check
Add a compliance test using ruff, for both linting and formatting of
newly added python files.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-19 18:36:54 -05:00
Pieter De Gendt
973eaff5a2 scripts: ci: Add ruff configuration files
Add a baseline toml file for current rule violations, and a default
configuration file.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-19 18:36:54 -05:00
Pieter De Gendt
4db97b5bb6 scripts: Add helper scripts for ruff baseline excludes
Add simple scripts to convert ruff check and ruff format output to
toml exclude sections.

These sections can be used to ignore baseline violations for an existing
codebase.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-19 18:36:54 -05:00
Pieter De Gendt
05c6517fc9 scripts: ci: check_compliance: Add support for end line and column
Reporting or annotating issues can be done on a range rather than a
single line.

Add support for end line and end column.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-19 18:36:54 -05:00
Lucien Zhao
95448ba21d boards: nxp: mimxrt1180_evk: set lptmr1 status as OK
set lptmr1 status as OK
test counter_basic_api passed on cm33/cm7 cores

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-19 18:36:31 -05:00
Lucien Zhao
e5ee95893c dts: arm: nxp: rt118x: add lptmr instances
Config/Enable lptmr1/2/3 clock
Add 3 lptmr instances for RT118X

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-11-19 18:36:31 -05:00
Bryce Wilkins
dacc462bbd west.yml: segger: RTT control block init mode Kconfigs
Kconfig options for RTT control block initialization and linker
section were added in #53569, however the Zephyr west.yml was not
updated to incorporate the Segger repository changes to make use
of the new Kconfig options.

This fixes that.

Signed-off-by: Bryce Wilkins <bryce.wilkins@gmail.com>
2024-11-19 18:35:45 -05:00
Daniel DeGrasse
71c80932a9 tests: drivers: build_all: display: fix conflicting nodelabels
Some nodelabels in the display build_all test overlay lacked a "test"
prefix, causing test failures on boards that also define displays with
this nodelabel. Prefix these nodes with "test" to resolve this issue.

Fixes #81610

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-19 18:35:32 -05:00
Benjamin Cabé
83356e924a doc: doxygen: improve formatting for kconfig alias
\verbatim is not giving the right output as we need an inline literal.
Switch to \c instead.

Fixes #81595.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-19 18:35:18 -05:00
Anas Nashif
71bb882221 tests: cpp: remove obsolete target
nrf54h20dk@0.8.0/nrf54h20/cpuapp was dropped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 18:21:19 -05:00
Tomasz Moń
e3acf5fa04 drivers: udc_nrf: handle overwritten Set Address commands
USBD peripheral automatically handles Set Address command which can
lead to state mismatch between USB stack and the host. Keep track of
device address and issue fake Set Address commands on mismatch.

This fixes default vs addressed state mismatch that can occur due to
sufficently high SETUP handling latency. The state mismatch was most
commonly seen as SET CONFIGURATION failure when the enumeration happened
during periods with increased latency.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-11-19 18:12:04 -05:00
Tomasz Moń
54dc01153c usb: device_next: check wIndex on Set Address
Set Address behavior is not specified when wValue is greater than 127,
or if wIndex or wLength are non-zero. USB stack did check wValue and
wLength but didn't care about wIndex value. Extend the check so non-zero
wIndex also results in STALL response.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-11-19 18:12:04 -05:00
James Roy
e569dfe175 doc: build: dts: Fix incorrect rst tag
Replaced incorrect ':c:func:' tag for devicetree macro
with ':c:macro' tag.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-19 18:10:16 -05:00
Krzysztof Chruściński
0852af215b drivers: pinctrl: nrf: Optimize access to gpd service
Request and release global power domain only once during setup
of pins. Request and release involves communication over IPC and
it should be avoided if possible. For example if there are 4 pins
(like in UART) where GPD is requested we can limit number of
request/release operations fourfold.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-19 18:09:47 -05:00
DineshKumar Kalva
749192a9fb Board: amd : add board support for the Audio DSP on ACP_6_0 soc.
Create a acp_6_0_adsp board support for
the Audio DSP on ACP soc.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
2024-11-19 17:53:11 -05:00
DineshKumar Kalva
173cc387a0 soc: amd: acp_6_0: add support for AMD ACP_6_0 soc.
Add a common part for AMD board ACP_6_0_ADSP.

Add support for ACP_6_0_ADSP BOARD,
which represents ACP_6_0 soc.

This has a 1 Xtensa HiFi5 core, with 200-800MHz
1.75 MB HP SRAM / 512 KB IRAM/DRAM,
1 x SP (I2S, PCM), 1 x BT (I2S, PCM), 1 x HS(I2S, PCM), DMIC as
audio interfaces.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
2024-11-19 17:53:11 -05:00
DineshKumar Kalva
eb9eff7018 west: sign: add support for AMD acp_6_0_adsp board.
Add support for signing acp_6_0 SOF with Zephyr images with rimage.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
2024-11-19 17:53:11 -05:00
DineshKumar Kalva
f64f36cb01 CODEOWNERS: add codeowner for SOF with Zephyr on AMD ACP_6_0.
Add myself and basavaraj as codeowners for ACP_6_0 related files
for SOF with Zephyr OS.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
2024-11-19 17:53:11 -05:00
Krzysztof Chruściński
662f412a35 tests: drivers: uart: async_api: Add nrf54h20 cpuppr
Add configuration for nrf54h20dk/nrf54h20/cpuppr.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-19 17:52:33 -05:00
Neil Chen
e5f0075dc6 board: frdmmcxc444: Add uart support
Add UART configuration and pin control. Set state to disabled,
as it serves as alternative to default LPUART0 or as second
uart only.

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-11-19 17:52:25 -05:00
Sergei Ovchinnikov
55c6a0eaa5 drivers: sensor: npm1300_charger: expose VBUS status
Add possibility to retrieve VBUS status of the nPM1300 charger through
its sensor APIs. Updated shields/npm1300_ek sample to use the new API.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2024-11-19 17:51:13 -05:00
Pisit Sawangvonganan
d81a8d452e drivers: ethernet: w5500: improve type consistency
Improve type safety and consistency by adjusting variable and
parameter types to avoid signed/unsigned comparisons and implicit casts.

Moreover, explicit casts were applied when converting from
`size_t` to `uint16_t`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-19 17:50:58 -05:00
Pisit Sawangvonganan
82e2709ed8 drivers: ethernet: w5500: make ethernet_api as const
This change marks `w5500_api_funcs`, an instance of
the `ethernet_api`, as `const`.

By using `const`, we ensure immutability, leading to usage of only
`.rodata` and a reduction in the `.data` area.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-19 17:50:58 -05:00
Nazar Palamar
6172092730 test: arm: irq: Add overlays files for Infineon boards
Changed interrupt priority for GPIO, default 6 is not suitable for
for the ZERO_LATENCY_IRQS function used in this test.
used in this test.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-11-19 17:50:44 -05:00
Nazar Palamar
697efe8b50 Infineon: board: Add CONFIG_GPIO to defconfigs
Add CONFIG_GPIO from defconfigs for Infineon boards.

Revert pull/81377, which affect some ble samples which
used GPIO.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-11-19 17:50:44 -05:00
Daniel DeGrasse
35f6c4922e dts: bindings: timer: move a few counter bindings to correct location
A few bindings in the timer directory (for kernel timing sources) were
being used for counters (which can have alarms set, and have a distinct
API). Move these bindings to the counters directory.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-19 17:50:04 -05:00
Anas Nashif
ac08acafdd ci: twister: use workflow_call for prep job
Use workflow_call to allow for different type of nodes depending on
event.

On push, we do not need to use zephyr runners, GH runners are enough and
are much faster to deploy and start.

This resolves an issue where push jobs will have to be queued for a
longer time waiting for the prep step, once the prep step is done, we
will have to wait one more time in the queue for requested nodes.

This should speed up execution of push events in CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 17:48:11 -05:00
Anas Nashif
0a8b16693f ci: twister: split publishing results out of main workflow
Move publishing data to ES to a workflow_run step. This way we can
change the main workflow to use pull_request instead of
pull_request_target.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 17:48:11 -05:00
Adrian Warecki
903b7cf9b6 mm: tlb: Add a mmu support in update page flags function
Platforms that support mmu require memory page access flags to be set in
both tlb and mmu. Add mmu flag update in sys_mm_drv_update_page_flags
function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-11-19 16:23:52 +01:00
Adrian Warecki
e4a9503706 mm: tlb: Improve the context saving function
Attempt to invalidate cache for an unmapped address results in cpu
exception for the ptl platform. Perform cache invalidation after
translation activation in tlb. Add address mapping in mmu for platforms
that have it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-11-19 16:23:52 +01:00
Adrian Warecki
750212c2a9 mm: tlb: Remove ARG_UNUSED macro invocation
The flags parameter in the sys_mm_drv_map_page function is used, so the
ARG_UNUSED macro invocation is unnecessary. Remove this macro usage to
clean up the code and improvs code readability and maintainability.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-11-19 16:23:52 +01:00
Håvard Reierstad
b38773f14b Bluetooth: Mesh: Use net xmit params for bridge
Makes sure that the Network Transmit state is used when using a Subnet
Bridge.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-19 10:12:19 -05:00
Håvard Reierstad
665a555e75 Bluetooth: Mesh: Use relay bufs/pool for brg_cfg
Adds support for using relay buffers and advertising set for the subnet
bridge feature, even if the relay feature is disabled.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-19 10:12:19 -05:00
Krzysztof Chruściński
d231b459df drivers: misc: coresight: Enable log colors for STMESP logging
Allow coloring of error and warning messages decoded by the ETR
decoder.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-19 10:12:05 -05:00
Krzysztof Chruściński
9917ea4fe6 logging: formatting: Allow coloring in custom cases
In order to support error and warning message coloring
LOG_BACKEND_SHOW_COLOR must be set. Allow setting it for
customized cases.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-19 10:12:05 -05:00
Fabian Kainka
c6b663e50b drivers: modem: initialize variables to avoid warn
The variables 'first' and 'next' in function 'stats_buffer_list_first()'
and 'stats_buffer_list_next()' were potentially used uninitialized.

Depending on the compiler and target architecture, this can lead to
different behavior, including warnings or errors when using strict
warning flags.

By initializing these pointers to 'NULL', we ensure consistent and
expected behavior across all toolchains and configurations.

Signed-off-by: Fabian Kainka <kainka@cognid.de>
2024-11-19 10:04:58 -05:00
Nikodem Kastelik
5f6fc8ad5d soc: nordic: nrf54l: tune configuration of DCDC regulator
DCDC regulator on nRF54L may not always works as intended.
Tune the fix addressing that.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-11-19 10:04:43 -05:00
Nikodem Kastelik
b7fb1012b0 soc: nordic: nrf54l: fix configuration of DCDC regulator
DCDC regulator on nRF54L may not always works as intended.
Apply a fix addressing that.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-11-19 10:04:43 -05:00
Nikodem Kastelik
17a81280b2 soc: nordic: nrf54l15: fix APPROTECT handling
To configure APPROTECT on nRF54L15 different set of MDK symbols
must be used. Additionally, nRF54L15 does not support loading
APPROTECT configuration from the UICR in runtime.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-11-19 10:01:07 -05:00
Anas Nashif
cfd5469dc1 ci: do not pull babblesim in twister test workflow
No need to pull babblesim and nrf_hw_models when doing twister testing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 09:57:13 -05:00
Anas Nashif
01ff1de91a ci: testplan: resolve board files when testing with targets
When using the -p option, changes to boards are irrelevant. This is true
in the clang workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 09:54:28 -05:00
Johann Fischer
1687e192b5 samples: usb: add new WebUSB sample
Add a WebUSB sample that uses the new USB device support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-19 09:53:29 -05:00
Johann Fischer
6ee1358519 usb: device_next: support BOS descriptor with vendor request code
Platform capability descriptors such as MSOSv2 or WebUSB BOS have a
vendor request code that is used by the host to perform vendor-specific
requests. Add a convenient way to define and register a platform
capability descriptor with a vendor request node.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-19 09:53:29 -05:00
Johann Fischer
34f42d6c71 usb: device_next: support vendor request with recipient device
Allow the user to register a vendor request node identified by the
vendor code (bRequest) and containing two callbacks to handle the vendor
request. The device stack uses the vendor request node to call the
vendor request callbacks when it receives a request of type Vendor,
recipient Device, and bRequest value equal to the vendor code.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-19 09:53:29 -05:00
Johann Fischer
2d90df407f samples: usb: add samples function to setup USB device only
Add a function similar to sample_usbd_init_device(), but one that does
not initialize the device. It allows the application to set additional
features, such as additional descriptors.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-19 09:53:29 -05:00
Anthony Wertz
a1474a9868 drivers: audio: dmic_nrfx_pdm: change log level in PDM read
Currently the dmic_nrfx_pdm read implementation treats a timeout as an
error, in that a logging error message is produced when no PDM data is
available. However, for non-(or minimally-)blocking applications this is
normal behavior. Classified this way, the logger is flooded with error
messages unnecessarily, unless the log level is changed for the dmic
module, which is not desirable.

This modification simply changes the log-level to debug so the
application user can then decide whether or not a failed read needs to
produce an error message.

Signed-off-by: Anthony Wertz <awertz@pm.me>
2024-11-19 09:53:20 -05:00
Rafał Kuźnia
e18410944e modules: hal_nordic: add NRFX_GPPI config
The nrfx_gppi module is an abstraction over nrfx_ppi and nrfx_dppi
drivers. It now has a Kconfig option that is separate from nrfx_dppi and
by default it enables all PPI/DPPI instances, if available.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-11-19 09:53:10 -05:00
Rafał Kuźnia
40d9dae867 modules: hal_nordic: rework resource reservations
The resource reservation definitions were moved to a separate header
file.

The PPIB and DPPI channel and group resources can now be statically
allocated for each individual instance.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-11-19 09:53:10 -05:00
Rafał Kuźnia
bf66012544 modules: hal_nordic: Enable nrfx_ppib drivers
The new nrfx_ppib driver can now be enabled, when the corrensponding
device tree node has the okay status.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-11-19 09:53:10 -05:00
Rafał Kuźnia
61d72936cb dts: nordic: 54l: Add PPIB device tree nodes and bindings
Added a binding description for the PPIB peripheral and added the device
tree nodes of the PPIB instances to the nRF54L15 and nRF54L20.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-11-19 09:53:10 -05:00
Rafał Kuźnia
d6007690de manifest: update hal_nordic revision
The hal_nordic revision was updated to bring in NRFX v3.8.0.

Aligned the uses of single-instance API to use multi-instance instead.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-11-19 09:53:10 -05:00
Declan Snyder
b070da7c33 dts: nxp,mcux-edma: Convert compats to prop
Convert the numerous revision compatibles to a DT property for the
revision called nxp,version (inspired from a linux DT property from
st called st,version on their DMA).

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-19 09:52:57 -05:00
Khoa Nguyen
8e46d26106 drivers: i2c: Add config I2C for EK-RA8D1 and MCK-RA8T1
Add config support I2C for EK-RA8D1 and MCK-RA8T1.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-11-19 09:52:44 -05:00
Tri Nguyen
c8938737c0 drivers: i2c: Support for RA6 devices
Add devices node that support I2C for RA6 boards

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
2024-11-19 09:52:44 -05:00
Henrik Brix Andersen
110c81f2f7 boards: others: add candleLight USB to CAN 2.0B adapter board
Add support for the open-hardware candleLight USB to CAN 2.0B board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-11-19 09:52:35 -05:00
Emil Gydesen
8e017ebff3 tests: Bluetooth: Audio: Increase RX buf count for bsim
The tests were using the default of 1 which is very low,
especially when we might have multiple RX streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-19 09:52:28 -05:00
Yishai Jaffe
a40e900970 boards: stm32f4_disco: Add pwm leds
Add four PWM leds for stm32f4_disco in order to run the
samples/basic/fade_led application.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-11-19 09:52:09 -05:00
Djordje Nedic
918cbc5146 soc: Move up SRAM definitions for stm32h56/7x
This moves the SRAM definitions for STM32H56/7x chips up to the top
level since they are common to all of them.

Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
2024-11-19 09:52:02 -05:00
Lingao Meng
b54f49cb8c Bluetooth: Mesh: Fix proxy advertising set sending Mesh messages
When start to sending proxy advertising, will also process in
send_pending_adv, but the bt_mesh_adv_get_by_tag will directly return
buffer from bt_mesh_adv_queue or bt_mesh_relay_queue, which case
mesh messages sent on different sets, can cause peer replay attack.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-11-19 09:51:51 -05:00
Piotr Kosycarz
6056a9237f soc: nordic: add configuration for nrf54h20 flpr core
To properly execute erase, recover and reset.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-11-19 09:51:43 -05:00
Krzysztof Chruściński
581c55496d pm: device_runtime: Fix bitfields misuse
PM_DEVICE_FLAG_ISR_SAFE is an enum and it must be converted to
a bit mask before masking with flags.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-19 09:51:14 -05:00
Jens Rehhoff Thomsen
b478ffe2ef Bluetooth: host: Fix bug in disconnected handling
When disconnected only the first empty slot in the disconnected_handles
array should be updated.

Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
2024-11-19 09:50:41 -05:00
Jamie McCrae
5b28751bf4 west.yml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  eb942067989569f9cf319b087d0bb16b16effd86

Brings following Zephyr relevant fixes:
  - eb942067 Allow bootstrapping for multiple images
  - d59ae346 boot_serial: Support sha256, sha384 and sha512
  - bcffc62c boot: bootutil: boot_record: Fix issue with saving
    image data
  - 099f4284 boot: zephyr: Add fallback for overhead calculation
    when auto fails
  - ab014436 boards: mcxn947_qspi: fix mcuboot partition allocation
  - bd7423d1 boot: zephyr: Add warning on default key file usage
  - a03c95f6 doc: remove repetition
  - 040fc42a boot/zephyr: Load image to RAM on single loader
  - 84c68ace boot/zephyr: Add
    CONFIG_SINGLE_APPLICATION_SLOT_RAM_LOAD
  - 77d911f4 boot/bootutil: Add
    MCUBOOT_SINGLE_APPLICATION_SLOT_RAM_LOAD mode
  - 0c721da7 boot/bootutil: Split RAM load code to its own file

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-19 09:50:25 -05:00
Fabrice DJIATSA
94a6ed68a1 dts: arm: st: c0: add spi node in dtsi file
- stm32cO11/31 share the same spi peripheral

- include stm32_dma header to be able to configure
spi with dma config macros (STM32_DMA_PERIPH_TX,...)
in dts

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-11-19 09:50:08 -05:00
Jilay Pandya
6098b2f673 drivers: stepper: tmc5041: use tmc5xxx generalized macros
This commit refactors tmc5041 driver to use tmc5xxx generalized macros

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-19 09:49:53 -05:00
Jilay Pandya
f3a868ad90 drivers: stepper: tmc5xxx: generalized macros for tmc5xxx
This commit generalizes macros which are common to tmc5xxx drivers

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-19 09:49:53 -05:00
Benjamin Cabé
2cef2781be doc: releases: expose draft 4.1 release notes + migration guide in toc
Update toctrees to show 4.1 documents in the release page

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-19 09:49:11 -05:00
Alberto Escolar Piedras
93c03214fa tests: Thread-Metric: Filter properly native targets
There is more native targets than native_sim and native_posix.
Let's exclude them all by architecture.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-19 08:52:05 -05:00
Jan Faeh
2efc8598e3 drivers: sensor: SCD4x Add driver
This adds support for Sensirion's SCD4x co2 sensor.

Signed-off-by: Jan Faeh <jan.faeh@sensirion.com>
2024-11-18 19:38:10 -05:00
Jilay Pandya
428db04fd5 doc: migration-guide: 4.1: rename gpio-stepper compatible
add entry in migration guide 4.1 about renaming of compatible from
zephyr,gpio-steppers to zephyr,gpio-stepper

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
Jilay Pandya
f04f924d52 MAINTAINERS: Add collaborators in stepper drivers
- bjarki-andreasen
- dipakgmx
- fabiobaltieri
- faxe1008

This commit adds dipakgmx as collaborator in stepper drivers

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
Jilay Pandya
1e142b0001 drivers: stepper: shell: fix null pointer check
This commit introduces null pointer check in print_callback

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
Jilay Pandya
195c2c1360 drivers: stepper: fix stepper_set_event_callback c prototype and definition
This commit fixes incorrect c prototype and defintion of
stepper_set_callback to stepper_set_event_callback

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
Jilay Pandya
843625a29b drivers: stepper: change gpio-stepper dt-compatible
This commit changes compatible of gpio-stepper in driver

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
Jilay Pandya
df3b76b55a drivers: stepper: gpio: introduce power down coils function
power down coils when gpio stepper is disabled

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
Peter Mitsis
9e7d182375 doc: Update licensing page
Updates the licensing page to indicate that the thread_metric
benchmark uses the MIT license.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-11-18 19:32:02 -05:00
Peter Mitsis
95a97fd287 tests: Port Thread-Metric benchmark from ThreadX
Ports the Thread-Metric suite of benchmarks from ThreadX to Zephyr.
This makes it easier for others to run these benchmarks with the
best set of configuration options for their board so that
they can better compare Zephyr performance to another RTOS.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-11-18 19:32:02 -05:00
Eric Ackermann
c9ce311aaa drivers: dma: Add Xilinx AXI DMA driver
The Xilinx AXI DMA Controller is commonly used in FPGA designs.
For example, it is a part of the 1G/2.5G AXI Ethernet subsystem.
This patch adds a driver for the Xilinx AXI DMA that supports
single MM2S and S2MM channels as well as the control and status
streams used by the AXI Ethernet subsystem.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2024-11-18 19:31:20 -05:00
Reto Schneider
057528b894 docs: dma: Fix typo and grammar
This fixes the spelling of the word expected, ads a missing comma.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-11-18 19:31:10 -05:00
Reto Schneider
0841bcff78 docs: dma: Explicitly allow reconfiguration
This explicitly documents that a configured DMA channel can be
reconfigured.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-11-18 19:31:10 -05:00
Florian Grandel
becd9e5b92 scripts: dts: edtlib: fix type docs
The return type of 'uint8-array' properties was not yet documented.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-11-18 19:30:57 -05:00
Florian Grandel
be4acee09a scripts: dts: edtlib: type hints
Adds type hints to functions that were not yet typed.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-11-18 19:30:57 -05:00
Florian Grandel
0f1549c575 scripts: dts: edtlib: simplification
Small refactorings to simplify code and improve method encapsulation.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-11-18 19:30:57 -05:00
Florian Grandel
4bd584cf21 scripts: dts: edtlib: improve Node encapsulation
Moves several node-specific operations inside the Node class to improve
its encapsulation, remove a monkey patch and access to internal methods
and fields.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-11-18 19:30:57 -05:00
Daniel Leung
d3695c3284 tests: CONFIG_TEST_USERSPACE selects CONFIG_USERSPACE
CONFIG_TEST_USERSPACE should select CONFIG_USERSPACE as they
should be enabled together. It is no use to enable userspace
tests without enabling userspace.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 19:30:50 -05:00
TOKITA Hiroshi
2bb0a504a7 include: dt-bindings: gecko: Correct include-guard
Both `include/zephyr/dt-bindings/pinctrl/gecko-pinctrl.h` and
`include/zephyr/dt-bindings/pinctrl/gecko-pinctrl-s1.h` define
`ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_H_`
to prevent duplicate inclusion.

Changed it to `ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_S1_H_`
in `include/zephyr/dt-bindings/pinctrl/gecko-pinctrl-s1.h` side.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-18 19:30:41 -05:00
TOKITA Hiroshi
c144ebf723 include: intertupt_controller: esp32: Correct include-guard
Both `include/zephyr/drivers/interrupt_controller/intc_esp32.h` and
`include/zephyr/drivers/interrupt_controller/intc_esp32c3.h`
define `ZEPHYR_INCLUDE_DRIVERS_ESP_INTR_ALLOC_H__` to prevent
duplicate inclusion, so it cannot be properly prevented.

Change to a file path name-based definition.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-18 19:30:41 -05:00
TOKITA Hiroshi
3f870b316f include: dma: smartbond: Correct include-guard
Both `include/zephyr/drivers/dma/dma_smartbond.h` and
`include/zephyr/dt-bindings/dma/dma_smartbond.h` define `DMA_SMARTBOND_H_`
to prevent duplicate inclusion, so it cannot be properly prevented.

Change to a file path name-based definition.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-18 19:30:41 -05:00
Pisit Sawangvonganan
3a6e36d548 drivers: serial: stm32: make poll-out function to pass data by value
Passing data by value is more efficient in this context. As such,
revise `poll_out_fn` and `uart_stm32_poll_out_visitor` to accept
the `out` argument by value instead of by address.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-18 19:30:17 -05:00
Jukka Rissanen
bffa312ea6 net: context: Fix the connect check for IPv4
Make sure that we cannot connect to IPv4 multicast or broadcast
destination address for a TCP socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
624f28cb65 tests: net: socket: udp: Add IP_MULTICAST_IF set/get testing
Add tests that verify that IP_MULTICAST_IF socket option
set/get works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
d3bac7047d net: socket: Add support for IP_MULTICAST_IF option
Allow user to set the network interface for multicast sockets
of type SOCK_DGRAM.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
056a3d3242 net: if: Add helper to return the first IPv4 address for iface
This is helper is only needed in socket multicast interface selection
where we need to get one address from the interface so that it will
tell (when getsockopt() is used), the interface IPv4 address where
multicast packets will be sent. This is private function which is not
needed in public headers so place the prototype to net_private.h file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
0bd6f3b3f0 net: if: Fix source interface select for IPv4 address
Do the selection same way as in IPv6 so that if user supplies
unspecified destination address, the default interface is selected
the same way.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
51763d834b tests: net: socket: udp: Add IPV6_MULTICAST_IF set/get testing
Add tests that verify that IPV6_MULTICAST_IF socket option
set/get works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
7bf9f599b1 drivers: net: loopback: Allow tests to control address swapping
Some of the network tests require that source and destination
addresses are not swapped so allow test to control the address
swapping from the test.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
96d4f84a52 net: socket: Add support for IPV6_MULTICAST_IF option
Allow user to set the network interface for multicast sockets
of type SOCK_DGRAM.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Dane Wagner
2f3a70ea4e drivers: i2c: Call correct I2C device definition macros
If CONFIG_I2C_STATS is enabled, the device state for all I2C controller
drivers must contain the I2C stats. This space is allocated by calling
Z_I2C_INIT_FN as part of the device definition; this is done automatically
when using I2C_DEVICE_DT_DEFINE instead of DEVICE_DT_DEFINE. If space
for statistics is not properly allocated but CONFIG_I2C_STATS is enabled,
an unexpected write to memory outside of the stats region may occur on
an I2C transfer. This commit uses I2C_DEVICE_DT_DEFINE or
I2C_DEVICE_DT_INST_DEFINE for all in-tree SPI controller drivers that do
not already.

Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
2024-11-18 19:29:42 -05:00
Alberto Escolar Piedras
a785548df6 bluetooth: CTS: Fix includes to avoid build error with some libCs
Remove unnecessary include in header and source file.

gmtime_r() is an extension to the C library, and therefore one
needs to explicitly ask for its prototype to have it exposed.
This is done by defining _POSIX_C_SOURCE so let's do so.

These two changes fix build errors with some libCs.
Tested with pico, newlib, minimal and the host glibc.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-18 19:29:32 -05:00
Laurentiu Mihalcea
4789820722 dma: remove isr-ok tag from channel request and release
The channel filter and release functions can be used by some
DMA drivers to perform blocking operations (i.e: allocating,
de-allocating channel resources). In such scenarios, the
channel request and release functions become unsuitable for usage
inside ISRs. Drop the `isr-ok` tag and add comments regarding this
behavior being driver-dependent.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-11-18 14:03:39 -05:00
Laurentiu Mihalcea
513aa787a4 dma: add channel release callback
This is useful for releasing channel resources "allocated" during
channel request. These resources can refer to enabled IRQs, PDs,
etc...

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-11-18 14:03:39 -05:00
Jianxiong Gu
4a2f89bcc6 drivers: tcpc: ps8xxx: Remove unreachable return
Remove unreachable return in ps8xxx_tcpc_vconn_discharge.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2024-11-18 14:03:23 -05:00
Marcin Niestroj
7d63646d35 shields: seeed_w5500: new shield
Support "W5500 Ethernet Shield" manufactured by Seeed Studio.

[1] https://www.seeedstudio.com/W5500-Ethernet-Shield.html

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-18 14:03:08 -05:00
Robin Kastberg
6532c2f0bb kernel: make z_is_idle_thread_entry take code ptr
This is causing errors on IAR toolchain.

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2024-11-18 14:02:56 -05:00
Anas Nashif
27d918e699 tests: cpp: remove non-existing target
nrf54h20dk@0.8.0/nrf54h20/cpurad was recently removed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-18 14:02:45 -05:00
Zihao Gao
1b8ad2cf40 Bluetooth: AVRCP: allow to parse unit info resposne.
Add AVRCP handler for UNIT INFO responses.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
498f81e45f Bluetooth: AVCTP: add error handling for fragmented message.
Fragmented AVCTP message is not supported now. Therefore
A error message is printed.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
5d322350b4 Bluetooth: AVCTP: check buffer length before use.
The buffer length shall be validated before extracting
Transaction ID and C/R field.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
3e2244d634 Bluetooth: AVRCP: fix bitfield issue.
The bit order can be incorrect when use bit field definition.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
9af026dcbf Bluetooth : AVRCP: allow to receive an AVRCP message.
This patch received an AVRCP message and remove timeout timers.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
4c932b4b80 Bluetooth: AVCTP: allow to receive an AVCTP message.
This patch received an AVCTP message and forward to the
upper layer, e.g., AVRCP.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
e0f1fb0bb6 Bluetooth: Shell: add command to obtain unit info
This patch allow to acquire the unit info of the remote device.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
3d9cf59fdd Bluetooth: AVRCP: allow to create and send AVRCP unit message
This patch defines the message format for AVCTP unit message.
This is the first out of the four types of commands and can be
used by the CT to obtain the unit info from the TG device.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
3a045fbeea Bluetooth: AVCTP: allow to create and send AVCTP message
This patch defines the message format for general AVCTP.
They would be further called by AVRCP layer.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
36acb89803 Bluetooth: AVRCP: add shell tools for AVRCP functions.
Only the basic functions for establishing an AVCTP connection
are provided at this stage.
An BR/EDR ACL connection is necessary before AVRCP function.
Register callbacks before utilizing AVRCP.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
4e0dc39e71 Bluetooth: AVRCP: Add SDP attributes.
This patch add SDP records for both CT and TG role.

The SDP attribute would be registered according to the configuration.

OBEX and Browsing commands are optional and yet not supported.

SDP registration is implemented at AVRCP level to simplify the
workload of the upper layer. We assume the App can have limited
knowledge on SDP structures.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
70b415dab6 Bluetooth: AVRCP: Implemation of AVRCP.
This patch implementing avrcp.c
New Kconfig BT_AVRCP is provided to enable this layer.
BT_AVRCP_TARGET and BT_AVRCP_CONTROLLER are then
provided to enable one of the two roles independently.
avrcp.h shows the APIs for the upper layer.

Only connection and disconnection interfaces are provided in this patch.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Zihao Gao
27f71b044a Bluetooth: AVCTP: Implementation of AVCTP.
This patch implementing avctp.c
New Kconfig BT_AVCTP is provided to enable this layer.
avctp_internal.h shows the APIs for the upper layer, i.e., AVRCP.

Only connection and disconnection interfaces are provided in this patch.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-11-18 13:19:07 -05:00
Georgij Cernysiov
d52438f435 drivers: clock_control: stm32h7: disable PLLs before configuration
Disable every PLL before configuration. That allows
an application to reconfigure PLLs after a bootloader
configuration.

Don't disable the PLL clock if it is used by (Q|O)SPI
when executing from external memory. That will lead
to a stall.

Note: when (Q|O)SPI runs from PLL, the bootloader
dictates the clock configuration. There is no clock
reconfiguration support for memory map mode in
(Q|O)SPI drivers.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-11-18 13:19:00 -05:00
Filip Kokosinski
0edc89c63b dts/x86: use proper unit-address values
This commit changes the way some x86 devicetree set the unit-address values
of memory nodes. Before the change, they were always set to `0`. After the
change, they are derived from the `DT_DRAM_BASE` macro to match the first
address specified by the reg property.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-18 13:18:53 -05:00
Pieter De Gendt
d37ae60751 scripts: west_commands: zephyr_ext_common: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
76864957fd scripts: west_commands: export: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
14f9164ee1 scripts: west_commands: twister_cmd: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
dd4747ff32 scripts: west_commands: shields: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
f8ec1c8a00 scripts: west_commands: completion: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
a74c9be593 scripts: west_commands: boards: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
d3ecdd9b5b scripts: west_commands: blobs: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
efe3d46531 scripts: west_commands: bindesc: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
45a3b6b731 doc: develop: west: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Emil Gydesen
0fa9701a26 Bluetooth: Tester: Added flag parameter to CAP stop cmd
Added a flag parameter so that it is possible
to use the bt_cap_initiator_unicast_audio_stop to perform
disable+stop without releasing the streams by setting the
RELEASE flag.

This allows us to use the bt_cap_initiator_unicast_audio_stop
function to just disable streams without releasing them,
as that is requested by some PTS tests such as
CAP/INI/UST/BV-40-C.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-18 13:18:32 -05:00
Daniel Leung
7ea6da0521 boards: intel_adsp/ace30: enable building with Zephyr SDK 0.17.0
Zephyr SDK 0.17.0 adds the toolchain for the Intel Audio DSP
ACE 3.0 platforms. We can now add the bits to enable building
the boards with SDK 0.17.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 13:18:22 -05:00
Daniel Leung
b889360b36 tests: posix/common: set CONFIG_MAX_THREAD_BYTES=3
Boards intel_adsp/ace30/ptl* needs more for thread objects.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 13:18:22 -05:00
Daniel Leung
74817cbc2c tests: mem_map: do not run on Intel Audio DSP SoCs
Amend the filtering so that the normal mem_map (with exec) test
is not going to run on Intel Audio DSP SoCs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 13:18:22 -05:00
Daniel Leung
06e6a84b1d tests: copy intel_adsp_ace30_ptl.conf to *_sim.conf
With the rename of intel_adsp/ace30_ptl to intel_adsp/ace30/ptl,
the "sim" variant no longer inherit the base configuration. So
make a copy of the .conf file to explicitly target the sim
variant.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 13:18:22 -05:00
Fin Maaß
cf4a398477 drivers: flash: spi_nor: add option for 4byte opcodes
some flashes support special opcodes
for 4-byte addressing, that can be used
without switching to 4-byte mode.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-18 13:18:08 -05:00
Emil Gydesen
1f55b8d8a4 tests: Bluetooth: Tester: Increase conn interval
Increase the conn interval from 30 to 60 for more stability
in test with multiple lower testers (up to 3).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-18 13:18:00 -05:00
Sylvio Alves
c7a592b3e0 soc: esp32c6: add Wi-Fi support
Enables Wi-Fi support.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-18 13:17:54 -05:00
Martin Stumpf
5d4f4acc7d docs: add release notes for #81184
Added release notes for PR #81184.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-18 13:17:43 -05:00
Martin Stumpf
7c24bd8520 samples: drivers: display: adjust alpha handling
ARGB8888 values all had alpha '0x00' (=transparent).
Changed them to '0xFF' and added a transparency test patch in the middle
of the screen.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-18 13:17:43 -05:00
Martin Stumpf
b816a2926d drivers: display_sdl: fix incorrect color conversion
Non-alpha colors were converted to colors with `0x00` alpha, which makes
them fully transparent.

The correct way would be to add a `0xff` alpha, which this change does.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-18 13:17:43 -05:00
Martin Stumpf
02d562e9b8 drivers: display_sdl: add alpha support
While the driver was already capable of processing `ARGB8888` data,
it did not actually show the alpha value in any way.

This change adds a checkerboard background that shows transparent
regions.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-18 13:17:43 -05:00
Martin Stumpf
86a126dba4 samples: modules: lvgl: fix integer overflow
`lv_task_handler()` returns a `uint32_t`, but `k_msleep` takes a
`int32_t`.

If no timer exists, `lv_task_handler()` returns `UINT32_MAX` to indicate
that we should wait forever. However, this gets auto-cast to `-1`,
indicating to `k_msleep` to not wait at all, creating a busy loop.

Hence, a clamping to `[0, INT32_MAX]` is required.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-18 13:17:43 -05:00
Martin Stumpf
3eae0201c8 samples: modules: lvgl: add screen_transparency sample
Adds a sample that renders the simple `hello world` LVGL demo
with a transparent background, to demonstrate ARGB8888 framebuffer
capabilities.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-18 13:17:43 -05:00
David Schneider
ded2e0ba4a drivers: udc_stm32: set address only for standard device requests
Any request 5 did set the address even if it's a non standard
request like vendor specific requests.

Signed-off-by: David Schneider <schneidav81@gmail.com>
2024-11-18 13:17:31 -05:00
Chris Friedt
8ac483fdd4 scripts: west_commands: core: run netcat with check_call()
Netcat (nc) does not handle SIGINT. It silently ignores it.

We cannot use run_client(), given that the pydoc for
run_client() specifically contains "Run a client that
handles SIGINT".

Instead, use check_call(), which correctly handles Ctrl+C.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-18 13:17:21 -05:00
Daniel Leung
01f8e0fa2d demand_paging: eviction: add kconfig CONFIG_EVICTION_TRACKING
This adds a new kconfig for eviction algorithm which needs page
tracking. When enabled, k_mem_paging_eviction_add()/_remove()
and k_mem_paging_eviction_accessed() must be implemented.
If an algorithm does not do page tracking, there is no need to
implement these functions, and no need for the kernel MMU code
to call into empty functions. This should save a few function
calls and some CPU cycles.

Note that arm64 unconditionally calls those functions so
forces CONFIG_EVICTION_TRACKING to be enabled there.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-18 13:16:44 -05:00
Franciszek Pindel
eb24920093 dts: x86: intel: alder_lake: Add second core
Alder Lake have at least 2 cores. Both boards using this SoC
(up_squared_pro_7000 and adl) are configured with
MP_MAX_NUM_CPUS=2, so dts should contain at least one more core.

Signed-off-by: Franciszek Pindel <fpindel@antmicro.com>
2024-11-18 13:16:35 -05:00
Ludvig Jordet
1f9baa3ac3 Bluetooth: Host: Refactor legacy adv creation
This fixes #78721 which was introduced in PR #44686, which changed (and
renamed) `adv_new_legacy`/`adv_get_legacy` to return an existing
`bt_dev.adv` if it existed. This caused a problem, where the existing
adv then would be used to start advertising, and if this fails (because
the adv is already advertising, for instance), `bt_le_adv_start` would
erroneously delete the adv, making the host lose the context for the adv
which still is advertising.

Before PR #44686, this would not happen, because `bt_le_adv_start` would
return early when `adv_new_legacy` returned `NULL` and never reach the
delete call.

I have refactored this to make responsibilities a bit more clear:
`adv_create_legacy` now does 1 thing: create an ext adv and assign as
the legacy advertiser. This mirrors `bt_le_adv_delete_legacy` which does
the opposite. I have implemented error codes to match the behavior that
PR #44686 was made to implement.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2024-11-18 13:16:27 -05:00
Jamie McCrae
2f800cea8f soc: Remove re-defining some defined types
Removes re-defining some Kconfigs that are already defined
e.g. in arch

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-18 07:41:23 -05:00
Dario Binacchi
ed48de2583 boards: st: stm32f429i_disc1: doc: re-work flashing section
The patch modifies the "Programming and Debugging" and "Flashing" sections
to make the documentation clearer and consistent with what is reported for
other ST boards.

Suggested-by: Abderrahmane Jarmouni <git@jarmouni.me>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2024-11-18 07:26:17 -05:00
Dario Binacchi
3f6978e913 boards: st: stm32f429i_disc1: doc: support LTDC hardware
The building and flashing of the drivers/display and subsys/display/lvgl
examples confirmed that the LTDC peripheral is supported.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2024-11-18 07:26:17 -05:00
Dario Binacchi
7bca40cced boards: st: stm32f429i_disc1: doc: fix flashing info
The commit e17e54c48f ("boards: stm32: add flashing with stm32cubeprog
for all") did not update the documentation regarding the flashing
section, which no longer uses the OpenOCD runner by default.

Fixes: e17e54c48f
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2024-11-18 07:26:17 -05:00
Jukka Rissanen
247941f79d net: ipv6_fragment: Data in one frag must be multiple of 8
After we take the true MTU into account, we need to send proper
number of bytes (multiple of 8) in one IPv6 fragment.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
4c37d5a7bd tests: net: ipv6_fragment: Add PMTU testing
Enable PMTU so that we test it with IPv6 fragmentation code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
19f9ce5622 net: ipv6_fragment: Add PMTU support
If PMTU is enabled, then use the MTU value from it instead of always
using network interface MTU.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
265828634d tests: net: ipv4_fragment: Make test to run faster
Shorten the timeouts so that the tests are run in 6 second instead
of 15 seconds.

Use only native_sim for the tests so that the tests are run without
any extra delays.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
bdd5001e5b tests: net: ipv4_fragment: Add PMTU testing
Enable PMTU so that we test it with IPv4 fragmentation code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
b6618e8a53 net: ipv4_fragment: Add PMTU support
If PMTU is enabled, then use the MTU value from it instead of always
using network interface MTU.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
3d39cbd24d tests: net: pmtu: Add IPV6_MTU socket option tests
Make sure we can use IPV6_MTU socket option from application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
9fb09da21a net: Add support for IPV6_MTU IPv6 socket option
Add IPV6_MTU IPv6 socket option and implement getsockopt() and
setsockopt() calls for the option.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
74fc23872d tests: net: pmtu: Add IP_MTU socket option tests
Make sure we can use IP_MTU socket option from application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
a818839186 net: Add support for IP_MTU IPv4 socket option
Add IP_MTU IPv4 socket option and implement getsockopt()
call for the option. The IP_MTU option does not support
setsockopt() call.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
fad10f7370 net: shell: events: Set the command mask correctly
Set the commands to monitor correctly. Before this change some
events were missed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
f0172e7fce net: shell: events: Print PMTU event values
Print the changed PMTU value and IP address in the event monitor.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
ee497c3108 tests: net: pmtu: Add network event tests for pmtu
Verify that the PMTU changed events are generated and we can
catch them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
02ccb0e523 net: pmtu: Send net_mgmt event for changed path MTU
Send a network management event for a changed path MTU value.
Both IPv4 and IPv6 have their own events as we cannot mix these
because how the network event numbering space is implemented.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
55e582635f tests: net: pmtu: Add IPv4 specific PMTU TCP tests
Allow tests to check whether a IPv4 TCP connection MTU is changed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
9dba02f8f4 net: ipv4: Add PMTU support
Catch "Destination Unreachable" ICMPv4 messages and update PMTU for
a given destination IPv4 address.
Use that PMTU when sending data to the destination.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
d178eb2908 net: stats: ipv4: pmtu: Add Path MTU Discovery statistics
Add information about PMTU related packets received/sent/dropped
for IPv4.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
ab0ddc0bbe net: shell: Add pmtu command to the net-shell
Show information whether PMTU is enabled or not.
Show pmtu destination cache content with "net pmtu"
command. The "net pmtu flush" can be used to clear the
cache.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
281c4ac742 tests: net: pmtu: Add IPv6 specific PMTU TCP tests
Allow tests to check whether a IPv6 TCP connection MTU is changed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
e7e3afcd01 net: ipv6: Add PMTU support
Catch "Packet Too Big" ICMPv6 messages and update PMTU for
a given destination IPv6 address.
Use that PMTU when sending data to the destination.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
84b135e226 net: ipv6: Print verdict information
Print more cases when the packet is dropped, and also print
the upper layer verdict for the packet.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
026f88481d net: stats: ipv6: pmtu: Add Path MTU Discovery statistics
Add information about PMTU related packets received/sent/dropped
for IPv6.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
67c004d707 tests: net: pmtu: Add tests for path MTU discovery
Add initial tests for generic part of PMTU discovery code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Jukka Rissanen
3da2629715 net: ip: pmtu: Add generic IP PMTU Discovery support
This adds generic code that can be used by both IPv4 and IPv6
Path MTU Discovery mechanism. The actual PMTU support for each
protocol family is in subsequent commits.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 07:26:07 -05:00
Manuel Argüelles
15d357df87 soc: nxp: s32k: make the SoCs SEGGER RTT capable
SEGGER RTT is supported for NXP S32K1 and S32K3 devices.

Fixes #74702

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-11-18 07:25:40 -05:00
Yong Cong Sin
ea23856336 drivers: intc: plic: remove incorrect arch_proc_id() usage
The `arch_proc_id()` returns the hartid of a CPU, which may not start
from zero. The way that it's used as an index to access `save_irq[]`
array is wrong, use `arch_curr_cpu()->id` instead.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-18 07:25:31 -05:00
Chris Friedt
93a9a0966e tests: posix: common: mitigate warning for qemu_arc_em
Previously, twister would fail due to a warning being escalated to
an error because CONFIG_NET_TEST was set.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-18 07:24:52 -05:00
Anas Nashif
a732379d62 tests: display: cfb: fix filtering
Test was marked build only with filters in each scenario looking for
sdl-dc which is only available on native_sim, so cut the chase and use
platform_only to narrow things down to native_sim directly instead of
building the world to get information we already know.

reduces build/run time from 78s to 17s on invocation of twister with
default options, saves a ton more when running twister with --all.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-18 07:24:12 -05:00
Chaitanya Tata
f537cf311d drivers: nrfwifi: Remove passing unused flag
This flag is now unused in OSAL as it takes the input via the API.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-17 19:06:34 -05:00
Kapil Bhatt
62e06a5072 drivers: wifi: Fix offloaded raw TX feature flags
Pass passive scan and offloaded raw tx feature flags to OSAL.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-11-17 19:06:34 -05:00
Fabio Baltieri
13a2f42d50 input: kbd_matrix: implement stable poll period support
Implement a new stable-poll-period-ms property to specify a new (slower)
polling rate for when the matrix is stable.

The keyboard thread can eat up a surprisingly high amount of cpu cycles in
busy waiting if the specific hardware implementation happen to have a
particularly slow settle time, but high frequency polling is really only
needed when debouncing.

The new property allow slowing down the polling rate when the matrix is
stable (either key pressed but none to be debounced or idle in the case
of the gpio implementation with no interrupts), this allows reducing the
overall cpu time taken by the keyboard scanning thread when keys are
persistently pressed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-17 19:06:15 -05:00
Anas Nashif
410c8a57e0 boards: m5stack/m5stack_cores3: disable in twister
Do not run this board with twister. Temporary fix while we wait for a
fix.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-17 19:05:32 -05:00
Jamie McCrae
a6cca606db mgmt: mcumgr: transport: smp_lorawan: Update downlink function
Updates the function to account for a change in the arguments

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-11-17 17:15:10 -05:00
Håvard Reierstad
68361eacfa Bluetooth: Host: Fix unsafe ccc cast
Changes the implementation of `bt_gatt_is_subscribed` to use the
attribute read method instead of casting the user data pointer when
extracting the CCC Attribute Value.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-16 15:56:57 -05:00
Håvard Reierstad
43149c1056 Bluetooth: host: refactor bt_gatt_is_subscribed
Refactors `bt_gatt_is_subscribed` by changing a CHECKIF to an if
statement to avoid undefined behavior if CHECKIFs are "disabled".
Uses sizeof(a uint8_t) instead of 1 to avoid magic numbers.
Initializes `properties` to 0 to avoid undefined behavior.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-16 15:56:57 -05:00
Aaron Ye
f7b2638165 soc: ambiq: enable the TPIU clock source
This commit enables the TPIU clock source in Apollo3 and
Apollo4 soc initialization if LOG_BACKEND_SWO is used.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-11-16 15:56:49 -05:00
Aaron Ye
fe3c0ecb53 boards: ambiq: enable the ITM in Ambiq boards
This commit defines the default pinctrl of ITM for Apollo3 and
Apollo4 EVB. Also configures the default SWO frequency.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-11-16 15:56:49 -05:00
Aaron Ye
390f8329b4 dts: arm: ambiq: add ITM node for Apollo series
This commit adds the ITM node for Ambiq Apollo3 and Apollo4
series devicetree.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-11-16 15:56:49 -05:00
Jonathon Penix
2493123758 cmake: lld: Remove duplicate -fuse-ld=lld
-fuse-ld=lld is currently specified twice through the baremetal property
(in cmake/linker/lld/linker_flags.cmake) and TOOLCHAIN_LD_FLAGS (in
cmake/linker/lld/target.cmake). This doesn't really harm anything as
it isn't duplicated on the link line (and specifying it multiple times
wouldn't hurt even if it was), but it also doesn't really help anything.

-fuse-ld isn't baremetal-specific and setting it via TOOLCHAIN_LD_FLAGS
will cover this case anyway, so remove this duplicate.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-11-16 15:56:42 -05:00
Sudan Landge
c99243c8ce arch: arm: cleanup of soc flags in arch
What is changed?

Use CMSIS SystemCoreClock via a dedicated flag instead of using
soc flags.

Why do we need this change?

This change is part of cleaning soc specific code out of arch folder.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2024-11-16 15:56:11 -05:00
Bjarki Arge Andreasen
14117b453d pm: policy: separate default policy and events
The default policy currently directly references the private
variable next_event from policy_events.c to then convert the cycle
of said event (if exists) to a kernel tick in the future, something
policy_events.c already implements and exposes through
pm_policy_next_event_ticks().

Additionally, the implementation of pm_policy_next_state() in
policy_default.c already gets the nearest kernel tick, wherein
the next event has already been accounted for in, see
implementation of pm_system_suspend().

This commit removes the redundant and layer violating computation
if the tick of the next event from policy_default.c and updates
the test test_pm_policy_events to not use default policy to
determine if pm_policy_next_event_ticks() is correct.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-11-16 15:56:02 -05:00
Jukka Rissanen
8070e7ca6d tests: net: conn_mgr_monitor: Increase the sleep between states
The short sleep (10ms) was not enough any more. Increase the sleep
to 100ms so that system stabilizes between checks.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 15:55:49 -05:00
Jukka Rissanen
185269d86e net: shell: ipv6: Print information about SLAAC addresses
Print information in "net ipv6" command how the SLAAC addresses
are generated. There is the default legacy EUI-64 method (RFC 4862) or
the stable method described in RFC 7217.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 15:55:49 -05:00
Jukka Rissanen
3a5c6c54c1 tests: net: ipv6: Add tests for stable IIDs
Add tests that verify that stable IIDs generate a proper IPv6
interface identifier described in RFC 7217.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 15:55:49 -05:00
Jukka Rissanen
94177a200e net: ipv6: Add support for stable IID addresses
This implements support for RFC 7217 which describes a method
to have stable IPv6 Interface Identifiers to be used with IPv6
Stateless Address Autoconfiguration (SLAAC). The stable IIDs are used
to provide enhanced privacy so that an IPv6 address configured using
this method is stable within each subnet, but the corresponding
Interface Identifier changes when the host moves from one network
to another. This method is meant to be an alternative to generating
Interface Identifiers based on hardware (MAC) addresses,
such that the benefits of stable addresses can be achieved without
sacrificing the security and privacy of users.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 15:55:49 -05:00
Jamie McCrae
c9f3690ed4 kconfig: Remove deprecated option BOOTLOADER_SRAM_SIZE
Removes BOOTLOADER_SRAM_SIZE which was deprecated with Zephyr 3.6

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-16 15:55:42 -05:00
Yves Vandervennet
11f18c7340 boards: lpcxpresso55s69: enable multicore debugging
- Refactoring of the cmake code so LinkServer can be invoked with the
correct switches.
 - Documentation update

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-11-16 15:55:34 -05:00
Yves Vandervennet
7b29b66bd5 west: linkserver: change the default port number for semihost
LinkServer manages port numbers for gdb and semihost as separate linear
sequences when invoked to debug multi-core applications, e.g the
gdb-server instance for cpu0 will have the default GDB port 3333 and the
next gdb-server instance will be assigned the port 3334. The latter will
conflict with the default port for semihost which is 3334.

This patch changes the default port for semihost to 8888.
Port numbers can be changed when invoking the linkserver runner.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-11-16 15:55:34 -05:00
Marcin Szymczyk
26973bd054 snippets: nordic-*: support custom boards
Apply overlays for custom boards, based on already supported SoCs.

Fixes #77639.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-11-16 15:55:27 -05:00
James Roy
28238d03ad devicetree: Add DT_HAS_ALIAS macro
Add 'DT_HAS_ALIAS' macro to verify node alias existence.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-16 15:55:10 -05:00
Aleksander Wasaznik
3734268f90 Bluetooth: host: Remove useless alloc_buf_cb in test
The alloc_buf callback is not used when `seg_recv` is set, so it is
never called in this test. Remove it.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-11-16 15:55:02 -05:00
Corey Wharton
76bceb9ed2 kernel: mem_slab: always validate memory address on free
Allowing an invalid address to be "freed" when asserts are disabled
is dangerous and can lead to a very hard class of bugs (and potential
security issues) to troubleshoot. This change always validates the
address before adding it to the free list and calls k_panic() if
asserts are not enabled.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-11-16 15:54:56 -05:00
Ioannis Damigos
e330b55f81 soc/da1469x: Update sys_arch_reboot() function
Update sys_arch_reboot() function

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-11-16 15:54:45 -05:00
Daniel Leung
a6c1f80f46 tests: benchmarks/latency: limit CPU to 1 for Intel ADSP ACE
Due to addition of busy threads running on other cores, and
the simulator runs in single thread bouncing through all cores,
we are wasting quite a bit of time just busy waiting. This makes
each simulator run too long for CI. So limit CPU number to 1.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-16 15:54:36 -05:00
Alexander Kozhinov
e68c7f2f73 boards: arm: nucleo_h745zi_q
add fdcan1, fdcan2 and usb_fs DT configurations

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-11-16 15:54:27 -05:00
Torsten Rasmussen
cc488787ea cmake: source dedicated linker library properties for native builds
Native builds uses system libraries per default.
Instead of handling this in each linker_libraries.cmake files, then the
check for native build is moved one level up and for native build a
dedicated linker_libraries_native.cmake is sourced.

This simplifies the linker_libraries.cmake files as they no longer need
to check for native builds.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-11-16 15:28:20 -05:00
Torsten Rasmussen
d2896df821 cmake: set minimal C++ linker properties in minimal C++ CMake impl
The property based toolchain integration allows a cleaner design by
letting the toolchain define its properties and values and let CMake
implementation of Zephyr provided C and C++ libraries adjust those
properties when minimal C or C++ libraries are used.

This commit moves handling of C++ linker library properties into
the minimal C++ CMake implementation.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-11-16 15:28:20 -05:00
Guennadi Liakhovetski
44d96a2668 LLEXT: add llext_section_offset() to replace llext_find_section()
Now that section header cache is persistent, it can be used for
finding sections. Add a new function, similar to llext_find_section()
to use it and deprecate llext_find_section().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Guennadi Liakhovetski
c714f0e148 LLEXT: preserve section headers
Move cached section headers to struct llext from struct llext_loader
to preserve them after llext_load() returns.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Guennadi Liakhovetski
e2d8daae16 LLEXT: Xtensa: add a Kconfig option to enable -fPIC
Currently when building LLEXT for Xtensa we use the -fPIC compiler
option, but this cannot be used when using detached sections in
extensions. Add a Kconfig option to switch between the two
compilation modes and switch -fPIC off when building relocatable
(partially linked) ELF binaries.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Guennadi Liakhovetski
4f0cb90c59 LLEXT: fix advanced uses of detached sections
When detached sections are used, STB_GLOBAL relocations also have to
be processed depending on the relocation type. This commit unified
STB_GLOBAL and STB_LOCAL flows by making them use the same relocation
type parser, adds support for R_XTENSA_GLOB_DAT and R_XTENSA_JMP_SLOT
type relocations on Xtensa and fixes STT_SECTION address calculation
for such sections.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Guennadi Liakhovetski
2b3666109e LLEXT: fix detached section cache synchronisation
Detached sections are used in situ without being copied to or
referenced from ext->mem[] LLEXT region arrays. Their caches must be
synchronised accordingly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Guennadi Liakhovetski
ce32eea24a LLEXT: Xtensa: fix logging level
Use the same logging level as in the rest of LLEXT.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Guennadi Liakhovetski
ec02b815a7 LLEXT: (cosmetic) reduce the scope of a variable
Move a variable calculation inside the block, where it is actually
used.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 15:28:00 -05:00
Lukasz Majewski
835cbad6cc drivers: ethernet: lan865x: Avoid writing PLCA node count when nodeID not 0
The newest AN1760 application note - Revision F (DS60001760G - June 2024)
is recommending to not write the node count to PLCA_CTRL1 register when
the node is not the PLCA coordinator (i.e. its ID is not zero).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-11-16 15:27:45 -05:00
Lukasz Majewski
3ea491cb1c drivers: ethernet: lan865x: Update initial setup guidelines (from AN1760)
This patch brings update of the procedure to initially configure the
LAN865x devices. It follows setup guidelines from newest AN1760 [*].

The values from "TABLE1" on the [*] must be written to the device in the
indicated order with recommended values.

This was not the case previously, as first values from in-flash allocated
(const) table were written and only afterwards calculated configuration
parameters (cfgparams) were updated.

With this patch the lan865x_conf[] table is allocated in-RAM, so
placeholder values can be updated and it can be written at once at the
end of configuration process.
Its single entry has been reduced from 8B to only 4B. Moreover, moving
it out of flash saves 512B of flash memory.

Note:
[*] - AN1760 Revision F (DS60001760G - June 2024)

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2024-11-16 15:27:45 -05:00
Yves Vandervennet
04dee0025f boards: frdm_k22f: enable linkserver`
- add linkserver arguments in board.cmake
 - update documentation

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-11-16 15:27:39 -05:00
Jamie McCrae
0c7433dcaa boards: Remove PINCTRL from some boards
Removes lines from defconfig files having PINCTRL in them

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-16 15:27:31 -05:00
Andries Kruithof
f1f78682d9 Bluetooth: Audio: API for the distribute broadcast code procedure
Define the API for the distribute broadcast code CAP procedure

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-11-16 15:27:10 -05:00
Adam Cavender
a68a0a4a5b bluetooth: host: Update FAE table type for HCI commands
Update FAE table type from array of uint8_t to int8_t. From Vol 6.0,
Part B, section 2.4.2.52: "The ChFAE field contains the per-channel
mode-0 FAE table of the local Controller. Every per-channel mode-0
FAE value is represented by an 8-bit signed integer"

Signed-off-by: Adam Cavender <adam.cavender@nordicsemi.no>
2024-11-16 15:27:04 -05:00
Fin Maaß
fbea2ceba3 samples: net: cloud: aws_iot_mqtt: remove redundant kconfig
CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR is on
by default, if the device supports that, so there is no need
to enable it explicit.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-16 15:26:57 -05:00
Fin Maaß
3231b993ae samples: net: cloud: aws_iot_mqtt: use auto init
use auto init for networking, dhcp and sntp.
This simplifys the code of this sample by using the
auto init feature of the networking stack.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-16 15:26:57 -05:00
Fabio Baltieri
d6013e7044 input: it8xxx2_kbd: add a kso-ignore-mask property
The it8xxx2_kbd KSO pins can be used as both keyboard scan and GPIO. By
default the keyboard scanning driver controls the output level of all
the KSO signals from 0 to (col-size - 1), meaning that any line in
between used as GPIO is going to have its output value overridden.

Add a kso-ignore-mask property to the keyboard scan driver to allow
specifiying extra pins that should not be controlled by the driver.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-16 15:26:49 -05:00
Noemie Gillet
4355d07fcd test: posix: timer: fix format
change { 0 } to {0}

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-16 15:26:42 -05:00
Noemie Gillet
cbec9a342b test: posix: add test_one_shot__SIGEV_SIGNAL testcase
increase test coverage for newly added code

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-16 15:26:42 -05:00
Noemie Gillet
a214ddb2c9 posix: fix one-time timer for SIGEV_SIGNAL
For SIGEV_SIGNAL, the function zephyr_timer_wrapper() is the handler
between kernel and posix layer.
Here, for one-time timer, reload is equal to 0 and function returns.
As a consequence, handler function was never called.

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-16 15:26:42 -05:00
Ryan McClelland
37784442f8 tests: drivers: build_all: uart: add uart interrupt driven
Add CONFIG_UART_INTERRUPT_DRIVEN for building the uart driver

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-16 15:26:24 -05:00
Ryan McClelland
36772a8889 drivers: serial: cdns: fix interrupt driven uart
The tx fifo empty interrupt is a edge driven interrupt, so if it
is already empty then and the interrupt is enabled, it will not
fire so the isr needs to be triggered manually for the callback.

This also removes the unnecessary interrupt locking in the isr and
removes the receiver timeout interrupt.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-16 15:26:24 -05:00
Pisit Sawangvonganan
df24d0114c drivers: can: sja1000: reduce number of frame->id pointer dereferences
Refined `can_sja1000_read_frame` and `can_sja1000_write_frame` by
reducing `frame->id` pointer dereferences.
Using a local `id` variable aims to improve efficiency, given
the frequent execution of this code in CAN applications.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 15:25:55 -05:00
Emil Gydesen
f9b5de2d0a tests: Bluetooth: Tester: Set conn = NULL in btp_gap
bt_conn_le_create logs an error if the provided conn is
not NULL. This small change cleans up the log a bit to
avoid the warning.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 15:25:41 -05:00
Andrej Butok
92273c5754 samples: smp_svr: add common sysbuild true
Adds sysbuild: true to the common section,
to build the project using sysbuild.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-11-16 15:25:03 -05:00
Emil Gydesen
75f5f71200 tests: Bluetooth: Tester: Redefine service IDs as hex
Everything else is defined as hex, so it makes sense to
be consistent. This will also make it easier to find the
service IDs in the logs that primarily already log
commands and events as hex.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 15:24:08 -05:00
Emil Gydesen
9a5fa367ba tests: Bluetooth: Tester: Format BTP cmd/evt/rsp logs as hex
Since the values are defined as hex, e.g. 0x82, it is easier
to compare with the log if they also log them as such.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 15:24:08 -05:00
Ian Morris
44477ad732 drivers: serial: fix renesas ra8 sci_b uart hardware flow control enable
Fixed typo in Renesas RA8 SCI_B UART configuration that was preventing
hardware flow control from being enabled.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-11-16 15:23:24 -05:00
Chris Friedt
9504034733 sys: util: use BITS_PER_BYTE macro instead of the magic number 8
Obviously, everyone knows that there are 8 bits per byte, so
there isn't a lot of magic happening, per se, but it's also
helpful to clearly denote where the magic number 8 is referring
to the number of bits in a byte.

Occasionally, 8 will refer to a field size or offset in a
structure, MMR, or word. Occasionally, the number 8 will refer
to the number of bytes in a 64-bit value (which should probably
be replaced with `sizeof(uint64_t)`).

For converting bits to bytes, or vice-versa, let's use
`BITS_PER_BYTE` for clarity (or other appropriate `BITS_PER_*`
macros).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-16 15:22:35 -05:00
Jilay Pandya
5032d8ede8 drivers: stepper: add common helper header for tmc5xxx functions
This commit adds a common helper header for tmc5xxx driver

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 15:22:24 -05:00
Henrik Brix Andersen
3825c852e8 boards: fysetc: add FYSETC UCAN USB to CAN 2.0B adapter board
Add support for the open-source FYSETC UCAN USB to CAN 2.0B board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-11-16 15:22:10 -05:00
Henrik Brix Andersen
7f5351bc45 dts: bindings: vendor-prefixes: add fysetc
Add Shenzhen Fuyuansheng Electronic Technology Co., Ltd. devicetree vendor
prefix (https://www.fysetc.com/).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-11-16 15:22:10 -05:00
Adrian Gielniewski
9fd9e231df net: openthread: Add platform message management
* Add CONFIG_OPENTHREAD_PLATFORM_MESSAGE_MANAGEMENT to allow enabling
message management by the platform.
* Add implementation of `otPlatMessagePoolInit`, `otPlatMessagePoolNew`
and `otPlatMessagePoolFree`.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2024-11-16 15:21:20 -05:00
Gerard Marull-Paretas
a706461ea9 snippets: add serial-console
Add a new snippet to enable serial console. Even though most Zephyr
boards enable this by default, the same is not true for many real
boards, where enabling UART can increase power consumption. Having
this snippet may become handy on such scenarios. We could also
consider cleaning up upstream boards by just enabling this snippet
by default.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-16 15:21:14 -05:00
Gerard Marull-Paretas
40a73ec96e snippets: rtt-console: fix README issues
- Title underline too long
- Remove redundant how-to-use snippet bit, this can be documented
  generically for all snippets instead of repeating it everywhere.
- Snippet does not redirect anything.
- RTT does not require HW support for console.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-16 15:21:00 -05:00
Gerard Marull-Paretas
ce4ce9986a snippets: rtt-console: do not disable SERIAL
There's no point in disabling serial when enabling RTT. They are
not incompatible between each other.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-16 15:21:00 -05:00
Ren Chen
06f4213e6b driver: spi: support it8xxx2 spi driver
This commit adds the it8xxx2 spi driver support.

Tested with:
- west build -p always -b it8xxx2_evb samples/drivers/spi_flash

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-11-16 15:20:51 -05:00
Neil Chen
02027365f1 boards: nxp/frdm_mcxn236: Support MRT for NXP frdm_mcxn236 board
Enabled the MRT at the board level for mcxn236.

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-11-16 15:20:31 -05:00
Neil Chen
7e1f754f02 dts: arm/nxp: Add mrt nodes to NXP MCXN23x dtsi file
Add mrt nodes to NXP MCXN23x dtsi file

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-11-16 15:20:31 -05:00
Yishai Jaffe
b44ab89c4c samples: sensor: die temperature polling: remove redundant configuration
rpi_pico.conf only adds CONFIG_ADC=y which already exists in the
prj.conf so it's redundant and can be removed.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-11-16 15:20:24 -05:00
Tom Burdick
2b5012a5d9 kernel: Move run queue initialization
Move the initialization of the priority q for running out of sched.c to
remove one more ifdef from sched.c. No change in functionality but
better matches the rest of sched.c and priority_q.h such that the
ifdefry needed is done in in priority_q.h.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-11-16 15:20:15 -05:00
Pieter De Gendt
794dd05459 scripts: ci: check_compliance: Keep UNDEF list sorted
Keep the UNDEF_KCONFIG_ALLOWLIST list sorted, as mentioned in the
comment.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-16 15:20:03 -05:00
Pieter De Gendt
5d49d5c00c scripts: ci: check_compliancy: Add zephyr-keep-sorted regex support
To support checking for sorted blocks of multi-line text add
an optional regex pattern for the KeepSorted compliance check.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-16 15:20:03 -05:00
Hakan Jansson
8e4dc4e7fa boards: infineon: cyw920829m2evk_02: set openocd target handle
Openocd target cyw20829 does not define _TARGETNAME which is used by
default by the openocd west runner when using CONFIG_DEBUG_THREAD_INFO.

This is similar to the issue previously addressed for STM32H7:

Link: https://github.com/zephyrproject-rtos/zephyr/issues/45778

Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
2024-11-16 15:19:44 -05:00
Matt Rodgers
2eda6df48a net: lib: http_server: add option to use ALPN
Web browsers don't support HTTP Upgrade mechanism to upgrade to HTTP2.
Instead, HTTP2 is supported only over TLS, and ALPN is used to negotiate
the protocol to be used.

This commit adds the supported HTTP protocols to the ALPN list, so that
web browsers can use HTTP2 with the server.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-11-16 15:19:36 -05:00
Simon Hein
d4da23e3c3 sca: Add cmake options file for tool configuration
Add a cmake file which uses the cmake options feature
and include it inot the sca.cmake file to set up and describe
the options for the ECLAIR tool.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-11-16 15:18:57 -05:00
Simon Hein
22ce16d17b doc: sca: Add Bugseng eclair documentation
Add the documentation for the eclair from Bugseng
with the pre configuration for the zephyr project.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-11-16 15:18:57 -05:00
Simon Hein
e0db9ce948 sca: Add ECLAIR sca cmake implementation
Add the ECLAIR calls for the zephyr cmake environment to call
ECLAIR while the firmware is build by replacing the actual compiler
call and setup the eclair environment and call the compiler through
the eclair.

The Integration accepts a kconfig file for configuring the
analysis and the generation of the reports. The path of the
kconfig file should be provided via the variable ECLAIR_CONFIG.

db_generation.ecl has be created and introduced instead of
reports.ecl because the report generation is handled by the
sca.cmake directly.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-11-16 15:18:57 -05:00
Simon Hein
4c7d86a8b5 sca: Add ECLAIR SCA configuration files.
Add the Eclair configuration files, which are needed to
configure the static code analysis tool for the zephyr
coding guidelines.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-11-16 15:18:57 -05:00
Furkan Akkiz
9bb46e6417 samples: drivers: Add MAX78002EVKIT sample overlay files
Enable counter/alarm sample for MAX780002EVKIT.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Furkan Akkiz
ee1d4da864 tests: Add MAX78002EVKIT test overlay files
Enable following tests for MAX78002EVKIT:
 - tests/drivers/adc/adc_api
 - tests/drivers/counter/counter_basic_api
 - tests/drivers/dma/chan_blen_transfer
 - tests/drivers/dma/loop_transfer
 - tests/drivers/flash/common
 - tests/drivers/gpio/gpio_basic_api
 - tests/drivers/i2c/i2c_target_api
 - tests/drivers/pwm/pwm_api
 - tests/drivers/spi/spi_loopback
 - tests/drivers/w1/w1_api

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Furkan Akkiz
4488728822 boards: adi: Add MAX78002EVKIT board
Add MAX78002EVKIT board.
For more information about this board please check
https://www.analog.com/

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Furkan Akkiz
9c98ab7b73 dt-bindings: dma: Add MAX78002 DMA binding file
Add MAX78002 binding file for DMA slots.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Furkan Akkiz
f42568ca7b soc: adi: Add the MAX78002 SoC
Added MAX78002 Kconfig and dts files.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Furkan Akkiz
1b194393ce drivers: clock control: Add IPLL and EBO clocks for MAX32 MCUs
MAX78002 SoC has IPLL and EBO clocks. Added these clocks for MAX78002.
Updated ERFO clock with '_OR' option because MAX78002 doesn't have it.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Furkan Akkiz
c47523c1c4 manifest: Update hal_adi to add MAX78002 SoC
Added MAX78002 SoCs' files to the hal_adi repository. This commit
fetches it.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-11-16 15:09:57 -05:00
Reto Schneider
7c31369f51 MAINTAINERS: Cover Si32 pinctrl dt binding header
Without this change, `get_maintainer.py path ...` did not return a SiM3U
specific maintainer information when querying for
include/zephyr/dt-bindings/pinctrl/si32-pinctrl.h.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-11-16 15:09:46 -05:00
Gang Li
f8acf35ddc drivers: wifi: nxp: fix build failure after disabling 802.11ax
Fixed build error, when disabling 802.11ax, if-else does not match.
Fixes #81117

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-11-16 15:09:22 -05:00
Carles Cufi
9643ca20e9 nordic: Remove the nRF54H20 Engineering B
The production version of the nRF54H20 SoC is now available, so remove
the initial Engineering B (EngB) preview version.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-16 15:09:14 -05:00
Carles Cufi
5cb8d6c5b4 boards: nordic: Remove v0.8.0 of the nRF54H20 DK
The nRF54H20 Development Kit version 0.8.0 is no longer supported, given
that they should have all been replaced by 0.9.x.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-16 15:09:14 -05:00
Damian Krolik
11b6bd0ab1 net: openthread: support Wake-up End Device without CSL receiver
Make it possible to enable Wake-up End Device feature with
CSL receiver disabled (to receive wake-up frames on MED).

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Damian Krolik
de9519127b net: openthread: add wake-up end device support
Add Kconfig option to enable the Wake-up End Device role.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Co-authored-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Damian Krolik
8ce12aaa04 net: openthread: add wake-up coordinator support
Add Kconfig option `OPENTHREAD_WAKEUP_COORDINATOR` to enable
the Wake-up Coordinator role. Implement API to set Coordinated
Sampled Transmitting sample time and period for a driver that supports
`IEE802154_OPENTHREAD_HW_CST` capability.

The feature is be enabled on with ieee802154_nrf5 driver with option
by setting default value of CONFIG_IEEE802154_NRF5_CST_ENDPOINT.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Co-authored-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Damian Krolik
c9dbce36c0 drivers: ieee802154_nrf5: cabability IEE802154_OPENTHREAD_HW_CST
The new Kconfig option `IEEE802154_NRF5_CST_ENDPOINT` is added.
When it is enabled, then capability `IEE802154_OPENTHREAD_HW_CST`
is supported by the ieee802154_nrf5 driver and allows to set the
CST period and CST expected transmission time point.
This feature is an OpenThread-specific extention to the
ieee802154_nrf5 driver.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Co-authored-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Damian Krolik
242498e6be net: openthread: add capability IEEE802154_OPENTHREAD_HW_CST
The new capability `IEEE802154_OPENTHREAD_HW_CST` is added.
The option MAY be implemented as an extension to IEEE 802.15.4
drivers allowing to inject CST related Information Elements.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Co-authored-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Troels Nilsson
fa3bfa5453 Bluetooth: Controller: Add margin to ISOALs time offset
To ensure payloads are delivered in time for the first subevent
in framed BIS, ISOAL now enforces a (configurable) margin of
the calculated time offset

Without this margin, it has been observed that a broadcaster
can end up consistently missing the first subevent in every third
event in a 7.5 ms ISO with a 10 ms SDU interval

The margin is a conservative 2 ms by default, but can likely be
set a lot lower for most implementations and HWs

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-11-16 15:08:59 -05:00
Lauren Murphy
99a5236b40 llext: add support for arc
Adds compiler flag(s) and some architecture-specific relocations
for ARC. No userspace support, doesn't support all relocations.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-11-16 15:08:51 -05:00
Sadik Ozer
18853d026a tests: drivers: counter: Enable counter RTC test for MAX32 MCUs
This commit enables counter RTC test for MAX32 MCUs.

Co-authored-by: Okan Sahin <okan.sahin@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-11-16 15:08:43 -05:00
Okan Sahin
0253a1054c boards: adi: max32: Enable counter RTC
This commit enables counter RTC for following boards

- MAX32662 EVKIT
- MAX32655 EVKIT
- MAX32655 FTHR
- MAX32666 FTHR
- MAX32666 EVKIT
- MAX32670 EVKIT
- MAX32672 FTHR
- MAX32672 EVKIT
- MAX32690 EVKIT

Co-authored-by: Sadik Ozer <sadik.ozer@analog.com>
Co-authored-by: Maureen Helm <maureen.helm@analog.com>
Signed-off-by: Okan Sahin <okan.sahin@analog.com>
2024-11-16 15:08:43 -05:00
Sadik Ozer
5e38168f0c drivers: counter: Add MAX32xxx counter RTC driver
Common RTC counter driver for MAX32xxx MCUs.
Time of day alarm is used to generate interrupt.
The resolution of time of day interrupt is 1Hz.
Subsecond alarm interrupt not works it does not meet
zephyr counter driver requirement, so that not used.

To use as wakeup source wakeup-source parameter shall be
defined as below

&rtc_counter {
    status = "okay";
    wakeup-source;
};

Co-authored-by: Okan Sahin <okan.sahin@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-11-16 15:08:43 -05:00
Okan Sahin
b4d1076ab2 dts: arm: adi: Add counter RTC instance to MAX32xxx
This commit instantiates counter RTC on MAX32xxx MCUs.

Co-authored-by: Sadik Ozer <sadik.ozer@analog.com>
Signed-off-by: Okan Sahin <okan.sahin@analog.com>
2024-11-16 15:08:43 -05:00
Ian Morris
fd96edcd28 boards: renesas: ek_ra8m1: added pmod node labels
Added pmod_serial and pmod_header node labels to EK-RA8M1 device
tree board definition, allowing compatible shield boards to be used.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-11-16 15:08:36 -05:00
Kenneth Witham
e19838d157 net: mqtt-sn: Update MQTT-SN Publisher Sample with Gateway Discovery
Fixes: #78010
This commit adds the "Gateway Advertisement and Discovery" process
to the MQTT-SN Publisher Sample application.

Signed-off-by: Kenneth Witham <kennywitham4@gmail.com>
2024-11-16 15:08:27 -05:00
Kenneth Witham
cc33fd685f net: mqtt-sn: Update MQTT-SN Unit Tests
Fixes: #78010
This commit adds tests for the "Gateway Advertisement and Discovery"
process. This includes tests for handling SEARCHGW, GWINFO, and ADVERTISE
as well as manually adding a Gateway for use. Gateway pruning when
missing ADVERTISE messages is also tested.

Signed-off-by: Kenneth Witham <kennywitham4@gmail.com>
2024-11-16 15:08:27 -05:00
Kenneth Witham
aa9c9228d4 net: mqtt-sn: Add Gateway Advertisement and Discovery process support
Fixes: #78010
This commit implements the "Gateway Advertisement and Discovery" process
defined in section 6.1 of the MQTT-SN specification.
This includes breaking changes to the transport interface and the default
included UDP interface implementation as support for UDP multicast
messages is added as implemented by the Paho MQTT-SN Gateway.

Signed-off-by: Kenneth Witham <kennywitham4@gmail.com>
2024-11-16 15:08:27 -05:00
Chun-Chieh Li
d716f54bbf drivers: usb_c: numaker: update UTCPD.VBSCALE register field
This follows update of UTCPD.VBSCALE register field. It supports:
- "divide-20": External VBUS voltage divider circuit should be 1/20
               for EPR application. The divided voltage compares with
               200mV to set or clean VBUS Present bit.
- "divide-10": External VBUS voltage divider circuit should be 1/10
               for SPR application. The divided voltage compares with
               400mV to set or clean VBUS Present bit.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2024-11-16 15:08:18 -05:00
Bjarki Arge Andreasen
9df88e62fc samples: boards: nordic: add nrf_sys_event sample
Add sample for nrf system events.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-11-16 15:08:11 -05:00
Bjarki Arge Andreasen
3e6d6033bb soc: nordic: add fn for setting constlat mode
Nordic SoCs implement an event system, for which the system can
optimize for low latency/high power or low power.

Add soc level implementation of reference counted API which will
optimize for low latency if any part of the system requires it.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-11-16 15:08:11 -05:00
Bjarki Arge Andreasen
05529584a9 dts: common: nordic: nrf54l15: add power peripheral
Add power peripheral to nrf54l15.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-11-16 15:08:11 -05:00
Jakub Wasilewski
cfdaa91ff6 drivers: eeprom: add mb85rsm1t fram support
Add a driver for the MB85RSM1T FRAM chip.

Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-11-16 15:08:01 -05:00
Laurentiu Mihalcea
f754e09dcd dma: dma_nxp_edma: drop the hal-cfg-index property
The HAL configuration binding can be done dynamically based on the
IP's address space. The `hal-cfg-index` property is more tied to
software rather than hardware so remove it as an attempt to clean
up the binding.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-11-16 15:07:45 -05:00
Dino Li
7c2478e547 espi/it8xxx2: supports host command interrupt requested by custom opcode
Enables or disables host command interrupt when
ECUSTOM_HOST_SUBS_INTERRUPT_EN opcode is requested.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-11-16 15:07:38 -05:00
Chew Zeh Yang
0facdd834f boards: ambiq: apollo4p: Add USB nodes
Add USB node to apollo4p and apollo4p_blue qualifier, and apollo4p_evb
and apollo4p_blue_kxr_evb board to enableUSB support on the MCU and
its EVB.

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-11-16 15:07:29 -05:00
Chew Zeh Yang
659582b06f drivers: udc_ambiq: Implemented UDC driver for apollo4p
Added implementation for udc_ambiq with its required Kconfig and
CMakelist updates.

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-11-16 15:07:29 -05:00
Chew Zeh Yang
97187bee6a dt-bindings: apollo4p: add ambiq usb binding
Added ambiq-usb bindings needed by udc_ambiq.

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-11-16 15:07:29 -05:00
Chew Zeh Yang
b0f4cf6511 boards: ambiq: add user button
Added user button for apollo4p_blue_kxr_evb and apollo4p_evb

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-11-16 15:07:29 -05:00
Olivier Lesage
fc8d9425c1 bluetooth: samples: Add samples showing basic channel sounding features
These samples demonstrate how to use the bluetooth 6.0 channel
sounding APIs. A basic distance estimation algorithm is included.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-11-16 15:07:20 -05:00
Jan Kowalewski
42889628a9 drivers: i2c: Introduce I2C timeout for SAM0
Adds configurable timeout for I2C transactions for SAM0 SoCs.

Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 15:07:11 -05:00
Sven Ginka
fe4215462d soc: sensry: udma, pad renaming
Before that fix the names for UDMA could be misleading.
With that fix the namespace is clear and easy to follow.
Same applies for peripheral addresses and pad config.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2024-11-16 15:06:43 -05:00
Alan Yang
795644f8f3 MAINTAINERS: update information of Nuvoton NPCM Platform
Update 'Nuvoton NPCM Platform': 'files' section.

Signed-off-by: Alan Yang <tyang1@nuvoton.com>
2024-11-16 15:06:25 -05:00
Alan Yang
bf8181bbb1 soc: nuvoton: Enable npcm clock control driver
Enable npcm clock control driver in npcm4.

Signed-off-by: Alan Yang <tyang1@nuvoton.com>
2024-11-16 15:06:25 -05:00
Alan Yang
cae35c2a1e boards: nuvoton: support npcm clock driver
Support npcm clock driver on npcm400_evb.

Signed-off-by: Alan Yang <tyang1@nuvoton.com>
2024-11-16 15:06:25 -05:00
Alan Yang
af5794fec2 dts: arm: nuvoton: add npcm mdc and pcc instances
Add npcm miscellaneous device control and power and clock control
instances.
Add device tree bindings for npcm power and clock control.

Signed-off-by: Alan Yang <tyang1@nuvoton.com>
2024-11-16 15:06:25 -05:00
James Chiang
bfa1e36789 drivers: clock_control: add npcm clock control driver
Add npcm clock control driver.

Signed-off-by: James Chiang <cpchiang1@nuvoton.com>
Signed-off-by: Joseph Liu <kwliu@nuvoton.com>
Signed-off-by: Alan Yang <tyang1@nuvoton.com>
2024-11-16 15:06:25 -05:00
Felipe Neves
9542166589 drivers: mbox: add IVSHMEM based mbox driver
Add initial support of the mailbox driver based
on the inter VM shared memory mechanism similar
as the existing IPM driver.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2024-11-16 15:05:34 -05:00
Francois Ramu
abfd712cec samples: boards: stm32 power lptim adjusted to 15 seconds
Gives an example where the timeout value is 15seconds,
the prescaler of 8 can let the LPTIM count from 0 to 16 seconds
with LSE

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-16 15:05:26 -05:00
Francois Ramu
27bb4961b3 drivers: stm32 lptim driver with a exact LPTIM timeout value
With this change, the LPTIM counter will be able to set
its timeout to the st,timeout value. So that system can
sleep for that period without interruption.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-16 15:05:26 -05:00
Anas Nashif
dfa170e909 tests: cmsis_nn: reduce architecture scope
Filters already only allow arm and native, so exclude everything else
very early and reduce churn and build time.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-16 15:01:55 -05:00
Anas Nashif
a505078c60 tests: cmsis_dsp: reduce architecture scope
Filters already only allow arm and native, so exclude everything else
very early and reduce churn and build time.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-16 15:01:55 -05:00
Timothy Keys
e976a01bed Bluetooth: Host: Unit test for bt_le_cs_set_valid_chmap_bits
Add coverage of the bt_le_cs_set_valid_chmap_bits function to unit tests

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2024-11-16 14:58:14 -05:00
Timothy Keys
97399d4027 Bluetooth: Host: Remove code causing build error
This code is redundant and causes a build error if called more than
once.

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2024-11-16 14:58:14 -05:00
Timothy Keys
59126aca7e Bluetooth: Host: Fix spelling mistakes in cs.h
Fix a spelling mistake in the enum bt_le_cs_procedure_phy, and various
mistakes in comments.

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2024-11-16 14:58:14 -05:00
Nils Bosbach
2506d599a3 drivers: interrupt_controller: do not set sgi type
The GICD_ICFGR0 register is read only because SGIs are always
edge-triggered.

Signed-off-by: Nils Bosbach <bosbach@ice.rwth-aachen.de>
2024-11-16 14:57:44 -05:00
Benedikt Schmidt
5aa835c66b drivers: fpga: simplify load mode selection of iCE40
Replace the enum for load modes for the iCE40 with a boolean flag,
as there are only two options:
- SPI: default, which should be used whenever possible
- GPIO bitbang: workarorund, in case a low-end microcontroller is used

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-16 14:57:36 -05:00
Raffael Rostagno
834fa11e6b drivers: gpio: esp32: Add input/output enable flags
Flags added allow keeping a pin as input/output by not disabling
the output buffer when configuring it as an input and by not
disabling input enable when configuring it as output. This can
be useful to implement signal diagnosis or for testing purposes.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-11-16 14:57:29 -05:00
Lars-Ove Karlsson
e7c74e8f30 tests: kernel: fpu_sharing Fixed missing struct defs for ARM
Added empty fp register structs for ARM combinations not handled,
i.e. any ARM without a fpu.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2024-11-16 14:57:17 -05:00
Aaron Ye
0439cbc29c drivers: bluetooth: hci: add close function for Ambiq Apollo3x
This commit adds the bt_hci_driver.close function for Ambiq
Apollo3x SoC. Also update the hal_ambiq revision including
the necessary support.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-11-16 14:57:06 -05:00
Fin Maaß
8646a6c289 net: ethernet: arp: extend error log
If a gateway is not set for a interface,
also log the destination address.

Also print the interface index instead of the
interface pointer.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-16 14:56:57 -05:00
Emil Gydesen
8386929944 tests: Bluetooth: Tester: Log conn changes
Log the address and the err/reason values in the connected
and disconnect callbacks.

Since these values are not part of the BTP events it is
difficult to follow the order and reason why disconnects
happen when debugging.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:56:51 -05:00
Alberto Escolar Piedras
6d53e376cb tests/bsim/bluetooth/ll: Increase EXECUTION_TIMEOUT where needed
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:56:43 -05:00
Alberto Escolar Piedras
5da8eb3e9f tests/bsim/bluetooth/host: Increase EXECUTION_TIMEOUT where needed
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:56:43 -05:00
Alberto Escolar Piedras
4c8ee78b76 tests/bsim/bluetooth/audio: Increase EXECUTION_TIMEOUT where needed
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:56:43 -05:00
Emil Gydesen
dc6630d5f5 samples: Bluetooth: PBP: Source: Fix advertising data
The sample had a few off-by-ones in the code, which caused access
to invalid data.

Fixed by setting the right buffer sizes and the right AD length
fields.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:56:30 -05:00
Guennadi Liakhovetski
ae8c373314 LLEXT: fix a needless allocation
When CONFIG_LLEXT_STORAGE_WRITABLE is selected and .pre_located is
set, the BSS section is allocated by the user too, no need to
allocate it internally.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 14:56:23 -05:00
Marvin Ouma
7e8ee25479 tests: posix: common: separate posix rwlocks tests into a standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves rwlocks into a singular
testsuite at tests/posix/rwlocks app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-16 14:56:16 -05:00
Marvin Ouma
f7633a55aa tests: posix: common: separate posix semaphores tests into standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves semaphore into a singular
testsuite at tests/posix/semaphores app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-16 14:56:09 -05:00
Krzysztof Chruściński
ed5ce47437 drivers: serial: nrfx_uarte: Fix RX path without low power modes
RX FIFO flushing on RXTO event should only be performed when
UARTE peripheral might be disable during inactivity and that
happens when low power modes is enabled or when device runtime
PM is used. Flushing was incrementing flush_cnt which was not
used (flushed data is not copied to the next buffer) which
was causing data loss and invalid RX data length reporting.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-16 14:55:43 -05:00
Pisit Sawangvonganan
effe4bbf95 fb: cfb_shell: remove dev null check
Remove `dev` null check as `DEVICE_DT_GET` ensures compile-time
initialization.
Refer to commit 6eb371f (fb: initialize devices at compile time)

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Pisit Sawangvonganan
cff8b6092e fb: cfb_shell: use shell_strtol in cmd_set_kerning
Switch from using direct `strtol` calls to `shell_strtol`.
This change leverages the extensive error handling provided
by `shell_strtol`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Pisit Sawangvonganan
06e0b2d1d6 fb: cfb: remove unnecessary NULL check and NULL assignment
Since the `fb` pointer is always assigned to `char_fb`, there is no need
for a `NULL` check. Additionally, removed setting `fb->buf` to `NULL` in
`cfb_framebuffer_init` as it will be overwritten by subsequent operations.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Pisit Sawangvonganan
b7fe2a0bf9 fb: cfb: avoid multiple strlen calls in draw_text
Added `len` to store the result of `strlen(str)` to avoid
multiple calls to `strlen` in the `for-loop`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Marvin Ouma
ab601ae05c tests: posix: common: separate posix single process into a standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves confstr, sysconf and uname into
a singular testsuite at tests/posix/single_process app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-16 14:53:42 -05:00
Mikhail Kushnerov
a995d9d76f kernel: fix k_sleep in no multi-threading mode
Fix k_sleep implementation for no multi-threading mode.

Absolute value of timeout expiration was fed to the k_busy_wait()
function instead of delta value. That caused bug like incrementing of
sleep time in geometric progression (while actual function argument is
constant) during program running.

Signed-off-by: Mikhail Kushnerov <m.kushnerov@yadro.com>
2024-11-16 14:07:41 -05:00
Mark Inderhees
c9d6c4c744 compiler: for xtensa add libgcc support
In order to compile with C++ exception handling for xtensa, the libgcc
location needs to be known. This change uses the same logic from gcc's
target.cmake to query the compiler for libgcc location and add the lib
to the include list.

Signed-off-by: Mark Inderhees <markind@meta.com>
2024-11-16 14:07:30 -05:00
Neil Chen
2de5e601a7 boards: frdm_mcxc444: Add lptmr support
Support lptmr for NXP frdm_mcxc444 board

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-11-16 14:07:17 -05:00
Yong Cong Sin
e0ce096b91 tests: benchmarks/sched: limit CPU to 1 for Intel ADSP ACE
Due to addition of busy threads running on other cores, and
the simulator runs in single thread bouncing through all cores,
we are wasting quite a bit of time just busy waiting. This makes
each simulator run too long for CI. So limit CPU number to 1.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-16 14:07:08 -05:00
Yong Cong Sin
927420a423 tests: sched: Add busy threads for SMP
The sched benchmark is designed for systems with a single
CPU. Otherwise, the timestamps would be wrong when the partner
thread is scheduled on another CPU, i.e. negative values:

```
unpend   63 ready   62 switch -16562 pend 18937 tot 2500 (avg  928)
```

When the system allows for multiple CPUs, spawn a non-preemptible
thread to keep the other CPUs busy.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-16 14:07:08 -05:00
Maxime Vincent
b77c50d7b8 soc: arm: nxp: lpc55xx flexcomm 3->7 clock init
Add clock init for FlexComm 3,4,5,6,7 in case they
are enabled in DeviceTree

Signed-off-by: Maxime Vincent <maxime@veemax.be>
2024-11-16 14:06:54 -05:00
Jamie McCrae
73f3f7dbef soc: gd: gd32: Remove setting Kconfig in wrong place
This Kconfig should not be set from here

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-16 14:06:37 -05:00
Jamie McCrae
557a2c6cbd soc: nxp: imx: imx8m: Remove wrong Kconfig setting
Removes setting a Kconfig in the wrong place

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-16 14:06:37 -05:00
Jamie McCrae
6bc6e4e5c2 soc: mediatek: mtk_adsp: Fix wrong hwmv2 Kconfigs
Fixes Kconfigs for hwmv2 being defined in the wrong files

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-16 14:06:37 -05:00
Krzysztof Chruściński
bedb7e16c3 tests: kernel: timer: timer_behavior: Adjust TIMER_TEST_SAMPLES
Adjust default number of test samples which is based on SRAM size.
Test is using 8*TIMER_TEST_SAMPLES and with previous defaults for
the device with 64k RAM it was using 56k of test data leaving only
8k RAM and that was easily not enough. Adjust conditions to
take less samples when SRAM_SIZE is equal to the threshold.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-16 14:06:28 -05:00
Erwan Gouriou
4a94a33164 drivers: i2c: stm32: LL API C filers are not required
From some reason, STM32 I2C drivers selected the compilation of
C files of the I2C LL API.
This is actually not required, so remove this dependency.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-16 14:06:21 -05:00
Pieter De Gendt
2ee5a24417 scripts: ci: check_compliance: Simplify line number in loop
Use the builtin enumerate function rather than a manual variable.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-16 14:06:12 -05:00
Emil Gydesen
8703381764 Bluetooth: Host: Add conversion macros from ms to various units
Add conversion macros from milliseconds to various units.
The purpose of these macros is to make it more clear/easier
for users to set and read values using milliseconds rather
than the various BT units which may be in 0.625, 1.25 or 10ms
units.

This is especially useful when comparing related values using
different units, such as advertising interval (0.625ms units)
and periodic advertising interval units (1.25ms units).

Users will have to be aware that these macros can provide slightly
different values than what is provided, if the provided values
do not match the units.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:06:03 -05:00
Alberto Escolar Piedras
0d249ecd23 tests/bsim: Also runtime test the UART drivers for the nrf5340
To increase coverage.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
7065b4628b doc boards nrfbsim: Mention the UARTE as supported for nrf5340
Include in the list of supported peripherals the UARTE for the
simulated nrf5340

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
5321941a5d tests uart_pm: Enable for nrf5340bsim
Enable this test in the simulated nrf5340 and provide
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
51053cce11 tests uart_mix_fifo_poll: Enable for nrf5340bsim
Enable this test in the simulated nrf5340 and provide
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
dd13fa0c47 tests uart_async_api: Enable in nrf5340bsim//cpuapp
Enable this test in the simulated nrf5340 by providing
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
a7abf80064 boards nrfbsim: Enable UART(E) peripherals for nrf5340bsim
The HW models now support this peripheral for these targets.
Let's enable them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
3418305eb8 doc boards nrfbsim: Mention the GPIO & GPIOTE as supported
Include in the list of supported peripherals the GPIO
and GPIOT for both the nrf5340 and nrf54l15

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
da01758908 tests gpio_get_direction: Enable for nrf5340bsim
Enable this test by providing an overlay for the nrf5340bsim
Both for the app and net core.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
14c096ff38 tests gpio_basic_api: Enable for nrf5340bsim
Enable this test, and provide overlays, in the nrf5340bsim

Note this test specs 2 GPIO pins to be shorted. This can be done
for the simulation target by calling zephyr.exe with the option
`-gpio_conf_file=shorts_config.txt`
Where  that file would contain this one line (for the provided overlay),
for the cpunet:
---- shorts_config.txt
short 1.1 1.2
----
And this for the cpuapp:
---- shorts_config.txt
short 3.1 3.2
----

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
8bd0a2525c tests gpio_hogs: Enable for nrf5340bsim
Enable this test, and provide overlays, for the nrf5340bsim.
Both for the app and net core.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
d0746f1177 boards nrfbsim: Enable GPIO & GPIOTE peripherals for nrf5340bsim
The HW models now support these pheripherals, let's enable them

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
990fc4c130 tests gpio_get_direction: Enable for nrf54l15bsim
Enable this test by providing an overlay for the nrf54l15bsim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
fb5ee609a0 tests gpio_hogs: Enable for nrf54l15bsim
Enable this test, and provide overlays, in the nrf54l15bsim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
1b1d3ca5d5 tests gpio_basic_api: Enable for nrf54l15bsim
Enable this test, and provide overlays, in the nrf54l15bsim

Note this test specs 2 GPIO pins to be shorted. This can be done
for the simulation target by calling zephyr.exe with the option
`-gpio_conf_file=shorts_config.txt`
Where  that file would contain this one line (for the provided overlay)
---- shorts_config.txt
short 1.1 1.2
----

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
4b890bc7b5 boards nrfbsim: Enable GPIO & GPIOTE peripherals for nrf54l15bsim
The HW models now support these pheripherals, let's enable them

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
0efbca30a5 manifest: Update nRF hw models to latest
Update the HW models module to:
aeef3db9fa9e4b9d12b3bbec44f9cedc8fcb7d9c

Including the following:
aeef3db GPIO & GPIOTE: Improve notes and documentation
93549c4 UART: Fix command line parameter description
dbab746 nrf_hack: Add a few missing peripherals
4b1a61b 53 UARTE: Correct subscribe sideeffects function name
197e9cf docs: UART can be used now for 5340 in Zephyr
dc18d14 53: GPIO+TE: Add app core instances
b236c08 GPIO+TE: Add to 5340's netcore
7a621f6 GPIO: Clarify function description
1a2e1e4 GPIO+TE: Build for 54L
d121db4 nrf_gpio hal: Add new nrf_gpio_port_pin_{in,out}put_set
9bc41ce GPIOTE: Connect to DPPI
7141042 GPIOTE: Add simple support for PORT.SECURE & NONSECURE
dc930ba GPIOTE: Support having or not sense functionality per instance
a07180d GPIO: Support multiple GPIOTEs
14bdce5 GPIO: Collect status in single struct
b91da53 GPIOTE: Add support for N interrupt lines
9963424 GPIO & GPIOTE: Generalize to N instances
7379c23 GPIO+TE: Fix indentation
8d691c6 Add SPU registers stub
dd68ca9 Add NFCT register stub
cf2cc5b HW_models: NHW_NVMC: fix buffer read validation
f3db727 zephyr: module.yml: add `depends` field
09fc98f CMakeLists: remove trailing whitespace

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Yong Cong Sin
ad7f3a9a0c soc: andestech: refactor out soc_early_init_hook() from pma.c
Refactor out the `soc_early_init_hook()` function from `pma.c` to
`soc.c` which is always compiled so that it can be extended to run
other init functions easily in the future. Then, restore the function
in `pma.c` to `pma_init()`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-16 14:04:25 -05:00
Yong Cong Sin
01b69e9c22 soc: andestech: run pma_init_per_core() with soc_per_core_init_hook()
The function `pma_init_per_core()`, as its name suggest, should be
run from every core, so call it from `soc_per_core_init_hook()`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 14:04:25 -05:00
Yong Cong Sin
de347a4e07 init: support per-core init hook
Allow SoC to implement their custom per-core initialization function by
selecting `CONFIG_SOC_PER_CORE_INIT_HOOK` and implement
`soc_per_core_init_hook()`.

Signed-off-by: Maxim Adelman <imax@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 14:04:25 -05:00
Yong Cong Sin
cc0796ab86 soc: andestech: soc_per_core_init_hook() shouldn't return value
The `soc_per_core_init_hook()` function now has `void` type after
da118b9, so it should just return without any value.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 14:04:25 -05:00
Piotr Zierhoffer
b05136fc06 x86: Add intel,x86_64 compat to all x86-64 platforms
This will help distinguish 64 and 32-bit platforms by tooling, following
the pattern visible in e.g. RISC-V.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-11-16 14:04:12 -05:00
Piotr Zierhoffer
12a27f31a1 intel: Explicitly set x86 compat in intel_ish5 and lakemont
Those dtsi are a base for a range of 32-bit platforms. Setting this
compatible makes it easier to distinguish all 32-bit x86 platforms.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>

y
2024-11-16 14:04:12 -05:00
Piotr Zierhoffer
8f14d08bf5 x86: Divide Intel Atom CPU compatible to x86 and x86_64
atom.dtsi enforces "intel,x86", but it doesn't help us discern if the
platform is 32 or 64-bit. We do that for example in RISC-V and it's
useful from the tooling perspective.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-11-16 14:04:12 -05:00
Damian Nikodem
f556a76081 driver: ssp: Refactor SSP driver to use SSP_IP_VER for version checks
This commit updates the SSP driver to use the newly defined
SSP_IP_VER macros for IP version checks instead of relying
on CONFIG_SOC_* macros. The change ensures better readability
and maintainability by centralizing the IP version definitions
and comparisons.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-11-16 14:04:01 -05:00
Tomasz Leman
5cf2cb6a37 soc: intel_adsp: ace: Use DT macros instead of hardcoded values
Replace hardcoded register addresses and values in
asm_memory_management.h with Devicetree (DT) macros for LPSRAM
power-down operations. This change ensures that register addresses and
bank counts are dynamically obtained from the Devicetree, improving code
portability and reducing the risk of errors due to manual updates.

- Removed hardcoded LSPGCTL address definitions.
- Updated m_ace_lpsram_power_down_entire macro to use DT_NODELABEL to
  fetch LPSRAM bank count and control register address
- Adjusted bit field extraction logic to align with the updated register
  information from the Devicetree.

This commit aligns with the ongoing effort to utilize Devicetree for
hardware abstraction and to facilitate easier maintenance and updates to
the codebase.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
946aeaa7e8 soc: intel_adsp: ace: Remove obsolete HPSRAM power change macro
Remove the m_ace_hpsram_power_change macro from asm_memory_management.h
as it is no longer used after refactoring the power_down function to
utilize the new m_ace_hpsram_power_down_entire macro. This cleanup helps
to reduce code complexity and maintainability.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
2d997082fc soc: intel_adsp: ace: Update power_down to use new HPSRAM power-down macro
Refactor the power_down function to utilize the newly introduced
m_ace_hpsram_power_down_entire macro for shutting down the entire
HPSRAM. This change simplifies the power-down process by replacing the
previous segment-based power gating mask approach with a single boolean
flag that indicates whether the entire HPSRAM should be disabled.

The function signature of power_down has been updated to accept the new
boolean flag, and the corresponding call sites have been modified to
pass the flag based on the CONFIG_ADSP_POWER_DOWN_HPSRAM Kconfig option.

Additionally, the assembly code has been cleaned up to remove the
now-obsolete hpsram_mask array and related logic.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
f447d10b0a soc: intel_adsp: ace: Add macro to power down entire HPSRAM
Introduce a new assembly macro, m_ace_hpsram_power_down_entire, which
utilizes Zephyr Devicetree macros to power down the entire HPSRAM on
Intel ADSP ACE platforms.

This macro dynamically retrieves the HPSRAM bank count and control
register address from the Devicetree, streamlining the power-down
process. The macro is designed to iterate over all HPSRAM banks and
issue a power down command to each, ensuring a complete shutdown of the
HPSRAM when required by the system's power management policy.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
e0977dccd8 dts: xtensa: intel: Add hsbcap register node for ADSP ACE platforms
This commit introduces the L2 Memory Capabilities (hsbcap) register node
to the Devicetree specifications for Intel ADSP ACE platforms. The
hsbcap register provides information on the general capabilities
associated with the L2 memory, which is critical for system
configuration and resource management. The hsbcap node has been added to
the Devicetree source files for ACE 1.5 (MTPM), ACE 2.0 (LNL), and ACE
3.0 (PTL) platforms.

In addition, the DFL2MM_REG macro in adsp_memory.h has been updated to
use the Devicetree node label for hsbcap, ensuring a consistent and
maintainable approach to accessing this register across the codebase.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
f810b5d292 soc: intel_adsp: ace: Clean up macro indentation in power_down.S
This commit improves the readability of the power_down.S assembly file
by standardizing the indentation of the preprocessor definitions.

No functional changes have been made; this is purely a cosmetic update
to the code formatting.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
095bc56a57 soc: intel_adsp: ace: Ensure TLB entry for HW registers during power-down
This commit addresses an issue on platforms with an MMU where a
LoadStoreTLBMissCause exception occurs when accessing hardware registers
during the power-down process. The exception arises when attempting to
access the IPC register after HPSRAM has been powered down, leading to a
double exception: LoadStoreTLBMissCause followed by
InstrPIFDataErrorCause.

To resolve this, we preload the IPC register before shutting down
LPSRAM. This change prevents the double exception by ensuring that the
page table entries are correctly managed in the TLB before HPSRAM is
powered down and allowing the power-down sequence to complete
successfully.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
romain pelletant
bea68273d5 lorawan: replace booleans by atomic flags
ADR status and devtime updated flags merged into an atomic bits array.
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
romain pelletant
ae0c1b72cf lorawan: add devicetime request support
Add devicetime request support.
Update lorawan sample
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
romain pelletant
866905fd6a lorawan: change downlink callback
Change downlink callback to transport data using flags.
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romainp@kickmaker.net>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
Maksim Drachov
91d3eb9107 soc: atmel: fix wait state value
The datasheet specifies that 2 wait states are required at 48 MHz.

Signed-off-by: Maksim Drachov <maksim.drachov@outlook.com>
2024-11-16 14:03:27 -05:00
Philip-Dylan Gleonec
8084111e54 boards: shields: add adafruit adalogger featherwing
Add definition for the Adafruit Adalogger Featherwing. This shield
compatible with the Adafruit Feather family is equipped with an SD card
slot and a PCF8524 RTC.

This work is based on the Adafruit Data Logger shield definition.

Signed-off-by: Philip-Dylan Gleonec <philip-dylan@gleonec.bzh>
2024-11-16 14:03:16 -05:00
Sreeram Tatapudi
0a9c0f4017 soc: infineon: Support for power management on 20829
- Initial changes in board, dts, and soc files to support
 system power management

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-11-16 14:03:04 -05:00
Andriy Gelman
041f9821ca drivers: xmc4xxx_uart: Delay transmit interrupt until byte is sent out
Generate the Tx service request after the symbol is shifted out of the
UART. This is useful when the UART is connected to an RS485 transducer
which has a separate transmit enable gpio/line. Hence it's important
to know when the transmission actually finishes so that the drive
enable line can be disabled.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-11-16 14:02:43 -05:00
Peter Ujfalusi
a8ac02f9ad drivers: dma: intel-adsp-gpdma: Account for LLPL wrapping
In case the LLP wraps we need to re-read the LLPU to make sure we return
the correct value.

Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-11-16 14:02:35 -05:00
Jan Faeh
22945254ef drivers: sensor: STS4x Add driver
This adds support for Sensirion's STS4x temperature sensor.

Signed-off-by: Jan Faeh <jan.faeh@sensirion.com>
2024-11-16 14:02:15 -05:00
Meir Komet
5595f66851 multi_heap: introduce support for realloc()
Add support for realloc (and realloc_aligned) into the multi heap lib,
where the buffer sent in will either be reused (maybe shrinked),
or enlarged by allocating on any of the matching heaps of the multi heap.

Signed-off-by: Meir Komet <mskomet1@gmail.com>
2024-11-16 14:02:07 -05:00
Zhang Xingtao
0cf866037d boards: xtensa: add M5Stack CoreS3 support
Initial support for M5Statck CoreS3 development board.

Signed-off-by: Zhang Xingtao <zhxt@live.cn>
Co-authored-by: Benjamin Cabé <kartben@gmail.com>
Co-authored-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-16 14:01:42 -05:00
Mathieu Choplain
f27323a45d arch: arm: cortex_m: pm_s2ram: add support for all architectures
Extend the ARM M-profile suspend-to-RAM implementation to be compatible
with all versions of the M-profile supported by Zephyr: ARMv6-M, ARMv7-M,
and ARMv8-M Baseline.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Mathieu Choplain
18f41aa63c arch: arm: cortex_m: pm_s2ram: wrap context save/restore in macros
Wrap the CPU register save/restore operations (GPR and special registers)
in macros to make core logic simpler to follow. This is also a preparatory
step to introduce ARMv6-M and ARMv7-M support.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Mathieu Choplain
041714cb37 arch: arm: cortex_m: pm_s2ram: use macros to access struct __cpu_context
Use macros to wrap the interaction between the assembly code and the
struct __cpu_context. This helps making the assembly more readable.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Mathieu Choplain
7dd7dffe33 arch: arm: cortex_m: pm_s2ram: ignore xPSR
Remove all xPSR-related registers from struct __cpu_context, and the
associated save/restore code in S2RAM code, as they are not needed:

* EPSR and IPSR are read-only - they cannot be "restored"
* Bits N, V, Z, C, V, Q, and GE (if DSP Extension is implemented) of APSR
  could be restored, but this is not needed as the AAPCS indicates these
  bits to be "undefined on entry to or return from a public interface"

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Adrien Leravat
1d6a89d26e tests: drivers: sensor: add hc-sr04 tests
Add automated build and functional tests for the HC-SR04.

Signed-off-by: Adrien Leravat <adrien.leravat@gmail.com>
2024-11-16 14:00:34 -05:00
Adrien Leravat
9df661ea1a drivers: sensor: hc-sr04: add driver
Add a simple driver for the HC-SR04 ultrasonic distance sensor.

Signed-off-by: Adrien Leravat <adrien.leravat@gmail.com>
2024-11-16 14:00:34 -05:00
Andries Kruithof
6d187ba882 Bluetooth: Audio: Bablesim tests for CAP broadcast reception stop
Implement a babblesim test for the CAP broadcast reception stop
procedure

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-11-16 14:00:25 -05:00
Steve Boylan
d0aced304b drivers: spi: RPi Pico PIO SPI code size and byte order.
Use minimized PIO code for 3-wire operation.

Input and output buffers are conventionally stored in bus byte order.
For 16 and 32 bit transfers, this is effectively big-endian, so
txbuf and rxbuf need to be read as such.  Those pointers also need
to be declared uint8_t * instead of void *.
In addition, tx_count and rx_count are based on dts, and refer to
whole transfers (8, 16, or 32 bits), not bytes.

Added rpi_pico.overlay to samples/sensor/magn_polling to demonstrate
32-bit word size, and updated the README.rst to make it independent
of the specific sensor.

Clean up compliance check failures.
Fix typos.
Synchronize 3-wire TX and RX cycles.
Simplify state machine synchronization
Minimize SPI bus delay time in 3-wire mode
Move clock delay to PIO code and remove k_sleep

Signed-off-by: Steve Boylan <stephen.boylan@beechwoods.com>
2024-11-16 14:00:16 -05:00
Øyvind Rønningstad
782f0b2a4a west.yml: Update zcbor from 0.9.0 to 0.9.1
This is just a README update, so no changes are needed in Zephyr.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-11-16 13:52:08 -05:00
Teresa Zepeda Ventura
7ec8c8e753 boards: adafruit: add initial support for feather m4 express
The Adafruit Feather M4 Express is a compact, lightweight
ARM development board with an onboard mini NeoPixel, 2 MiB
of SPI flash, charging status indicator and user LEDs, USB
connector, 21 GPIO pins and a small prototyping area.

Signed-off-by: Teresa Zepeda Ventura <teresa.zvent@gmail.com>
2024-11-16 13:51:45 -05:00
Thomas Stranger
e6664e38ba samples: sensor: ds18b20: updates to reflect analog maxim acquisition
Links and the manufacturer name are updated from maxim to analog.

After the acquisition of Maxim Integrated the documentation
of these devices has been moved to the analog.com website.
Redirects exist, so they are not broken yet,
but we should not rely on that.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-11-16 13:51:38 -05:00
Thomas Stranger
d0816a1a60 drivers: w1: updates to reflect analog maxim acquisition
Links and the manufacturer name are updated from maxim to analog
for the 1-wire subsystem and the related ds18b20 sensor.

After the acquisition of Maxim Integrated the documentation
of these devices has been moved to the analog.com website.
Redirects exist, so they are not broken yet,
but we should not rely on that.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-11-16 13:51:38 -05:00
Jukka Rissanen
2188387dd3 samples: net: mdns_responder: Increase interface name len for VLAN
In this sample, VLAN has longer interface name so increase it to max.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Jukka Rissanen
f95ab280fb net: shell: dns: Print DNS server with network interface
If network interface is specified in the DNS server, then send
the queries to the server via the network interface. Print this
information in the server list.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Jukka Rissanen
6c95daf0ae net: dns: Bind DNS server to a network interface
Allow user to specify a network interface in the DNS server
list. User can append "%" and network interface name to the
DNS server to use this. If the network interface is mentioned
in the server list, then the DNS queries are sent via this network
interface.
For example setting the interfaces like this:
   192.0.2.2%eth1
   [2001:db8::2]:5353%ppp0

would cause the DNS queries to sent to 192.0.2.1 via eth1 in the first
example, and to 2001:db8::2 via ppp0 in the second example.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Jukka Rissanen
5f3e6212af net: utils: Port parsing failure in net_ipaddr_parse()
If trying to parse a string like 192.0.2.2:80/foobar and
setting the length to 12 which means to parse the IP address
and port, the parsing failed because it used one extra character
from the string. This issue was not present if the input string
was terminated after the port number.

Add a test case to catch this problem.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Dominik Ermel
06c0b764cc tests: flash_map: Move SHA test to separate test scenario
The commit moves SHA calculation to separate test scenario, so that
it can be run separately from other flash map tests.
This reduces flash wear by not running basic flash map tests each
time different SHA backend is tested.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-16 13:51:18 -05:00
Dominik Ermel
dd93bce0b9 tests: flash_map: Reduce flash wear in test_flash_area_get_sectors
Remove needless writes/read and erase in flash_area_get_sectors test
scenario, by replacing it with comparison with layout directly obtained
from device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-16 13:51:18 -05:00
Thomas Stranger
501f07fe53 drivers: sensor: sensirion: sht4x: update measurement duration
Update the measurement durations for the sht4x sensors
in accordance with the datasheet revision 6.6 (2024-04).

These timings have been updated by sensirion in rev 3 of
the datasheet.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-11-16 13:51:10 -05:00
Pisit Sawangvonganan
c120ffb31d bluetooth: shell: avoid multiple strlen calls
Add `len` to store the result of `strlen(addr_arg)` to avoid
multiple calls to `strlen` within the `for-loop` in
`cmd_scan_filter_set_addr`.
While the performance impact may be minimal in a shell context,
storing `strlen(addr_arg)` in `len` ensures a single call,
making the code more predictable and consistent.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 13:50:58 -05:00
Vijay Hiremath
3f95fd4349 eSPI: NPCX/ITE: Enable conditional virtual wire valid bit check
On the new Intel SoC, the "Valid" bit of the Virtual Wire is set only for
Virtual Wires that undergo changes. This behavior differs from previous
generations. Therefore, to maintain backward compatibility, a conditional
check for the virtual wire valid bit is added for processing the virtual
wire level.

Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
2024-11-16 13:50:50 -05:00
Emil Gydesen
7e7e1aa719 Bluetooth: BAP: Fix CONFIG_BT_BAP_BASS_MAX_SUBGROUPS include issue
There were a few cases where CONFIG_BT_BAP_BASS_MAX_SUBGROUPS was
used in structs in the public header files. Unfortunately using
a Kconfig for an array size will cause include issues if the
file is included without the Kconfig being available.

For now add and use a new #define value that will be 0 if
CONFIG_BT_BAP_BASS_MAX_SUBGROUPS is not defined.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 13:50:25 -05:00
Keith Packard
c759b8ac3d libc/picolibc: Split hooks into separate files
This splits the picolibc helper functions into separate files instead of
smashing them all together.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-11-16 13:50:16 -05:00
Piotr Kosycarz
e4b830fe7a tests: drivers: sensor: temp_sensor: enable for nrf54l15dk
Incorrectly removed during transfer pdk->dk.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-11-16 13:44:48 -05:00
Piotr Kosycarz
51c5bc7667 tests: drivers: gpio: gpio_basic_api: enable for nrf54l15dk
Incorrectly removed during transfer pdk->dk.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-11-16 13:44:48 -05:00
Jukka Rissanen
5b007183d0 tests: posix: headers: net: Convert to use zexpect
Use zexpect instead of zassert so that the failed tests do not
stop the test execution but we run all the tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
d1e42fc147 tests: posix: headers: net: Add test for ipv6_mreq
The "struct ipv6_mreq" is supported so enable the tests for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
8f49925a0f tests: posix: headers: net: Add various IPv6 address check macros
Add these Posix specified IPv6 address checking macros

IN6_IS_ADDR_UNSPECIFIED
IN6_IS_ADDR_LOOPBACK
IN6_IS_ADDR_MULTICAST
IN6_IS_ADDR_LINKLOCAL
IN6_IS_ADDR_SITELOCAL
IN6_IS_ADDR_V4MAPPED
IN6_IS_ADDR_MC_NODELOCAL
IN6_IS_ADDR_MC_LINKLOCAL
IN6_IS_ADDR_MC_SITELOCAL
IN6_IS_ADDR_MC_ORGLOCAL
IN6_IS_ADDR_MC_GLOBAL

and tests for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
606eeed8c9 tests: posix: headers: net: Add INADDR_BROADCAST definition
Add INADDR_BROADCAST definition and a test for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
f2d58c4e18 tests: posix: headers: net: Mark unicast/multicast hops supported
Both the IPV6_UNICAST_HOPS and IPV6_MULTICAST_HOPS are supported
so add tests for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
96795f0b6c tests: posix: headers: net: Add IPv6 join/leave group
The IPV6_JOIN/LEAVE_GROUP corresponds to IPV6_ADD/DROP_MEMBERSHIP
definitions so define the former and add tests for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
5216b52477 tests: posix: headers: net: Add check for in6addr_any variable
The in6addr_any is a global symbol that can be used when any
address (all zero bits) is being referenced.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
Jukka Rissanen
8776ae316c tests: posix: headers: net: sin6_scope_id is supported
The Posix documentation uses sin6_scope_id for scope id and
we support that already.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:44:35 -05:00
James Roy
9e5d4084b1 style: Inconsistent macro name changed
Fix incorrect header file pre-macro name in
'include/zephyr/devicetree.h'.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-16 13:44:12 -05:00
Emil Gydesen
c32210b003 Bluetooth: Host: ID: Log resolve list conflicts
In case of conflicts when calling bt_id_find_conflict
there was no way to easily determine what conflicted.

This is a rare occurance, but has happened when testing
against PTS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 13:43:59 -05:00
Mark Inderhees
1993ea019b build: support newlines in syscall decls
Some auto formatters will wrap long lines of code and insert newlines
that are part of function decls outside of arguments. This change strips
out all newlines so syscall typename regex function as expected.

Signed-off-by: Mark Inderhees <markind@meta.com>
2024-11-16 13:43:51 -05:00
Yong Cong Sin
70abb6077d tests/benchmarks: latency_measure: add qemu_riscv_64_smp board
Add `qemu_riscv64/qemu_virt_riscv64/smp` to the list of
integration_platforms.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 13:38:37 -05:00
Marcin Niestroj
60dba52859 boards: st: nucleo_h533re: add arduino_{gpio,serial} supported tags
This allows to build samples by twister which depend on 'arduino_gpio'
and/or 'arduino_serial'.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-16 13:38:18 -05:00
Marcin Niestroj
79bc3d1de5 samples: dap: drop 'sample.dap.bulk.nrf'
'nrf52840dk/nrf52840' is already listed under "generic" 'sample.dap.bulk',
so keeping 'sample.dap.bulk.nrf' has no value. The only difference is
dependency on 'gpio' instead of 'arduino_gpio', but
'nrf52840dk_nrf52840.overlay' references arduino header gpios only.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-16 13:38:07 -05:00
Jilay Pandya
6a0d7351d5 drivers: sensor: fcx_mldx5 fix string_overflow issue
This commit fixes Copy into fixed size buffer (STRING_OVERFLOW) by checking
the cmd_data_len

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 13:38:00 -05:00
Djordje Nedic
5c4f7d9e82 soc: Fix missing mem.h include in stm32h562
This caused failed builds due to the missing DT_SIZE_K(x) macro.

Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
2024-11-16 13:37:52 -05:00
Jilay Pandya
cebd1c78e8 drivers: sensor: emul_bmi160: fix cid 215232
This commit fixes the issue of Null pointer dereferencing

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 13:37:42 -05:00
Tarang Raval
532c775787 board: silabs: slstk3701a: add i2c2 node
Enable the I2C2 node on the EFM32GG11 SLSTK3701A board

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-16 13:37:28 -05:00
Benedikt Schmidt
7918c921d5 drivers: fpga: always check state of CDONE during configuration of iCE40
Turn the assert into an if-statement to ensure that CDONE is always
checked during the configuration of an iCE40.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-16 13:37:16 -05:00
Juha Sunnari
51bc60e142 logging: frontends: stmesp: alternate message output option
Add an alternate message output option in which messages are
ended with an additional zero data byte with marker and timestamp.
Can be used to maintain compatibility with certain decoders.

Signed-off-by: Juha Sunnari <juha.sunnari@nordicsemi.no>
2024-11-16 13:37:02 -05:00
Alberto Escolar Piedras
84dc9a1721 lib/cpp: Remove deprecated CONFIG_CPP_STATIC_INIT_GNU
This option was replaced with CONFIG_STATIC_INIT_GNU
2 releases ago in 6e977ae2d5

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 13:36:37 -05:00
Fabio Baltieri
6342eff58b led: add a struct led_dt_spec and some _dt wrapper APIs
Add a struct led_dt_spec to hold an LED device and index pointer, some
initializer and wrapper APIs.

This allows simpler LED usage, such as:

static const struct led_dt_spec led = LED_DT_SPEC_GET(DT_NODELABEL(led0));
led_on_dt(&led);
led_off_dt(&led);

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-16 13:36:27 -05:00
Daniel DeGrasse
0ea212918f cmake: extensions: use INTERFACE_SOURCES as property for code relocation
In order to enable code relocation, we use a custom target
(code_data_relocation_target), and add files we wish to relocate, as
well as which sections should be relocated to the COMPILE_DEFINITIONS
property for the target.

This approach has been fragile, because COMPILE_DEFINITIONS can also be
added to for all targets using `add_definitions`. This means if another
part of the project uses `add_definitions` and
CONFIG_CODE_DATA_RELOCATION is on, a warning will appear about the
"file" not being found. The "file" of course, is just the definition
added by `add_definitions`.

To work around this, switch to overloading the INTERFACE_SOURCES
property. This property should be a bit more robust, because nobody else
will add sources to the code_data_relocation_target.

However, this approach has the downside that the CMake documentation
pstates targets created with `add_custom_target()` (which the
code_data_relocation_target is) do not have an INTERFACE scope for
their sources- so while this approach works, it is not officially
supported by CMake

Fixes #60220

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-16 13:35:36 -05:00
Martin Stumpf
abc296ff65 drivers: display: display_sdl: implement display_show
Adds frame synchronization to every frame.
This prevents frame tearing.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Martin Stumpf
2e0687cfd2 generic: add frame_incomplete where missing
The newly introduced `frame_incomplete` flag of
`display_buffer_descriptor` needed to be added at several places to
avoid uninitialized memory.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Martin Stumpf
05bb8d9504 lvgl: add frame_incomplete information to display_write
In frames with multiple writes (officially supported through
`CONFIG_LV_Z_VDB_SIZE`) the display needs to be signalled that the
current frame is over and the content should be displayed.
This allows displays to present the UI without tearing artifacts.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Martin Stumpf
2bdffc6818 display: add frame_incomplete to display_buffer_descriptor
Introduces support for double-buffered/latched displays.
Currently, every write has to be presented to the user immediately,
which negates the advantage of latched displays to prevent frame tearing.

Now, GUI managers can indicate whether the current `display_write` call
is the last call of the frame or not, allowing displays to group writes
to a single present.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Jordan Yates
8b69b79279 tests: fuel_gauge: test negative current
Validate that the SBS fuel gauge driver returns the expected values for
negative currents (discharging).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-16 13:35:03 -05:00
Jordan Yates
8345775de0 fuel_gauge: sbs_gauge: fix negative currents
Fix negative currents being read as extremely high currents due to
unsigned variable use.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-16 13:35:03 -05:00
Yong Cong Sin
9c3482b1d5 arch: riscv: smp: allow other IPI implementation
The currently IPI implementation assumes that CLINT exists in the
system, however, that might not be the case as IPI can be implemented
with PLIC that supports software-triggering as well, such as the Andes
NCEPLIC100.

Refactor the CLINT-based IPI implementations into `ipi_clint.c`, and
create Kconfig that selects the CLINT implementation when
`sifive-clint0` exists and enabled, otherwise default to
`RISCV_SMP_IPI_CUSTOM` which allows OOT implementation. This also
makes way for the upstreaming of non-clint IPI implementation later.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-16 13:34:10 -05:00
Tarang Raval
bb7319e7f2 drivers: sensor: ina219: remove redundant error check
The function ina219_set_msr_delay always returns zero, indicating success.
Therefore, the error check on its return value is unnecessary and can be
removed.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-16 13:33:34 -05:00
Seppo Takalo
b3f3bce23e net: lib: coap_client: Add API to cancel specific request
Add a new API to cancel just one, or mathing requests,
instead of cancelling all ongoing requests.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
f0c6efe798 net: lib: coap_client: Stop polling on unneeded sockets
poll() only for sockets that have traffic ongoing or have some lifetime
left.
On socket failures during a poll(), stop listening for the socket.
Application can recover by reconnecting the socket.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
f72d634826 net: lib: coap_client: All error cases should be reported to callback
When the client fails when parsing the response and we stop proceeding,
we should report that to the application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
c0eb260c2c net: lib: coap_client: Drop duplicate MID only after responding with Ack
Even if we receive duplicate confirmable message, we should still
respond with the Ack. Just don't deliver the second callback.

This is achieved by moving the MID deduplication to after Ack handling.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
48434a3c1b net: lib: coap_client: Return -errno from send_request()
Return the -errno when zsock_sendto() or zsock_recvfrom() fails, so
rest of the code can deal with return values, instead of separately
comparing errno and return value.


Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
a1368a7ff7 net: lib: coap_client: Drop duplicate responses
When response is already handled, don't forward anymore responses
to the client application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
934c74f26e net: lib: coap_client: Don't match zero length tokens
If our internal structure is cleared, don't match tokens.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
7b0cce4418 net: lib: coap_client: Parse incoming MID only once
Incomming Message-ID is already parsed, use it as a parameter to
get_request_with_mid().

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
41ee35ae8b net: lib: coap_client: Don't clear internal structures on response
When response is received and handled, don't just clear the structure
but instead mark it as ongoing=false.
So if we later on receive a duplicate response for it, we can still
respond with Ack or Rst.

This is achieved by using release_internal_request() when we don't
expect any response for it and reset_internal_request() when we really
fill up a new request.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
107dc9b96d tests: coap_client: Add testcase for receiving RST
When server responds with CoAP RESET, we should inform the
client and stop the request.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
05a6ba678e tests: coap_client: Add testcase for observation
Add test for ongoing observation and cancellation.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
237b26c44a tests: coap_client: Test for operating on socket while another fails
CoAP client should be able to push data through functioning socket
while another sockets is failing or reporting poll() errors.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
fc51fa491f tests: coap_client: Add testcase for Ack failure
Add testcase where sending Ack to incomming Confirmable message fails.
This should be reported to application as now the server is unaware
that transmission have succeeded, so we cannot thread it as success.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
5559a520c9 tests: coap_client: Improve retry testcases
Add testcases for testing client's retry behaviour.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
120aabbb8f tests: coap_client: Add test when separate response is lost
Test a scenario where Ack is received but the actual response
is not coming.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
83bc1fcb46 tests: coap_client: Add test for duplicate response
Add test where we receive same UDP packet twice.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo
ca67f51170 tests: coap_client: Improve socket stubs
* Use sys_rand_get() and seed the CoAP library, so our MIDs are
  random.
* Set socket events per socket, so we don't accidentally receive
  on wrong socket
* Reply with correct tokens

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Daniel DeGrasse
0be5dcd25d arch: arm: add MPU definitions for all flash and SRAM region sizes
Add definitions for all possible flash and SRAM region sizes for ARMv7
MPU. Also, correct some of the SRAM size checks to use <= instead of ==,
to be consistent with the remainder of the file

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-16 13:33:15 -05:00
Declan Snyder
6d1a3bb36e boards: rd_rw612_bga: Move FCB in tree
Move the FCB to be in tree for this board instead of in the NXP HAL.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-16 13:32:48 -05:00
Maximilian Deubel
9bed2b7a98 scripts: logging: dictionary: Add support for size_t %z format specifier
This patch adds support for the size_t %z format specifier to the
dictionary parser.
It's the correct format to use for size_t types in modern C,
but it's not supported in python directly.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-11-16 13:32:22 -05:00
Nidhal BEN OTHMEN
92a7ddfb56 boards: st: Update nucleo_wba55cg dts file
Update nucleo_wba55cg dts file to use pinctrl dtsi file of WBA55
instead of WBA52.

Signed-off-by: Nidhal BEN OTHMEN <nidhal.benothmen@st.com>
2024-11-16 13:32:13 -05:00
Pieter De Gendt
175bfb4bc9 tests: net: lib: lwm2m: interop: Fix strip-with-multi-characters (B005)
All strip functions remove any of the provided characters instead of a
prefix/suffix. This is likely a bug.

See https://docs.astral.sh/ruff/rules/strip-with-multi-characters/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-16 13:32:02 -05:00
Marcin Niestroj
8f14c68660 boards: st: nucleo_u5a5zj_q: configure PD14 as SPI1 nCS
ST ZIO connector is Arduino Uno compatible. Arduino SPI pins are placed on
D10-D13 pins, where D10 is SPI nCS pin. This pin is connected with PD14 of
STM32U5A.

According to schematics of this Nucleo board [1]:

  Due to muxing constrainte, the SPI_NSS is not available as an alternate
  on this IO, so this pin is affected with an I/O function to do the Chip
  Select

This means that software control of GPIO is needed to make use of this SPI
interface on regular SPI signals on Arduino connector. Reconfigure
SPI1 (used as Arduino SPI) interface to account for that.

Note that previously configured PE12 is only available on ST ZIO and ST
Morpho connectors, not on Arduino connector.

Update documentation as well, which was referencing PA4 as nCS signal (used
on some other Nucleo boards).

[1] https://www.st.com/resource/en/schematic_pack/mb1549-u5a5ziq-c04-schematic.pdf

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-11-16 13:31:53 -05:00
Andrej Butok
a730d9abad boards: nxp: fix s26ks512s0 flash write-block-size
- Sets s26ks512s0 flash write-block-size to correct 256KB.
- Optimizes MCUboot partitions to fit the correct write-block-size.

Fixes #80284

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-11-16 13:31:35 -05:00
Jamie McCrae
ed8f613e55 cmake: dts: Use temporary file for dts.cmake
Uses a temporary file for dts output then uses CMake to copy to the
correct file if it has changed. This prevents a ping-pong issue when
sysbuild is used of configuring and building cycle when nothing has
changed and there is sysbuild code which loads in the devicetree
data from an image

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-16 13:31:02 -05:00
Alberto Escolar Piedras
2324d5daa1 doc nrf54l15bsim: Clarify the L10 and L05 are also covered
Clarify that one can simulate equally well the nRF54L10 and L05
variants with this target.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 13:30:49 -05:00
Alberto Escolar Piedras
5e6c28bfa3 doc nrf54l15bsim: Remove experimental warning
This target simulated is reasonably tested.
Let's stop warning about it being experimental.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 13:30:49 -05:00
Marvin Ouma
05196e38a9 tests: posix: common: separate posix barriers to standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves barrier into a singular
testsuite at tests/posix/barriers app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-16 13:30:36 -05:00
Nidhal BEN OTHMEN
a199f7f9d3 tests: bluetooth: tester: Fix bluetooth tester for nucleo_wba55cg
Fix compilation error by specifying usart1 to be used for uart-pipe.
Add a board-specific configuration file to disable the console,
so, the usart1 will be used only for bluetooth and to specify
the BT_HCI_TX_STACK_SIZE.

Signed-off-by: Nidhal BEN OTHMEN <nidhal.benothmen@st.com>
2024-11-16 13:29:39 -05:00
Anas Nashif
cfc232fa32 twister: stats: fix platform stats
Fix wrong reporting about where testcases were executed.

We have:

INFO    - 1130 of 1130 executed test cases passed (100.00%) on 0 out of
total 860 platforms (0.00%).

which is obviously wrong.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-16 13:29:23 -05:00
Carles Cufi
a3cc532221 actions: manifest: check additional metadata in projects
See https://github.com/zephyrproject-rtos/action-manifest/pull/14.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-16 13:28:58 -05:00
Mahesh Mahadevan
0006ba8ee3 release: Zephyr v4.0.99
Set the version to v4.0.99

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-16 13:40:34 +01:00
Mahesh Mahadevan
8469084dfa release: Zephyr v4.0.0
Set the version to v4.0.0

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-15 17:27:32 -06:00
Mahesh Mahadevan
c5b27d948a doc: release: Finalize v3.7.0 release notes and migration guide
Remove working draft status from the 4.0.0 release notes and
migration guide.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-15 17:27:32 -06:00
Mahesh Mahadevan
95633cf68c doc: release: Add v4.0.0 to the list of supported releases
Add v4.0.0 to the list of supported releases.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-15 17:27:32 -06:00
Mahesh Mahadevan
5c31f61d51 doc: release-notes-4.0: Update the DAC section
This incorrectly had references to timers and watchdog
related items.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-15 15:09:56 -08:00
Jilay Pandya
955d7974d5 docs: release notes: add 80875 to known issues
add #80875 to known issues in release notes 4.0.0.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-15 16:32:41 -06:00
Mahesh Mahadevan
91c3768b25 doc: release-notes-4.0: Release notes cleanup
1. Move deprecated items to the deprecated section.
2. Fixed a portion of a sentence that was deleted.
3. Miscellaneous cleanup.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-15 16:03:40 -06:00
Andrzej Głąbek
c7a1b53f82 doc: release-notes-4.0: Add a few Nordic related entries and an ADC one
Add notes for Nordic HAL and other nRF related stuff plus one more ADC
entry.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-11-15 16:03:40 -06:00
Flavio Ceolin
659eec8d85 doc: release-notes-4.0: Add CVE-2024-11263 info
Add CVE-2024-11263 to release notes.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-15 13:03:16 -06:00
Flavio Ceolin
7aa7e894bc doc: security: Disclose CVE-2024-11263
Disclose information about published CVE

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-15 13:03:16 -06:00
Benjamin Cabé
275f44730e doc: releases: re-arrange API Changes section
some entries were not properly put under either
Removed or Deprecated section. This commit
fixes that.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
c1d150934a doc: releases: use correct compatible for zephyr.gpio-steppers
The current name of the compatible is zephyr,gpio-steppers

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
2be735c558 doc: releases: fix galaxycore,gc2145 compatible
fix typo in compatible name

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
7fa0d83966 doc: releases: drop empty subsections from migration guide
Drop sections with no updates

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
657229f72e doc: releases: fix typos in MCUboot section
Fix minor typos

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
36ccae904d doc: releases: drop empty lib/subsystems subsections
Drop sections with no updates

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
a3978892c3 doc: releases: drop empty driver subsections
Drop sections with no updates

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
8f0a4bd323 doc: releases: fix Devicetree spelling
Spell Devicetree with a capital D

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Benjamin Cabé
c4b00f7bea doc: releases: add more release highlights for 4.0
This adds a few more entries to hopefully complete the list of
4.0 highlights.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-15 13:03:02 -06:00
Chris Friedt
1bf22569fc doc: release-notes-4.0: add posix api release notes
Add POSIX API release notes for new features and enhancements
since v3.7.0 .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-15 11:10:20 -06:00
Chris Friedt
95f4912e72 doc: posix: options: correct anchor for thread safe functions
Previously, the anchor for `_POSIX_THREAD_SAFE_FUNCTIONS` was
`posix_thread_safe_functions` but it should have been
`posix_option_thread_safe_functions`.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-15 11:10:20 -06:00
Yves Vandervennet
214837fa2b doc: release: NXP contribution
Adding NXP's contributions to v4.0

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-11-15 11:09:10 -06:00
Gerson Fernando Budke
d71d4c0e80 drivers: rtc: sam: Fix missing function
The #64939 introduced a few convenience function like
rtc_utils_validate_rtc_time. However the PR did not replace all
occurrences which result on a build error. This add the missing
header include to remove a building warning and replace the old
function by the new one.

Fixes #81454

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-15 11:08:58 -06:00
Alberto Escolar Piedras
24c2c43bcd boards nrf52_bsim: Fix sample used as example
Let's fix the sample used in the example. The peripheral_hr and
central_hr are meant to be run with each other.
Let's also use the :zephyr:code-sample: directive to refer to the
samples so we get a link.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-15 08:10:08 -06:00
Ahmed Adel
8034de73d5 doc: services: debugging: Remove unwanted reference link
Remove unwanted reference link to the section (Usage)
in ARM Coresight Trace Deformatter that shows up in
the main Debugging documentation page, by lowering
the level of (Usage) heading from ##### to *****

The commit also has a typo fix.

Signed-off-by: Ahmed Adel <a.adel2010@gmail.com>
2024-11-15 08:09:53 -06:00
Jilay Pandya
a482884751 doc: release: doc stepper API as major enhancement
Add entry in "Major enhancements with this release include:" for
stepper device driver subsystem.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-15 08:09:39 -06:00
Lukasz Mrugala
7092335c11 doc: Add information on Twister Statuses
Currently, Twister Statuses are only useful for
the initiated, save for the very basics.
This is in opposition to the fact
that they are the main thing end users take into
account when checking their Twister run reports.

In order to make Statuses more useful for the end user,
a new documentation page has been created,
elucidating the full meaning of all Statuses.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-15 08:09:28 -06:00
Jilay Pandya
5f418f506c docs: contribute: documentation: generation: fix missing doc
fix the path where the user has to be in order to execute make html-fast

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-14 20:37:45 -06:00
McAtee Maxwell
2fe4a37f38 Documentation: Update documenation for Infineon boards
-Update formatting and contents of index.rst for cy8ckit_062s4
	-Update formatting and contents of index.rst for cy8ckit_064s0s2_4343w
	-Update formatting and contents of index.rst for cy8cproto_062_4343w
	-Update formatting and contents of index.rst for cy8cproto_063_ble
	-Update formatting and contents of index.rst for xmc45_relax_kit
	-Update formatting and contents of index.rst for xmc47_relax_kit
	-Change all instances of "PSoC" to "PSOC" for infineon platforms

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2024-11-14 20:36:38 -06:00
Flavio Ceolin
422a41ddc1 MAINTAINERS: Add Bjarki as pm co-maintainer
Add bjarki-andreasen as second maintainer for power management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-14 20:36:21 -06:00
Mark Holden
94c1079560 arch: arm: Don't use STKALIGN mask on ARMv8-M Baseline
The STKALIGN mask is not present for CONFIG_ARMV8_M_BASELINE as
well as CONFIG_ARMV8_M_MAINLINE. So filter out that check when
setting the sp for ARM core dumps.

Signed-off-by: Mark Holden <mholden@meta.com>
2024-11-14 17:27:17 -06:00
Nazar Palamar
7e1b00d35e Infineon: board: remove CONFIG_GPIO from defconfigs
Remove CONFIG_GPIO from defconfigs for Infineon boards.
Applications, drivers will enable GPIO if need.

Added 'select GPIO' from spi/Kconfig.ifx_cat1
Added 'select GPIO' from wifi/infineon/Kconfig.airoc

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-11-14 17:27:06 -06:00
Nazar Palamar
44aa6f11a6 cy8ckit_062_ble: board: moved uart-6 to common dts for m4
Moved uatr6 to common dts for m4

- cm0 uses uart-5 in ver 0.0.0 and uart-5 in ver 1.0.0 (for
using of Arduino headers).

- cm4 by default uses uart-2 (for ver 0.0.0 and ver 1.0.0)

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-11-14 17:27:06 -06:00
Phi Bang Nguyen
c872b49ab0 doc: release-notes-4.0: Add tracked issue for video-interface bindings
Add link to the track the migration to the new video-interfaces
bindings.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-11-14 12:41:36 -06:00
Phi Bang Nguyen
da8de0945a doc: release-notes-4.0: Add fixed chicken-egg issue on NXP RT10xx
Add the chicken-egg issue on init order for the camera pipeline on NXP
RT10xx platforms

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-11-14 12:41:36 -06:00
Phi Bang Nguyen
3dff1a0a6f doc: release-notes-4.0: Add camera colorbar pattern test
This is added via PRs #79337 and #79263 to automatically check if a
colorbar pattern generated by a camera pipeline is correct or not.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-11-14 12:41:36 -06:00
Benjamin Cabé
4ddef9fc0f boards: lilygo: adopt new zephyr:board directive and role
This updates the documentation of all the LilyGO boards to use
the new `zephyr:board::` directive.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-14 12:41:19 -06:00
Ricardo Rivera-Matos
a88af572f4 doc: releases: 4.0: Adds Haptics notes
Introduces haptics subsystem and DRV2605 support in the release notes.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2024-11-14 12:41:09 -06:00
Bjarki Arge Andreasen
2f81bbbdf8 doc: release: doc comparator API as major enhancement
Add entry in "Major enhancements with this release include:" for
comparator device driver subsystem.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-11-14 12:40:59 -06:00
Johann Fischer
d0ea9d5243 doc: release-notes-4.0: add release notes for USB
Add release notes for USB support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-14 12:40:50 -06:00
Luca Burelli
07df2c5d5e soc: sensry: sy1xx: add support for LLEXT build
The linker script for this SoC was not including the LLEXT section
definitions when CONFIG_LLEXT was enabled. This patch adds the
necessary include directive to the linker script and fixes the build
issue identified by CI.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-14 11:01:27 -06:00
Aksel Skauge Mellbye
7f8b531d4c drivers: serial: gecko: Fix build error on Series 0
Series 0 does not have the TXIDLE status flag. The closest equivalent is
TXC, but it isn't set until the first transmission completes, and is
therefore not safe to use in PM suspend without also separately keeping
track of whether the driver has ever initiated a transmission. For now,
disable the TXIDLE check on devices that don't support it as a minimal
fix for the observed build error. This is effectively equivalent to
reverting the addition of PM support for these devices only. Since these
devices don't have a low-power system timer implementation anyway, the
lack of PM handling does not hurt anything.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-14 11:01:17 -06:00
Luca Burelli
876b44d150 soc: mediatek: mt8195_adsp: add support for LLEXT build
The linker script for this SoC was not including the LLEXT section
definitions when CONFIG_LLEXT was enabled. This patch adds the
missing include directive to the linker script.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-14 11:01:07 -06:00
Fabio Baltieri
f7ff83079f github: west_cmds: add missing anytree package
Add missing anytree package, runners started to fail on it:

../pylib/twister/twisterlib/runner.py:60: in <module>
    from anytree import Node, RenderTree
E   ModuleNotFoundError: No module named 'anytree'

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-14 09:51:06 -05:00
Laurentiu Mihalcea
c0a0e6a388 doc: release-notes-4.0: add release notes for firmware subsystem
Includes notes on SCMI's introduction.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-11-13 21:14:05 -06:00
TOKITA Hiroshi
9e51f1a754 drivers: sensor: mmc56x3: Fixed an error in include-guard
Fixed definitions duplicated with those in
`include/zephyr/drivers/sensor/tsl2591.h`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-13 19:11:25 -08:00
TOKITA Hiroshi
241c7b3fb7 arch: arc: Fixed an error in include-guard
Fixed definitions duplicated with those in
`include/zephyr/arch/xtensa/arch_inlines.h`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-13 19:11:25 -08:00
Yong Cong Sin
408c151282 tests: arch: riscv: make sure that gp reg can't be corrupted
Add a test to make sure that the `gp` global pointer register used for
relative addressing when `CONFIG_RISCV_GP` is enabled can't be
corrupted by a rogue user thread.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-13 19:08:54 -08:00
Yong Cong Sin
e30db2d53f arch: riscv: reset global pointer on exception
Reset the gp on exception entry from u-mode to protect the kernel
against a possible rogue user thread.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-13 19:08:54 -08:00
Yong Cong Sin
de3a845612 arch: riscv: add macro to access hardware registers
Add macros to read / write hardware registers.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-13 19:08:54 -08:00
Jimmy Zheng
d267402404 tests: drivers: build_all: eeprom: fix label name conflict
Renamed the label of 'ti_tmp116_eeprom@0' node because 'eeprom' label name
already exists in some boards, such as adp_xc7k/ae350, bytesensi_l,
same54_xpro.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2024-11-13 19:08:41 -08:00
Mahesh Mahadevan
d9bfdaf996 bluetooth: kconfig: Remove deprecated config
Remove deprecated Kconfig BT_MESH_PROV_DEVICE

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-13 19:08:29 -08:00
Mahesh Mahadevan
7498329d59 random: remove deprecated rand32.h
Header file was kept for 2 releases, time to remove it.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-13 19:08:11 -08:00
Anas Nashif
9f5ef47184 ci: twister: also report filtered instances
For statistical purposes and to improve over all coverage, report
filtered suites so we can see trends in elasticsearch and act on them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-13 20:04:04 -05:00
Sylvio Alves
40cd35e56d west.yml: espressif: fix mcuboot assert in hal
Espressif contains mcuboot calls for loading image.
This fixes the way assert call is included in that scenario.

Fixes #81351

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-13 13:36:27 -06:00
David Brown
44e0edcf1b submanifests: optional: rust: Limit build targets
Brings in a change in the v4.0-branch branch to limit the targets that
rust tests are run on to those that have been tested.  This will avoid a
large number of failure in the nightly build on platforms that aren't
expected to work.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-11-13 13:36:17 -06:00
Daniel DeGrasse
dee76a7907 boards: nxp: mimxrt1170_evk: document flash support for EVKB
Flash support for RT1170 EVKB was fixed with cfb7322107 (drivers: flash:
flash_mcux_flexspi: add support for W25Q512NW-IQ/IN). Document this
support in the board page.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-13 13:36:00 -06:00
Pisit Sawangvonganan
1175f57640 doc: fix typo in multiple directories before v4.0.0 release
Utilize a code spell-checking tool to scan for and correct spelling errors
in various files within the `doc` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-13 13:35:49 -06:00
Declan Snyder
1a5ae376a3 doc: release-notes-4.0: Add DT 4.0 notes
Add release notes for DT area for zephyr 4.0.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-13 09:15:49 -06:00
Akshay James
b93a51ae78 doc: fix typo in blackpill_f401cc docs
Fix the text and links where it mentions 'blackpill_f401ce' instead
of 'blackpill_f401cc'.

Signed-off-by: Akshay James <akshayjames95@gmail.com>
2024-11-13 09:15:00 -06:00
IBEN EL HADJ MESSAOUD Marwa
db6589f780 Revert "drivers: ethernet: eth_stm32_hal"
This reverts commit 0036b8bf21.

The reverted commit causes a compile error with the STM32F2 because
there are some variables used in the file eth_stm32_hal that are
not defined in the HAL module of the STM32F2 series,
such as 'ETH_RX_DESC_CNT' and 'HAL_ETH_MII_MODE'

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-11-13 09:13:23 -06:00
IBEN EL HADJ MESSAOUD Marwa
1721454266 Revert "drivers: ethernet: eth_stm32_hal_priv.h"
This reverts commit fbeda5959d.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-11-13 09:13:23 -06:00
Jamie McCrae
996b8a63e7 mgmt: mcumgr: Remove deprecated function smp_add_cmd_ret
Removes a function that was deprecated in Zephyr 3.4

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-13 09:08:18 -06:00
Jamie McCrae
55e7cc659c doc: Fix renamed ARM MPS* board targets
Fixes some board target names that have changed or were not
updated for hwmv2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-13 09:08:09 -06:00
Declan Snyder
c1398250e9 drivers: nxp_enet: Check link state in iface init
Still mark the iface as down after ethernet_init, but then actually
check the link state and initialize carrier appropriately

This fixes the case where, the phy driver doesn't give a callback after
iface init due to the link already being up, there was no change from
the phy driver perspective, so callback  wouldn't happen, and therefore
the interface could remain marked as down after boot even if carrier is up.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-13 09:07:59 -06:00
Declan Snyder
0da16f7ec6 drivers: nxp_enet: put phy cb before iface init
This commit moves one function before another, to make the diff of the
next commit clearer of what it's doing.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-13 09:07:59 -06:00
Anas Nashif
049b243b51 twister: stats: use anytree to create summary
Do not create the tree structure manually, use anytree instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
a43a67e3a3 twister: stats: fix suite statistics
suite stats were not correct, a mixup between skipped and filtered
suites was leading to inconsistent numbers. This is now fixed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
b578fa5b2a twister: stats: more renames skipped -> filtered
Additional variable renames leading to confusion between skipped and
filtered.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
d69d14aac6 twister: stats: skipped_configs -> filtered_configs
Rename variables leading to confusion between skipped and filtered
suites.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
61aefee3ad twister: stats: skipped testcases are part of selected group
Count skipped cases as part of selected group in stats.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
1647b46a07 twister: stats: remove double counting of statuses
We have been double counting some statuses, remove to get the stats
right.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
eddb0b77a3 twisters: tests: adapt twister testsuite
Adapt tests for new changes in twister.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
7e23b35c33 twister: stats: 'Executed test cases' -> 'Completed test cases'
Built tests are not executed, change column title.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
950dccc5bb twister: status inconsistencies are now warnings
Do not report status issues as errors, very confusing and developer end
up looking at the wrong thing, instead, treat those as warnings and
count them and report them at the end.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
5ad5b95fde twister: remove verbose debug message about adding platforms
This is very verbose and very long sometimes getting the way when trying
to debug a problem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
11447e4463 twister: stats: not run tests are also part not executed summary
Add notrun tests to the count of non-executed tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
64f950420a twister: do not report filtered cases in summary
It is confusing to report filtered testcases as  testcases that were
selected but not exexuted. If they are filtered, then there should not
be considered as selected.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
81af36202b twister: use consistent language for test configurations
In the summary, use "configurations" instead of instances.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Anas Nashif
c394a27d77 twister: count filtered testcases as such, not as skipped
When a suite is filtered, its testcases are also filtered and not
skipped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 18:05:16 -06:00
Jeremy Bettis
b1f42f2e71 drivers: Fix uninitialized variable warning.
In GCC 14.2.0, the keyvariable in usb_dc_ep_write is detected to be used
before initialization, even though this usage should be safe.

Fix by initializing the key variable to 0, and making the 2 if
statements explicitly checking the same value.

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2024-11-12 15:58:47 -06:00
Ioannis Damigos
135214d844 driver/dma_smartbond: Fix driver initialization when PM_DEVICE is set
Fix DMA driver initialization when PM_DEVICE is set.
Don't put PM policy state lock if it is not active.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-11-12 15:49:26 -06:00
Ioannis Karachalios
a66c070598 drivers: counter: Fix unbalanced policy state lock
This commit should deal with fixing unbalanced policy state locks.
When PM and PM_DEVICE are declared, default state, policy locks
should be given only when  active.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-11-12 15:48:20 -06:00
Ryan McClelland
88fb090b7f doc: release: add release notes for I3C for v4.0.0
add release notes for I3C for zephyr v4.0.0

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-12 13:21:35 -08:00
Aksel Skauge Mellbye
092fd18d5b doc: release-notes-4.0: Add Silabs notes
Add noteworthy additions for Silabs socs, boards and drivers.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-12 15:15:53 -06:00
Daniel DeGrasse
37c9cf22ce doc: release-notes-4.0: add release notes for SD subsystem
No significant changes have been made to the SD subsystem since 3.7. Add
a note documenting this for the 4.0 release.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-12 15:14:33 -06:00
Daniel DeGrasse
4606e1cfe5 doc: release-notes-4.0: add SDHC release notes
Add release notes for SD host controllers for 4.0

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-12 15:14:33 -06:00
Daniel DeGrasse
5ef6e46010 doc: release-notes-4.0: add release notes for disk
Add release notes for the disk driver subsystem

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-12 15:14:33 -06:00
Daniel DeGrasse
00f08ba004 doc: release-notes-4.0: add release notes for display
Add release notes for displays for 4.0 release

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-12 15:14:19 -06:00
Daniel DeGrasse
d9745bd36d doc: release-notes-4.0: add MIPI-DBI release notes
Add release notes for MIPI-DBI capturing significant changes since 3.7

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-12 15:14:07 -06:00
Josuah Demangeon
db4dc5b450 doc: releases: 4.0: Add LVGL capture sample to Video
The LVGL pull request was started before v3.7 release but merged
after, so needs to be included in v4.0 release notes. This was an
omission in commit 467f31190e.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-11-12 12:16:40 -06:00
Jordan Yates
35295f3663 zbus: observervation -> observation
Fix a typo in the doxygen and service documentation.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-12 12:15:55 -06:00
Flavio Ceolin
81491df4ac doc: release/4.0: Crypto driver notes
Add information about TinyCrypt shim driver deprecation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-12 12:15:36 -06:00
Fabian Blatz
db9ba1865a doc: release: 4.0: Add lvgl notes
Add release notes section about lvgl and the added sample.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-11-12 12:15:24 -06:00
Maochen Wang
d9ef4b7e69 manifest: Update hal_nxp to fix psa_crypto_init failure
The MBEDTLS_PSA_ACCEL_xxx macro means it will not enable the SW/Builtin
implementation of the feature. The PSA_WANT_xxx macro means it will
enable the PSA-API usage of the feature, and can use SW or HW
acceleration. If enable the MBEDTLS_PSA_ACCEL_xxx macros, during
psa_crypto_init, mbedtls_psa_hash_setup will failed, as the macro
MBEDTLS_PSA_BUILTIN_ALG_SHA_512 is undefined. Remove the marco of
MBEDTLS_PSA_ACCEL_xxx can enable maco MBEDTLS_PSA_BUILTIN_ALG_xxx,
and fix the supp_psa_crypto_init fail and Wi-Fi connection failed issue.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-12 09:58:18 -06:00
Sylvio Alves
0cbb92c2c8 boards: heltec: fix kconfig cpu entry name
Minimum heap pool should be always set for the board
in order to enable internal drivers/subsystems to work.

It is currently not defined for APPCPU due to typo in
board's Kconfig, possibly causing build failures.

Fixes #81218

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-12 09:58:04 -06:00
Maureen Helm
27fca4d24f doc: release: Add ADI notes for v4.0.0
Adds release notes for new ADI drivers and notable changes introduced
since the last release.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-11-12 09:57:53 -06:00
Maureen Helm
782247bc6a doc: release: Add sensor notes for v4.0.0
Adds release notes for notable changes and new sensor drivers introduced
since the last release.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-11-12 09:57:53 -06:00
Jukka Rissanen
0ab7ecf038 doc: release-notes-4.0: Add notes for Wi-Fi
Added release notes for Wi-Fi.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-12 09:57:41 -06:00
Declan Snyder
3b16920ada doc: release-notes-4.0: Add ethernet/mdio notes
Add release notes for ethernet and mdio drivers for 4.0

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-12 09:57:28 -06:00
Robert Middleton
05ad0ae8fd doc: develop: tools: Add STM32CubeIDE directions
Add directions on using STM32CubeIDE for developing Zephyr.

Signed-off-by: Robert Middleton <robert.middleton@rm5248.com>
2024-11-12 09:57:15 -06:00
Anas Nashif
79f742f252 doc: tests: remove page about deprecated ztest APIs
Remove leftover page about deprecated ztest APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 09:56:54 -06:00
Dat Nguyen Duy
65511eacf9 drivers: dma_mcux_edma: utilize correct macros for edma v3
Utilize correct macros for edma v3

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2024-11-11 17:53:07 -06:00
Duy Nguyen
7f4cab95b3 doc: release notes v4.0: Renesas RA addition
Update noteworthy support of Renesas RA driver for 4.0 release

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-11-11 17:52:57 -06:00
Flavio Ceolin
a19fb8e122 doc: security: Add CVE under embargo
Add an entry to CVE-2024-10395

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-11 17:52:48 -06:00
Flavio Ceolin
1aba3ce280 doc: release/4.0: Add CVE under embargo
Add information about CVE under embargo.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-11 17:52:48 -06:00
Dan Kalowsky
c50777a843 VERSION: bump for 4.0.0-rc3
Update the VERSION file to reflect the taggingg for v4.0.0-rc3 release

Signed-off-by: Dan Kalowsky <dkalowsky@amperecomputing.com>
2024-11-09 04:26:19 -06:00
Pieter De Gendt
373ed89e4b doc: release: 4.0: Add nanopb 0.4.9 update
Add section for nanopb and upstream sync.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-08 22:31:17 -06:00
Pieter De Gendt
0775b507b5 submanifests: optional: Bump nanopb to 0.4.9
Sync upstream and get the latest tagged version 0.4.9.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-08 22:31:17 -06:00
Erwan Gouriou
8025c8473b doc: Migration guide v4.0: STM32 additions
STM32 noteworthy additions for 4.0 release.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-08 22:29:51 -06:00
Erwan Gouriou
4e50521a22 doc: release notes v4.0: STM32 additions
Gathers STM32 noteworthy additions for 4.0 release.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-08 22:29:51 -06:00
Flavio Ceolin
429d2e79b1 docs: release/4.0: Info about TinyCrypt
Add an information about upcoming TinyCrypt deprecation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-08 22:29:08 -06:00
Flavio Ceolin
f81c20d088 Revert "tinycrypt: deprecate the library"
This reverts commit 5e225e0c8b.

Based on #79931 and TSC discussions, it was decided that TinyCrypt
will be deprecated *AFTER* 4.0.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2024-11-08 22:29:08 -06:00
Marek Matej
207da3ad15 doc: espressif: Add missing images
Update and add missing Espressif board images.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 22:28:30 -06:00
Ryan McClelland
c58c130b48 drivers: sensor: default_rtio_sensor: fix limited range warning
`chan_type` is defined as a `uint16_t`. This makes checking if it is
< 0 always false. A warning is shown with -Wtype-limits. Remove the
check as it is unnecessary.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-08 22:28:08 -06:00
Jukka Rissanen
04d8b7c595 net: sockets: Cleanup socket properly if POSIX API is enabled
The sock_obj_core_dealloc() was not called if close() is called
instead of zsock_close(). This happens if POSIX API is enabled.

Fix this by calling zvfs_close() from zsock_close() and then
pass the socket number to zsock_close_ctx() so that the cleanup
can be done properly.

Reported-by: Andreas Ålgård <aal@ixys.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-08 15:56:39 -06:00
Declan Snyder
92d0287813 drivers: spi_mcux_lpspi: Fix DMA path on RT
Apparently, the previous change to fix the chip select only works on
some newer revisions of the LPSPI, and the behavior is different on
older parts like RT. For now put some #ifdef to keep the fixed CS on
MCXN but have the old behavior on RT and other platforms.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-08 15:56:06 -06:00
Bernardo Perez Priego
b6b8eeedf0 serial: mchp_xec: Fix uart_xec_irq_tx_complete function
This function is only checking for current byte being transmitted.
This patch ensures that function returns `1` until TX is disabled and
no byte is being transmitted.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2024-11-08 15:55:52 -06:00
Dong Wang
431c34039a tests: debug/coredump: Change to call k_panic() for ISH SoCs
ISH SoCs have zero-address memory mapped to I2C0 controller.
Coredump cannot be triggered by zero-address access.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2024-11-08 15:55:36 -06:00
Peter Mitsis
aeaddd70b7 tests: Fix IRQ locking in sched benchmark
Corrects an issue that was introduced when the interrupt
locking/unlocking was added to the 'sched' benchmark by
unlocking the interrupts before the context switch done by
k_yield(), but after the call to z_unpend_first_thread().

Fixes PR #81050

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-11-08 15:55:23 -06:00
Simon Maurer
18818c15cd openamp: resource table: fixes resource table for ram_console section
in commit 1cd37f21f3 the global ram console buffer was replaced
with a pointer. This didn't work with the OpenAMP resource table
anymore (#75656).

Signed-off-by: Simon Maurer <mail@maurer.systems>
2024-11-08 15:55:11 -06:00
Karun Kumar Eagalapati
02c8a5a80c manifest: Update hal_nordic
Updated manifest to include fix for incorrect display of scan
results when APs have EAP and PMF enabled.

Fixes #80995

Signed-off-by: Karun Kumar Eagalapati <karun.kumar@nordicsemi.no>
2024-11-08 15:54:59 -06:00
Hongquan Li
c5fa9af235 drivers/wifi/nrfwifi: Add buffer for discard bytes
Some spi drivers do not allow the send buffer
and receive buffer to be empty at the same time,
if this happens it will cause the spi to be unable
to communicate with the nrf7002, so add the receive
buffer for the discard byte in the spim_xfer_rx.

Fix #80686

Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
2024-11-08 14:01:23 -06:00
Andrew Feldhaus
a2e920cf96 drivers: rtc: rtc_ds1307: Fix corruption of SECONDS register
We read/modify/write the CH/SECONDS register at initialisation to clear
only the Clock Halt bit and only if it is set.

The previous implementation zeroes the entire register unconditionally at
initialisation, which wipes the SECONDS fields.

Fixes #77354.

Signed-off-by: Andrew Feldhaus <github@feldhaus.co.uk>
2024-11-08 13:58:10 -06:00
Franciszek Pindel
9c94ee5346 include/zephyr: Use ROMABLE_REGION for LMA in .last_ram_section
Currently RAMABLE_REGION is used for both virtual address (VMA)
and a load address (LMA). It results in wrong LMA for some platforms.
This commits adds using ROMABLE_REGION for LMA.

Signed-off-by: Franciszek Pindel <fpindel@antmicro.com>
2024-11-08 13:57:42 -06:00
Raymond Lei
a6466249a9 drivers: dma: edma: Put the TCD pool in DTCM by default
To reduce the latency of CPU accessing/modifying SW TCD content, it
better to put TCD pool to DTCM by default.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Raymond Lei
209cb8157a drivers: serial: lpuart: Enable SG mode of LPUART
New implemented eDMA loop SG mode can be used to lpuart driver to fix
the conflict of "Done" bit issue which cause uart_async_api test failed
when SG mode is enabled.

Also, this loop SG mode works well even with a high bandrate(test done
on 2000000bps).
Fixes: #78291

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Raymond Lei
7145295a4a Drivers: driver: i2s: Use eDMA loop SG mode
I2S speed test failed because of "Invalid destination address" issue By use
eDMA loop SG mode, this issue is fixed.

Fixes: #70777

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Raymond Lei
dfb1652dec drivers: dma: edma: eDMA loop SG mode support
Existing dynamic SG mode have some issues which cause uart sync api and
I2S speed test failed.

These issues are: a wrong "Done" bit issue found on UART async api
test. An invalid destination address issue found on I2S speed
test. By introducing loop SG mode, these issues are all fixed.

Some data structures are different between eDMA and eDMA V4, use
different macros defined in SDK driver for each of them.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Raymond Lei
fddc009f58 drivers: dma: edma: Pending length calculation incorrect
Pending length should be mainloop count multiply NBYTES of minor loops.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Simon Moser
a77d499e2d doc: fix body length in SMP UART transport
In the description of the partial-final frame of the SMP UART transport
specification was a typo in the maximum allowed raw body size. The size
must not be larger than MTU - 5 because there are 5 bytes occupied by
total length (2), frame termination (1) and crc (2).

Signed-off-by: Simon Moser <simon.github@mailbox.org>
2024-11-08 13:57:18 -06:00
Zak Portnoy
32b1140066 mgmt: smp: shell: Respond on uart shell device when changed at runtime
Responses are currently set to the shell device that was configured
in the device tree.

The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.

This patch causes smp_shell_tx_raw to use the shell_uart device

Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
2024-11-08 13:57:09 -06:00
Luca Burelli
50ab6953c2 linker: llext: avoid modifying current address in linker script snippet
The linker script snippet that places the llext_no_syscall_impl section
has the unfortunate side effect of overwriting the current linker
address. This can lead to unexpected behavior of the caller script.

Saving the current address before defining the section and restoring it
afterwards avoids this issue.

Fixes #81136.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-08 13:56:57 -06:00
Robert Lubos
ebac6f2f21 doc: release-notes: Add 4.0.0 release notes for networking
Add 4.0.0 release notes for networking.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-08 13:56:46 -06:00
Ioannis Karachalios
7c5c459440 drivers: memc: Fix various APS6404 device issues
This commit deals with fixing various issues that prevents
the device from being built. In specific:

1. Fix default timing macro definitions to build with
an MSPI controller, other than AMBIG.
Add macro definition for MSPI_PORT.
2. Timing settings should be applied only when MSPI_TIMING
is defined. Otherwise, the APS6404 initialization routine
will fail with -EIO.
3. Similarly, use MSPI_XIP and MSPI_SCRAMBLE to apply XIP
and SCRAMBLE device settings, respectively (optimization).
4. MEMC_INIT_PRIORITY is assigned higher priority than
MSPI_INIT_PRIORITY which results in compiler error as
APS6404 device initialization depends on its underlying
MSPI bus controller.
5. The 'acquire' subroutine should be compiled when PM_DEVICE
is used (suppress compiler warning).

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-11-08 13:56:31 -06:00
Benjamin Cabé
dc2c13bebd doc: ci: Build documentation on board documentation changes
Adds glob expression triggering CI for *all* changes in boards'
documentation, not just those matching the "*.rst" pattern since there
can also be images being changed without any other change on RST files.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-08 11:40:58 -06:00
Francois Ramu
c7cbe91760 drivers: i2c: stm32 I2C V2 handles i2c_target processed_cb return code
Check the return code of the i2c_target_read/write callback function
is 0 before continuing the transmit/receive operation on I2C target
When Transmitting: 0 if data has been provided, then continue
When address matches: 0 if the write is accepted or
if more data can be requested depending on the transfer direction.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-08 11:38:02 -06:00
Jukka Rissanen
fe56ce5a1c net: ipv6: fragmentation: Drop the packet if fragmentation fails
If we could not fragment the IPv6 packet, then drop it and do
not try to send it. Let the upper layer re-send the packet if
needed. It is causing more trouble if we try to send the packet
and not honor the MTU setting.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-08 11:37:49 -06:00
Jukka Rissanen
414316379a net: ipv4: fragmentation: Drop the packet if fragmentation fails
If we could not fragment the IPv4 packet, then drop it and do
not try to send it. Let the upper layer re-send the packet if
needed. It is causing more trouble if we try to send the packet
and not honor the MTU setting.

Fixes #81021

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-08 11:37:49 -06:00
Chaitanya Tata
9561a0ac76 drivers: nrfwifi: Fix recovery for SAP
nRF70 recovery relies on power-management feature which isn't applicable
for SAP, so, we keep seeing false recovery causing interface restart.

Disabled recovery for SAP to fix the issue.

Fixes #81130.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-08 11:37:31 -06:00
Maochen Wang
f1572b988b manifest: Update hostap to fix ECSA issue
Update hostap to fix ECSA issue that warning log and
current_mode is not updated.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-08 11:37:18 -06:00
Marcus Penate
72534b83e4 net: lib: sntp_simple: Handle responses from previous iterations
SNTP simple runs request iterations with exponential backoff.
If the net interface is a slower connection (ie. CAT M1 modems)
then the request will be sent but the response may take time to
be received, thus causing a timeout and another request to be sent.
Because of the nature of UDP and the fact that the same socket
(source IP/port combo) is being used for both requests, a delayed
response to the first request can be received as the response to the
second request, causing -EINVAL to be returned when the timestamps
mismatch (see subsys/net/lib/sntp/sntp.c). The solution provided
retries receiving the response when the timestamp is mismatched
(without sending an additional request).

Signed-off-by: Marcus Penate <marcus.penate@ellenbytech.com>
2024-11-08 11:37:02 -06:00
Emil Gydesen
4d8acdf9ed doc: Fix VMWare type in autopots-linux
It is called VMWare and not WMWare.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-08 11:36:41 -06:00
Emil Gydesen
58c3940a6b doc: autopts-linux: Add troubleshooting for window opening and closing
Refactored the structure of the troubleshooting section so it
is more similar to how e.g. the ArchWiki lists troubleshooting
entries, which makes it easier to search for and separate
each entry.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-08 11:36:41 -06:00
Emil Gydesen
e89a5d10ef doc: Update Virtualbox steps for autopts-linux
The exisitng documentation was out of date and
possibly not working.

Added a section on how to use NAT and port forwarding.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-08 11:36:41 -06:00
Emil Gydesen
397b5cbcd9 doc: Use correct RST headings in autopts-linux.rst
The documentation guidelines have a specified order of
header underlines that this file did not follow.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-08 11:36:41 -06:00
Raffael Rostagno
38a70cc1fd tests: drivers: spi: esp32c6: Fix overlay configuration for loopback
Fixes overlay configuration to allow running the test on CI without
externally connecting two pins.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-11-08 11:36:21 -06:00
Raffael Rostagno
c4b7903828 pinctrl: esp32c6: Fix for input/output enable flags
Fix missing input/output enable flags on pinctrl macro, which
wouldn't allow for driver to see and apply flags configuration
made in the device tree.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-11-08 11:36:21 -06:00
Marek Matej
a8ab8b49f2 samples: drivers: IPM fixes
Updates and fixes to support IPM sample on ESP32:

- fix IPM sample code for APPCPU and PROCPU
- align with memory layout, add flash awarenes
- shell commands to stop/start APPCPU
- reorganize overlays

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Marek Matej
ed1179713c soc: esp32s3: AMP support
Updates and fixes to support APPCPU.
- fix ld scripts
- fix and update memory layout
- fix build issues
- fix sysbuild

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Marek Matej
82eb8a1fb6 drivers: clock_control: amp clock fix
Avoid APPCPU to interact with a clock settings.
Fix warning when LOG_LEVEL_DBG.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Marek Matej
93121879cf boards: esp32s3: AMP support and fixes
Fix missing flash and code partition.
Add missing dts entries and use common partition tables to all related
non-Espressif boards, previously ommited.
Add uart1 node in pinctrl for APPCPU.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Marek Matej
f3e70fdd75 dts: esp32s3: shm nodes update
Align the shared memories with the memory.h layout.
Reorder nodes to show memory related nodes together.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Marek Matej
1cf44557c5 manifest: update hal_espressif
Fetch latest features to support fixes.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-11-08 11:36:09 -06:00
Daniel DeGrasse
fc3ebac704 samples: drivers: display: make platform names fully qualified
Twister's extra arguments feature only works correctly if the fully
qualified platform name is given, which was not the case. Make all
platform names for the shield testcase fully qualified to resolve this.

Fixes #80876

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-08 11:35:58 -06:00
Daniel DeGrasse
d565f6e62a samples: drivers: display: remove lpc54114 from shield test
LPC54114 does not define arduino_header nodelabel, so it cannot be
supported by the shield test within the display sample. Replace with
mimxrt1010_evk, which is supported.

Fixes #80876

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-08 11:35:58 -06:00
Håvard Reierstad
42ae483795 Bluetooth: Host: Ensure only connected peers affect _bt_gatt_ccc.value
The doc on `_bt_gatt_ccc.value` specifies that only connected peers
contribute to that value. But before this change, it was computed from
all entries in `_bt_gatt_ccc.cfg`, which include bonded but not
connected peers when `CONFIG_BT_SETTINGS_CCC_LAZY_LOADING` is set.

Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-08 11:35:42 -06:00
Dmitrii Golovanov
d7fe3d1a75 tests: crypto: tinycrypt: Fix premature Ztest end
Don't use TC_END_RESULT() to report Ztest's result prematurely.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-08 11:35:22 -06:00
Declan Snyder
e8cf9601c1 drivers: flash: mcx: Clear cache after erase
Cache needs to be cleared after erase in order to read back erased
values correctly.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-08 09:29:11 -06:00
Dmitrii Golovanov
e3ec702196 tests: drivers: ipm: Fix drivers.ipc.mailbox
Fix 'drivers.ipc.mailbox' test suite to restore and improve
its testing functionality:

 * fix printf() redirection through IPM console.

 * fix and check the dummy driver initialization.

 * specify correct Twister harness type (Console)
   and use matching patterns to recognize the expected
   console output.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-08 09:28:50 -06:00
Thomas Stranger
3ca53ac518 doc: release notes: add 1-wire release notes for 4.0
Add 1-Wire related release notes for Zephyr v4.0.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-11-08 09:27:37 -06:00
Emilio Benavente
c06ecf9a50 soc: nxp: mcxw: Update IRQ Size for MCXW to remove reserved IRQ
The FRDM_MCXW71 Platform has a reserved IRQ as its
last IRQ, this test was using this IRQ to
test an interrupt and would not fire. This change
ensures the test does not use the reserved IRQ.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-11-08 09:26:43 -06:00
Mahesh Mahadevan
9861a6a7c1 drivers: flexspi_nor: Fix Flash failures seen on FRDM-MCXN947
The flash_flexspi_nor_check_jedec() checks the lower 16-bits of
the manufacturer ID and installs a custom LUT table.
Add an exception to check for the whole 32-bits so we do not
accidentally install custom LUT for flash devices that do not
support this LUT table.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-08 09:26:24 -06:00
Daniel Leung
a8c3025de2 MAINTAINERS: remove duplicate soc/cdns/dc233c
This removes the duplicate soc/cdns/dc233c paths from the Xtensa
arch.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-08 09:26:08 -06:00
Daniel DeGrasse
2ad01d966b modules: hal: nxp: update to include fix for CACHE64_GetInstanceByAddr()
CACHE64_GetInstanceByAddr() function was asserting when an instance was
requested for an invalid address that the CACHE64 controller does not
manage. This behavior is not correct, as the CACHE64 management
functions check to see if the instance number returned by this function
is out of range (and if so, simply return without modifying the cache).

This assertion was causing a failure within the USDHC driver, which
performs a cache clean/invalidate for tx/rx transfers within the HAL
layer. When a transfer was run using a data buffer not in the CACHE64
address range, this assertion failed and caused the application to crash

Fixes #80901

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-08 09:25:55 -06:00
James Roy
e7c34367cf doc: build: dts: Fix incorrect rst tag
Replaced incorrect ':c:func:' tag for devicetree macro
with ':c:macro' tag.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-08 09:25:41 -06:00
Vinayak Kariappa Chettimada
525ba389bc tests: Bluetooth: tester: Workaround Bus Fault in nRF53x using full RAM
Workaround failing autopts weekly run due to tester
application having Bus Fault in the nRF53 NET core hci_ipc
firmware at startup.

Having atleast 32 bytes free in nRF53x hci_ipc sample to
avoid Bus Fault when Zephyr Kernel does SYSINIT calls.

Reduce supported ISO Broadcaster instance and ISO TX buffer
counts in the Controller hci_ipc firmware.

Add sysbuild support for tester application so that the
build is CI verified.

sysbuild commandline for LE audio PTS testing:

  # west build --sysbuild -b nrf5340_audio_dk/nrf5340/cpuapp
    -d build/tester tests/bluetooth/tester
    -DEXTRA_CONF_FILE="overlay-le-audio.conf"

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-08 09:25:28 -06:00
Emilio Benavente
3018ff7a4d dts: arm: nxp: Updating the ram size for the MCXW71
Updating the SRAM space for the MCXW71 SOC.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-11-08 09:25:04 -06:00
Emilio Benavente
5c9d6f1dba tests: lib: cmsis_dsp: transform: Update Ram Size
Updating the minimum Ram Size for failing tests
that require more ram memory for heap allocations.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-11-08 09:25:04 -06:00
Erwan Gouriou
b2c9db7606 boards: st: stm32l5: Fix TF-M by restricting Libc malloc aera
By default, libc malloc allocated area is using all available RAM.
For some yet unknown reason, this conflicts with TF-M resulting in a
Hard Fault before jumping in the non secure application.

For now, define a Libc malloc area defined to 2048 which is the default in
some other typical applications (ARMv7 targets enabling USERSPACE).

Fixes #77847

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-11-08 09:24:55 -06:00
Emil Gydesen
7c40b071e4 Bluetooth: CSIP: Fix off-by-one in in lock restore
If the lock request was rejected by a set member we should
restore any previously written logs in reverse order.

However there was a off-by-one error in
csip_set_coordinator_write_lock_cb which caused us to attempt to
release member[1] instead of member[0] if member[1] was the
one that rejected the lock request.

Additionally, the lock_set_complete would be called
prematurely before we get the response from the restore
request.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-08 09:24:43 -06:00
Anas Nashif
5776436136 tests: shell: limit build only config tests
Limit build_only config tests to one platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-08 09:24:31 -06:00
Hui Bai
67980643d7 net: wifi: Fix 11k command errors
Add condition check so that the 11k flag will be updated for set
operation only.
Fix print log error when getting 11k status.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-11-07 18:42:15 -08:00
Peter Mitsis
41064c8e1d tests: Add objcore to latency_measure testcase.yaml
Adds the object core configuration to the latency_measure benchmark's
testcase.yaml file as there have been requests for it.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-11-07 18:42:03 -08:00
Chaitanya Tata
fd7fc17810 net: wifi: Fix strings for missing enumerations
Enumerations were extended but respective strings were not added.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 18:41:53 -08:00
Chris Desjardins
862af5e903 fs: Fix null pointer exception caused by async fs_unmount
The mp pointer is in fs_file_t and fs_dir_t so if the fs pointer is made
NULL then subsequent file I/O operations will cause a NULL pointer
exception. Removing the mount point from the list is threadsafe and
should be sufficient.

Signed-off-by: Chris Desjardins <chris@arch-embedded.com>
2024-11-07 18:06:58 -06:00
Francois Ramu
f781d7a26f soc: st: stm32U5/L5 series also have SWO line
Add the SWO trace output to the stm32H5/H7RS/L5/U5/WB series

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-07 18:05:07 -06:00
Daniel DeGrasse
e516a2219b boards: shields: rk055hdmipi4ma0: increase DSI clock for RT1160
Increase target DSI clock frequency for the RT1160, as the DSI
peripheral requires a faster clock to account for the DSI packets that
must be sent outside of video mode frames.

This fix was previously applied for the RT1170, but is also needed for
the RT1160 SOC as they use the same DSI IP.

Fixes #78299

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-07 18:04:53 -06:00
Chaitanya Tata
073f68d248 drivers: nrfwifi: WAR for performance regression
With the newly introduced settling time for PLLS, we are seeing a peak
performance drop of 3Mbps in Zperf benchmarks, and also other
performance tests are also impacted.

This settling time was introduced based on observations in lab and not
because of any real problem or bug reported, so, for now, use zero
settling time (same as earlier) till we fully investigate and understand
the impacts and need.

Fixes #80951.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 18:04:44 -06:00
Emil Gydesen
6c79fdf2ca Bluetooth: BAP: Fix bad state check for broadcast sink
The state check used != instead of == to very that it entered
the streaming state for all streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-07 18:04:34 -06:00
Declan Snyder
6984fd87a3 drivers: eth_nxp_enet: use net_if_carrier_off init
Use net_if_carrier_off during iface init instead of net_eth_carrier_off,
to immediately mark net if as down

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-07 18:04:18 -06:00
Declan Snyder
39f32eac37 doc: twister: Clarify that the minimums are rough
There is no way to know for sure the size of an image built for a test,
given that zephyr can build for so many different architectures,
platforms, software supports, etc. So it should be clear that the filter
for min_ram and min_flash on the twister testcases is an estimate, and
not a strictly well known value.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-07 18:04:08 -06:00
Grixa Yrev
91a59e7e15 soc: nxp: imxrt: exclude mpu_regions.c when ARM_MPU disabled
When option ARM_MPU is disabled exclude soc\nxp\imxrt\mpu_regions.c.
It is needed to remove constraints of SRAM and FLASH size.
Fixes #70920

Signed-off-by: Grixa Yrev <GrixaYrev@yandex.ru>
2024-11-07 11:07:04 -08:00
Jordan Yates
60442a221a modules: segger: remove mutex locking
Remove mutex locking in favour of the standard IRQ locking mechanism.
The primary problem with the mutex implementation is that mutex locking
is forbidden in ISR's. This means that any logging from an interrupt
context (e.g. LOG_PANIC in an exception handler), will itself trigger
another assertion due its attempt to use a mutex.

Furthermore, mutexes are a relatively heavyweight locking scheme, which
doesn't necessarily make sense in the context of extremely short locking
periods that would be expected from RTT.

This change aligns Zephyr with the default RTT locking scheme, which
uses interrupt masking to perform access control.

Resolves #79403.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-07 11:06:45 -08:00
Robin Kastberg
580e93e9b4 arm: tests: kernel: fix bug in fatal_exception test
In ARM architectures the entry_cpu_exception_extend calls
svc #0 when trying to generate a `K_ERR_CPU_EXCEPTION`, however
z_arm_svc calls z_do_oops with a stack frame only, and gets the
reason from `r0`. This means that the test working was just lucky
and running it with another compiler (or setting the value of r0
before the svc #0 call, made the test fail).

Cortex-A/R 32-bit architectures was doing a BKPT, this works better
but will not be a hard exception when debugger is attached.

I switched all the Cortex 32-bits to the ARM specified undefined
instruction.

Also RISC-V has a designated unimp instruction that should be used to
guarantee trap.

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2024-11-07 11:06:34 -08:00
Daniel Leung
eb9fc642b9 xtensa: remove mem_domain excess padding
The ptables field in arch_mem_domain for Xtensa has excessive
padding as it is incorrectly marked with needing page size
alignment. This is simply a pointer and not the actual page
table so there is no need for that alignment. So remove it.

Fixes #71896

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-07 11:06:23 -08:00
Daniel Leung
0e9376ebff tests: thread_error_case: no ICOUNT for qemu/xtensa/dc233c/mmu
For some weird reasons, enabling ICOUNT would result in some
tests crashing QEMU. So disable ICOUNT.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-07 11:06:23 -08:00
Anas Nashif
ac162b041a intel_adsp: set exec for simulator targets
Set exec in combination with custom simulator to all for correct
test/envionment evaluation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-07 11:06:10 -08:00
Anas Nashif
52f9a129b5 twister: custom simulator needs an exec defined
custom simulator needs an executable defined, or else we will have tests
marked runnable with nothing to run them which would result in an
error/warning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-07 11:06:10 -08:00
Nicolas Pitre
8232440bb1 doc: release: 4.0: mention LLEXT for ARM64
Mention LLEXT for ARM64.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-11-07 09:08:02 -08:00
Chaitanya Tata
4ae6520c3a drivers: nrfwifi: Fix passing of RAW scan results flag
The CONFIG_ prefix should be removed when passing to OSAL code.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 09:00:35 -08:00
Jun Lin
69e85b25fe board: npcx: remove CONFIG_PINCTRL from defconfig of npcx boards
The CONFIG_PINCTRL is removed from the board's defconfig files.
Drivers which use pin control function should add "select PINCTRL"
in their Kconfig files.

Fixes #78619

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-11-07 08:59:14 -08:00
Gerard Marull-Paretas
faf075a9d4 soc: nrf54h: gpd: use callback to fetch nrfs async result
Busy-waiting for the result of the nrfs service calls can stall, so
let's use a callback that flags a semaphore instead. Since the API is
supposed to be callable in the context of pre-kernel, fallback to
busy-wait on that scenario.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-07 08:57:45 -08:00
Gerard Marull-Paretas
d22c209c4b doc: release-notes-4.0: add device changes
Not much happening here, just some LLEXT related changes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-07 08:57:34 -08:00
Gerard Marull-Paretas
654303cd73 doc: release-notes-4.0: add relevant pinctrl changes
Add relevant changes for the pinctrl area.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-07 08:57:34 -08:00
Gerard Marull-Paretas
e5602f859e doc: release-notes-4.0: add relevant regulator changes
Add notable changes to the regulator drivers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-07 08:57:34 -08:00
Nicolas Pitre
6b0e259d27 doc: release/4.0: more bits about demand paging
Mention SMP and demand mapping.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-11-07 08:57:20 -08:00
Fabio Baltieri
2a250af793 doc: release: 4.0: add Input release notes
Add Input subsystem release notes.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-07 08:57:04 -08:00
Johan Lafon
2b5ee0ca91 drivers: display: ssd1322: fix only part of the image being diplayed
Only the first chunk of the desired image is displayed repeatedly over
the screen height (at least on an NHD-2.7-12864WDW3 display). Fix it
by computing the internal mono01 to 4bit grayscale conversion buffer
size correctly so it can fit the entire image.

Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
2024-11-07 08:35:02 -06:00
Johan Lafon
a140dd3de9 drivers: display: ssd1322: fix low and uneven pixel brightness
In case more than one segment per pixel is required, only part of the
segments were written resulting in low and uneven pixel brightness (at
least on NHD-2.7-12864WDW3). Fix it by writing all required segments.

Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
2024-11-07 08:35:02 -06:00
Johan Lafon
b92bd6d345 drivers: display: ssd1322: fix never returning call to display_write
A call to the write API function was never returning as we were trapped
into an infinite loop. This was caused by the pixel_count pointer not
being incremented properly.

Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
2024-11-07 08:35:02 -06:00
Arif Balik
10fa1eab50 drivers: clock: fix STM32_PERIPH_BUS_MIN for STM32U0
`STM32_PERIPH_BUS_MIN` is not the minimum bus address in `stm32u0_clock.h`

Signed-off-by: Arif Balik <arifbalik@outlook.com>
2024-11-07 08:34:34 -06:00
Maximilian Deubel
4f85ce6eda dp: swdp_bitbang: fix missing reset pin error
This patch fixes an issue where the reset pin is used even when it's
not given.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-11-07 08:33:18 -06:00
Emil Gydesen
4331b5fe77 tests: Bluetooth: PBP: Fix adv data for PBP BSIM test
The test had a few off-by-ones in the code, which caused access
to invalid data.

Fixed by setting the right buffer sizes and the right AD length
fields.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-07 08:33:03 -06:00
Raymond Lei
2696220bee soc: nxp: imxrt11xx: Typo in clock initialization of usb2
a typo in usb2 clock initialization which impact the function of usb2.
fixes: #81027

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-07 08:32:51 -06:00
Benedikt Schmidt
035b139f64 drivers: fpga: add checks for optional properties of iCE40
Add checks in the GPIO bitbang mode to avoid a fault for missing
configuration in the devicetree.
Fixes #80850

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-11-07 08:32:42 -06:00
Benjamin Cabé
c6cc7a17e5 samples: drivers: video: fix shield name
The capture to LVGL sample is using an incorrect name for the
weact_ov2640_cam_module shield

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-07 08:32:33 -06:00
Luca Burelli
33def3036a drivers/flash/soc_flash_mcux: adjust alignment logic
The current alignment logic does not work as expected if given unaligned
values, resulting in a skip of the first word. The length also has to
take into account the starting address: for example, asking for 2 bytes
at offset 3 should actually check 8 bytes.

This patch adjusts the logic so that it always includes the first and
the last word of the input area.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-07 08:32:14 -06:00
Luca Burelli
20cd3a3f09 drivers/flash/mcux: fix flash_read() operation on LPC55S36
As other targets in the LPC55xxx series, the LPC55S36 has a Flash
controller that raises ECC errors when reading erased pages directly.
To avoid this, there is special code for this platform that calls the
HAL FLASH_IsFlashAreaReadable() function. However, this in turn calls a
function at an hardcoded address in ROM that _always_ causes an
instruction fault, making the situation worse.

This patch reworks the read operation to use the FLASH_Read() HAL
function for this target to gracefully handle error conditions and
properly emulate accesses to erased pages. The preprocessor is required
since some targets do not define the FLASH_Read() function.

Fixes: #80325

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-07 08:32:14 -06:00
Andries Kruithof
5a03d3f51c Bluetooth: Audio: Fix description for broadcast_code callback
Small mismatch between the actual procedure name and the name as
described in the doxygen documentation for the bap set broadcast
code procedure

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-11-07 08:32:04 -06:00
Henrik Skreslet
e254a7f3c8 modem: cmux: added validation of cmux frame length
Validates cmux frame length and drops it if its larger
than the receive buffer

Signed-off-by: Henrik Skreslet <henrik.skreslet@gmail.com>
2024-11-07 08:31:48 -06:00
Gaofeng Zhang
c3466b14d0 manifest: Update hal_nxp to fix hang when board reset
Update hal_nxp to fix hang when board reset

Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
2024-11-06 18:57:47 -08:00
Fabio Baltieri
5155c0e820 doc: release: add a step to verify that the tag is signed
Add an extra "git show" step to the release process to verify that the
key has been indeed signed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-06 18:52:51 -08:00
Riadh Ghaddab
f556826c83 doc: release: 4.0: add notes on ZMS
Add notes about the new storage system ZMS

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-11-06 18:52:39 -08:00
Benjamin Cabé
4300a4c33b doc: boards: esp32: fix XIAO-ESP32S3 build instructions
fix wrong board target in build command snippets

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-06 16:41:21 -06:00
Sylvio Alves
85f9940e14 doc: release: 4.0: Add Espressif changes.
Adds notes on Espressif changes to this release.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-06 16:40:30 -06:00
Sylvio Alves
07fd5600a9 kconfig: fix typo and help description.
Fix typo and re-phrase help description to improve it.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-06 16:40:30 -06:00
Sylvio Alves
41b3cd77df docs: boards: xiao_esp32s3: migrate board name to new directive
Update board name to meet zephyr:board model.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-06 16:40:30 -06:00
Josuah Demangeon
467f31190e doc: release: 4.0: Add video driver and video API updates
Add entries for video driver contributed or enhanced.
Add entries for video APIs introduced or modified.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-11-06 16:40:13 -06:00
Daniel Leung
d4b1302387 doc: release/4.0: add bits about serial
This adds some bits about serial/UART in the migration
and release notes for 4.0.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-06 16:39:55 -06:00
Daniel Leung
6fb8157ee4 doc: release/4.0: add bits about demand paging
This adds some bits about demand paging in release note
for 4.0.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-06 16:39:55 -06:00
Sumit Batra
e0d1e5973d mdio: fmurt6: dts: Enable the parent node of mdio
mdio_enet_nxp driver accesses the registers of its parent node Ethernet MAC
This commit enables this node in mimxrt1062_fmurt6 board's device tree.
This also fixes Issue #80881

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2024-11-06 16:39:32 -06:00
Grzegorz Swiderski
8fc161f820 west: runners: nrf: Check for missing UICR
On nRF54H and nRF92, booting certain cores requires programming a UICR,
which is normally generated using nrf-regtool. This should be considered
an optional dependency, because we do not wish to force non-Nordic users
to install it just to work with Zephyr, or just for build-only tests.

When nrf-regtool is not installed, a CMake warning will be displayed,
but people ignore warnings all the time. As the last line of defense,
check for missing UICR in the nrfutil flash runner, to prevent our users
from unintentionally programming unbootable firmware. Show a fatal error
specifically if CONFIG_NRF_REGTOOL_GENERATE_UICR=y, yet no UICR exists.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-11-06 16:39:09 -06:00
Benjamin Cabé
ce02d0c0fc doc: releases: Complete documentation release notes for 4.0
This completes the existing "Documentation" section of the release notes
for 4.0 by documenting the various changes/improvements implemented
during the last development cycle.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-06 16:38:49 -06:00
Szymon Janc
2f6a65c8a4 test: bluetooth: Update ICS to TCRL 2024-2
GAP PAST (and BAP) tests were also enabled since controller support is
under review.

This also adds bqw file which is exported draft project from
Qualification Workspace.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-11-06 17:38:36 -05:00
Anas Nashif
8a824f307d mips: tracing: add switched_out trace point
add missing switched_out trace point.

Partially fixes #76057

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-06 14:43:27 -06:00
Christophe Dufaza
b0b278503f Revert "edtlib: fix "last modified" semantic for included ... specs"
[1] was introduced to get more valuable answers from
the PropertySpec.path API, which is supposed to tell
in which file the property's specification was "last modfied".

Further work on related issues [2] showed that the
approach chosen in [1] is dead end: we need to first rethink
how bindings (and especially child-bindings) are initialized.

[1] edtlib: fix last modified semantic in included property specs
[2] edtlib: Preserve paths of properties from included child bindings

See also: #65221, #78095

This reverts commit b3b5ad8156.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2024-11-06 14:43:19 -06:00
Christophe Dufaza
c58d6761bc edtlib: tests: cover basics of filtering inherited properties
Use-case "B includes I includes X":
- X is a base binding file, specifying common properties
- I is an intermediary binding file, which includes X
  without modification nor filter
- B includes I, filtering the properties it chooses
  to inherit with an allowlist or a blocklist

Check that the properties inherited from X via I
are actually filtered as B intends to,
up to the grandchild-binding level.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2024-11-06 14:43:19 -06:00
Christophe Dufaza
0b946dfc01 Revert "edtlib: test "last modified" semantic for ... specs"
This unit test was added to cover the change introduced by [1].

Further work on related issues [2] showed that the chosen approach
is dead end.
We're reverting all changes made in [1].

[1] edtlib: fix last modified semantic in included property specs
[2] edtlib: Preserve paths of properties from included child bindings

See also: #65221, #78095

This reverts commit 70eaa61cb0.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2024-11-06 14:43:19 -06:00
Christophe Dufaza
308b568219 Revert "edtlib: test filters set by including bindings"
This unit test was added specifically to cover a regression
reported by the CI while working on [1].

Further work on related issues [2] showed that:
- [1] and [2] are dead end: we need to first rethink
  how bindings (and especially child-bindings) are initialized
- the inclusion mechanism supported by Zephyr deserves more systematic
  testing in edtlib if we want to work with confidence

The approach we choose is to:
- revert all changes made in [1]
- from there, systematically add unit tests as we address
  the issues we identified (or the additional features we need)
  one after the other

[1] edtlib: fix last modified semantic in included property specs
[2] edtlib: Preserve paths of properties from included child bindings

See also: #65221, #78095

This reverts commit 33bb3b60d9.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2024-11-06 14:43:19 -06:00
Daniel Kampert
ec10d56fbb drivers: rtc: rv8263-c8: Alarm reworking
- Fix typos for alarm field identification
- Fix a bug where an alarm interrupt starts
update interrupts
- Rework interrupt code to reduce code size
and complexity

Signed-off-by: Daniel Kampert <danielkampert@kampis-elektroecke.de>
2024-11-06 14:43:10 -06:00
Xiaoli Ji
e20c095eee soc: nxp: imxrt118x: update MPU configuration
fixes: #80721
Updated mpu region address to secure address.

Signed-off-by: Xiaoli Ji <xiaoli.ji@nxp.com>
2024-11-06 14:43:00 -06:00
Emil Gydesen
1f1e4afa4f Bluetooth: CSIP: Handle disconnects while in procedure
If a device disconnects while we are in a procedure then
get_next_active_instance would return a service instance pointer
with the `conn` set to NULL.

The issue was caused by the set_info being potentially memset
when the device that disconnected was the one that held the
set_info pointer.
The solution is to not use a pointer, but rather a copy of the
set_info, so that the active.set_info value is still valid
after a disconnect.

Since the set_info is not longer a pointer to a specific
set_info from one of the members, the logs have been updated
as well, as the pointer of the active.set_info is useless
for debugging.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-06 14:42:51 -06:00
Johan Hedberg
b710167f1b Bluetooth: drivers: Rename IPM to IPC
This bus type was originally created for what's today the ipc.c HCI driver.
Since this type hasn't yet been synced with BlueZ, rename it for
consistency, however leave the old define to not break backwards
compatibility with existing DT bindings (there are several more that use
"ipm" than ipc.c).

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-06 14:42:19 -06:00
Johan Hedberg
af3dac2131 Bluetooth: drivers: Sync bus types with BlueZ
The authoritative source of these values is BlueZ:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/lib/hci.h#n38

Update our values with the above. The IPM definiton doesn't exist in
BlueZ, but should be added there to make sure we don't get out of sync
again.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-06 14:42:19 -06:00
Henrik Brix Andersen
d5c88d6576 doc: releases: 4.0: add EEPROM release notes
Add EEPROM related release notes for Zephyr v4.0.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-11-06 14:41:52 -06:00
Henrik Brix Andersen
f5090110da doc: releases: 4.0: add CAN release notes
Add CAN related release notes for Zephyr v4.0.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-11-06 14:41:52 -06:00
Chaitanya Tata
87a9363fa7 drivers: nrfiwif: Enable recovery by default
This is needed to ensure Wi-Fi can always be used.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 14:41:44 -06:00
Dominik Ermel
756affe2eb doc: releases: 4.0: Add release notes for Flash and Storage
Update of release notes in areas related to Storage and Flash.
Additionally two known Stream Flash issues have been added to
Know Issue section.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-06 14:41:35 -06:00
Benjamin Cabé
d342f9e0c2 doc: releases: introduce release notes and migration guide docs for 4.1
This introduces the release notes and migration guide for 4.1.0 earlier
than we typically do, so that people have a placeholder to start adding
content as they line up pull requests for 4.1.
The two documents are currently orphan and not visible from the main
documentation as this would confuse users of 4.0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-06 14:41:25 -06:00
Benjamin Cabé
99b1c2a912 doc: releases: rework linkage to old release notes/migration guides
Move the link to old release notes and migration guides to the bottom of
the document

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-06 14:41:25 -06:00
Daniel DeGrasse
6023d6a142 arch: common: fix copy for ramfunc region during XIP init
ramfunc region is copied into RAM from FLASH region during XIP init. We
copy from the loadaddr of the region, and were previously loading to the
symbol __ramfunc_start. This is incorrect when using an MPU with
alignment requirements, as the __ramfunc_start symbol may have padding
placed before it in the region. The __ramfunc_start symbol still needs
to be aligned in order to be used by the MPU though, so define a new
symbol __ramfunc_region_start, and use that symbol when copying the
__ramfunc region from FLASH to RAM.

Fixes #75296

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-06 10:19:08 -08:00
Ha Duong Quang
6984237c06 arch: arm: core: cortex_a_r: enable the VFP unit on boot for FPU_SHARING
The FPU is already disabled by the z_arm_svc function when the first
thread starts. Therefore, disabling the FPU at boot is unnecessary for
lazy FPU; instead, it must be enabled to handle floating-point instructions
before the lazy FPU works.

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
2024-11-06 10:18:59 -08:00
Mark Holden
8bd4f244b0 coredump: ARM: Ensure sp in dump is set as gdb expects
Gdb is typically able to reconstruct the first two frames of the
failing stack using the "pc" and "lr" registers. After that, (if
the frame pointer is omitted) it appears to need the stack pointer
(sp register) to point to the top of the stack before a fatal
error occurred.

The ARM Cortex-M processors push registers r0-r3, r12, LR,
{possibly FPU registers}, PC, SPSR onto the stack before entering the
exception handler. We adjust the stack pointer back to the point
before these registers were pushed for preservation in the dump.

During k_oops/k_panic, the sp wasn't stored in the core dump at all.
Apply similar logic to store it when failures occur in that path.

Signed-off-by: Mark Holden <mholden@meta.com>
2024-11-06 10:17:59 -08:00
Robin Kastberg
5d52e39a52 random: random_timer.c Remove __GNUC__ ifdef
Remove an old __GNUC__ ifdef

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2024-11-06 10:11:58 -08:00
Emil Gydesen
3a39ca1e7e samples: Bluetooth: BAP: Add missing return in stream_is_streaming
Add missing return before a `false`;.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-06 10:10:06 -08:00
Luca Burelli
ba58b066d4 west build: fix a leftover "log" reference in build.py
A recent commit changed all references to the global 'west.log' instance
(now deprecated) to the new WestCommand logging API, but another PR
merged in the same period added an extra instance that is now causing CI
to fail. Convert this last reference to the new API.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:07:13 -08:00
Luca Burelli
6c2bc2ff37 west build: warn about conditional flags in 'extra_configs'
The 'west build' command does not know about conditional flags (in the
format 'type:value:CONFIG_FOO=bar') in the 'extra_configs' argument of
Twister testcase.yaml files, and currently converts them to malformed
arguments that are silently ignored by cmake.

This change adds a check to 'west build' to clearly warn the user if the
'extra_configs' list contains conditional flags and provide a hint on
how to add them to the CMake command line.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:07:13 -08:00
Daniel DeGrasse
cbe07bcb92 Revert "drivers: display: elcdif: Modify interrupt enablement"
This reverts commit 206897658a.

We must keep the frame completion interrupt disabled until we send a new
frame to the eLCDIF, as the frame completion interrupt fires at each
vertical blank interval. If we keep it enabled, then the semaphore we
use to indicate the frame has been loaded by the eLCDIF will be posted
to when we do not have a frame queued, and calls to `display_write` will
return before the eLCDIF has actually loaded the new framebuffer.

Fixes #80590

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-06 10:06:47 -08:00
Michal Smola
593f4423ab samples: led: pwm: fix console harness regex
Led blinking period was made configurable and time unit changed
from sec to msec recently in the source code of the sample.
Console harness regex was not changed accordingly in sample.yaml.
Device testing fails when run with twister.
Change the regex to accept any period and change the units to msec.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2024-11-06 10:06:24 -08:00
Zheng Wu
f59e2477ba drivers: serial: fix potential overflow in fifo_fill and fifo_read
Change the type of num_tx/num_rx to avoid overflow.

Fixes #80599

Signed-off-by: Zheng Wu <ken4647@outlook.com>
2024-11-06 10:06:06 -08:00
Luca Burelli
de1e76fa4e tests/subsys/llext: fix coverage for readonly_mmu test
The test was not being run on arm64 and riscv because the filter was
incorrect. Properly fix the filter to run the test on all platforms
that have any kind of MMU enabled.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:01:26 -08:00
Luca Burelli
7427d1c85b tests/subsys/llext: cleanup memory protection options
Most of the tests in the LLEXT subsystem test suite run with memory
protection hardware (MPU/MMU) disabled, to avoid including memory domain
issues while testing the core functionality. Only a few tests need to
run with MPU/MMU enabled.

This patch simplifies the testcase.yaml by setting the memory protection
as disabled in a shared config file that is included by most tests.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:01:26 -08:00
Luca Burelli
184a2a65a2 tests/subsys/llext: update filtering logic
Restore Apollo boards now that the issue has been fixed.
Also remove extra CONFIG_SOC_SERIES_S32ZE filters, as they are already
covered by the 'platform_exclude' common section.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:01:26 -08:00
Luca Burelli
d33686fef7 tests/subsys/llext: Remove llext.simple.readonly_fs_loader
The fs_loader test is always executed in the main test source when
CONFIG_FILE_SYSTEM is set, and this is in turn enabled by per-board
config overlays. So there is no point in having a separate test case:
it is simply a duplicate of the "readonly" test.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:01:26 -08:00
Thao Luong
c66dcd52db drivers: Select PINCTRL for renesas RA drivers
Select PINCTRL for drivers: adc, i2c, pwm, serial and spi

Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
2024-11-06 09:59:32 -08:00
Thao Luong
56326e4677 soc: renesas: ra: Remove CONFIG_PINCTRL
Remove CONFIG_PINCTRL from ra defconfig files

Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
2024-11-06 09:59:32 -08:00
Thao Luong
75bc16f0a2 boards: renesas: Remove CONFIG_PINCTRL for RA boards
Remove CONFIG_PINCTRL from defconfig files of RA boards

Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
2024-11-06 09:59:32 -08:00
Chaitanya Tata
c0a84524cd drivers: nrfwifi: Fix the undefined macro usage
This works because undefined macro in conditional is treated as zero,
but could end up choosing the wrong divider.

Fix the macro with the new name.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:58:37 -08:00
Andrzej Głąbek
9bdb71fe55 tests: subsys: dfu: img_util: Increase stack size
Fix a problem with the test that manifested itself with a surprising
assertion failure at lib/utils/onoff.c:283. Apparently, due to the
stack being too small, some memory got accidentally overwritten.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-11-06 09:57:41 -08:00
Johan Hedberg
47562485e4 MAINTAINERS: Fix issues with Bluetooth HCI section
The primary header file was missing, and one of the labels was wrong.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-06 09:56:26 -08:00
Chaitanya Tata
9705fc06b4 [nrf fromlist] drivers: nrfwifi: Fix CSUM support
With introduction of Raw modes, nRF70 driver now advertises get_c
onfig OP, but doesn't implement all types.

This causes problems two-fold with checksum calculations:
  1. The "config" isn't uninitialized, so, every call returns differnet
     values. So, for UDP header checksum would be done and
     pkt->chksumdone would be set. But for IPv4 header checksum might be
     skipped.
  2. Even if we initialize to zero, then network stack gets all zeros
     and calculates checksum by itself rendering offload moot.

There is another problem in #1, as there is only single flag for pkt for
all checksum, nRF70 driver sees this and tells UMAC to skip checksum for
the entire packet. The design isn't coherent, and should be converted to
communicate per-type checksum status (some are filled by network stack
and some HW).

But as nRF70 support all checksum offloads, advertise all types for both
RX and TX.

Upstream PR #: 80882

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:54:12 -08:00
Chaitanya Tata
ae077b9475 manifest: hal_nordic: Pull logging level fix
Fix the noise during boot.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:54:12 -08:00
Chaitanya Tata
c86225384a drivers: nrfwifi: Add a NULL check for FMAC context
In case the driver UP fails, the FMAC context will be NULL, so, add a
NULL check in the DOWN.

Fixes a crash seen when working with unprogrammed OTP (no MAC) that
fails the interface UP.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:54:12 -08:00
Henrik Brix Andersen
c261bdf6fc MAINTAINERS: remove nonexistent GitHub user accounts
Remove nonexistent GitHub user accounts as reported by the
scripts/check_maintainers.py script.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-11-06 09:53:52 -08:00
Henrik Brix Andersen
97d6cd335c scripts: check_maintainers: add scripts for checking GitHub accounts
Add script for checking if maintainer and collaborator GitHub accounts
exist.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-11-06 09:53:52 -08:00
Robert Lubos
a597feafb8 test: net: lib: prometheus: formatter: Fix test flakiness
If a string is already present in the provided buffer,
prometheus_format_exposition() appends it instead of overwriting,
hence the buffer needs to be cleared on the test start, otherwise it
works by chance.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-06 09:53:29 -08:00
Maureen Helm
130c5c0002 tests: zbus: publish_stats: Fix for non-zero boot delay
Fixes the zbus publishing statistics test to account for a non-zero boot
delay, which is often used in hardware testing environments. This fixes
an assertion failure observed on multiple max32 boards in the adi board
farm.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-11-06 09:52:58 -08:00
Chaitanya Tata
5106a0407e boards: thingy53: Fix missing GPIOs
Status and request GPIOs are missing from the edge connector, add those
to fix Thingy53 + nRF7002EB build.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:52:47 -08:00
Ryan McClelland
952daca695 debug: symtab: fix ignored type qualifiers on func return type
const is ignored on the function return type. A warning is reported with
-Wignored-qualifers. Remove the ignored const.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-06 09:52:36 -08:00
Dmitrii Golovanov
7e1cd18be4 twister: Fix NOTRUN status
Fix Twister TestCase statuses left not assigned ('NONE') in these 'NOTRUN'
situations:

 * a test suite has `integration platform` which is not available to run.

 * `--cmake-only` execution.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-11-06 09:52:25 -08:00
Alberto Escolar Piedras
d4b7bf986c tests bsim bt audio: Increase execution timeout
These tests have been seen failing in CI due to the
real time execution timeout. Let's increase it so it does
not happen.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-06 09:40:16 +01:00
Stephanos Ioannidis
5c00d99f4b ci: Add '-specs' to ccache ignore option list
`-specs=` is an alternate form of `--specs=`, which is now used by the
Zephyr build system.

This commit adds `-specs=*` to the ccache ignore option list because, as
with `--specs=*`, ccache is unable to resolve the toolchain specs file path
and refuses to cache when this option is specified.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-11-06 11:26:32 +09:00
Raffael Rostagno
b9fc4cc415 drivers: pwm: ledc: esp32c2: esp32c6: Fix clock frequency
Fix clock frequency for both devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-11-05 15:25:21 -06:00
Raffael Rostagno
ba52c8c350 west.yml: Update for esp32c2/esp32c6 ledc clock fix
Update HAL for esp32c2/esp32c6 ledc clock fix

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-11-05 15:25:21 -06:00
Daniel DeGrasse
832e02daa6 doc: releases: migration-guide-4.0: add note about disk-name for SD/MMC
SD and MMC devices now require the disk-name property. Add a note to the
migration guide so that users know the recommended value to add for this
name for each disk driver type.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 15:25:10 -06:00
Daniel DeGrasse
07a8e3253a drivers: disk: mmc_subsys: remove CONFIG_MMC_VOLUME_NAME
Remove CONFIG_MMC_VOLUME_NAME, and set the disk name based on the
``disk-name`` property. This aligns with other disk drivers, and allows
for multiple instances of the mmc_subsys disk driver to be registered.

Add disk-name properties for all in tree definitions for the
mmc-subsys disk driver, and change all in tree usage of the disk name

Fixes #75004

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 15:25:10 -06:00
Daniel DeGrasse
a1dc0b8b3e drivers: disk: sdmmc_subsys: remove CONFIG_SDMMC_VOLUME_NAME
Remove CONFIG_SDMMC_VOLUME_NAME, and set the disk name based on the
``disk-name`` property. This aligns with other disk drivers, and allows
for multiple instances of the sdmmc_subsys disk driver to be registered.

Add disk-name properties for all in tree definitions for the
sdmmc-subsys disk driver, and change all in tree usage of the disk name

Fixes #75004

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 15:25:10 -06:00
Tomi Fontanilles
87bb0b9212 manifest: tf-m: update to 2.1.1
Update the TF-M repos to version 2.1.1.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-11-05 15:24:57 -06:00
Lingao Meng
b9fbfc9a23 Bluetooth: Mesh: Introduce separate workq for ADV EXT
this PR is to make the host always send packets.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-11-05 15:24:31 -06:00
Daniel Baluta
646775bf9e manifest: hal_nxp: Pull in change to fix irqsteer mask computation
This fixes irq_steer channel mask index computation for i.MX8MP
platform.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-11-05 15:24:19 -06:00
Carles Cufi
94ad822a33 include: dt-bindings: regulator: nrf5x: Fix guards
Fix the include guard mismatch. Found building with clang.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-05 13:45:46 -06:00
Pavel Vasilyev
457a20c4a2 test: bsim: bluetooth: mesh: Wait until adv is actually sent
k_sleep may not be enough to let advertiser send the message. Instead we
should rely on the bt_mesh_send_cb.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-11-05 13:44:51 -06:00
Pavel Vasilyev
4c5c434ea2 bluetooth: mesh: adv: legacy: Check suspended flag in the adv thread
Instead of checking the `enabled` flag, check if BT_MESH_SUSPENDED is
set in the legacy advertiser thread. BT_MESH_SUSPENDED is set earlier
than advertiser is stopped and will prevent the advertiser send anything
earlier.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-11-05 13:44:51 -06:00
Vinayak Kariappa Chettimada
db967209ca Bluetooth: Controller: Fix spurious ISO Sync receiver stall
Fix spurious ISO Sync Receiver stall due to uninitialised
value accessed due to regression introduced by
commit 64faceea72 ("Bluetooth: controller: Stop Sync ISO
ticker when establishment fails").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-11-05 13:44:37 -06:00
Valerio Setti
7f5574817f jwt: remove TinyCrypt usage
As part of TinyCrypt deprecation process (#79566) this commit
removes usage of this library from the JWT subsystem and its
related tests.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-05 13:44:20 -06:00
Valerio Setti
3d45ee7cb7 random: remove TinyCrypt usage
Following the deprecation of TinyCrypt (#79566) we remove
TinyCrypt usage in random generators. This basically only affects
the CTR-DRBG random generator which from now only will only make
use of Mbed TLS.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-05 13:44:20 -06:00
Valerio Setti
f4b7d151c5 board: remove references to TinyCrypt
Following the deprecation of TinyCrypt (#79566) we remove tags
referring to it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-05 13:44:20 -06:00
Valerio Setti
adad8dc48a soc: remove usage of TinyCrypt in NXP SOCs
As for the IMX SOCs all the lines removed in this commit were
actually commented out so there's basically no change in code
behavior expected here.
The only affected SOCs family is therefore the Kinetis one.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-05 13:44:20 -06:00
Valerio Setti
dbda4642cd drivers: crypto: deprecated TinyCrypt shim driver
As part of the deprecation process of TinyCrypt started in #79566,
this commit set the TinyCrypt based crypto shim driver as
deprecated.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-05 13:44:20 -06:00
The Nguyen
39015912d0 boards: renesas: doc: update supported feature on Renesas RA boards
Add information about CAN supported on these boards:
- ek_ra8m1
- ek_ra8d1
- mck_ra8t1

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2024-11-05 10:59:51 -06:00
Grzegorz Swiderski
c1776df8ae soc: nordic: dmm: Fix DMM_REG_ALIGN_SIZE macro when CONFIG_DCACHE=n
Make sure this expansion doesn't include `CONFIG_DCACHE_LINE_SIZE`,
which would be undefined and produce a build error.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-11-05 10:57:07 -06:00
Anas Nashif
9cabb89969 tests: drivers: display: fix filtering
Test was marked build only with filters in each scenario looking for
sdl-dc which is only available on native_sim, so cut the chase and use
platform_only to narrow things down to native_sim directly instead of
building the world to get information we already know.

reduces build/run time from 78s to 17s on invocation of twister with
default options, saves a ton more when running twister with --all.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-05 10:56:29 -06:00
David Leach
21f37c8bfd tests: counter: RW612 dts overlay support for basic_api tests
Remove memory spaces not needed for the counter_basic_api test.
Add frdm_rw612.overlay

Signed-off-by: David Leach <david.leach@nxp.com>
2024-11-05 10:56:00 -06:00
Daniel DeGrasse
0856ceed7b soc: nxp: imxrt: correct flexspi XIP check to avoid reclocking
RT11xx SOC init should check to see if the zephyr flash node is
set to a device on the FLEXSPI bus to determine if the part is running
in XIP mode. This check was incorrect, so the FLEXSPI was being
reclocked in XIP mode to 24 MHz. Fix this check so the FlexSPI is not
downclocked.

Fixes #75702

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 10:55:13 -06:00
Daniel DeGrasse
cfb7322107 drivers: flash: flash_mcux_flexspi: add support for W25Q512NW-IQ/IN
Add support for the W25Q512NW-IQ/IN with the FLEXSPI, using a custom
LUT table.

Fixes #80592

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 10:55:13 -06:00
Tomáš Juřena
0911003c11 boards: st: stm32h745i_disco: m7: Fix PHY address
According to the datasheet, the PHY address is 0x1. When changed to this
value the PHY id is correctly read.

Before:
```
[00:00:00.602,000] <err> phy_mii: No PHY found at address 0
```

After:
```
[00:00:00.051,000] <inf> phy_mii: PHY (1) ID 7C111
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2024-11-05 10:54:58 -06:00
Bjarki Arge Andreasen
145d04101d pm: policy: fix pm_policy_event_register arg
The pm_policy_event_register() API takes absolute cycles as the
second arg, like pm_policy_event_update(), but the arg is renamed
time_us and treated as a relative time in us rather than abs
cycles.

Fix implementation of pm_policy_event_register() to treat cycles
like pm_policy_event_update() and API docs suggest.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-11-05 10:54:41 -06:00
Duy Nguyen
639d9ae96f manifest: Update hal_renesas commit ID
Update hal renesas commit ID to resolve PLL clock
config issue

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-11-05 10:54:28 -06:00
Duy Nguyen
0a68d492e2 dts: renesas: Separate pll p q r into child node
The new update of clock device tree make the pll p q r clock
source cannot be choose by other node
This fix add 1 new dts binding for pll out p q r out line

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-11-05 10:54:28 -06:00
Kevin ORourke
4690689a36 drivers: ethernet: eth_stm32_hal: fix bus error after disconnect
In some circumstances the struct eth_stm32_tx_context object that was
allocated on eth_tx's stack is still referenced after the function exits.
This usually happens when the network is disconnected, depending on the
PHY hardware.

When the network is reconnected there will eventually be a call to
HAL_ETH_ReleaseTxPacket, which calls HAL_ETH_TxFreeCallback with the
(now invalid) pointer to the tx context. When HAL_ETH_TxFreeCallback
tries to dereference that pointer we get a bus error.

Fix this by allocating struct eth_stm32_tx_context objects from a
static array, similarly to how the buffers are allocated. This ensures
that they remain valid until the HAL is finished with them.

Fixes: #79037

Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
2024-11-05 10:54:16 -06:00
Benjamin Cabé
6bb0c092b5 doc: comparator: fix nested bullet list formatting
add missing newline for sub-list to render correctly

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-05 10:54:01 -06:00
Torsten Rasmussen
f2ea8506ae cmake: use CMake variable KERNEL_VERSION_CUSTOMIZATION for default value
Fixes: #80193

With #62395 the Zephyr kernel and app version customization values were
moved to target properties to allow Zephyr modules to adjust the values.

This had the consequence described by #80193 that version customization
using CMake arguments, `-D`, or CMakeList.txt toplevel file can no
longer be used for customizing the version.

To support both CMake variable as well as Zephyr module version
customization use-cases then this commit uses `zephyr_get()` to fetch
any CMake variable adjustments and uses the value for default property
setting. This allows users to set customized version while still allow
Zephyr modules to overrule this as intended with #62395.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-11-05 10:53:49 -06:00
Benjamin Cabé
2995eb79f1 doc: fix scrolling glitch causing search bar to be partially hidden
With the recent update to Sphinx RTD theme 3.0.0, a 19px-high element
that used to display the version number is not visible anymore, so the
JS code that hides the upper-left logo when scrolling down needs to be
adjusted to account for this change.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-05 10:53:34 -06:00
Chaitanya Tata
580707ed4d drivers: nrfwifi: Fixes from doc review
Help text fixes from doc-team.

Signed-off-by: Richa Pandey <richa.pandey@nordicsemi.no>
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-05 10:53:24 -06:00
Johann Fischer
973f914b90 drivers: udc_nrf: fix enqueue of control IN transfer with length 0
If the direction of the last setup packet is not to the device but to
the host, then the transfer is not a status stage and should be queued.
This is not checked and prevents a zero length control IN transfer to
the host, e.g. used by the DFU class to indicate the end of the upload
process.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-05 10:53:11 -06:00
Johann Fischer
0c299e66a4 drivers: udc_kinetis: reset control endpoint busy flags
Reset control endpoint busy flags if configured and enabled, otherwise
it could mark the wrong buffer as busy after endpoint disable/enable.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-05 10:53:11 -06:00
Johann Fischer
6619d15662 doc: usb: update the USB device stack deprecation plans
Deprecation has been postponed one version.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-05 10:52:43 -06:00
Jukka Rissanen
3e1e2ea8ec net: wifi: mgmt: Use memcpy instead of strncpy
Using strncpy gives this warning

warning: 'strncpy' output may be truncated copying 32 bytes from
  a string of length 32 [-Wstringop-truncation]

 strncpy(roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info,
         bssid_info,
         sizeof(roaming_params.neighbor_rep.neighbor_ap->bssid_info));

There is '\0' at the end of the allocated buffer so we can safely
use memcpy() here to avoid any warnings.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-05 10:52:29 -06:00
Jukka Rissanen
0a75809a8e net: wifi: mgmt: Check string length in sscanf
Make sure we are not able to overwrite string variables in sscanf
call. Allocate also one extra byte for null terminator character.

Fixes #80644

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-05 10:52:29 -06:00
Gerard Marull-Paretas
5249619f6a soc: nordic: nrf54h: gpd: fix compile warning when CONFIG_DEBUG=y
Usage of K_SPINLOCK with CONFIG_DEBUG=y seems to trigger a compiler
warning about request not always being initialized. Fallback to
k_spin_lock/unlock calls to fix this issue.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-05 14:46:15 +01:00
Lukasz Mrugala
4bb945300b scripts: twister: Python Version Guard
Twister shall now verify that the user does not
use an obsolete Python version. If user's Python
is deemed too old, it will raise a relevant error.
This check will also happen when running Twister
via west.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-04 17:24:24 -05:00
Benjamin Cabé
5c9b0a5a33 drivers: comparator: fix wrong @since tag
The Comparator API was introduced in 4.0, not 3.7

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-04 13:43:40 -06:00
Gerson Fernando Budke
0cc8f93e8a soc: atmel: Drop PINCTRL from Kconfig.defconfig
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.sam*.

Fixes #78619

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-04 13:43:26 -06:00
Henrik Brix Andersen
0bb5270f7b drivers: can: sam: fix sys_write32() arguments order
Fix the order of the arguments to sys_write32().

Fixes: #80750

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-11-04 13:43:03 -06:00
Jamie McCrae
cef75af6af doc: release: 4.0: Add MCUboot and other misc. updates
Adds notes on MCUboot changes to this release and some other
updates for boards/build system

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-04 13:42:23 -06:00
Philipp Steiner
ec7d0c8e6f doc: add missing Ethernet Support for Nucleo H563ZI & STM32H573I-DK
I recently found out, that the Ethernet support for the boards Nucleo
H563ZI and STM32H573I-DK is already available but it isn't mentioned
in the "Supported Features" section.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2024-11-04 13:42:09 -06:00
Francois Ramu
a925d60cbd drivers: flash: stm32h7 flash driver reformat code
Apply clang-format to re-format the flash_stm32h7.c driver

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-04 13:41:46 -06:00
Francois Ramu
331423d8e3 drivers: flash: stm32H7 flash driver enable clock when defined
Not all the stm32H7 have a clock enable for their flash;
only the dual-core.
For the st,stm32h7-flash-controller with "clocks" property, the driver
will enable the flash clock bit in the corresponding RCC register.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-04 13:41:46 -06:00
Francois Ramu
5c529919ec dts: arm: st: stm32h7 with dual core have flash clock enable bit
Define the "clocks" property, for the flash "st,stm32h7-flash-controller"
node, only for the stm32H7 dual-core devices
which have the RCC bit 8 present in their RCC AHB3 register.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-11-04 13:41:46 -06:00
Jukka Rissanen
ec18ab1eda net: dns: Convert the query and answer to small case letters
Because we might get answers in capital letters, convert the answer
to small case letters and also make sure we send query in small case
latters. This makes sure that our query_hash is properly calculated
regardless of how the resolver gets the data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-04 13:41:17 -06:00
Jukka Rissanen
adeb28d147 net: dhcpv4: Fix DNS server list allocation
Allocate one extra pointer for the DNS server list so that
DNS resolving code can detect the end of the list.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-04 13:40:56 -06:00
Gerson Fernando Budke
52d21d7bf0 soc: gd32: Drop PINCTRL from Kconfig.defconfig
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.gd32.

Fixes #78619

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-04 13:40:42 -06:00
Benjamin Cabé
23fb3b77a2 doc: releases: Use :cve: role in security section
Adopte `:cve:` role to automatically link to CVE.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-03 17:30:21 -08:00
Benjamin Cabé
8beaf986fc doc: releases: Add list of added shields in 4.0 cycle
Adds the list of new shields for 4.0 release, sorted by vendor name.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-03 17:30:21 -08:00
Benjamin Cabé
12821f8ec6 doc: releases: Add list of added boards in 4.0 cycle
Adds the list of new boards for 4.0 release, sorted by vendor name.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-03 17:12:30 -08:00
3086 changed files with 78356 additions and 17913 deletions

3
.github/SECURITY.md vendored
View file

@ -8,9 +8,10 @@ updates:
- The most recent release, and the release prior to that.
- Active LTS releases.
At this time, with the latest release of v3.6, the supported
At this time, with the latest release of v4.0, the supported
versions are:
- v4.0: Current release
- v3.7: Current LTS
- v3.6: Prior release
- v2.7: Prior LTS

View file

@ -107,13 +107,13 @@ jobs:
export ZEPHYR_TOOLCHAIN_VARIANT=llvm
# check if we need to run a full twister or not based on files changed
python3 ./scripts/ci/test_plan.py --platform ${{ matrix.platform }} -c origin/${BASE_REF}..
python3 ./scripts/ci/test_plan.py --no-detailed-test-id --platform ${{ matrix.platform }} -c origin/${BASE_REF}..
# We can limit scope to just what has changed
if [ -s testplan.json ]; then
echo "report_needed=1" >> $GITHUB_OUTPUT
# Full twister but with options based on changes
./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
./scripts/twister --no-detailed-test-id --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
else
# if nothing is run, skip reporting step
echo "report_needed=0" >> $GITHUB_OUTPUT

View file

@ -34,7 +34,7 @@ jobs:
CCACHE_REMOTE_STORAGE: "redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3"
CCACHE_REMOTE_ONLY: "true"
# `--specs` is ignored because ccache is unable to resovle the toolchain specs file path.
CCACHE_IGNOREOPTIONS: '--specs=*'
CCACHE_IGNOREOPTIONS: '-specs=* --specs=*'
steps:
- name: Apply container owner mismatch workaround
run: |

View file

@ -38,7 +38,7 @@ jobs:
run: |
pip3 install setuptools
pip3 install wheel
pip3 install python-magic lxml junitparser gitlint pylint pykwalify yamllint clang-format unidiff sphinx-lint
pip3 install python-magic lxml junitparser gitlint pylint pykwalify yamllint clang-format unidiff sphinx-lint ruff
pip3 install west
- name: west setup
@ -79,7 +79,7 @@ jobs:
git log --pretty=oneline | head -n 10
# Increase rename limit to allow for large PRs
git config diff.renameLimit 10000
./scripts/ci/check_compliance.py --annotate -e KconfigBasic \
./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e ClangFormat \
-c origin/${BASE_REF}..
- name: upload-results

View file

@ -42,6 +42,7 @@ jobs:
with:
files: |
doc/
boards/**/doc/
**.rst
include/
kernel/include/kernel_arch_interface.h

View file

@ -26,7 +26,7 @@ jobs:
west init -l . || true
- name: Manifest
uses: zephyrproject-rtos/action-manifest@v1.3.1
uses: zephyrproject-rtos/action-manifest@v1.5.0
with:
github-token: ${{ secrets.ZB_GITHUB_TOKEN }}
manifest-path: 'west.yml'

146
.github/workflows/twister-prep.yaml vendored Normal file
View file

@ -0,0 +1,146 @@
name: Prepare For a Twister Run
on:
workflow_call:
outputs:
subset:
description: subset
value: ${{ jobs.prep_push.outputs.subset != '' && jobs.prep_push.outputs.subset || jobs.prep_pr.outputs.subset }}
size:
description: size
value: ${{ jobs.prep_push.outputs.size != '' && jobs.prep_push.outputs.size || jobs.prep_pr.outputs.size }}
fullrun:
description: fullrun
value: ${{ jobs.prep_push.outputs.fullrun != '' && jobs.prep_push.outputs.fullrun || jobs.prep_pr.outputs.size }}
jobs:
prep_pr:
if: github.repository_owner == 'zephyrproject-rtos' && github.event_name == 'pull_request_target'
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
options: '--entrypoint /bin/bash'
outputs:
subset: ${{ steps.output-services.outputs.subset }}
size: ${{ steps.output-services.outputs.size }}
fullrun: ${{ steps.output-services.outputs.fullrun }}
env:
MATRIX_SIZE: 10
PUSH_MATRIX_SIZE: 20
DAILY_MATRIX_SIZE: 80
BSIM_OUT_PATH: /opt/bsim/
BSIM_COMPONENTS_PATH: /opt/bsim/components
TESTS_PER_BUILDER: 700
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
BASE_REF: ${{ github.base_ref }}
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Print cloud service information
run: |
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: Clone cached Zephyr repository
continue-on-error: true
run: |
git clone --shared /repo-cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Environment Setup
run: |
git config --global user.email "bot@zephyrproject.org"
git config --global user.name "Zephyr Bot"
rm -fr ".git/rebase-apply"
git rebase origin/${BASE_REF}
git clean -f -d
git log --pretty=oneline | head -n 10
west init -l . || true
west config manifest.group-filter -- +ci,+optional
west config --global update.narrow true
west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /repo-cache/zephyrproject)
west forall -c 'git reset --hard HEAD'
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
- name: Generate Test Plan with Twister
id: test-plan
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --no-detailed-test-id --pull-request -t $TESTS_PER_BUILDER
if [ -s .testplan ]; then
cat .testplan >> $GITHUB_ENV
else
echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV
fi
rm -f testplan.json .testplan
- name: Determine matrix size
id: output-services
run: |
if [ -n "${TWISTER_NODES}" ]; then
subset="[$(seq -s',' 1 ${TWISTER_NODES})]"
else
subset="[$(seq -s',' 1 ${MATRIX_SIZE})]"
fi
size=${TWISTER_NODES}
echo "subset=${subset}" >> $GITHUB_OUTPUT
echo "size=${size}" >> $GITHUB_OUTPUT
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT
prep_push:
if: github.repository_owner == 'zephyrproject-rtos' && (github.event_name == 'push' || github.event_name == 'schedule')
runs-on: ubuntu-22.04
outputs:
subset: ${{ steps.output-services.outputs.subset }}
size: ${{ steps.output-services.outputs.size }}
fullrun: ${{ steps.output-services.outputs.fullrun }}
env:
MATRIX_SIZE: 10
PUSH_MATRIX_SIZE: 20
DAILY_MATRIX_SIZE: 80
BSIM_OUT_PATH: /opt/bsim/
BSIM_COMPONENTS_PATH: /opt/bsim/components
TESTS_PER_BUILDER: 700
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
BASE_REF: ${{ github.base_ref }}
steps:
- name: Print cloud service information
run: |
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: Determine matrix size
id: output-services
run: |
if [ "${{github.event_name}}" = "push" ]; then
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]"
size=${MATRIX_SIZE}
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]"
size=${DAILY_MATRIX_SIZE}
else
size=0
fi
echo "subset=${subset}" >> $GITHUB_OUTPUT
echo "size=${size}" >> $GITHUB_OUTPUT
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT

53
.github/workflows/twister-publish.yaml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Publish Twister Test Results
on:
workflow_run:
workflows: ["Run tests with twister"]
branches:
- main
types:
- completed
jobs:
upload-to-elasticsearch:
if: |
github.repository == 'zephyrproject-rtos/zephyr' &&
github.event.workflow_run.event != 'pull_request_target'
env:
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
runs-on: ubuntu-22.04
steps:
# Needed for elasticearch and upload script
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Download Artifacts
id: download-artifacts
uses: dawidd6/action-download-artifact@v6
with:
path: artifacts
workflow: twister.yml
run_id: ${{ github.event.workflow_run.id }}
if_no_artifact_found: ignore
- name: Upload to elasticsearch
if: steps.download-artifacts.outputs.found_artifact == 'true'
run: |
pip3 install elasticsearch
# set run date on upload to get consistent and unified data across the matrix.
run_date=`date --iso-8601=minutes`
if [ "${{github.event.workflow_run.event}}" = "push" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--run-attempt ${{github.run_attempt}} \
--run-branch ${{github.ref_name}} \
--index zephyr-main-ci-push-1 artifacts/*/*/twister.json
elif [ "${{github.event.workflow_run.event}}" = "schedule" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--run-attempt ${{github.run_attempt}} \
--run-branch ${{github.ref_name}} \
--index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
fi

View file

@ -21,108 +21,7 @@ concurrency:
jobs:
twister-build-prep:
if: github.repository_owner == 'zephyrproject-rtos'
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
options: '--entrypoint /bin/bash'
outputs:
subset: ${{ steps.output-services.outputs.subset }}
size: ${{ steps.output-services.outputs.size }}
fullrun: ${{ steps.output-services.outputs.fullrun }}
env:
MATRIX_SIZE: 10
PUSH_MATRIX_SIZE: 20
DAILY_MATRIX_SIZE: 80
BSIM_OUT_PATH: /opt/bsim/
BSIM_COMPONENTS_PATH: /opt/bsim/components
TESTS_PER_BUILDER: 700
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
BASE_REF: ${{ github.base_ref }}
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Print cloud service information
run: |
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: Clone cached Zephyr repository
if: github.event_name == 'pull_request_target'
continue-on-error: true
run: |
git clone --shared /repo-cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Environment Setup
if: github.event_name == 'pull_request_target'
run: |
git config --global user.email "bot@zephyrproject.org"
git config --global user.name "Zephyr Bot"
rm -fr ".git/rebase-apply"
git rebase origin/${BASE_REF}
git clean -f -d
git log --pretty=oneline | head -n 10
west init -l . || true
west config manifest.group-filter -- +ci,+optional
west config --global update.narrow true
west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /repo-cache/zephyrproject)
west forall -c 'git reset --hard HEAD'
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
- name: Generate Test Plan with Twister
if: github.event_name == 'pull_request_target'
id: test-plan
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --pull-request -t $TESTS_PER_BUILDER
if [ -s .testplan ]; then
cat .testplan >> $GITHUB_ENV
else
echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV
fi
rm -f testplan.json .testplan
- name: Determine matrix size
id: output-services
run: |
if [ "${{github.event_name}}" = "pull_request_target" ]; then
if [ -n "${TWISTER_NODES}" ]; then
subset="[$(seq -s',' 1 ${TWISTER_NODES})]"
else
subset="[$(seq -s',' 1 ${MATRIX_SIZE})]"
fi
size=${TWISTER_NODES}
elif [ "${{github.event_name}}" = "push" ]; then
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]"
size=${MATRIX_SIZE}
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]"
size=${DAILY_MATRIX_SIZE}
else
size=0
fi
echo "subset=${subset}" >> $GITHUB_OUTPUT
echo "size=${size}" >> $GITHUB_OUTPUT
echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT
uses: ./.github/workflows/twister-prep.yaml
twister-build:
runs-on:
@ -142,13 +41,13 @@ jobs:
CCACHE_REMOTE_STORAGE: "redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3"
CCACHE_REMOTE_ONLY: "true"
# `--specs` is ignored because ccache is unable to resolve the toolchain specs file path.
CCACHE_IGNOREOPTIONS: '--specs=*'
CCACHE_IGNOREOPTIONS: '-specs=* --specs=*'
BSIM_OUT_PATH: /opt/bsim/
BSIM_COMPONENTS_PATH: /opt/bsim/components
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 '
DAILY_OPTIONS: ' -M --build-only --all --show-footprint'
TWISTER_COMMON: '--no-detailed-test-id --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 '
WEEKLY_OPTIONS: ' -M --build-only --all --show-footprint --report-filtered'
PR_OPTIONS: ' --clobber-output --integration'
PUSH_OPTIONS: ' --clobber-output -M --show-footprint'
PUSH_OPTIONS: ' --clobber-output -M --show-footprint --report-filtered'
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
BASE_REF: ${{ github.base_ref }}
steps:
@ -230,6 +129,7 @@ jobs:
- if: github.event_name == 'push'
name: Run Tests with Twister (Push)
id: run_twister
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
@ -243,11 +143,12 @@ jobs:
- if: github.event_name == 'pull_request_target'
name: Run Tests with Twister (Pull Request)
id: run_twister_pr
run: |
rm -f testplan.json
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --pull-request
python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --pull-request --no-detailed-test-id
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} --load-tests testplan.json ${TWISTER_COMMON} ${PR_OPTIONS}
if [ "${{matrix.subset}}" = "1" -a ${{needs.twister-build-prep.outputs.fullrun}} = 'True' ]; then
./scripts/zephyr_module.py --twister-out module_tests.args
@ -258,14 +159,15 @@ jobs:
- if: github.event_name == 'schedule'
name: Run Tests with Twister (Daily)
id: run_twister_sched
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${DAILY_OPTIONS}
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${WEEKLY_OPTIONS}
if [ "${{matrix.subset}}" = "1" ]; then
./scripts/zephyr_module.py --twister-out module_tests.args
if [ -s module_tests.args ]; then
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${DAILY_OPTIONS}
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${WEEKLY_OPTIONS}
fi
fi
@ -306,42 +208,18 @@ jobs:
twister-test-results:
name: "Publish Unit Tests Results"
env:
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
needs: twister-build
needs:
- twister-build
runs-on: ubuntu-22.04
# the build-and-test job might be skipped, we don't need to run this job then
if: success() || failure()
steps:
# Needed for elasticearch and upload script
- if: github.event_name == 'push' || github.event_name == 'schedule'
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- if: github.event_name == 'push' || github.event_name == 'schedule'
name: Upload to elasticsearch
run: |
pip3 install elasticsearch
# set run date on upload to get consistent and unified data across the matrix.
run_date=`date --iso-8601=minutes`
if [ "${{github.event_name}}" = "push" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--index zephyr-main-ci-push-1 artifacts/*/*/twister.json
elif [ "${{github.event_name}}" = "schedule" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
fi
- name: Merge Test Results
run: |
pip3 install junitparser junit2html

View file

@ -44,7 +44,8 @@ jobs:
west init -l . || true
# we do not depend on any hals, tools or bootloader, save some time and space...
west config manifest.group-filter -- -hal,-tools,-bootloader
west config manifest.group-filter -- -hal,-tools,-bootloader,-babblesim
west config manifest.project-filter -- -nrf_hw_models
west config --global update.narrow true
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
west forall -c 'git reset --hard HEAD'

View file

@ -66,7 +66,7 @@ jobs:
- name: install pytest
run: |
pip3 install wheel
pip3 install pytest west pyelftools canopen natsort progress mypy intelhex psutil ply pyserial
pip3 install pytest west pyelftools canopen natsort progress mypy intelhex psutil ply pyserial anytree
- name: run pytest-win
if: runner.os == 'Windows'
run: |

1
.gitignore vendored
View file

@ -102,6 +102,7 @@ MaintainersFormat.txt
ModulesMaintainers.txt
Nits.txt
Pylint.txt
Ruff.txt
SphinxLint.txt
TextEncoding.txt
YAMLLint.txt

2079
.ruff-excludes.toml Normal file

File diff suppressed because it is too large Load diff

31
.ruff.toml Normal file
View file

@ -0,0 +1,31 @@
# Copyright (c) 2024 Basalte bv
# SPDX-License-Identifier: Apache-2.0
extend = ".ruff-excludes.toml"
line-length = 100
target-version = "py310"
[lint]
select = [
# zephyr-keep-sorted-start
"B", # flake8-bugbear
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
# zephyr-keep-sorted-stop
]
ignore = [
# zephyr-keep-sorted-start
"SIM108", # Allow if-else blocks instead of forcing ternary operator
"UP027", # deprecated pyupgrade rule
# zephyr-keep-sorted-stop
]
[format]
quote-style = "preserve"
line-ending = "lf"

View file

@ -598,6 +598,8 @@ add_custom_command(
COMMAND_EXPAND_LISTS
)
add_custom_target(version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h)
zephyr_get(KERNEL_VERSION_CUSTOMIZATION SYSBUILD LOCAL)
set_property(TARGET version_h PROPERTY KERNEL_VERSION_CUSTOMIZATION ${KERNEL_VERSION_CUSTOMIZATION})
if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION)
add_custom_command(
@ -616,6 +618,8 @@ if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION)
app_version_h
DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zephyr/app_version.h)
add_dependencies(zephyr_interface app_version_h)
zephyr_get(APP_VERSION_CUSTOMIZATION SYSBUILD LOCAL)
set_property(TARGET app_version_h PROPERTY APP_VERSION_CUSTOMIZATION ${APP_VERSION_CUSTOMIZATION})
endif()
# Unfortunately, the order in which CMakeLists.txt code is processed
@ -1035,14 +1039,6 @@ if(CONFIG_USERSPACE)
set(PROCESS_GPERF ${ZEPHYR_BASE}/scripts/build/process_gperf.py)
endif()
get_property(GLOBAL_CSTD GLOBAL PROPERTY CSTD)
if(DEFINED GLOBAL_CSTD)
message(DEPRECATION
"Global CSTD property is deprecated, see Kconfig.zephyr for C Standard options.")
set(CSTD ${GLOBAL_CSTD})
list(APPEND CMAKE_C_COMPILE_FEATURES ${compile_features_${CSTD}})
endif()
# @Intent: Obtain compiler specific flag for specifying the c standard
zephyr_compile_options(
$<$<COMPILE_LANGUAGE:C>:$<TARGET_PROPERTY:compiler,cstd>${CSTD}>

View file

@ -133,6 +133,7 @@
/boards/arm64/intel_socfpga_agilex_socdk/ @siclim @ngboonkhai
/boards/arm64/intel_socfpga_agilex5_socdk/ @teikheng @gdengi
/boards/arm64/rcar_*/ @lorc @xakep-amatop
/boards/amd/acp_6_0_adsp/ @dineshkumar.kalva @basavaraj.hiregoudar
# All cmake related files
/doc/develop/tools/coccinelle.rst @himanshujha199640 @JuliaLawall
/doc/services/device_mgmt/smp_protocol.rst @de-nordic @nordicjm

View file

@ -448,6 +448,7 @@ config CODING_GUIDELINE_CHECK
config NATIVE_LIBC
bool
select FULL_LIBC_SUPPORTED
select TC_PROVIDES_POSIX_C_LANG_SUPPORT_R
help
Zephyr will use the host system C library.
@ -470,9 +471,11 @@ config NATIVE_APPLICATION
default y if ARCH_POSIX
depends on !NATIVE_LIBRARY
select NATIVE_BUILD
select DEPRECATED
help
Build as a native application that can run on the host and using
resources and libraries provided by the host.
resources and libraries provided by the host. This option is deprecated
and will be removed in Zephyr v4.3
config NATIVE_LIBRARY
bool
@ -1021,32 +1024,6 @@ config IS_BOOTLOADER
This option indicates that Zephyr will act as a bootloader to execute
a separate Zephyr image payload.
config BOOTLOADER_SRAM_SIZE
int "SRAM reserved for bootloader [DEPRECATED]"
default 0
depends on !XIP || IS_BOOTLOADER
depends on ARM || XTENSA
help
This option specifies the amount of SRAM (measure in kB) reserved for
a bootloader image, when either:
- the Zephyr image itself is to act as the bootloader, or
- Zephyr is a !XIP image, which implicitly assumes existence of a
bootloader that loads the Zephyr !XIP image onto SRAM.
This option is deprecated, users should transition to using DTS to set this, if needed.
To be removed after Zephyr 3.7 release.
config BOOTLOADER_SRAM_SIZE_DEPRECATED
bool
default y
select DEPRECATED
depends on BOOTLOADER_SRAM_SIZE != 0
depends on !XIP || IS_BOOTLOADER
depends on ARM || XTENSA
help
Non-prompt symbol to indicate that the deprecated BOOTLOADER_SRAM_SIZE Kconfig has a
non-0 value. Please transition to using devicetree.
config BOOTLOADER_BOSSA
bool "BOSSA bootloader support"
select USE_DT_CODE_PARTITION

View file

@ -314,12 +314,13 @@ Bluetooth HCI:
- HoZHel
files:
- include/zephyr/drivers/bluetooth/
- include/zephyr/drivers/bluetooth.h
- drivers/bluetooth/
- samples/bluetooth/hci_*/
- tests/bsim/bluetooth/hci_uart/
- dts/bindings/bluetooth/
labels:
- "area: Bluetooth Host"
- "area: Bluetooth HCI"
- "area: Bluetooth"
tests:
- bluetooth
@ -389,8 +390,10 @@ Bluetooth Host:
- doc/connectivity/bluetooth/img/ctlr*
- doc/connectivity/bluetooth/api/audio/
- doc/connectivity/bluetooth/api/mesh/
- doc/connectivity/bluetooth/api/shell/iso.rst
- doc/connectivity/bluetooth/api/controller.rst
- doc/connectivity/bluetooth/shell/classic/a2dp.rst
- doc/connectivity/bluetooth/shell/host/iso.rst
- doc/connectivity/bluetooth/shell/audio/
- samples/bluetooth/bap*/
- samples/bluetooth/cap*/
- samples/bluetooth/hap*/
@ -474,6 +477,7 @@ Bluetooth Audio:
- tests/bluetooth/tester/overlay-le-audio.conf
- tests/bluetooth/tester/src/audio/
- doc/connectivity/bluetooth/api/audio/
- doc/connectivity/bluetooth/shell/audio/
- samples/bluetooth/bap*/
- samples/bluetooth/cap*/
- samples/bluetooth/hap*/
@ -492,6 +496,7 @@ Bluetooth Classic:
collaborators:
- jhedberg
files:
- doc/connectivity/bluetooth/shell/classic/a2dp.rst
- subsys/bluetooth/common/
- subsys/bluetooth/host/classic/
- include/zephyr/bluetooth/classic/
@ -511,7 +516,7 @@ Bluetooth ISO:
- rugeGerritsen
files:
- include/zephyr/bluetooth/iso.h
- doc/connectivity/bluetooth/api/shell/iso.rst
- doc/connectivity/bluetooth/shell/host/iso.rst
- samples/bluetooth/iso_*/
- subsys/bluetooth/Kconfig.iso
- subsys/bluetooth/host/iso.c
@ -1006,8 +1011,8 @@ Documentation Infrastructure:
Release Notes:
status: maintained
maintainers:
- dkalowsk
- mmahadevan108
- fabiobaltieri
- kartben
collaborators:
- kartben
files:
@ -1586,9 +1591,7 @@ Release Notes:
- drivers.i3c
"Drivers: IEEE 802.15.4":
status: maintained
maintainers:
- fgrandel
status: odd fixes
collaborators:
- rlubos
- ankuns
@ -2078,6 +2081,11 @@ Release Notes:
status: maintained
maintainers:
- jilaypandya
collaborators:
- bjarki-andreasen
- dipakgmx
- fabiobaltieri
- faxe1008
files:
- drivers/stepper/
- include/zephyr/drivers/stepper.h
@ -2168,6 +2176,7 @@ Release Notes:
- rlubos
- kludentwo
- krish2718
- MaochenWang1
files:
- drivers/wifi/
- dts/bindings/wifi/
@ -2194,7 +2203,7 @@ Release Notes:
collaborators:
- sachinthegreen
files:
- drivers/wifi/nrfwifi/
- drivers/wifi/nrf_wifi/
- dts/bindings/wifi/nordic,nrf70.yaml
- dts/bindings/wifi/nordic,nrf70-qspi.yaml
- dts/bindings/wifi/nordic,nrf70-spi.yaml
@ -2923,8 +2932,6 @@ Networking:
status: maintained
maintainers:
- jukkar
collaborators:
- fgrandel
files:
- doc/connectivity/networking/api/gptp.rst
- include/zephyr/net/gptp.h
@ -2991,14 +2998,12 @@ Networking:
- subsys/net/lib/ptp/
- samples/net/ptp/
labels:
- "area: Networking"
- "area: PTP"
tests:
- sample.net.ptp
"Networking: Native IEEE 802.15.4":
status: maintained
maintainers:
- fgrandel
status: odd fixes
collaborators:
- rlubos
- jukkar
@ -3040,6 +3045,7 @@ Networking:
collaborators:
- rlubos
- krish2718
- MaochenWang1
files:
- doc/connectivity/networking/api/wifi.rst
- include/zephyr/net/wifi*.h
@ -3138,6 +3144,7 @@ Power management:
status: maintained
maintainers:
- ceolin
- bjarki-andreasen
collaborators:
- nashif
- teburd
@ -3493,6 +3500,8 @@ Nuvoton NPCM Platforms:
- soc/nuvoton/npcm/
- boards/nuvoton/npcm*/
- dts/arm/nuvoton/
- drivers/*/*_npcm*
- include/zephyr/dt-bindings/*/npcm_*
labels:
- "platform: Nuvoton NPCM"
@ -3548,6 +3557,7 @@ Silabs SiM3U Platforms:
- drivers/*/Kconfig.si32
- dts/arm/silabs/sim3u*
- dts/bindings/*/*silabs,si32*
- include/zephyr/dt-bindings/pinctrl/*si32*
- soc/silabs/silabs_sim3/
labels:
- "platform: Silabs SiM3U"
@ -3670,7 +3680,7 @@ NXP Drivers:
- drivers/*/*.mcux
- drivers/*/*.nxp
- drivers/*/*nxp*
- drivers/*/*kinetis*
- drivers/*/*/*kinetis*
- drivers/misc/*/nxp*
- include/zephyr/dt-bindings/*/*nxp*
- include/zephyr/dt-bindings/*/*mcux*
@ -4871,6 +4881,14 @@ West:
labels:
- "platform: TI"
"West project: hal_wch":
status: maintained
maintainers:
- nzmichaelh
- kholia
files:
- modules/hal_wch/
"West project: hal_wurthelektronik":
status: maintained
maintainers:
@ -5047,6 +5065,16 @@ West:
labels:
- "area: native port"
"West project: nrf_wifi":
status: maintained
maintainers:
- krish2718
- sachinthegreen
files:
- modules/nrf_wifi/
labels:
- "area: Wi-Fi"
"West project: open-amp":
status: odd fixes
collaborators:
@ -5233,6 +5261,8 @@ West:
maintainers:
- krish2718
- jukkar
collaborators:
- MaochenWang1
files:
- modules/hostap/
labels:
@ -5255,7 +5285,6 @@ Xtensa arch:
- boards/qemu/xtensa/
- boards/cdns/xt-sim/
- soc/cdns/dc233c/
- soc/cdns/dc233c/
- soc/cdns/xtensa_sample_controller/
- tests/arch/xtensa/
labels:

View file

@ -1,5 +1,5 @@
VERSION_MAJOR = 4
VERSION_MINOR = 0
PATCHLEVEL = 0
PATCHLEVEL = 99
VERSION_TWEAK = 0
EXTRAVERSION = rc2
EXTRAVERSION =

View file

@ -55,6 +55,8 @@ config ARM64
select ARCH_HAS_DIRECTED_IPIS
select ARCH_HAS_DEMAND_PAGING
select ARCH_HAS_DEMAND_MAPPING
select ARCH_SUPPORTS_EVICTION_TRACKING
select EVICTION_TRACKING if DEMAND_PAGING
help
ARM64 (AArch64) architecture
@ -694,6 +696,12 @@ config ARCH_SUPPORTS_ROM_START
config ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
bool
config ARCH_SUPPORTS_EVICTION_TRACKING
bool
help
Architecture code supports page tracking for eviction algorithms
when demand paging is enabled.
config ARCH_HAS_EXTRA_EXCEPTION_INFO
bool
@ -1140,3 +1148,9 @@ config ARCH_HAS_CUSTOM_BUSY_WAIT
It's possible that an architecture port cannot or does not want to use
the provided k_busy_wait(), but instead must do something custom. It must
enable this option in that case.
config ARCH_HAS_CUSTOM_CURRENT_IMPL
bool
help
Select when architecture implements arch_current_thread() &
arch_current_thread_set().

View file

@ -262,7 +262,7 @@ config ARC_CURRENT_THREAD_USE_NO_TLS
RGF_NUM_BANKS the parameter is disabled by-default because banks syncronization
requires significant time, and it slows down performance.
ARCMWDT works with tls pointer in different way then GCC. Optimized access to
TLS pointer via _current variable does not provide significant advantages
TLS pointer via arch_current_thread() does not provide significant advantages
in case of MetaWare.
config GEN_ISR_TABLES

View file

@ -34,3 +34,5 @@ add_subdirectory_ifdef(CONFIG_ARC_CORE_MPU mpu)
add_subdirectory_ifdef(CONFIG_ARC_SECURE_FIRMWARE secureshield)
zephyr_linker_sources(ROM_START SORT_KEY 0x0vectors vector_table.ld)
zephyr_library_sources_ifdef(CONFIG_LLEXT elf.c)

80
arch/arc/core/elf.c Normal file
View file

@ -0,0 +1,80 @@
/*
* Copyright (c) 2024 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/llext/elf.h>
#include <zephyr/llext/llext.h>
#include <zephyr/llext/loader.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/util.h>
LOG_MODULE_REGISTER(elf, CONFIG_LLEXT_LOG_LEVEL);
#define R_ARC_32 4
#define R_ARC_B26 5 /* AKA R_ARC_64 */
#define R_ARC_S25W_PCREL 17
#define R_ARC_32_ME 27
/* ARCompact insns packed in memory have Middle Endian encoding */
#define ME(x) (((x & 0xffff0000) >> 16) | ((x & 0xffff) << 16))
/**
* @brief Architecture specific function for relocating shared elf
*
* Elf files contain a series of relocations described in multiple sections.
* These relocation instructions are architecture specific and each architecture
* supporting modules must implement this.
*
* The relocation codes are well documented:
* https://github.com/foss-for-synopsys-dwc-arc-processors/arc-ABI-manual/blob/master/ARCv2_ABI.pdf
* https://github.com/zephyrproject-rtos/binutils-gdb
*/
int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc, uintptr_t sym_base_addr, const char *sym_name,
uintptr_t load_bias)
{
int ret = 0;
uint32_t insn = UNALIGNED_GET((uint32_t *)loc);
uint32_t value;
sym_base_addr += rel->r_addend;
int reloc_type = ELF32_R_TYPE(rel->r_info);
switch (reloc_type) {
case R_ARC_32:
case R_ARC_B26:
UNALIGNED_PUT(sym_base_addr, (uint32_t *)loc);
break;
case R_ARC_S25W_PCREL:
/* ((S + A) - P) >> 2
* S = symbol address
* A = addend
* P = relative offset to PCL
*/
value = (sym_base_addr + rel->r_addend - (loc & ~0x3)) >> 2;
insn = ME(insn);
/* disp25w */
insn = insn & ~0x7fcffcf;
insn |= ((value >> 0) & 0x01ff) << 18;
insn |= ((value >> 9) & 0x03ff) << 6;
insn |= ((value >> 19) & 0x000f) << 0;
insn = ME(insn);
UNALIGNED_PUT(insn, (uint32_t *)loc);
break;
case R_ARC_32_ME:
UNALIGNED_PUT(ME(sym_base_addr), (uint32_t *)loc);
break;
default:
LOG_ERR("unknown relocation: %u\n", reloc_type);
ret = -ENOEXEC;
break;
}
return ret;
}

View file

@ -55,7 +55,7 @@ static bool z_check_thread_stack_fail(const uint32_t fault_addr, uint32_t sp)
{
#if defined(CONFIG_MULTITHREADING)
uint32_t guard_end, guard_start;
const struct k_thread *thread = _current;
const struct k_thread *thread = arch_current_thread();
if (!thread) {
/* TODO: Under what circumstances could we get here ? */

View file

@ -49,8 +49,8 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
__asm__ volatile("sync");
/* If _current was aborted in the offload routine, we shouldn't be here */
__ASSERT_NO_MSG((_current->base.thread_state & _THREAD_DEAD) == 0);
/* If arch_current_thread() was aborted in the offload routine, we shouldn't be here */
__ASSERT_NO_MSG((arch_current_thread()->base.thread_state & _THREAD_DEAD) == 0);
}
/* need to be executed on every core in the system */

View file

@ -16,6 +16,7 @@
#include <ipi.h>
#include <zephyr/init.h>
#include <zephyr/irq.h>
#include <zephyr/platform/hooks.h>
#include <arc_irq_offload.h>
volatile struct {
@ -115,6 +116,11 @@ void arch_secondary_cpu_init(int cpu_num)
DT_IRQ(DT_NODELABEL(ici), priority), 0);
irq_enable(DT_IRQN(DT_NODELABEL(ici)));
#endif
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
/* call the function set by arch_cpu_start */
fn = arc_cpu_init[cpu_num].fn;

View file

@ -210,7 +210,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
#ifdef CONFIG_MULTITHREADING
void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
{
*old_thread = _current;
*old_thread = arch_current_thread();
return z_get_next_switch_handle(NULL);
}
@ -227,16 +227,16 @@ void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3)
{
setup_stack_vars(_current);
setup_stack_vars(arch_current_thread());
/* possible optimizaiton: no need to load mem domain anymore */
/* need to lock cpu here ? */
configure_mpu_thread(_current);
configure_mpu_thread(arch_current_thread());
z_arc_userspace_enter(user_entry, p1, p2, p3,
(uint32_t)_current->stack_info.start,
(_current->stack_info.size -
_current->stack_info.delta), _current);
(uint32_t)arch_current_thread()->stack_info.start,
(arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta), arch_current_thread());
CODE_UNREACHABLE;
}
#endif
@ -336,7 +336,7 @@ int arc_vpx_lock(k_timeout_t timeout)
id = _current_cpu->id;
#if (CONFIG_MP_MAX_NUM_CPUS > 1) && defined(CONFIG_SCHED_CPU_MASK)
__ASSERT(!arch_is_in_isr() && (_current->base.cpu_mask == BIT(id)), "");
__ASSERT(!arch_is_in_isr() && (arch_current_thread()->base.cpu_mask == BIT(id)), "");
#endif
k_spin_unlock(&lock, key);
@ -355,7 +355,7 @@ void arc_vpx_unlock(void)
key = k_spin_lock(&lock);
#if (CONFIG_MP_MAX_NUM_CPUS > 1) && defined(CONFIG_SCHED_CPU_MASK)
__ASSERT(!arch_is_in_isr() && (_current->base.cpu_mask == BIT(id)), "");
__ASSERT(!arch_is_in_isr() && (arch_current_thread()->base.cpu_mask == BIT(id)), "");
#endif
id = _current_cpu->id;
k_spin_unlock(&lock, key);

View file

@ -29,7 +29,7 @@ size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr)
void *_Preserve_flags _mwget_tls(void)
{
return (void *)(_current->tls);
return (void *)(arch_current_thread()->tls);
}
#else

View file

@ -26,6 +26,8 @@
#include <v2/irq.h>
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -33,6 +35,10 @@ extern "C" {
static ALWAYS_INLINE void arch_kernel_init(void)
{
z_irq_setup();
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}

View file

@ -178,7 +178,7 @@ bool z_arm_fault_undef_instruction_fp(void)
* context because it is about to be overwritten.
*/
if (((_current_cpu->nested == 2)
&& (_current->base.user_options & K_FP_REGS))
&& (arch_current_thread()->base.user_options & K_FP_REGS))
|| ((_current_cpu->nested > 2)
&& (spill_esf->undefined & FPEXC_EN))) {
/*
@ -196,7 +196,7 @@ bool z_arm_fault_undef_instruction_fp(void)
* means that a thread that uses the VFP does not have to,
* but should, set K_FP_REGS on thread creation.
*/
_current->base.user_options |= K_FP_REGS;
arch_current_thread()->base.user_options |= K_FP_REGS;
}
return false;

View file

@ -62,7 +62,6 @@ static inline void z_arm_floating_point_init(void)
__set_CPACR(reg_val);
barrier_isync_fence_full();
#if !defined(CONFIG_FPU_SHARING)
/*
* FPEXC: Floating-Point Exception Control register
* comp. ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition,
@ -84,7 +83,6 @@ static inline void z_arm_floating_point_init(void)
*/
__set_FPEXC(FPEXC_EN);
#endif
#endif
}
#endif /* CONFIG_CPU_HAS_FPU */

View file

@ -12,6 +12,7 @@
#include "zephyr/cache.h"
#include "zephyr/kernel/thread_stack.h"
#include "zephyr/toolchain/gcc.h"
#include <zephyr/platform/hooks.h>
#define INV_MPID UINT32_MAX
@ -198,6 +199,10 @@ void arch_secondary_cpu_init(void)
*/
#endif
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
fn = arm_cpu_boot_params.fn;
arg = arm_cpu_boot_params.arg;
barrier_dsync_fence_full();

View file

@ -17,8 +17,8 @@
int arch_swap(unsigned int key)
{
/* store off key and return value */
_current->arch.basepri = key;
_current->arch.swap_return_value = -EAGAIN;
arch_current_thread()->arch.basepri = key;
arch_current_thread()->arch.swap_return_value = -EAGAIN;
z_arm_cortex_r_svc();
irq_unlock(key);
@ -26,5 +26,5 @@ int arch_swap(unsigned int key)
/* Context switch is performed here. Returning implies the
* thread has been context-switched-in again.
*/
return _current->arch.swap_return_value;
return arch_current_thread()->arch.swap_return_value;
}

View file

@ -70,7 +70,7 @@ SECTION_FUNC(TEXT, z_arm_do_swap)
#if defined(CONFIG_FPU_SHARING)
ldrb r0, [r2, #_thread_offset_to_user_options]
tst r0, #K_FP_REGS /* _current->base.user_options & K_FP_REGS */
tst r0, #K_FP_REGS /* arch_current_thread()->base.user_options & K_FP_REGS */
beq out_fp_inactive
mov ip, #FPEXC_EN
@ -152,7 +152,7 @@ out_fp_inactive:
#if defined(CONFIG_FPU_SHARING)
ldrb r0, [r2, #_thread_offset_to_user_options]
tst r0, #K_FP_REGS /* _current->base.user_options & K_FP_REGS */
tst r0, #K_FP_REGS /* arch_current_thread()->base.user_options & K_FP_REGS */
beq in_fp_inactive
mov r3, #FPEXC_EN
@ -336,12 +336,14 @@ _context_switch:
_oops:
/*
* Pass the exception frame to z_do_kernel_oops. r0 contains the
* exception reason.
* Pass the exception frame to z_do_kernel_oops.
*/
cps #MODE_SYS
mov r0, sp
cps #MODE_SVC
/* Zero callee_regs and exc_return (only used on Cortex-M) */
mov r1, #0
mov r2, #0
bl z_do_kernel_oops
b z_arm_int_exit

View file

@ -150,10 +150,12 @@ offload:
_oops:
/*
* Pass the exception frame to z_do_kernel_oops. r0 contains the
* exception reason.
* Pass the exception frame to z_do_kernel_oops.
*/
mov r0, sp
/* Zero callee_regs and exc_return (only used on Cortex-M) */
mov r1, #0
mov r2, #0
bl z_do_kernel_oops
inv:

View file

@ -198,8 +198,8 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
{
/* Set up privileged stack before entering user mode */
_current->arch.priv_stack_start =
(uint32_t)z_priv_stack_find(_current->stack_obj);
arch_current_thread()->arch.priv_stack_start =
(uint32_t)z_priv_stack_find(arch_current_thread()->stack_obj);
#if defined(CONFIG_MPU_STACK_GUARD)
#if defined(CONFIG_THREAD_STACK_INFO)
/* We're dropping to user mode which means the guard area is no
@ -208,13 +208,13 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
* which accounted for memory borrowed from the thread stack.
*/
#if FP_GUARD_EXTRA_SIZE > 0
if ((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) {
_current->stack_info.start -= FP_GUARD_EXTRA_SIZE;
_current->stack_info.size += FP_GUARD_EXTRA_SIZE;
if ((arch_current_thread()->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) {
arch_current_thread()->stack_info.start -= FP_GUARD_EXTRA_SIZE;
arch_current_thread()->stack_info.size += FP_GUARD_EXTRA_SIZE;
}
#endif /* FP_GUARD_EXTRA_SIZE */
_current->stack_info.start -= MPU_GUARD_ALIGN_AND_SIZE;
_current->stack_info.size += MPU_GUARD_ALIGN_AND_SIZE;
arch_current_thread()->stack_info.start -= MPU_GUARD_ALIGN_AND_SIZE;
arch_current_thread()->stack_info.size += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_THREAD_STACK_INFO */
/* Stack guard area reserved at the bottom of the thread's
@ -222,23 +222,23 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
* buffer area accordingly.
*/
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
_current->arch.priv_stack_start +=
((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
arch_current_thread()->arch.priv_stack_start +=
((arch_current_thread()->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
_current->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
arch_current_thread()->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#endif /* CONFIG_MPU_STACK_GUARD */
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
_current->arch.priv_stack_end =
_current->arch.priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE;
arch_current_thread()->arch.priv_stack_end =
arch_current_thread()->arch.priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE;
#endif
z_arm_userspace_enter(user_entry, p1, p2, p3,
(uint32_t)_current->stack_info.start,
_current->stack_info.size -
_current->stack_info.delta);
(uint32_t)arch_current_thread()->stack_info.start,
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta);
CODE_UNREACHABLE;
}
@ -304,7 +304,7 @@ EXPORT_SYMBOL(z_arm_thread_is_in_user_mode);
uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp)
{
#if defined(CONFIG_MULTITHREADING)
const struct k_thread *thread = _current;
const struct k_thread *thread = arch_current_thread();
if (thread == NULL) {
return 0;
@ -314,7 +314,7 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp
#if (defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)) && \
defined(CONFIG_MPU_STACK_GUARD)
uint32_t guard_len =
((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
((arch_current_thread()->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
/* If MPU_STACK_GUARD is not enabled, the guard length is
@ -377,7 +377,7 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
int arch_float_disable(struct k_thread *thread)
{
if (thread != _current) {
if (thread != arch_current_thread()) {
return -EINVAL;
}

View file

@ -40,54 +40,6 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
#define EACD(edr) (((edr) & SYSMPU_EDR_EACD_MASK) >> SYSMPU_EDR_EACD_SHIFT)
#endif
/* Exception Return (EXC_RETURN) is provided in LR upon exception entry.
* It is used to perform an exception return and to detect possible state
* transition upon exception.
*/
/* Prefix. Indicates that this is an EXC_RETURN value.
* This field reads as 0b11111111.
*/
#define EXC_RETURN_INDICATOR_PREFIX (0xFF << 24)
/* bit[0]: Exception Secure. The security domain the exception was taken to. */
#define EXC_RETURN_EXCEPTION_SECURE_Pos 0
#define EXC_RETURN_EXCEPTION_SECURE_Msk \
BIT(EXC_RETURN_EXCEPTION_SECURE_Pos)
#define EXC_RETURN_EXCEPTION_SECURE_Non_Secure 0
#define EXC_RETURN_EXCEPTION_SECURE_Secure EXC_RETURN_EXCEPTION_SECURE_Msk
/* bit[2]: Stack Pointer selection. */
#define EXC_RETURN_SPSEL_Pos 2
#define EXC_RETURN_SPSEL_Msk BIT(EXC_RETURN_SPSEL_Pos)
#define EXC_RETURN_SPSEL_MAIN 0
#define EXC_RETURN_SPSEL_PROCESS EXC_RETURN_SPSEL_Msk
/* bit[3]: Mode. Indicates the Mode that was stacked from. */
#define EXC_RETURN_MODE_Pos 3
#define EXC_RETURN_MODE_Msk BIT(EXC_RETURN_MODE_Pos)
#define EXC_RETURN_MODE_HANDLER 0
#define EXC_RETURN_MODE_THREAD EXC_RETURN_MODE_Msk
/* bit[4]: Stack frame type. Indicates whether the stack frame is a standard
* integer only stack frame or an extended floating-point stack frame.
*/
#define EXC_RETURN_STACK_FRAME_TYPE_Pos 4
#define EXC_RETURN_STACK_FRAME_TYPE_Msk BIT(EXC_RETURN_STACK_FRAME_TYPE_Pos)
#define EXC_RETURN_STACK_FRAME_TYPE_EXTENDED 0
#define EXC_RETURN_STACK_FRAME_TYPE_STANDARD EXC_RETURN_STACK_FRAME_TYPE_Msk
/* bit[5]: Default callee register stacking. Indicates whether the default
* stacking rules apply, or whether the callee registers are already on the
* stack.
*/
#define EXC_RETURN_CALLEE_STACK_Pos 5
#define EXC_RETURN_CALLEE_STACK_Msk BIT(EXC_RETURN_CALLEE_STACK_Pos)
#define EXC_RETURN_CALLEE_STACK_SKIPPED 0
#define EXC_RETURN_CALLEE_STACK_DEFAULT EXC_RETURN_CALLEE_STACK_Msk
/* bit[6]: Secure or Non-secure stack. Indicates whether a Secure or
* Non-secure stack is used to restore stack frame on exception return.
*/
#define EXC_RETURN_RETURN_STACK_Pos 6
#define EXC_RETURN_RETURN_STACK_Msk BIT(EXC_RETURN_RETURN_STACK_Pos)
#define EXC_RETURN_RETURN_STACK_Non_Secure 0
#define EXC_RETURN_RETURN_STACK_Secure EXC_RETURN_RETURN_STACK_Msk
/* Integrity signature for an ARMv8-M implementation */
#if defined(CONFIG_ARMV7_M_ARMV8_M_FP)
#define INTEGRITY_SIGNATURE_STD 0xFEFA125BUL
@ -1112,9 +1064,7 @@ void z_arm_fault(uint32_t msp, uint32_t psp, uint32_t exc_return,
__ASSERT(esf != NULL,
"ESF could not be retrieved successfully. Shall never occur.");
#ifdef CONFIG_DEBUG_COREDUMP
z_arm_coredump_fault_sp = POINTER_TO_UINT(esf);
#endif
z_arm_set_fault_sp(esf, exc_return);
reason = fault_handle(esf, fault, &recoverable);
if (recoverable) {

View file

@ -14,6 +14,145 @@
#include <zephyr/arch/cpu.h>
#include <zephyr/arch/common/pm_s2ram.h>
/**
* Macro expanding to an integer literal equal to the offset of
* field `sr_name` in `struct __cpu_context`. This macro has to
* be implemented in C, because GEN_OFFSET_SYM provides offsets
* as C preprocessor definitions - there are not visible to the
* assembler.
*
* See also: `arch/arm/core/offsets/offsets_aarch32.c`
*/
#define CPU_CTX_SR_OFFSET(sr_name) \
___cpu_context_t_ ## sr_name ## _OFFSET
/**
* Macros used to save / load a special register in __cpu_context.
* These also have to be implemented in C due to CPU_CTX_SR_OFFSET.
*/
#define SAVE_SPECIAL_REG(sr_name, cpu_ctx_reg, tmp_reg) \
mrs tmp_reg, sr_name; \
str tmp_reg, [cpu_ctx_reg, # CPU_CTX_SR_OFFSET(sr_name)];
#define RESTORE_SPECIAL_REG(sr_name, cpu_ctx_reg, tmp_reg) \
ldr tmp_reg, [cpu_ctx_reg, # CPU_CTX_SR_OFFSET(sr_name)]; \
msr sr_name, tmp_reg;
/*
* The following macros could be written as assembler macros, but C is used
* for portability (assembler macro syntax may differ between toolchains).
*/
/*
* Pushes registers r4~r12 and lr on the stack.
* r0 is unmodified but other GPRs may be overwritten.
*/
#if !defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* `push` on ARMv6-M / ARMv8-M Baseline:
* only r0~r7 and lr may be pushed
*/
#define PUSH_GPRS \
push {r4-r7}; \
mov r1, r8; \
mov r2, r9; \
mov r3, r10; \
mov r4, r11; \
mov r5, r12; \
push {r1-r5, lr}
#else
/* `push` on ARMv7-M and ARMv8-M Mainline: no limitation */
#define PUSH_GPRS \
push {r4-r12, lr}
#endif /* !CONFIG_ARMV7_M_ARMV8_M_MAINLINE */
/*
* Pops registers r4~r12 and lr from the stack
* r0 is unmodified but other GPRs may be overwritten.
*/
#if !defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* `pop` on ARMv6-M / ARMv8-M Baseline:
* can only pop to r0~r7 and pc (not lr!)
*/
#define POP_GPRS \
pop {r1-r6}; \
mov lr, r6; \
mov r12, r5; \
mov r11, r4; \
mov r10, r3; \
mov r9, r2; \
mov r8, r1; \
pop {r4-r7}
#else
/* `pop` on ARMv7-M and ARMv8-M Mainline: no limitation */
#define POP_GPRS \
pop {r4-r12, lr}
#endif /* !CONFIG_ARMV7_M_ARMV8_M_MAINLINE */
#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* Registers present only on ARMv7-M and ARMv8-M Mainline */
#define SAVE_FM_BP_REGS(cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(faultmask, cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(basepri, cpu_ctx, tmp_reg)
#define RESTORE_FM_BP_REGS(cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(faultmask, cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(basepri, cpu_ctx, tmp_reg)
#else
/* Registers not present: do nothing */
#define SAVE_FM_BP_REGS(cpu_ctx, tmp_reg)
#define RESTORE_FM_BP_REGS(cpu_ctx, tmp_reg)
#endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE */
#if defined(CONFIG_CPU_CORTEX_M_HAS_SPLIM)
/* Registers present only on certain ARMv8-M implementations */
#define SAVE_SPLIM_REGS(cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(msplim, cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(psplim, cpu_ctx, tmp_reg)
#define RESTORE_SPLIM_REGS(cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(msplim, cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(psplim, cpu_ctx, tmp_reg)
#else
/* Registers not present: do nothing */
#define SAVE_SPLIM_REGS(cpu_ctx, tmp_reg)
#define RESTORE_SPLIM_REGS(cpu_ctx, tmp_reg)
#endif /* CONFIG_CPU_CORTEX_M_HAS_SPLIM */
/*
* Saves the CPU's special registers in the `struct __cpu_context`
* pointed to by the `cpu_ctx` register.
* The `tmp_reg` register is overwritten as part of this process.
*/
#define SAVE_SPECIAL_REGISTERS(cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(msp, cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(psp, cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(primask, cpu_ctx, tmp_reg) \
SAVE_SPLIM_REGS( cpu_ctx, tmp_reg) \
SAVE_FM_BP_REGS( cpu_ctx, tmp_reg) \
SAVE_SPECIAL_REG(control, cpu_ctx, tmp_reg)
/*
* Restores the CPU's special registers from the `struct __cpu_context`
* pointed to by the `cpu_ctx` register.
* The `tmp_reg` register is overwritten as part of this process.
*
* N.B.: ISB at the end is required because "Software must use an ISB
* barrier instruction to ensure a write to the CONTROL register takes
* effect before the next instruction is executed."
*
* If this macro is modified, make sure CONTROL is always the last
* restored register, and that an ISB follows the MSR instruction.
*/
#define RESTORE_SPECIAL_REGISTERS(cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(msp, cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(psp, cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(primask, cpu_ctx, tmp_reg) \
RESTORE_SPLIM_REGS( cpu_ctx, tmp_reg) \
RESTORE_FM_BP_REGS( cpu_ctx, tmp_reg) \
RESTORE_SPECIAL_REG(control, cpu_ctx, tmp_reg) \
isb
_ASM_FILE_PROLOGUE
GTEXT(pm_s2ram_mark_set)
@ -26,7 +165,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend)
*
* r0: address of the system_off function
*/
push {r4-r12, lr}
PUSH_GPRS
/* Move system_off to protected register. */
mov r4, r0
@ -34,38 +173,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend)
/* Store CPU context */
ldr r1, =_cpu_context
mrs r2, msp
str r2, [r1, #___cpu_context_t_msp_OFFSET]
mrs r2, msplim
str r2, [r1, #___cpu_context_t_msplim_OFFSET]
mrs r2, psp
str r2, [r1, #___cpu_context_t_psp_OFFSET]
mrs r2, psplim
str r2, [r1, #___cpu_context_t_psplim_OFFSET]
mrs r2, apsr
str r2, [r1, #___cpu_context_t_apsr_OFFSET]
mrs r2, ipsr
str r2, [r1, #___cpu_context_t_ipsr_OFFSET]
mrs r2, epsr
str r2, [r1, #___cpu_context_t_epsr_OFFSET]
mrs r2, primask
str r2, [r1, #___cpu_context_t_primask_OFFSET]
mrs r2, faultmask
str r2, [r1, #___cpu_context_t_faultmask_OFFSET]
mrs r2, basepri
str r2, [r1, #___cpu_context_t_basepri_OFFSET]
mrs r2, control
str r2, [r1, #___cpu_context_t_control_OFFSET]
SAVE_SPECIAL_REGISTERS(/* ctx: */ r1, /* tmp: */ r2)
/*
* Mark entering suspend to RAM.
@ -95,7 +203,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend)
/* Move system_off back to r0 as return value */
mov r0, r4
pop {r4-r12, lr}
POP_GPRS
bx lr
@ -117,44 +225,12 @@ resume:
*/
ldr r0, =_cpu_context
ldr r1, [r0, #___cpu_context_t_msp_OFFSET]
msr msp, r1
RESTORE_SPECIAL_REGISTERS(/* ctx: */ r0, /* tmp: */ r1)
ldr r1, [r0, #___cpu_context_t_msplim_OFFSET]
msr msplim, r1
ldr r1, [r0, #___cpu_context_t_psp_OFFSET]
msr psp, r1
ldr r1, [r0, #___cpu_context_t_psplim_OFFSET]
msr psplim, r1
ldr r1, [r0, #___cpu_context_t_apsr_OFFSET]
msr apsr_nzcvq, r1
ldr r1, [r0, #___cpu_context_t_ipsr_OFFSET]
msr ipsr, r1
ldr r1, [r0, #___cpu_context_t_epsr_OFFSET]
msr epsr, r1
ldr r1, [r0, #___cpu_context_t_primask_OFFSET]
msr primask, r1
ldr r1, [r0, #___cpu_context_t_faultmask_OFFSET]
msr faultmask, r1
ldr r1, [r0, #___cpu_context_t_basepri_OFFSET]
msr basepri, r1
ldr r1, [r0, #___cpu_context_t_control_OFFSET]
msr control, r1
isb
pop {r4-r12, lr}
POP_GPRS
/*
* Set the return value and return
*/
mov r0, #0
movs r0, #0
bx lr

View file

@ -33,8 +33,8 @@
int arch_swap(unsigned int key)
{
/* store off key and return value */
_current->arch.basepri = key;
_current->arch.swap_return_value = -EAGAIN;
arch_current_thread()->arch.basepri = key;
arch_current_thread()->arch.swap_return_value = -EAGAIN;
/* set pending bit to make sure we will take a PendSV exception */
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
@ -45,5 +45,5 @@ int arch_swap(unsigned int key)
/* Context switch is performed here. Returning implies the
* thread has been context-switched-in again.
*/
return _current->arch.swap_return_value;
return arch_current_thread()->arch.swap_return_value;
}

View file

@ -288,7 +288,7 @@ in_fp_endif:
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
push {r2,lr}
mov r0, r2 /* _current thread */
mov r0, r2 /* arch_current_thread() thread */
bl z_arm_configure_dynamic_mpu_regions
pop {r2,lr}
#endif
@ -447,6 +447,7 @@ _oops:
mov r1, sp /* pointer to _callee_saved_t */
#endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE */
#endif /* CONFIG_EXTRA_EXCEPTION_INFO */
mov r2, lr /* EXC_RETURN */
bl z_do_kernel_oops
/* return from SVC exception is done here */
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)

View file

@ -231,8 +231,8 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
{
/* Set up privileged stack before entering user mode */
_current->arch.priv_stack_start =
(uint32_t)z_priv_stack_find(_current->stack_obj);
arch_current_thread()->arch.priv_stack_start =
(uint32_t)z_priv_stack_find(arch_current_thread()->stack_obj);
#if defined(CONFIG_MPU_STACK_GUARD)
#if defined(CONFIG_THREAD_STACK_INFO)
/* We're dropping to user mode which means the guard area is no
@ -241,13 +241,13 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
* which accounted for memory borrowed from the thread stack.
*/
#if FP_GUARD_EXTRA_SIZE > 0
if ((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) {
_current->stack_info.start -= FP_GUARD_EXTRA_SIZE;
_current->stack_info.size += FP_GUARD_EXTRA_SIZE;
if ((arch_current_thread()->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) {
arch_current_thread()->stack_info.start -= FP_GUARD_EXTRA_SIZE;
arch_current_thread()->stack_info.size += FP_GUARD_EXTRA_SIZE;
}
#endif /* FP_GUARD_EXTRA_SIZE */
_current->stack_info.start -= MPU_GUARD_ALIGN_AND_SIZE;
_current->stack_info.size += MPU_GUARD_ALIGN_AND_SIZE;
arch_current_thread()->stack_info.start -= MPU_GUARD_ALIGN_AND_SIZE;
arch_current_thread()->stack_info.size += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_THREAD_STACK_INFO */
/* Stack guard area reserved at the bottom of the thread's
@ -255,18 +255,18 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
* buffer area accordingly.
*/
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
_current->arch.priv_stack_start +=
((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
arch_current_thread()->arch.priv_stack_start +=
((arch_current_thread()->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
_current->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
arch_current_thread()->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#endif /* CONFIG_MPU_STACK_GUARD */
z_arm_userspace_enter(user_entry, p1, p2, p3,
(uint32_t)_current->stack_info.start,
_current->stack_info.size -
_current->stack_info.delta);
(uint32_t)arch_current_thread()->stack_info.start,
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta);
CODE_UNREACHABLE;
}
@ -379,7 +379,7 @@ void configure_builtin_stack_guard(struct k_thread *thread)
uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp)
{
#if defined(CONFIG_MULTITHREADING)
const struct k_thread *thread = _current;
const struct k_thread *thread = arch_current_thread();
if (thread == NULL) {
return 0;
@ -389,7 +389,7 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp
#if (defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)) && \
defined(CONFIG_MPU_STACK_GUARD)
uint32_t guard_len =
((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
((arch_current_thread()->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
/* If MPU_STACK_GUARD is not enabled, the guard length is
@ -452,7 +452,7 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
int arch_float_disable(struct k_thread *thread)
{
if (thread != _current) {
if (thread != arch_current_thread()) {
return -EINVAL;
}
@ -522,7 +522,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
{
z_arm_prepare_switch_to_main();
_current = main_thread;
arch_current_thread_set(main_thread);
#if defined(CONFIG_THREAD_LOCAL_STORAGE)
/* On Cortex-M, TLS uses a global variable as pointer to

View file

@ -27,7 +27,7 @@ void z_impl_k_thread_abort(k_tid_t thread)
{
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_thread, abort, thread);
if (_current == thread) {
if (arch_current_thread() == thread) {
if (arch_is_in_isr()) {
/* ARM is unlike most arches in that this is true
* even for non-peripheral interrupts, even though

View file

@ -28,8 +28,7 @@
*/
static inline uint64_t z_arm_dwt_freq_get(void)
{
#if defined(CONFIG_SOC_FAMILY_NORDIC_NRF) || \
defined(CONFIG_SOC_SERIES_IMXRT6XX)
#if defined(CONFIG_CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK)
/*
* DWT frequency is taken directly from the
* System Core clock (CPU) frequency, if the

View file

@ -101,8 +101,9 @@ void z_arm_fatal_error(unsigned int reason, const struct arch_esf *esf)
*
* @param esf exception frame
* @param callee_regs Callee-saved registers (R4-R11)
* @param exc_return EXC_RETURN value present in LR after exception entry.
*/
void z_do_kernel_oops(const struct arch_esf *esf, _callee_saved_t *callee_regs)
void z_do_kernel_oops(const struct arch_esf *esf, _callee_saved_t *callee_regs, uint32_t exc_return)
{
#if !(defined(CONFIG_EXTRA_EXCEPTION_INFO) && defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE))
ARG_UNUSED(callee_regs);
@ -110,6 +111,8 @@ void z_do_kernel_oops(const struct arch_esf *esf, _callee_saved_t *callee_regs)
/* Stacked R0 holds the exception reason. */
unsigned int reason = esf->basic.r0;
z_arm_set_fault_sp(esf, exc_return);
#if defined(CONFIG_USERSPACE)
if (z_arm_preempted_thread_in_user_mode(esf)) {
/*

View file

@ -83,17 +83,21 @@ GEN_OFFSET_SYM(_thread_stack_info_t, start);
*/
#if defined(CONFIG_PM_S2RAM)
GEN_OFFSET_SYM(_cpu_context_t, msp);
GEN_OFFSET_SYM(_cpu_context_t, msplim);
GEN_OFFSET_SYM(_cpu_context_t, psp);
GEN_OFFSET_SYM(_cpu_context_t, psplim);
GEN_OFFSET_SYM(_cpu_context_t, apsr);
GEN_OFFSET_SYM(_cpu_context_t, ipsr);
GEN_OFFSET_SYM(_cpu_context_t, epsr);
GEN_OFFSET_SYM(_cpu_context_t, primask);
GEN_OFFSET_SYM(_cpu_context_t, control);
#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* Registers present only on ARMv7-M and ARMv8-M Mainline */
GEN_OFFSET_SYM(_cpu_context_t, faultmask);
GEN_OFFSET_SYM(_cpu_context_t, basepri);
GEN_OFFSET_SYM(_cpu_context_t, control);
#endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE */
#if defined(CONFIG_CPU_CORTEX_M_HAS_SPLIM)
/* Registers present only on certain ARMv8-M implementations */
GEN_OFFSET_SYM(_cpu_context_t, msplim);
GEN_OFFSET_SYM(_cpu_context_t, psplim);
#endif /* CONFIG_CPU_CORTEX_M_HAS_SPLIM */
#endif /* CONFIG_PM_S2RAM */
#endif /* _ARM_OFFSETS_INC_ */

View file

@ -43,6 +43,15 @@ static ALWAYS_INLINE bool arch_is_in_nested_exception(const struct arch_esf *esf
return (arch_curr_cpu()->arch.exc_depth > 1U) ? (true) : (false);
}
/**
* @brief No current implementation where core dump is not supported
*
* @param esf exception frame
* @param exc_return EXC_RETURN value present in LR after exception entry.
*/
static ALWAYS_INLINE void z_arm_set_fault_sp(const struct arch_esf *esf, uint32_t exc_return)
{}
#if defined(CONFIG_USERSPACE)
/*
* This function is used by privileged code to determine if the thread

View file

@ -20,6 +20,8 @@
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_A_R_KERNEL_ARCH_FUNC_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_A_R_KERNEL_ARCH_FUNC_H_
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -28,6 +30,9 @@ extern "C" {
static ALWAYS_INLINE void arch_kernel_init(void)
{
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
#ifndef CONFIG_USE_SWITCH

View file

@ -39,6 +39,54 @@ extern volatile irq_offload_routine_t offload_routine;
*/
#define AIRCR_VECT_KEY_PERMIT_WRITE 0x05FAUL
/* Exception Return (EXC_RETURN) is provided in LR upon exception entry.
* It is used to perform an exception return and to detect possible state
* transition upon exception.
*/
/* Prefix. Indicates that this is an EXC_RETURN value.
* This field reads as 0b11111111.
*/
#define EXC_RETURN_INDICATOR_PREFIX (0xFF << 24)
/* bit[0]: Exception Secure. The security domain the exception was taken to. */
#define EXC_RETURN_EXCEPTION_SECURE_Pos 0
#define EXC_RETURN_EXCEPTION_SECURE_Msk \
BIT(EXC_RETURN_EXCEPTION_SECURE_Pos)
#define EXC_RETURN_EXCEPTION_SECURE_Non_Secure 0
#define EXC_RETURN_EXCEPTION_SECURE_Secure EXC_RETURN_EXCEPTION_SECURE_Msk
/* bit[2]: Stack Pointer selection. */
#define EXC_RETURN_SPSEL_Pos 2
#define EXC_RETURN_SPSEL_Msk BIT(EXC_RETURN_SPSEL_Pos)
#define EXC_RETURN_SPSEL_MAIN 0
#define EXC_RETURN_SPSEL_PROCESS EXC_RETURN_SPSEL_Msk
/* bit[3]: Mode. Indicates the Mode that was stacked from. */
#define EXC_RETURN_MODE_Pos 3
#define EXC_RETURN_MODE_Msk BIT(EXC_RETURN_MODE_Pos)
#define EXC_RETURN_MODE_HANDLER 0
#define EXC_RETURN_MODE_THREAD EXC_RETURN_MODE_Msk
/* bit[4]: Stack frame type. Indicates whether the stack frame is a standard
* integer only stack frame or an extended floating-point stack frame.
*/
#define EXC_RETURN_STACK_FRAME_TYPE_Pos 4
#define EXC_RETURN_STACK_FRAME_TYPE_Msk BIT(EXC_RETURN_STACK_FRAME_TYPE_Pos)
#define EXC_RETURN_STACK_FRAME_TYPE_EXTENDED 0
#define EXC_RETURN_STACK_FRAME_TYPE_STANDARD EXC_RETURN_STACK_FRAME_TYPE_Msk
/* bit[5]: Default callee register stacking. Indicates whether the default
* stacking rules apply, or whether the callee registers are already on the
* stack.
*/
#define EXC_RETURN_CALLEE_STACK_Pos 5
#define EXC_RETURN_CALLEE_STACK_Msk BIT(EXC_RETURN_CALLEE_STACK_Pos)
#define EXC_RETURN_CALLEE_STACK_SKIPPED 0
#define EXC_RETURN_CALLEE_STACK_DEFAULT EXC_RETURN_CALLEE_STACK_Msk
/* bit[6]: Secure or Non-secure stack. Indicates whether a Secure or
* Non-secure stack is used to restore stack frame on exception return.
*/
#define EXC_RETURN_RETURN_STACK_Pos 6
#define EXC_RETURN_RETURN_STACK_Msk BIT(EXC_RETURN_RETURN_STACK_Pos)
#define EXC_RETURN_RETURN_STACK_Non_Secure 0
#define EXC_RETURN_RETURN_STACK_Secure EXC_RETURN_RETURN_STACK_Msk
/*
* The current executing vector is found in the IPSR register. All
* IRQs and system exceptions are considered as interrupt context.
@ -184,6 +232,43 @@ static ALWAYS_INLINE void z_arm_clear_faults(void)
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
}
/**
* @brief Set z_arm_coredump_fault_sp to stack pointer value expected by GDB
*
* @param esf exception frame
* @param exc_return EXC_RETURN value present in LR after exception entry.
*/
static ALWAYS_INLINE void z_arm_set_fault_sp(const struct arch_esf *esf, uint32_t exc_return)
{
#ifdef CONFIG_DEBUG_COREDUMP
z_arm_coredump_fault_sp = POINTER_TO_UINT(esf);
#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) || defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* Gdb expects a stack pointer that does not include the exception stack frame in order to
* unwind. So adjust the stack pointer accordingly.
*/
z_arm_coredump_fault_sp += sizeof(esf->basic);
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
/* Assess whether thread had been using the FP registers and add size of additional
* registers if necessary
*/
if ((exc_return & EXC_RETURN_STACK_FRAME_TYPE_STANDARD) ==
EXC_RETURN_STACK_FRAME_TYPE_EXTENDED) {
z_arm_coredump_fault_sp += sizeof(esf->fpu);
}
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#if !(defined(CONFIG_ARMV8_M_MAINLINE) || defined(CONFIG_ARMV8_M_BASELINE))
if ((esf->basic.xpsr & SCB_CCR_STKALIGN_Msk) == SCB_CCR_STKALIGN_Msk) {
/* Adjust stack alignment after PSR bit[9] detected */
z_arm_coredump_fault_sp |= 0x4;
}
#endif /* !CONFIG_ARMV8_M_MAINLINE */
#endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE || CONFIG_ARMV6_M_ARMV8_M_BASELINE */
#endif /* CONFIG_DEBUG_COREDUMP */
}
/**
* @brief Assess whether a debug monitor event should be treated as an error
*

View file

@ -20,6 +20,8 @@
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_KERNEL_ARCH_FUNC_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_KERNEL_ARCH_FUNC_H_
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -53,6 +55,10 @@ static ALWAYS_INLINE void arch_kernel_init(void)
*/
z_arm_configure_static_mpu_regions();
#endif /* CONFIG_ARM_MPU */
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static ALWAYS_INLINE void

View file

@ -727,7 +727,7 @@ static int configure_dynamic_mpu_regions(struct k_thread *thread)
*/
thread->arch.region_num = (uint8_t)region_num;
if (thread == _current) {
if (thread == arch_current_thread()) {
ret = flush_dynamic_regions_to_mpu(dyn_regions, region_num);
}
@ -795,7 +795,7 @@ int arch_mem_domain_thread_add(struct k_thread *thread)
ret = configure_dynamic_mpu_regions(thread);
#ifdef CONFIG_SMP
if (ret == 0 && thread != _current) {
if (ret == 0 && thread != arch_current_thread()) {
/* the thread could be running on another CPU right now */
z_arm64_mem_cfg_ipi();
}
@ -810,7 +810,7 @@ int arch_mem_domain_thread_remove(struct k_thread *thread)
ret = configure_dynamic_mpu_regions(thread);
#ifdef CONFIG_SMP
if (ret == 0 && thread != _current) {
if (ret == 0 && thread != arch_current_thread()) {
/* the thread could be running on another CPU right now */
z_arm64_mem_cfg_ipi();
}

View file

@ -306,8 +306,9 @@ static bool z_arm64_stack_corruption_check(struct arch_esf *esf, uint64_t esr, u
}
}
#ifdef CONFIG_USERSPACE
else if ((_current->base.user_options & K_USER) != 0 && GET_ESR_EC(esr) == 0x24) {
sp_limit = (uint64_t)_current->stack_info.start;
else if ((arch_current_thread()->base.user_options & K_USER) != 0 &&
GET_ESR_EC(esr) == 0x24) {
sp_limit = (uint64_t)arch_current_thread()->stack_info.start;
guard_start = sp_limit - Z_ARM64_STACK_GUARD_SIZE;
sp = esf->sp;
if (sp <= sp_limit || (guard_start <= far && far <= sp_limit)) {
@ -434,7 +435,7 @@ void z_arm64_do_kernel_oops(struct arch_esf *esf)
* User mode is only allowed to induce oopses and stack check
* failures via software-triggered system fatal exceptions.
*/
if (((_current->base.user_options & K_USER) != 0) &&
if (((arch_current_thread()->base.user_options & K_USER) != 0) &&
reason != K_ERR_STACK_CHK_FAIL) {
reason = K_ERR_KERNEL_OOPS;
}

View file

@ -36,7 +36,7 @@ static void DBG(char *msg, struct k_thread *th)
strcpy(buf, "CPU# exc# ");
buf[3] = '0' + _current_cpu->id;
buf[8] = '0' + arch_exception_depth();
strcat(buf, _current->name);
strcat(buf, arch_current_thread()->name);
strcat(buf, ": ");
strcat(buf, msg);
strcat(buf, " ");
@ -125,7 +125,7 @@ static void flush_owned_fpu(struct k_thread *thread)
* replace it, and this avoids a deadlock where
* two CPUs want to pull each other's FPU context.
*/
if (thread == _current) {
if (thread == arch_current_thread()) {
arch_flush_local_fpu();
while (atomic_ptr_get(&_kernel.cpus[i].arch.fpu_owner) == thread) {
barrier_dsync_fence_full();
@ -260,15 +260,15 @@ void z_arm64_fpu_trap(struct arch_esf *esf)
* Make sure the FPU context we need isn't live on another CPU.
* The current CPU's FPU context is NULL at this point.
*/
flush_owned_fpu(_current);
flush_owned_fpu(arch_current_thread());
#endif
/* become new owner */
atomic_ptr_set(&_current_cpu->arch.fpu_owner, _current);
atomic_ptr_set(&_current_cpu->arch.fpu_owner, arch_current_thread());
/* restore our content */
z_arm64_fpu_restore(&_current->arch.saved_fp_context);
DBG("restore", _current);
z_arm64_fpu_restore(&arch_current_thread()->arch.saved_fp_context);
DBG("restore", arch_current_thread());
}
/*
@ -287,7 +287,7 @@ static void fpu_access_update(unsigned int exc_update_level)
if (arch_exception_depth() == exc_update_level) {
/* We're about to execute non-exception code */
if (atomic_ptr_get(&_current_cpu->arch.fpu_owner) == _current) {
if (atomic_ptr_get(&_current_cpu->arch.fpu_owner) == arch_current_thread()) {
/* turn on FPU access */
write_cpacr_el1(cpacr | CPACR_EL1_FPEN_NOTRAP);
} else {

View file

@ -1309,7 +1309,7 @@ int arch_mem_domain_thread_add(struct k_thread *thread)
}
thread->arch.ptables = domain_ptables;
if (thread == _current) {
if (thread == arch_current_thread()) {
z_arm64_swap_ptables(thread);
} else {
#ifdef CONFIG_SMP

View file

@ -23,6 +23,7 @@
#include <zephyr/drivers/interrupt_controller/gic.h>
#include <zephyr/drivers/pm_cpu_ops.h>
#include <zephyr/arch/arch_interface.h>
#include <zephyr/platform/hooks.h>
#include <zephyr/sys/barrier.h>
#include <zephyr/irq.h>
#include "boot.h"
@ -163,6 +164,10 @@ void arch_secondary_cpu_init(int cpu_num)
#endif
#endif
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
fn = arm64_cpu_boot_params.fn;
arg = arm64_cpu_boot_params.arg;
barrier_dsync_fence_full();
@ -235,7 +240,7 @@ void mem_cfg_ipi_handler(const void *unused)
* This is a no-op if the page table is already the right one.
* Lock irq to prevent the interrupt during mem region switch.
*/
z_arm64_swap_mem_domains(_current);
z_arm64_swap_mem_domains(arch_current_thread());
arch_irq_unlock(key);
}

View file

@ -159,15 +159,15 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
uint64_t tmpreg;
/* Map the thread stack */
z_arm64_thread_mem_domains_init(_current);
z_arm64_thread_mem_domains_init(arch_current_thread());
/* Top of the user stack area */
stack_el0 = Z_STACK_PTR_ALIGN(_current->stack_info.start +
_current->stack_info.size -
_current->stack_info.delta);
stack_el0 = Z_STACK_PTR_ALIGN(arch_current_thread()->stack_info.start +
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta);
/* Top of the privileged non-user-accessible part of the stack */
stack_el1 = (uintptr_t)(_current->stack_obj + ARCH_THREAD_STACK_RESERVED);
stack_el1 = (uintptr_t)(arch_current_thread()->stack_obj + ARCH_THREAD_STACK_RESERVED);
register void *x0 __asm__("x0") = user_entry;
register void *x1 __asm__("x1") = p1;

View file

@ -22,6 +22,8 @@
#include <kernel_arch_data.h>
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -35,6 +37,10 @@ static ALWAYS_INLINE void arch_kernel_init(void)
#ifdef CONFIG_XEN
xen_enlighten_init();
#endif
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static inline void arch_switch(void *switch_to, void **switched_from)

View file

@ -9,6 +9,7 @@
SECTION_DATA_PROLOGUE(.ramfunc,,)
{
__ramfunc_region_start = .;
MPU_ALIGN(__ramfunc_size);
__ramfunc_start = .;
*(.ramfunc)

View file

@ -70,6 +70,7 @@ GTEXT(_Fault)
GTEXT(_k_neg_eagain)
GTEXT(z_thread_mark_switched_in)
GTEXT(z_thread_mark_switched_out)
/* exports */
GTEXT(__isr_vec)
@ -209,6 +210,9 @@ on_thread_stack:
#endif /* CONFIG_PREEMPT_ENABLED */
reschedule:
#ifdef CONFIG_INSTRUMENT_THREAD_SWITCHING
jal z_thread_mark_switched_out
#endif
/*
* Check if the current thread is the same as the thread on the ready Q. If
* so, do not reschedule.

View file

@ -19,6 +19,8 @@
#include <kernel_arch_data.h>
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -26,6 +28,9 @@ extern "C" {
#ifndef _ASMLANGUAGE
static ALWAYS_INLINE void arch_kernel_init(void)
{
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static ALWAYS_INLINE void

View file

@ -22,6 +22,8 @@
#include <kernel_arch_data.h>
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -30,6 +32,9 @@ extern "C" {
static ALWAYS_INLINE void arch_kernel_init(void)
{
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static ALWAYS_INLINE void

View file

@ -23,7 +23,7 @@
int arch_swap(unsigned int key)
{
/*
* struct k_thread * _current is the currently running thread
* struct k_thread * arch_current_thread() is the currently running thread
* struct k_thread * _kernel.ready_q.cache contains the next thread to
* run (cannot be NULL)
*
@ -34,8 +34,8 @@ int arch_swap(unsigned int key)
#if CONFIG_INSTRUMENT_THREAD_SWITCHING
z_thread_mark_switched_out();
#endif
_current->callee_saved.key = key;
_current->callee_saved.retval = -EAGAIN;
arch_current_thread()->callee_saved.key = key;
arch_current_thread()->callee_saved.retval = -EAGAIN;
/* retval may be modified with a call to
* arch_thread_return_value_set()
@ -47,10 +47,10 @@ int arch_swap(unsigned int key)
posix_thread_status_t *this_thread_ptr =
(posix_thread_status_t *)
_current->callee_saved.thread_status;
arch_current_thread()->callee_saved.thread_status;
_current = _kernel.ready_q.cache;
arch_current_thread_set(_kernel.ready_q.cache);
#if CONFIG_INSTRUMENT_THREAD_SWITCHING
z_thread_mark_switched_in();
#endif
@ -66,9 +66,9 @@ int arch_swap(unsigned int key)
/* When we continue, _kernel->current points back to this thread */
irq_unlock(_current->callee_saved.key);
irq_unlock(arch_current_thread()->callee_saved.key);
return _current->callee_saved.retval;
return arch_current_thread()->callee_saved.retval;
}
@ -94,7 +94,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
z_thread_mark_switched_out();
#endif
_current = _kernel.ready_q.cache;
arch_current_thread_set(_kernel.ready_q.cache);
#ifdef CONFIG_INSTRUMENT_THREAD_SWITCHING
z_thread_mark_switched_in();

View file

@ -96,6 +96,25 @@ void posix_arch_thread_entry(void *pa_thread_status)
z_thread_entry(ptr->entry_point, ptr->arg1, ptr->arg2, ptr->arg3);
}
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
int arch_float_disable(struct k_thread *thread)
{
ARG_UNUSED(thread);
/* Posix always has FPU enabled so cannot be disabled */
return -ENOTSUP;
}
int arch_float_enable(struct k_thread *thread, unsigned int options)
{
ARG_UNUSED(thread);
ARG_UNUSED(options);
/* Posix always has FPU enabled so nothing to do here */
return 0;
}
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#if defined(CONFIG_ARCH_HAS_THREAD_ABORT)
void z_impl_k_thread_abort(k_tid_t thread)
{
@ -112,7 +131,7 @@ void z_impl_k_thread_abort(k_tid_t thread)
key = irq_lock();
if (_current == thread) {
if (arch_current_thread() == thread) {
if (tstatus->aborted == 0) { /* LCOV_EXCL_BR_LINE */
tstatus->aborted = 1;
} else {

View file

@ -12,6 +12,8 @@
#include <kernel_arch_data.h>
#include <zephyr/platform/hooks.h>
#ifndef _ASMLANGUAGE
#ifdef __cplusplus
@ -20,7 +22,9 @@ extern "C" {
static inline void arch_kernel_init(void)
{
/* Nothing to be done */
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static ALWAYS_INLINE void

View file

@ -1,4 +1,5 @@
# Copyright (c) 2016 Jean-Paul Etienne <fractalclone@gmail.com>
# Copyright (c) 2024 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0
menu "RISCV Options"
@ -27,6 +28,16 @@ config RISCV_GP
global pointer at program start or earlier than any instruction
using GP relative addressing.
config RISCV_CURRENT_VIA_GP
bool "Store current thread into the global pointer (GP) register"
depends on !RISCV_GP && !USERSPACE
depends on MP_MAX_NUM_CPUS > 1
select ARCH_HAS_CUSTOM_CURRENT_IMPL
help
Store the current thread's pointer into the global pointer (GP) register.
When is enabled, calls to `arch_current_thread()` & `k_sched_current_thread_query()` will
be reduced to a single register read.
config RISCV_ALWAYS_SWITCH_THROUGH_ECALL
bool "Do not use mret outside a trap handler context"
depends on MULTITHREADING
@ -37,6 +48,31 @@ config RISCV_ALWAYS_SWITCH_THROUGH_ECALL
and most people should say n here to minimize context switching
overhead.
choice RISCV_SMP_IPI_IMPL
prompt "RISC-V SMP IPI implementation"
depends on SMP
default RISCV_SMP_IPI_CLINT if DT_HAS_SIFIVE_CLINT0_ENABLED
default RISCV_SMP_IPI_CUSTOM
config RISCV_SMP_IPI_CLINT
bool "CLINT-based IPI"
depends on DT_HAS_SIFIVE_CLINT0_ENABLED
help
Use CLINT-based IPI implementation.
config RISCV_SMP_IPI_CUSTOM
bool "Custom IPI implementation"
help
Allow custom IPI implementation.
When this is selected, the following functions must be provided:
- arch_sched_directed_ipi()
- arch_flush_fpu_ipi() if CONFIG_FPU_SHARING
- arch_spin_relax() if CONFIG_FPU_SHARING
- arch_smp_init()
endchoice # RISCV_SMP_IPI_IMPL
menu "RISCV Processor Options"
config INCLUDE_RESET_VECTOR
@ -311,7 +347,6 @@ endif #RISCV_PMP
config PMP_STACK_GUARD
def_bool y
depends on MULTITHREADING
depends on HW_STACK_PROTECTION
config PMP_STACK_GUARD_MIN_SIZE
@ -350,6 +385,15 @@ config NULL_POINTER_EXCEPTION_REGION_SIZE
endif # NULL_POINTER_EXCEPTION_DETECTION_PMP
config RISCV_IMPRECISE_FPU_STATE_TRACKING
bool "Imprecise implementation of FPU state tracking"
depends on FPU
help
According to the RISC-V Instruction Set Manual: Volume II, Version 20240411
(Section 3.1.6.6), some implementations may choose to track the dirtiness of
the floating-point register state imprecisely by reporting the state to be
dirty even when it has not been modified. This option reflects that.
endmenu
config MAIN_STACK_SIZE

View file

@ -17,6 +17,12 @@ if ((CONFIG_MP_MAX_NUM_CPUS GREATER 1) OR (CONFIG_SMP))
zephyr_library_sources(smp.c)
endif ()
if (CONFIG_SMP)
zephyr_library_sources(ipi.c)
zephyr_library_sources_ifdef(CONFIG_RISCV_SMP_IPI_CLINT ipi_clint.c)
endif()
zephyr_library_sources_ifdef(CONFIG_FPU_SHARING fpu.c fpu.S)
zephyr_library_sources_ifdef(CONFIG_DEBUG_COREDUMP coredump.c)
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)

View file

@ -158,33 +158,43 @@ static bool bad_stack_pointer(struct arch_esf *esf)
uintptr_t sp = (uintptr_t)esf + sizeof(struct arch_esf);
#ifdef CONFIG_USERSPACE
if (_current->arch.priv_stack_start != 0 &&
sp >= _current->arch.priv_stack_start &&
sp < _current->arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE) {
if (arch_current_thread()->arch.priv_stack_start != 0 &&
sp >= arch_current_thread()->arch.priv_stack_start &&
sp < arch_current_thread()->arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE) {
return true;
}
if (z_stack_is_user_capable(_current->stack_obj) &&
sp >= _current->stack_info.start - K_THREAD_STACK_RESERVED &&
sp < _current->stack_info.start - K_THREAD_STACK_RESERVED
if (z_stack_is_user_capable(arch_current_thread()->stack_obj) &&
sp >= arch_current_thread()->stack_info.start - K_THREAD_STACK_RESERVED &&
sp < arch_current_thread()->stack_info.start - K_THREAD_STACK_RESERVED
+ Z_RISCV_STACK_GUARD_SIZE) {
return true;
}
#endif /* CONFIG_USERSPACE */
if (sp >= _current->stack_info.start - K_KERNEL_STACK_RESERVED &&
sp < _current->stack_info.start - K_KERNEL_STACK_RESERVED
#if CONFIG_MULTITHREADING
if (sp >= arch_current_thread()->stack_info.start - K_KERNEL_STACK_RESERVED &&
sp < arch_current_thread()->stack_info.start - K_KERNEL_STACK_RESERVED
+ Z_RISCV_STACK_GUARD_SIZE) {
return true;
}
#else
uintptr_t isr_stack = (uintptr_t)z_interrupt_stacks;
uintptr_t main_stack = (uintptr_t)z_main_stack;
if ((sp >= isr_stack && sp < isr_stack + Z_RISCV_STACK_GUARD_SIZE) ||
(sp >= main_stack && sp < main_stack + Z_RISCV_STACK_GUARD_SIZE)) {
return true;
}
#endif /* CONFIG_MULTITHREADING */
#endif /* CONFIG_PMP_STACK_GUARD */
#ifdef CONFIG_USERSPACE
if ((esf->mstatus & MSTATUS_MPP) == 0 &&
(esf->sp < _current->stack_info.start ||
esf->sp > _current->stack_info.start +
_current->stack_info.size -
_current->stack_info.delta)) {
(esf->sp < arch_current_thread()->stack_info.start ||
esf->sp > arch_current_thread()->stack_info.start +
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta)) {
/* user stack pointer moved outside of its allowed stack */
return true;
}
@ -236,9 +246,9 @@ FUNC_NORETURN void arch_syscall_oops(void *ssf_ptr)
void z_impl_user_fault(unsigned int reason)
{
struct arch_esf *oops_esf = _current->syscall_frame;
struct arch_esf *oops_esf = arch_current_thread()->syscall_frame;
if (((_current->base.user_options & K_USER) != 0) &&
if (((arch_current_thread()->base.user_options & K_USER) != 0) &&
reason != K_ERR_STACK_CHK_FAIL) {
reason = K_ERR_KERNEL_OOPS;
}

View file

@ -36,8 +36,8 @@ static void DBG(char *msg, struct k_thread *th)
strcpy(buf, "CPU# exc# ");
buf[3] = '0' + _current_cpu->id;
buf[8] = '0' + _current->arch.exception_depth;
strcat(buf, _current->name);
buf[8] = '0' + arch_current_thread()->arch.exception_depth;
strcat(buf, arch_current_thread()->name);
strcat(buf, ": ");
strcat(buf, msg);
strcat(buf, " ");
@ -82,12 +82,12 @@ static void z_riscv_fpu_load(void)
"must be called with FPU access disabled");
/* become new owner */
atomic_ptr_set(&_current_cpu->arch.fpu_owner, _current);
atomic_ptr_set(&_current_cpu->arch.fpu_owner, arch_current_thread());
/* restore our content */
csr_set(mstatus, MSTATUS_FS_INIT);
z_riscv_fpu_restore(&_current->arch.saved_fp_context);
DBG("restore", _current);
z_riscv_fpu_restore(&arch_current_thread()->arch.saved_fp_context);
DBG("restore", arch_current_thread());
}
/*
@ -168,7 +168,7 @@ static void flush_owned_fpu(struct k_thread *thread)
* replace it, and this avoids a deadlock where
* two CPUs want to pull each other's FPU context.
*/
if (thread == _current) {
if (thread == arch_current_thread()) {
z_riscv_fpu_disable();
arch_flush_local_fpu();
do {
@ -213,7 +213,7 @@ void z_riscv_fpu_trap(struct arch_esf *esf)
/* save current owner's content if any */
arch_flush_local_fpu();
if (_current->arch.exception_depth > 0) {
if (arch_current_thread()->arch.exception_depth > 0) {
/*
* We were already in exception when the FPU access trapped.
* We give it access and prevent any further IRQ recursion
@ -233,7 +233,7 @@ void z_riscv_fpu_trap(struct arch_esf *esf)
* Make sure the FPU context we need isn't live on another CPU.
* The current CPU's FPU context is NULL at this point.
*/
flush_owned_fpu(_current);
flush_owned_fpu(arch_current_thread());
#endif
/* make it accessible and clean to the returning context */
@ -256,13 +256,13 @@ static bool fpu_access_allowed(unsigned int exc_update_level)
__ASSERT((csr_read(mstatus) & MSTATUS_IEN) == 0,
"must be called with IRQs disabled");
if (_current->arch.exception_depth == exc_update_level) {
if (arch_current_thread()->arch.exception_depth == exc_update_level) {
/* We're about to execute non-exception code */
if (_current_cpu->arch.fpu_owner == _current) {
if (_current_cpu->arch.fpu_owner == arch_current_thread()) {
/* everything is already in place */
return true;
}
if (_current->arch.fpu_recently_used) {
if (arch_current_thread()->arch.fpu_recently_used) {
/*
* Before this thread was context-switched out,
* it made active use of the FPU, but someone else
@ -273,7 +273,7 @@ static bool fpu_access_allowed(unsigned int exc_update_level)
z_riscv_fpu_disable();
arch_flush_local_fpu();
#ifdef CONFIG_SMP
flush_owned_fpu(_current);
flush_owned_fpu(arch_current_thread());
#endif
z_riscv_fpu_load();
_current_cpu->arch.fpu_state = MSTATUS_FS_CLEAN;

14
arch/riscv/core/ipi.c Normal file
View file

@ -0,0 +1,14 @@
/*
* Copyright (c) 2021 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ipi.h>
#include <zephyr/kernel.h>
void arch_sched_broadcast_ipi(void)
{
arch_sched_directed_ipi(IPI_ALL_CPUS_MASK);
}

View file

@ -0,0 +1,97 @@
/*
* Copyright (c) 2021 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ipi.h>
#include <ksched.h>
#include <zephyr/kernel.h>
#define MSIP_BASE 0x2000000UL
#define MSIP(hartid) ((volatile uint32_t *)MSIP_BASE)[hartid]
static atomic_val_t cpu_pending_ipi[CONFIG_MP_MAX_NUM_CPUS];
#define IPI_SCHED 0
#define IPI_FPU_FLUSH 1
void arch_sched_directed_ipi(uint32_t cpu_bitmap)
{
unsigned int key = arch_irq_lock();
unsigned int id = _current_cpu->id;
unsigned int num_cpus = arch_num_cpus();
for (unsigned int i = 0; i < num_cpus; i++) {
if ((i != id) && _kernel.cpus[i].arch.online && ((cpu_bitmap & BIT(i)) != 0)) {
atomic_set_bit(&cpu_pending_ipi[i], IPI_SCHED);
MSIP(_kernel.cpus[i].arch.hartid) = 1;
}
}
arch_irq_unlock(key);
}
#ifdef CONFIG_FPU_SHARING
void arch_flush_fpu_ipi(unsigned int cpu)
{
atomic_set_bit(&cpu_pending_ipi[cpu], IPI_FPU_FLUSH);
MSIP(_kernel.cpus[cpu].arch.hartid) = 1;
}
#endif /* CONFIG_FPU_SHARING */
static void sched_ipi_handler(const void *unused)
{
ARG_UNUSED(unused);
MSIP(csr_read(mhartid)) = 0;
atomic_val_t pending_ipi = atomic_clear(&cpu_pending_ipi[_current_cpu->id]);
if (pending_ipi & ATOMIC_MASK(IPI_SCHED)) {
z_sched_ipi();
}
#ifdef CONFIG_FPU_SHARING
if (pending_ipi & ATOMIC_MASK(IPI_FPU_FLUSH)) {
/* disable IRQs */
csr_clear(mstatus, MSTATUS_IEN);
/* perform the flush */
arch_flush_local_fpu();
/*
* No need to re-enable IRQs here as long as
* this remains the last case.
*/
}
#endif /* CONFIG_FPU_SHARING */
}
#ifdef CONFIG_FPU_SHARING
/*
* Make sure there is no pending FPU flush request for this CPU while
* waiting for a contended spinlock to become available. This prevents
* a deadlock when the lock we need is already taken by another CPU
* that also wants its FPU content to be reinstated while such content
* is still live in this CPU's FPU.
*/
void arch_spin_relax(void)
{
atomic_val_t *pending_ipi = &cpu_pending_ipi[_current_cpu->id];
if (atomic_test_and_clear_bit(pending_ipi, IPI_FPU_FLUSH)) {
/*
* We may not be in IRQ context here hence cannot use
* arch_flush_local_fpu() directly.
*/
arch_float_disable(_current_cpu->arch.fpu_owner);
}
}
#endif /* CONFIG_FPU_SHARING */
int arch_smp_init(void)
{
IRQ_CONNECT(RISCV_IRQ_MSOFT, 0, sched_ipi_handler, NULL, 0);
irq_enable(RISCV_IRQ_MSOFT);
return 0;
}

View file

@ -163,6 +163,14 @@ SECTION_FUNC(exception.entry, _isr_wrapper)
lr t0, ___cpu_t_current_OFFSET(s0)
lr tp, _thread_offset_to_tls(t0)
/* Make sure global pointer is sane */
#ifdef CONFIG_RISCV_GP
.option push
.option norelax
la gp, __global_pointer$
.option pop
#endif /* CONFIG_RISCV_GP */
/* Clear our per-thread usermode flag */
lui t0, %tprel_hi(is_user_mode)
add t0, t0, tp, %tprel_add(is_user_mode)
@ -289,7 +297,7 @@ is_fp: /* Process the FP trap and quickly return from exception */
mv a0, sp
tail z_riscv_fpu_trap
2:
no_fp: /* increment _current->arch.exception_depth */
no_fp: /* increment arch_current_thread()->arch.exception_depth */
lr t0, ___cpu_t_current_OFFSET(s0)
lb t1, _thread_offset_to_exception_depth(t0)
add t1, t1, 1
@ -348,7 +356,7 @@ no_fp: /* increment _current->arch.exception_depth */
li t1, RISCV_EXC_ECALLU
beq t0, t1, is_user_syscall
#ifdef CONFIG_PMP_STACK_GUARD
#if defined(CONFIG_PMP_STACK_GUARD) && defined(CONFIG_MULTITHREADING)
/*
* Determine if we come from user space. If so, reconfigure the PMP for
* kernel mode stack guard.
@ -389,7 +397,7 @@ is_kernel_syscall:
addi t0, t0, 4
sr t0, __struct_arch_esf_mepc_OFFSET(sp)
#ifdef CONFIG_PMP_STACK_GUARD
#if defined(CONFIG_PMP_STACK_GUARD) && defined(CONFIG_MULTITHREADING)
/* Re-activate PMP for m-mode */
li t1, MSTATUS_MPP
csrc mstatus, t1
@ -500,7 +508,7 @@ do_irq_offload:
#ifdef CONFIG_USERSPACE
is_user_syscall:
#ifdef CONFIG_PMP_STACK_GUARD
#if defined(CONFIG_PMP_STACK_GUARD) && defined(CONFIG_MULTITHREADING)
/*
* We came from userspace and need to reconfigure the
* PMP for kernel mode stack guard.
@ -570,7 +578,7 @@ valid_syscall_id:
is_interrupt:
#ifdef CONFIG_PMP_STACK_GUARD
#if defined(CONFIG_PMP_STACK_GUARD) && defined(CONFIG_MULTITHREADING)
#ifdef CONFIG_USERSPACE
/*
* If we came from userspace then we need to reconfigure the
@ -716,7 +724,7 @@ no_reschedule:
mv a0, sp
call z_riscv_fpu_exit_exc
/* decrement _current->arch.exception_depth */
/* decrement arch_current_thread()->arch.exception_depth */
lr t0, ___cpu_t_current_OFFSET(s0)
lb t1, _thread_offset_to_exception_depth(t0)
add t1, t1, -1
@ -740,7 +748,7 @@ fp_trap_exit:
and t0, t2, t1
bnez t0, 1f
#ifdef CONFIG_PMP_STACK_GUARD
#if defined(CONFIG_PMP_STACK_GUARD) && defined(CONFIG_MULTITHREADING)
/* Remove kernel stack guard and Reconfigure PMP for user mode */
lr a0, ___cpu_t_current_OFFSET(s0)
call z_riscv_pmp_usermode_enable

View file

@ -348,8 +348,8 @@ static unsigned int global_pmp_end_index;
*/
void z_riscv_pmp_init(void)
{
unsigned long pmp_addr[5];
unsigned long pmp_cfg[2];
unsigned long pmp_addr[CONFIG_PMP_SLOTS];
unsigned long pmp_cfg[CONFIG_PMP_SLOTS / PMPCFG_STRIDE];
unsigned int index = 0;
/* The read-only area is always there for every mode */
@ -370,6 +370,7 @@ void z_riscv_pmp_init(void)
#endif
#ifdef CONFIG_PMP_STACK_GUARD
#ifdef CONFIG_MULTITHREADING
/*
* Set the stack guard for this CPU's IRQ stack by making the bottom
* addresses inaccessible. This will never change so we do it here
@ -396,6 +397,21 @@ void z_riscv_pmp_init(void)
/* And forget about that last entry as we won't need it later */
index--;
#else
/* Without multithreading setup stack guards for IRQ and main stacks */
set_pmp_entry(&index, PMP_NONE | PMP_L,
(uintptr_t)z_interrupt_stacks,
Z_RISCV_STACK_GUARD_SIZE,
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
set_pmp_entry(&index, PMP_NONE | PMP_L,
(uintptr_t)z_main_stack,
Z_RISCV_STACK_GUARD_SIZE,
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
/* Write those entries to PMP regs. */
write_pmp_entries(0, index, true, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
#endif /* CONFIG_MULTITHREADING */
#else
/* Write those entries to PMP regs. */
write_pmp_entries(0, index, true, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));
@ -419,7 +435,6 @@ void z_riscv_pmp_init(void)
}
#endif
__ASSERT(index <= PMPCFG_STRIDE, "provision for one global word only");
global_pmp_cfg[0] = pmp_cfg[0];
global_pmp_last_addr = pmp_addr[index - 1];
global_pmp_end_index = index;
@ -454,6 +469,7 @@ static inline unsigned int z_riscv_pmp_thread_init(unsigned long *pmp_addr,
#ifdef CONFIG_PMP_STACK_GUARD
#ifdef CONFIG_MULTITHREADING
/**
* @brief Prepare the PMP stackguard content for given thread.
*
@ -511,6 +527,8 @@ void z_riscv_pmp_stackguard_enable(struct k_thread *thread)
csr_set(mstatus, MSTATUS_MPRV);
}
#endif /* CONFIG_MULTITHREADING */
/**
* @brief Remove PMP stackguard content to actual PMP registers
*/
@ -734,8 +752,8 @@ int arch_buffer_validate(const void *addr, size_t size, int write)
int ret = -1;
/* Check if this is on the stack */
if (IS_WITHIN(start, size,
_current->stack_info.start, _current->stack_info.size)) {
if (IS_WITHIN(start, size, arch_current_thread()->stack_info.start,
arch_current_thread()->stack_info.size)) {
return 0;
}
@ -750,7 +768,7 @@ int arch_buffer_validate(const void *addr, size_t size, int write)
}
/* Look for a matching partition in our memory domain */
struct k_mem_domain *domain = _current->mem_domain_info.mem_domain;
struct k_mem_domain *domain = arch_current_thread()->mem_domain_info.mem_domain;
int p_idx, remaining_partitions;
k_spinlock_key_t key = k_spin_lock(&z_mem_domain_lock);

View file

@ -7,11 +7,11 @@
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <ksched.h>
#include <ipi.h>
#include <zephyr/irq.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/arch/riscv/irq.h>
#include <zephyr/drivers/pm_cpu_ops.h>
#include <zephyr/platform/hooks.h>
volatile struct {
arch_cpustart_t fn;
@ -79,101 +79,8 @@ void arch_secondary_cpu_init(int hartid)
/* Enable on secondary cores so that they can respond to PLIC */
irq_enable(RISCV_IRQ_MEXT);
#endif /* CONFIG_PLIC_IRQ_AFFINITY */
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
riscv_cpu_init[cpu_num].fn(riscv_cpu_init[cpu_num].arg);
}
#ifdef CONFIG_SMP
#define MSIP_BASE 0x2000000UL
#define MSIP(hartid) ((volatile uint32_t *)MSIP_BASE)[hartid]
static atomic_val_t cpu_pending_ipi[CONFIG_MP_MAX_NUM_CPUS];
#define IPI_SCHED 0
#define IPI_FPU_FLUSH 1
void arch_sched_directed_ipi(uint32_t cpu_bitmap)
{
unsigned int key = arch_irq_lock();
unsigned int id = _current_cpu->id;
unsigned int num_cpus = arch_num_cpus();
for (unsigned int i = 0; i < num_cpus; i++) {
if ((i != id) && _kernel.cpus[i].arch.online &&
((cpu_bitmap & BIT(i)) != 0)) {
atomic_set_bit(&cpu_pending_ipi[i], IPI_SCHED);
MSIP(_kernel.cpus[i].arch.hartid) = 1;
}
}
arch_irq_unlock(key);
}
void arch_sched_broadcast_ipi(void)
{
arch_sched_directed_ipi(IPI_ALL_CPUS_MASK);
}
#ifdef CONFIG_FPU_SHARING
void arch_flush_fpu_ipi(unsigned int cpu)
{
atomic_set_bit(&cpu_pending_ipi[cpu], IPI_FPU_FLUSH);
MSIP(_kernel.cpus[cpu].arch.hartid) = 1;
}
#endif
static void sched_ipi_handler(const void *unused)
{
ARG_UNUSED(unused);
MSIP(csr_read(mhartid)) = 0;
atomic_val_t pending_ipi = atomic_clear(&cpu_pending_ipi[_current_cpu->id]);
if (pending_ipi & ATOMIC_MASK(IPI_SCHED)) {
z_sched_ipi();
}
#ifdef CONFIG_FPU_SHARING
if (pending_ipi & ATOMIC_MASK(IPI_FPU_FLUSH)) {
/* disable IRQs */
csr_clear(mstatus, MSTATUS_IEN);
/* perform the flush */
arch_flush_local_fpu();
/*
* No need to re-enable IRQs here as long as
* this remains the last case.
*/
}
#endif
}
#ifdef CONFIG_FPU_SHARING
/*
* Make sure there is no pending FPU flush request for this CPU while
* waiting for a contended spinlock to become available. This prevents
* a deadlock when the lock we need is already taken by another CPU
* that also wants its FPU content to be reinstated while such content
* is still live in this CPU's FPU.
*/
void arch_spin_relax(void)
{
atomic_val_t *pending_ipi = &cpu_pending_ipi[_current_cpu->id];
if (atomic_test_and_clear_bit(pending_ipi, IPI_FPU_FLUSH)) {
/*
* We may not be in IRQ context here hence cannot use
* arch_flush_local_fpu() directly.
*/
arch_float_disable(_current_cpu->arch.fpu_owner);
}
}
#endif
int arch_smp_init(void)
{
IRQ_CONNECT(RISCV_IRQ_MSOFT, 0, sched_ipi_handler, NULL, 0);
irq_enable(RISCV_IRQ_MSOFT);
return 0;
}
#endif /* CONFIG_SMP */

View file

@ -108,7 +108,7 @@ static void walk_stackframe(riscv_stacktrace_cb cb, void *cookie, const struct k
/* Unwind the provided exception stack frame */
fp = esf->s0;
ra = esf->mepc;
} else if ((csf == NULL) || (csf == &_current->callee_saved)) {
} else if ((csf == NULL) || (csf == &arch_current_thread()->callee_saved)) {
/* Unwind current thread (default case when nothing is provided ) */
fp = (uintptr_t)__builtin_frame_address(0);
ra = (uintptr_t)walk_stackframe;
@ -181,7 +181,7 @@ static void walk_stackframe(riscv_stacktrace_cb cb, void *cookie, const struct k
/* Unwind the provided exception stack frame */
sp = z_riscv_get_sp_before_exc(esf);
ra = esf->mepc;
} else if ((csf == NULL) || (csf == &_current->callee_saved)) {
} else if ((csf == NULL) || (csf == &arch_current_thread()->callee_saved)) {
/* Unwind current thread (default case when nothing is provided ) */
sp = current_stack_pointer;
ra = (uintptr_t)walk_stackframe;
@ -215,8 +215,10 @@ void arch_stack_walk(stack_trace_callback_fn callback_fn, void *cookie,
const struct k_thread *thread, const struct arch_esf *esf)
{
if (thread == NULL) {
/* In case `thread` is NULL, default that to `_current` and try to unwind */
thread = _current;
/* In case `thread` is NULL, default that to `arch_current_thread()`
* and try to unwind
*/
thread = arch_current_thread();
}
walk_stackframe((riscv_stacktrace_cb)callback_fn, cookie, thread, esf, in_stack_bound,
@ -280,7 +282,8 @@ void z_riscv_unwind_stack(const struct arch_esf *esf, const _callee_saved_t *csf
int i = 0;
LOG_ERR("call trace:");
walk_stackframe(print_trace_address, &i, _current, esf, in_fatal_stack_bound, csf);
walk_stackframe(print_trace_address, &i, arch_current_thread(), esf, in_fatal_stack_bound,
csf);
LOG_ERR("");
}
#endif /* CONFIG_EXCEPTION_STACK_TRACE */

View file

@ -132,28 +132,29 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
/* Set up privileged stack */
#ifdef CONFIG_GEN_PRIV_STACKS
_current->arch.priv_stack_start =
(unsigned long)z_priv_stack_find(_current->stack_obj);
arch_current_thread()->arch.priv_stack_start =
(unsigned long)z_priv_stack_find(arch_current_thread()->stack_obj);
/* remove the stack guard from the main stack */
_current->stack_info.start -= K_THREAD_STACK_RESERVED;
_current->stack_info.size += K_THREAD_STACK_RESERVED;
arch_current_thread()->stack_info.start -= K_THREAD_STACK_RESERVED;
arch_current_thread()->stack_info.size += K_THREAD_STACK_RESERVED;
#else
_current->arch.priv_stack_start = (unsigned long)_current->stack_obj;
arch_current_thread()->arch.priv_stack_start =
(unsigned long)arch_current_thread()->stack_obj;
#endif /* CONFIG_GEN_PRIV_STACKS */
top_of_priv_stack = Z_STACK_PTR_ALIGN(_current->arch.priv_stack_start +
top_of_priv_stack = Z_STACK_PTR_ALIGN(arch_current_thread()->arch.priv_stack_start +
K_KERNEL_STACK_RESERVED +
CONFIG_PRIVILEGED_STACK_SIZE);
#ifdef CONFIG_INIT_STACKS
/* Initialize the privileged stack */
(void)memset((void *)_current->arch.priv_stack_start, 0xaa,
(void)memset((void *)arch_current_thread()->arch.priv_stack_start, 0xaa,
Z_STACK_PTR_ALIGN(K_KERNEL_STACK_RESERVED + CONFIG_PRIVILEGED_STACK_SIZE));
#endif /* CONFIG_INIT_STACKS */
top_of_user_stack = Z_STACK_PTR_ALIGN(
_current->stack_info.start +
_current->stack_info.size -
_current->stack_info.delta);
arch_current_thread()->stack_info.start +
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta);
status = csr_read(mstatus);
@ -169,12 +170,12 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
#ifdef CONFIG_PMP_STACK_GUARD
/* reconfigure as the kernel mode stack will be different */
z_riscv_pmp_stackguard_prepare(_current);
z_riscv_pmp_stackguard_prepare(arch_current_thread());
#endif
/* Set up Physical Memory Protection */
z_riscv_pmp_usermode_prepare(_current);
z_riscv_pmp_usermode_enable(_current);
z_riscv_pmp_usermode_prepare(arch_current_thread());
z_riscv_pmp_usermode_enable(arch_current_thread());
/* preserve stack pointer for next exception entry */
arch_curr_cpu()->arch.user_exc_sp = top_of_priv_stack;

View file

@ -18,6 +18,8 @@
#include <kernel_arch_data.h>
#include <pmp.h>
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -53,6 +55,9 @@ static ALWAYS_INLINE void arch_kernel_init(void)
#ifdef CONFIG_RISCV_PMP
z_riscv_pmp_init();
#endif
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static ALWAYS_INLINE void

View file

@ -26,6 +26,12 @@ config NUM_IRQS
int
default 32
config SPARC_SVT
bool "Single-vector trapping"
help
Use Single-vector trapping (SVT). Defined by SPARC-V8 Embedded (V8E)
Architecture Specification and available in some LEON processors.
config SPARC_CASA
bool "CASA instructions"
help

View file

@ -13,8 +13,9 @@ zephyr_library_sources(
thread.c
window_trap.S
sw_trap_set_pil.S
trap_table_mvt.S
)
zephyr_library_sources_ifdef(CONFIG_SPARC_SVT trap_table_svt.S)
zephyr_library_sources_ifndef(CONFIG_SPARC_SVT trap_table_mvt.S)
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD irq_offload.c)
zephyr_library_sources_ifdef(CONFIG_THREAD_LOCAL_STORAGE tls.c)

View file

@ -12,6 +12,18 @@
GTEXT(__sparc_trap_reset)
SECTION_FUNC(TEXT, __sparc_trap_reset)
#ifdef CONFIG_SPARC_SVT
#ifdef CONFIG_SOC_SPARC_LEON
/* On LEON, enable single vector trapping by setting ASR17.SV. */
rd %asr17, %g1
set (1<<13), %g2
or %g1, %g2, %g1
wr %g1, %asr17
#else
#error "Don't know how to enable SVT on this SOC"
#endif
#endif
set __sparc_trap_table, %g1
wr %g1, %tbr
wr 2, %wim

View file

@ -61,7 +61,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
{
*old_thread = _current;
*old_thread = arch_current_thread();
return z_get_next_switch_handle(*old_thread);
}

View file

@ -0,0 +1,138 @@
/*
* Copyright (c) 2023 Frontgrade Gaisler AB
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* This file contains the trap entry for SPARC operating with
* single-vector trap model, defined in SPARC V8E. The processor
* redirects execution to a single entry on any trap event. From
* there, two levels of look-up tables are used to find the trap
* handler.
*
* - Execution time is constant.
* - Condition flags are not modified.
* - Provides handler with PSR in l0, TBR in l6
* - This SVT implementation is less than 400 bytes long. (An MVT
* table is always 4096 bytes long.)
*
* See trap_table_mvt.S for information about SPARC trap types.
*/
#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <zephyr/arch/sparc/sparc.h>
#ifdef CONFIG_IRQ_OFFLOAD
#define IRQ_OFFLOAD_HANDLER __sparc_trap_irq_offload
#else
#define IRQ_OFFLOAD_HANDLER __sparc_trap_fault
#endif
GTEXT(__sparc_trap_table)
GTEXT(__start)
SECTION_SUBSEC_FUNC(TEXT, traptable, __sparc_trap_table)
__start:
rd %psr, %l0
mov %tbr, %l6
and %l6, 0xf00, %l7
srl %l7, 6, %l7
set __sparc_trap_table_svt_level0, %l4
ld [%l4 + %l7], %l4
and %l6, 0x0f0, %l7
srl %l7, 2, %l7
ld [%l4 + %l7], %l4
srl %l6, 4, %l3
jmp %l4
and %l3, 0xf, %l3 /* Interrupt level */
__sparc_trap_svt_in_trap:
ta 0x00
nop
SECTION_VAR(RODATA, __sparc_trap_table_svt_tables)
.align 4
__sparc_trap_table_svt_level0:
.word __sparc_trap_table_svt_00
.word __sparc_trap_table_svt_10
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_80
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
.word __sparc_trap_table_svt_allbad
__sparc_trap_table_svt_00:
.word __sparc_trap_reset
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_window_overflow
.word __sparc_trap_window_underflow
__sparc_trap_table_svt_allbad:
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
__sparc_trap_table_svt_10:
.word __sparc_trap_fault
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
.word __sparc_trap_interrupt
__sparc_trap_table_svt_80:
.word __sparc_trap_svt_in_trap
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_flush_windows
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_sw_set_pil
.word __sparc_trap_fault
.word __sparc_trap_fault
.word __sparc_trap_fault
.word IRQ_OFFLOAD_HANDLER
.word __sparc_trap_fault
.word __sparc_trap_except_reason

View file

@ -17,6 +17,8 @@
#include <kernel_arch_data.h>
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -24,6 +26,9 @@ extern "C" {
#ifndef _ASMLANGUAGE
static ALWAYS_INLINE void arch_kernel_init(void)
{
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
void z_sparc_context_switch(struct k_thread *newt, struct k_thread *oldt);

View file

@ -49,7 +49,7 @@ bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs)
{
uintptr_t start, end;
if (_current == NULL || arch_is_in_isr()) {
if (arch_current_thread() == NULL || arch_is_in_isr()) {
/* We were servicing an interrupt or in early boot environment
* and are supposed to be on the interrupt stack */
int cpu_id;
@ -64,7 +64,7 @@ bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs)
end = start + CONFIG_ISR_STACK_SIZE;
#ifdef CONFIG_USERSPACE
} else if ((cs & 0x3U) == 0U &&
(_current->base.user_options & K_USER) != 0) {
(arch_current_thread()->base.user_options & K_USER) != 0) {
/* The low two bits of the CS register is the privilege
* level. It will be 0 in supervisor mode and 3 in user mode
* corresponding to ring 0 / ring 3.
@ -72,14 +72,14 @@ bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs)
* If we get here, we must have been doing a syscall, check
* privilege elevation stack bounds
*/
start = _current->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE;
end = _current->stack_info.start;
start = arch_current_thread()->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE;
end = arch_current_thread()->stack_info.start;
#endif /* CONFIG_USERSPACE */
} else {
/* Normal thread operation, check its stack buffer */
start = _current->stack_info.start;
end = Z_STACK_PTR_ALIGN(_current->stack_info.start +
_current->stack_info.size);
start = arch_current_thread()->stack_info.start;
end = Z_STACK_PTR_ALIGN(arch_current_thread()->stack_info.start +
arch_current_thread()->stack_info.size);
}
return (addr <= start) || (addr + size > end);
@ -97,7 +97,7 @@ bool z_x86_check_stack_bounds(uintptr_t addr, size_t size, uint16_t cs)
__pinned_func
bool z_x86_check_guard_page(uintptr_t addr)
{
struct k_thread *thread = _current;
struct k_thread *thread = arch_current_thread();
uintptr_t start, end;
/* Front guard size - before thread stack area */
@ -233,7 +233,7 @@ static inline uintptr_t get_cr3(const struct arch_esf *esf)
* switch when we took the exception via z_x86_trampoline_to_kernel
*/
if ((esf->cs & 0x3) != 0) {
return _current->arch.ptables;
return arch_current_thread()->arch.ptables;
}
#else
ARG_UNUSED(esf);

View file

@ -207,7 +207,7 @@ void z_float_enable(struct k_thread *thread, unsigned int options)
/* Associate the new FP context with the specified thread */
if (thread == _current) {
if (thread == arch_current_thread()) {
/*
* When enabling FP support for the current thread, just claim
* ownership of the FPU and leave CR0[TS] unset.
@ -222,7 +222,7 @@ void z_float_enable(struct k_thread *thread, unsigned int options)
* of the FPU to them (unless we need it ourselves).
*/
if ((_current->base.user_options & _FP_USER_MASK) == 0) {
if ((arch_current_thread()->base.user_options & _FP_USER_MASK) == 0) {
/*
* We are not FP-capable, so mark FPU as owned by the
* thread we've just enabled FP support for, then
@ -278,7 +278,7 @@ int z_float_disable(struct k_thread *thread)
thread->base.user_options &= ~_FP_USER_MASK;
if (thread == _current) {
if (thread == arch_current_thread()) {
z_FpAccessDisable();
_kernel.current_fp = (struct k_thread *)0;
} else {
@ -314,7 +314,7 @@ void _FpNotAvailableExcHandler(struct arch_esf *pEsf)
/* Enable highest level of FP capability configured into the kernel */
k_float_enable(_current, _FP_USER_MASK);
k_float_enable(arch_current_thread(), _FP_USER_MASK);
}
_EXCEPTION_CONNECT_NOCODE(_FpNotAvailableExcHandler,
IV_DEVICE_NOT_AVAILABLE, 0);

View file

@ -132,9 +132,9 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
/* Transition will reset stack pointer to initial, discarding
* any old context since this is a one-way operation
*/
stack_end = Z_STACK_PTR_ALIGN(_current->stack_info.start +
_current->stack_info.size -
_current->stack_info.delta);
stack_end = Z_STACK_PTR_ALIGN(arch_current_thread()->stack_info.start +
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta);
#ifdef CONFIG_X86_64
/* x86_64 SysV ABI requires 16 byte stack alignment, which
@ -156,15 +156,15 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
* Note that this also needs to page in the reserved
* portion of the stack (which is usually the page just
* before the beginning of stack in
* _current->stack_info.start.
* arch_current_thread()->stack_info.start.
*/
uintptr_t stack_start;
size_t stack_size;
uintptr_t stack_aligned_start;
size_t stack_aligned_size;
stack_start = POINTER_TO_UINT(_current->stack_obj);
stack_size = K_THREAD_STACK_LEN(_current->stack_info.size);
stack_start = POINTER_TO_UINT(arch_current_thread()->stack_obj);
stack_size = K_THREAD_STACK_LEN(arch_current_thread()->stack_info.size);
#if defined(CONFIG_X86_STACK_PROTECTION)
/* With hardware stack protection, the first page of stack
@ -182,7 +182,7 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
#endif
z_x86_userspace_enter(user_entry, p1, p2, p3, stack_end,
_current->stack_info.start);
arch_current_thread()->stack_info.start);
CODE_UNREACHABLE;
}

View file

@ -421,7 +421,7 @@ void z_x86_tlb_ipi(const void *arg)
/* We might have been moved to another memory domain, so always invoke
* z_x86_thread_page_tables_get() instead of using current CR3 value.
*/
ptables_phys = k_mem_phys_addr(z_x86_thread_page_tables_get(_current));
ptables_phys = k_mem_phys_addr(z_x86_thread_page_tables_get(arch_current_thread()));
#endif
/*
* In the future, we can consider making this smarter, such as
@ -1440,7 +1440,7 @@ static inline void bcb_fence(void)
__pinned_func
int arch_buffer_validate(const void *addr, size_t size, int write)
{
pentry_t *ptables = z_x86_thread_page_tables_get(_current);
pentry_t *ptables = z_x86_thread_page_tables_get(arch_current_thread());
uint8_t *virt;
size_t aligned_size;
int ret = 0;
@ -1958,7 +1958,7 @@ int arch_mem_domain_thread_add(struct k_thread *thread)
* IPI takes care of this if the thread is currently running on some
* other CPU.
*/
if (thread == _current && thread->arch.ptables != z_x86_cr3_get()) {
if (thread == arch_current_thread() && thread->arch.ptables != z_x86_cr3_get()) {
z_x86_cr3_set(thread->arch.ptables);
}
#endif /* CONFIG_X86_KPTI */
@ -1980,8 +1980,9 @@ void z_x86_current_stack_perms(void)
/* Clear any previous context in the stack buffer to prevent
* unintentional data leakage.
*/
(void)memset((void *)_current->stack_info.start, 0xAA,
_current->stack_info.size - _current->stack_info.delta);
(void)memset((void *)arch_current_thread()->stack_info.start, 0xAA,
arch_current_thread()->stack_info.size -
arch_current_thread()->stack_info.delta);
/* Only now is it safe to grant access to the stack buffer since any
* previous context has been erased.
@ -1991,13 +1992,13 @@ void z_x86_current_stack_perms(void)
* This will grant stack and memory domain access if it wasn't set
* already (in which case this returns very quickly).
*/
z_x86_swap_update_common_page_table(_current);
z_x86_swap_update_common_page_table(arch_current_thread());
#else
/* Memory domain access is already programmed into the page tables.
* Need to enable access to this new user thread's stack buffer in
* its domain-specific page tables.
*/
set_stack_perms(_current, z_x86_thread_page_tables_get(_current));
set_stack_perms(arch_current_thread(), z_x86_thread_page_tables_get(arch_current_thread()));
#endif
}
#endif /* CONFIG_USERSPACE */

View file

@ -14,13 +14,17 @@
#include <stddef.h> /* For size_t */
#include <zephyr/platform/hooks.h>
#ifdef __cplusplus
extern "C" {
#endif
static inline void arch_kernel_init(void)
{
/* No-op on this arch */
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
static ALWAYS_INLINE void

View file

@ -8,6 +8,8 @@
#include <zephyr/kernel_structs.h>
#include <zephyr/platform/hooks.h>
#ifndef _ASMLANGUAGE
extern void z_x86_switch(void *switch_to, void **switched_from);
@ -27,7 +29,9 @@ extern void z_x86_ipi_setup(void);
static inline void arch_kernel_init(void)
{
/* nothing */;
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
FUNC_NORETURN void z_x86_cpu_init(struct x86_cpuboot *cpuboot);

View file

@ -10,8 +10,18 @@
#include <zephyr/llext/loader.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(llext);
LOG_MODULE_DECLARE(llext, CONFIG_LLEXT_LOG_LEVEL);
/*
* ELF relocation tables on Xtensa contain relocations of different types. They
* specify how the relocation should be performed. Which relocations are used
* depends on the type of the ELF object (e.g. shared or partially linked
* object), structure of the object (single or multiple source files), compiler
* flags used (e.g. -fPIC), etc. Also not all relocation table entries should be
* acted upon. Some of them describe relocations that have already been
* resolved by the linker. We have to distinguish them from actionable
* relocations and only need to handle the latter ones.
*/
#define R_XTENSA_NONE 0
#define R_XTENSA_32 1
#define R_XTENSA_RTLD 2
@ -19,71 +29,126 @@ LOG_MODULE_DECLARE(llext);
#define R_XTENSA_JMP_SLOT 4
#define R_XTENSA_RELATIVE 5
#define R_XTENSA_PLT 6
#define R_XTENSA_ASM_EXPAND 11
#define R_XTENSA_SLOT0_OP 20
static void xtensa_elf_relocate(struct llext_loader *ldr, struct llext *ext,
const elf_rela_t *rel, uint8_t *text, uintptr_t addr,
uint8_t *loc, int type, uint32_t stb)
{
elf_word *got_entry = (elf_word *)loc;
switch (type) {
case R_XTENSA_RELATIVE:
/* Relocate a local symbol: Xtensa specific. Seems to only be used with PIC */
*got_entry += (uintptr_t)text - addr;
break;
case R_XTENSA_GLOB_DAT:
case R_XTENSA_JMP_SLOT:
if (stb == STB_GLOBAL) {
*got_entry = addr;
}
break;
case R_XTENSA_32:
/* Used for both LOCAL and GLOBAL bindings */
*got_entry += addr;
break;
case R_XTENSA_SLOT0_OP:
/* Apparently only actionable with LOCAL bindings */
;
elf_sym_t rsym;
int ret = llext_seek(ldr, ldr->sects[LLEXT_MEM_SYMTAB].sh_offset +
ELF_R_SYM(rel->r_info) * sizeof(elf_sym_t));
if (!ret) {
ret = llext_read(ldr, &rsym, sizeof(elf_sym_t));
}
if (ret) {
LOG_ERR("Failed to read a symbol table entry, LLEXT linking might fail.");
return;
}
/*
* So far in all observed use-cases
* llext_loaded_sect_ptr(ldr, ext, rsym.st_shndx) was already
* available as the "addr" argument of this function, supplied
* by arch_elf_relocate_local() from its non-STT_SECTION branch.
*/
uintptr_t link_addr = (uintptr_t)llext_loaded_sect_ptr(ldr, ext, rsym.st_shndx) +
rsym.st_value + rel->r_addend;
ssize_t value = (link_addr - (((uintptr_t)got_entry + 3) & ~3)) >> 2;
/* Check the opcode */
if ((loc[0] & 0xf) == 1 && !loc[1] && !loc[2]) {
/* L32R: low nibble is 1 */
loc[1] = value & 0xff;
loc[2] = (value >> 8) & 0xff;
} else if ((loc[0] & 0xf) == 5 && !(loc[0] & 0xc0) && !loc[1] && !loc[2]) {
/* CALLn: low nibble is 5 */
loc[0] = (loc[0] & 0x3f) | ((value << 6) & 0xc0);
loc[1] = (value >> 2) & 0xff;
loc[2] = (value >> 10) & 0xff;
} else {
LOG_DBG("%p: unhandled OPC or no relocation %02x%02x%02x inf %#x offs %#x",
(void *)loc, loc[2], loc[1], loc[0],
rel->r_info, rel->r_offset);
break;
}
break;
case R_XTENSA_ASM_EXPAND:
/* Nothing to do */
break;
default:
LOG_DBG("Unsupported relocation type %u", type);
return;
}
LOG_DBG("Applied relocation to %#x type %u at %p",
*(uint32_t *)((uintptr_t)got_entry & ~3), type, (void *)got_entry);
}
/**
* @brief Architecture specific function for relocating shared elf
*
* Elf files contain a series of relocations described in multiple sections.
* These relocation instructions are architecture specific and each architecture
* supporting modules must implement this.
* @brief Architecture specific function for STB_LOCAL ELF relocations
*/
void arch_elf_relocate_local(struct llext_loader *ldr, struct llext *ext,
const elf_rela_t *rel, const elf_sym_t *sym, size_t got_offset)
void arch_elf_relocate_local(struct llext_loader *ldr, struct llext *ext, const elf_rela_t *rel,
const elf_sym_t *sym, size_t got_offset,
const struct llext_load_param *ldr_parm)
{
uint8_t *text = ext->mem[LLEXT_MEM_TEXT];
uint8_t *loc = text + got_offset;
int type = ELF32_R_TYPE(rel->r_info);
elf_word *got_entry = (elf_word *)(text + got_offset);
uintptr_t sh_addr;
if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) {
elf_shdr_t *shdr = llext_peek(ldr, ldr->hdr.e_shoff +
sym->st_shndx * ldr->hdr.e_shentsize);
sh_addr = shdr->sh_addr ? : (uintptr_t)llext_peek(ldr, shdr->sh_offset);
sh_addr = shdr->sh_addr &&
(!ldr_parm->section_detached || !ldr_parm->section_detached(shdr)) ?
shdr->sh_addr : (uintptr_t)llext_peek(ldr, shdr->sh_offset);
} else {
sh_addr = ldr->sects[LLEXT_MEM_TEXT].sh_addr;
}
switch (type) {
case R_XTENSA_RELATIVE:
/* Relocate a local symbol: Xtensa specific */
*got_entry += (uintptr_t)text - sh_addr;
break;
case R_XTENSA_32:
*got_entry += sh_addr;
break;
case R_XTENSA_SLOT0_OP:
;
uint8_t *opc = (uint8_t *)got_entry;
xtensa_elf_relocate(ldr, ext, rel, text, sh_addr, loc, type, ELF_ST_BIND(sym->st_info));
}
/* Check the opcode: is this an L32R? And does it have to be relocated? */
if ((opc[0] & 0xf) != 1 || opc[1] || opc[2])
break;
/**
* @brief Architecture specific function for STB_GLOBAL ELF relocations
*/
void arch_elf_relocate_global(struct llext_loader *ldr, struct llext *ext, const elf_rela_t *rel,
const elf_sym_t *sym, size_t got_offset, const void *link_addr)
{
uint8_t *text = ext->mem[LLEXT_MEM_TEXT];
elf_word *got_entry = (elf_word *)(text + got_offset);
int type = ELF32_R_TYPE(rel->r_info);
elf_sym_t rsym;
int ret = llext_seek(ldr, ldr->sects[LLEXT_MEM_SYMTAB].sh_offset +
ELF_R_SYM(rel->r_info) * sizeof(elf_sym_t));
if (!ret) {
ret = llext_read(ldr, &rsym, sizeof(elf_sym_t));
}
if (ret)
return;
uintptr_t link_addr = (uintptr_t)llext_loaded_sect_ptr(ldr, ext, rsym.st_shndx) +
rsym.st_value + rel->r_addend;
ssize_t value = (link_addr - (((uintptr_t)got_entry + 3) & ~3)) >> 2;
opc[1] = value & 0xff;
opc[2] = (value >> 8) & 0xff;
break;
default:
LOG_DBG("unsupported relocation type %u", type);
return;
/* For global relocations we expect the initial value for R_XTENSA_RELATIVE to be zero */
if (type == R_XTENSA_RELATIVE && *got_entry) {
LOG_WRN("global: non-zero relative value %#x", *got_entry);
}
LOG_DBG("relocation to %#x type %u at %p", *got_entry, type, (void *)got_entry);
xtensa_elf_relocate(ldr, ext, rel, text, (uintptr_t)link_addr, (uint8_t *)got_entry, type,
ELF_ST_BIND(sym->st_info));
}

View file

@ -140,7 +140,7 @@ FUNC_NORETURN void arch_syscall_oops(void *ssf)
#ifdef CONFIG_USERSPACE
void z_impl_xtensa_user_fault(unsigned int reason)
{
if ((_current->base.user_options & K_USER) != 0) {
if ((arch_current_thread()->base.user_options & K_USER) != 0) {
if ((reason != K_ERR_KERNEL_OOPS) &&
(reason != K_ERR_STACK_CHK_FAIL)) {
reason = K_ERR_KERNEL_OOPS;

View file

@ -1086,7 +1086,7 @@ static int mem_buffer_validate(const void *addr, size_t size, int write, int rin
int ret = 0;
uint8_t *virt;
size_t aligned_size;
const struct k_thread *thread = _current;
const struct k_thread *thread = arch_current_thread();
uint32_t *ptables = thread_page_tables_get(thread);
/* addr/size arbitrary, fix this up into an aligned region */

View file

@ -156,7 +156,7 @@ int arch_float_enable(struct k_thread *thread, unsigned int options)
FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3)
{
struct k_thread *current = _current;
struct k_thread *current = arch_current_thread();
size_t stack_end;
/* Transition will reset stack pointer to initial, discarding

View file

@ -34,7 +34,7 @@ extern char xtensa_arch_kernel_oops_epc[];
bool xtensa_is_outside_stack_bounds(uintptr_t addr, size_t sz, uint32_t ps)
{
uintptr_t start, end;
struct k_thread *thread = _current;
struct k_thread *thread = arch_current_thread();
bool was_in_isr, invalid;
/* Without userspace, there is no privileged stack so the thread stack

View file

@ -14,6 +14,7 @@
#include <kernel_internal.h>
#include <string.h>
#include <zephyr/cache.h>
#include <zephyr/platform/hooks.h>
#include <zephyr/zsr.h>
#ifdef __cplusplus
@ -25,7 +26,9 @@ K_KERNEL_STACK_ARRAY_DECLARE(z_interrupt_stacks, CONFIG_MP_MAX_NUM_CPUS,
static ALWAYS_INLINE void arch_kernel_init(void)
{
#ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
soc_per_core_init_hook();
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
}
void xtensa_switch(void *switch_to, void **switched_from);

View file

@ -9,6 +9,7 @@
#include <espressif/esp32c3/esp32c3_fx4.dtsi>
#include "esp32c3_042_oled-pinctrl.dtsi"
#include <espressif/partitions_0x0_default.dtsi>
/ {
model = "01space ESP32C3 0.42 OLED";
@ -104,37 +105,3 @@
&esp32_bt_hci {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000F000>;
read-only;
};
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};
storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

View file

@ -14,7 +14,6 @@ testing:
- cmsis_rtos_v2
- net
- mpu
- tinycrypt
- crypto
- aes
- cmm

View file

@ -12,7 +12,4 @@ CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# pinctrl
CONFIG_PINCTRL=y
CONFIG_XIP=y

View file

@ -46,3 +46,7 @@
status = "okay";
current-speed = <115200>;
};
&cpu {
compatible = "intel,x86_64";
};

View file

@ -0,0 +1,5 @@
# Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ADAFRUIT_FEATHER_M4_EXPRESS
select SOC_SAMD51J19A

View file

@ -0,0 +1,51 @@
/*
* Copyright (c) 2022, Gerson Fernando Budke <nandojve@gmail.com>
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <dt-bindings/pinctrl/samd51j-pinctrl.h>
&pinctrl {
sercom1_spi_default: sercom1_spi_default {
group1 {
pinmux = <PB23C_SERCOM1_PAD3>,
<PA17C_SERCOM1_PAD1>,
<PB22C_SERCOM1_PAD2>;
};
};
sercom2_i2c_default: sercom3_i2c_default {
group1 {
pinmux = <PA12C_SERCOM2_PAD0>,
<PA13C_SERCOM2_PAD1>;
};
};
sercom5_uart_default: sercom5_uart_default {
group1 {
pinmux = <PB17C_SERCOM5_PAD1>,
<PB16C_SERCOM5_PAD0>;
};
};
pwm0_default: pwm0_default {
group1 {
pinmux = <PA22G_TCC0_WO2>;
};
};
pwm1_default: pwm1_default {
group1 {
pinmux = <PA18F_TCC1_WO2>,
<PA19F_TCC1_WO3>;
};
};
usb_dc_default: usb_dc_default {
group1 {
pinmux = <PA25H_USB_DP>,
<PA24H_USB_DM>;
};
};
};

View file

@ -0,0 +1,111 @@
/*
* Copyright (c) 2020 Google LLC.
* Copyright (c) 2024 Daikin Comfort Technologies North America, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <atmel/samd5xx19.dtsi>
#include "adafruit_feather_m4_express-pinctrl.dtsi"
/ {
model = "Adafruit Feather M4 Express";
compatible = "adafruit,feather-m4-express";
chosen {
zephyr,console = &sercom5;
zephyr,shell-uart = &sercom5;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
pwm-0 = &tcc0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&porta 23 0>;
label = "LED";
};
};
};
&cpu0 {
clock-frequency = <120000000>;
};
&sercom5 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <1>;
txpo = <0>;
pinctrl-0 = <&sercom5_uart_default>;
pinctrl-names = "default";
};
&sercom1 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom1_spi_default>;
pinctrl-names = "default";
};
&tcc0 {
status = "okay";
compatible = "atmel,sam0-tcc-pwm";
prescaler = <8>;
#pwm-cells = <2>;
pinctrl-0 = <&pwm0_default>;
pinctrl-names = "default";
};
zephyr_udc0: &usb0 {
status = "okay";
pinctrl-0 = <&usb_dc_default>;
pinctrl-names = "default";
};
&dmac {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "uf2";
reg = <0x00000000 DT_SIZE_K(16)>;
read-only;
};
code_partition: partition@4000 {
label = "code";
reg = <0x4000 DT_SIZE_K(512-16-16)>;
read-only;
};
/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@7c000 {
label = "storage";
reg = <0x7c000 DT_SIZE_K(16)>;
};
};
};

Some files were not shown because too many files have changed in this diff Show more