Commit graph

126,787 commits

Author SHA1 Message Date
Ederson de Souza
246cd228f2 arch/x86: Support shadow stack on IRQ
For IRQs, shadow stack support a mechanism similar to the Interrupt
Stack Table (IST) for x86_64: a table, indexed by the IST index, pointing
to a 64 byte table in memory containing the address of seven shadow stacks
to be used by the interrupt service routines.

This patch adds support to this mechanism. It is worth noting that, as
Zephyr may exit from an interrupt by going to a different thread than
the one that was interrupted, some housekeeping is done to ensure that
the necessary shadow stack tokens are on the right shadow stack before
return from the interrupt.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Ederson de Souza
436078968a arch/x86: Shadow Stack support
Shadow Stack is one of the capabilities provided by Intel Control-flow
Enforcement Technology (CET), aimed at defending against Return Oriented
Programming.

This patch enables it for x86_64 (32-bit support coming in future
patches):

    - Add relevant Kconfigs;
    - Shadow stacks should live in specially defined memory pages, so
      gen_mmu.py was updated to allow that;
    - A new macro, Z_X86_SHADOW_STACK_DEFINE, added to define the area
      for a shadow stack;
    - A new function, z_x86_thread_attach_shadow_stack(), added to
      attach a shadow stack to a never started thread;
    - locore.S changed to enable/disable shadow stack when a thread
      using it comes in/out of execution.

As not all threads are currently shadow stack capable, threads that do
not use it will still run with shadow stack disabled. Ideally, at some
point in the future, all threads would use the shadow stack, so no need
to disable it at all.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Ederson de Souza
49cb4ddbe2 arch/x86: Extend IBT support to x86_64
Add code to enable it and sprinkle `endbr64` on asm code, where needed.
Namely, IRQs and excepts entrypoints.

Finally, tests added to ensure IBT behaves sanely.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Ederson de Souza
1c7dc6930a arch/x86: Indirect Branch Tracking support
Indirect Branch Tracking (IBT) is one of the capabilities provided by
Intel Control-flow Enforcement Technology (CET), aimed at defending
against Jump/Call Oriented Programming.

This patch enables it for x86 (32-bit, 64-bit support coming in future
patches):

    - Add relevant Kconfigs (everything is behind X86_CET);
    - Code to enable it;
    - Enable compiler flags to enable it;
    - Add `endbr32` instructions to asm code, where needed.

Points in the code where an indirect branch is expected to land need
special instructions that tell the CPU they are valid indirect branch
targets. Those are added by the compiler, so toolchain support is
necessary. Note that any code added to the final ELF also need those
markers, such as libc or libgcc.

Finally, tests added to ensure IBT behaves sanely.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Daniel Leung
d36813a27c x86: add exception handling for control protection exception
This adds exception handling of control protection exception
in fatal code.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Pieter De Gendt
294f7e52c5 linker: Split nocache memory sections into loadable and non-loadable
Commit f9168ae464 made all non-cached memory
loadable by default.

However as nocache memory is typically used for reserving larger buffers to
be shared between peripherals, this comes at fairly large cost towards ROM
usage.

This commit creates two distinct sections for both loadable and
non-loadable nocache memory sections.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-09-01 23:28:28 +02:00
Manikanta Guntupalli
156e6488db drivers: i3c: Correct initialization order
The current initialization sequence enables the I3C controller before
setting the controller information, which can result in improper setup
and cause the controller to not function as expected.

Fix the initialization order by ensuring that the controller information
is set prior to enabling the controller.

Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Signed-off-by: Balanakakamal V <balanakakamal.v@amd.com>
2025-09-01 23:28:09 +02:00
Iliar Rabet
9ac88999eb util: tests function utf8_count_chars
adds 3 test cases for function utf8_count_chars

Signed-off-by: Iliar Rabet <iliar.rabet@gmail.com>
2025-09-01 23:27:44 +02:00
Iliar Rabet
4a4a46c26f util: adds the utf8_count_chars function
The function utf8_count_chars counts the number of UTF-encoded characters

Signed-off-by: Iliar Rabet <iliar.rabet@gmail.com>
2025-09-01 23:27:44 +02:00
Pieter De Gendt
8993a5ed10 drivers: flash: shell: Fix printing partitions without labels
Commit df0f74d491c851b3e7e970f898c5c2fc3aab5b80 added a shell command to be
able to print out the partitions. However the label property is optional.

Print both the name and label if available.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-09-01 23:27:28 +02:00
Chun-Chieh Li
cfa837c6dd drivers: usb: udc: refine log message in udc_common.c
This refines log message in udc_common.c, including:
1. Add address of allocated net_buf info into udc_ep_buf_alloc log so
   that net_buf create/destroy can be easily monitored with calls to
   udc_ep_buf_alloc and udc_buf_destroy.
2. Add ep info into udc_ep_buf_alloc log on failure.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-09-01 23:27:19 +02:00
Erwan Gouriou
f0a585645d dts: arm: st: n6: Disable axisram3
Those memories should be disabled by default and enabled
at application level.

Incidentally, fix the way Kconfig symbol is enabled as
we should not parse status of ramcfg, but status of enabled
memory nodes.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-01 23:27:13 +02:00
Erwan Gouriou
7db506b8d0 dts: arm: st: n6: Add npu node and dts binding
Provide binding for `st,stm32-npu` compatible and node in SoC dtsi.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-01 23:27:13 +02:00
Erwan Gouriou
196f725fd2 soc: stm32n6: Add NPU driver
Provide Neural-ART driver for STM32N6.
This driver handles unit initialization (clock, rif).

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-01 23:27:13 +02:00
Gerson Fernando Budke
6bdd63fe93 drivers: serial: sam0: Fix rx ready
The uart_sam0_irg_rx_ready() function always returns true, even if
interrupt is disabled. This happens because the function do not
evaluate if the interrupt is enable of not. This fixes the issue
by adding the missing check.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-09-01 16:56:36 +01:00
Sebastian Bøe
aa2a439299 west: runners: nrf_common: Delete deprecated suit handling
Delete deprecated suit handling.

SUIT is no longer supported.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2025-09-01 16:56:02 +01:00
Iuliana Prodan
cd31d1da72 MAINTAINERS: Remove carlocaione from Open AMP maintainers
Remove carlocaione from the OpenAMP maintainers list
because he hasn't been active for a while.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2025-09-01 16:55:53 +01:00
Aksel Skauge Mellbye
9a8b6d9a38 include: zephyr: drivers: gpio: Make enum gpio_int_trig complete
The gpio_int_trig enum did not enumerate all possible combinations
of flags after the addition of the GPIO_INT_WAKEUP flag.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-09-01 16:41:10 +02:00
Aksel Skauge Mellbye
c29aa88f9e include: zephyr: drivers: gpio: Propagate GPIO_INT_WAKEUP flag
The GPIO_INT_WAKEUP flag is available in the binding header,
but was not propagated from dt_flags in the interrupt_configure_dt
function. Allow GPIOs to be declared as wakeup sources in dts
by propagating the flag.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-09-01 16:41:10 +02:00
Aksel Skauge Mellbye
a8cd0a3637 include: zephyr: dt-bindings: gpio: Fix flags mask
Since 45a3d31, the GPIO_INT_WAKEUP flag has been available in
the binding header. Update the mask to include it.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-09-01 16:41:10 +02:00
Emil Gydesen
90e5b7d658 Bluetooth: Shell: Only add broadcast audio val one place
Instead of add BT_UUID_BROADCAST_AUDIO_VAL for either BAP or
CAP, we now only do it one place (in BAP). This can now be done
since the default_source.broadcast_id was recently added.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-01 16:41:05 +02:00
Emil Gydesen
6fe1474225 Bluetooth: Audio: Shell: Store broadcast_id statically
Add a broadcast_id field in broadcast_source so that it can be
lookup later, which is useful for doing broadcast assitant
procedures on a local broadcast source.

The broadcast ID is now created at the same time as the
broadcast source(s), instead at the time of retriving
the advertising data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-01 16:41:05 +02:00
Dmitrii Sharshakov
8433c491b2 build: uf2: set offset when building RAM images
Follow ROMABLE_REGION from include/.../arm/cortex_m/scripts/linker.ld

This enables UF2 images to be created for RAM-only apps on RP2350.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-09-01 16:40:54 +02:00
Muzaffar Ahmed
c3595fdebe west.yml: Update hal_silabs revision
This commit updates the hal_silabs revision in west.yml

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-09-01 16:40:40 +02:00
Muzaffar Ahmed
42c065f9cc drivers: wifi: siwx91x: Add support for RTS Threshold
Implemented siwx91x_set_rts_threshold and siwx91x_get_rts_threshold

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-09-01 16:40:40 +02:00
Emil Gydesen
933816c887 tests: Bluetooth: Tester: CCP BSIM test
Adds BSIM testing of the CCP features of the BT Tester.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-01 16:39:46 +02:00
Immo Birnbaum
41716ff905 soc: renode: cortex_r8_virtual: overhaul MPU regions
Apply the same modifications made to the ZynqMP's memory
regions to the cortex_r8_virtual SoC which was mainlined
while the fixes for the ZynqMP were being developed
(minus the OCM mapping, as there's no indication that this
type of memory was considered).

The cortex_r8_virtual appears to be a stripped down copy
of the old qemu_cortex_r5 codebase, therefore, the duplicated
MPU regions have the same flaws as qemu_cortex_r5 or any
actual ZynqMP-based target for that matter.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
7f6ee56910 soc: xlnx: zynqmp: overhaul MPU regions
Overhaul the MPU region definitions that are being
configured when the MPU is set up:
- drop local attribute definitions in favor of those
  already provided in arm_mpu_v7m.h
- actually tie the RAM region to the device tree
- set up a (potentially overlapping) R/O region for
  .text and .rodata, which hasn't existed so far
- Consider XIP

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
8e977215d3 arch: arm: cortex_a_r: update ROM region size calculation
update the directive that calculates the ROM region size
bit mask for the MPU setup.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
eff4ed0488 dts: arm: xilinx: zynqmp: remove sram0 declaration at SoC level
Remove the universal, unconditional declaration of the RAM area
at the SoC level, due to:

- the hardcoded base address 0 overlapping the exception vectors,
  the ATCM and the BTCM areas.
- the availability of the BTCM not being guaranteed unconditionally
  (config pin dependant)
- the possibility of having a 'black hole' between the ATCM and
  the BTCM depending on the operating mode of the R-cores cluster,
  which leads to a part of the text section being unavailable
- qemu not properly implementing the configuration-dependant
  behaviour of the ATCM and BTCM areas.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
099f0e2511 boards: qemu: cortex_r5: declare 64MB sram0 area at board level
Declare the sram0 area for this board to start at 0x4000000
and to be 64MB in size. The base address is the lowest possible
multiple of 64MB which doesn't have its base address at 0,
therefore preventing the mixed use of regular RAM and the
ATCM/BTCM and the possible issues of having a 'black hole'
between the ATCM and BTCM areas or the BTCM being completely
disabled.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
6ad1347a4e boards: qemu: cortex_r5: expand usable RAM area below 4G boundary
Expand the RAM area beginning behind the BTCM to allow the use
of a 64MB SRAM area starting at 0x4000000, which is the lowest
possible 64MB area with a non-zero start address that doesn't
overlap with the ATCM and BTCM memory areas.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
1e903675d9 boards: enclustra: mercury_xu: move unmodified sram0 from SoC to board DT
Move the unmodified sram0 memory area declaration to this board's
device tree due to its removal from the SoC device tree.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Immo Birnbaum
30abc773fe boards: amd: kv260_r5: move unmodified sram0 from SoC to board DT
Move the unmodified sram0 memory area declaration to this board's
device tree due to its removal from the SoC device tree.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-01 16:39:37 +02:00
Benjamin Cabé
6e1ff6a211 ci: workflows: doc: upload Doxygen coverage report to codecov.io
Upload Doxygen coverage report to codecov.io in cron-scheduled doc build

Fixes zephyrproject-rtos/zephyr#94708

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-01 09:18:46 -04:00
Ilya Tagunov
09a034e8ce toolchain: arcmwdt: override unsuitable default implementations
Provide toolchain-specific implementations for the new functions
added in d77b58a, because the default ones end up with build failures.

As the MWDT toolchain doesn't support different combinations of
compilers and linkers, there's no need to pass any linker properties
from the compiler, at least for the time being. Moreover, the default
implementation of compiler_set_linker_properties() uses the compiler
flag (--print-libgcc-file-name) that doesn't make any sense for MWDT.
Therefore, provide an empty implementation of the function.

The default implementation of toolchain_linker_add_compiler_options()
doesn't cause any issues for now, but it's still better to replace
it with the passthrough implementation borrowed from ld/lld.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2025-09-01 14:01:46 +02:00
Shontal Biton
0ddd78528c tests: eeprom: Added support for xg28
Added support for xg28 in eeprom test.

Signed-off-by: Shontal Biton <shontal1005@gmail.com>
2025-09-01 14:01:41 +02:00
Shontal Biton
c7a6482d9c boards: silabs: Add support for Silabs EFR32ZG28 BRD4401C board
Add support for Silicon Labs BRD4401C (a.k.a xG28-RB4401C) Radio Board.

Signed-off-by: Shontal Biton <shontal1005@gmail.com>
2025-09-01 14:01:41 +02:00
Shontal Biton
799a3f9a4f soc: silabs: Add support for Silabs EFR32ZG28 SoC
Add support for Silicon Labs EFR32ZG28 SoC.

Signed-off-by: Shontal Biton <shontal1005@gmail.com>
2025-09-01 14:01:41 +02:00
Pavel Vasilyev
fe5b266ddb bluetooth: mesh: pb_adv: check TotalLength against adv buf length
Check that the buffer length of the received advertising data is less
than reported TotalLength in Transaction Start PDU.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-09-01 07:44:57 -04:00
Jun Lin
0d68cc39ac dts: npcx: re-arrange the default interrupt priority
Because the EC host command with SHI/SPI backend is timing sensitive, it
required the CPU to response the SHI interrrupt as soon as possible.
This commit re-arranges the default interrupt priority by:
1. keep the SHI's interrupt priority to 1.
2. Decrease the priority of the other peripherals by 1.
   (i.e. increase the priority `value` by 1)

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2025-09-01 07:44:23 -04:00
Abderrahmane JARMOUNI
86ad7b3481 boards: fanke: fk723m1_zgt6: fix Kconfig warning
Move Kconfig symbol setting to 'Kconfig.defconfig' file to fix
compliance check "defined without a type" warning.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-09-01 12:01:09 +02:00
Fin Maaß
d5c29cc1e2 dfu: mcuboot: return flash area id without intermediate var
return flash area id directly without intermediate var.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-01 12:01:01 +02:00
Muhammad Waleed Badar
7dbd60016c tests: ram_context_for_isr: Use Kconfig for IRQ config
Replace hardcoded platform-specific IRQ definitions with
Kconfig symbols TEST_IRQ_NUM and TEST_IRQ_PRIO.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2025-09-01 12:00:51 +02:00
Torsten Rasmussen
795445535d scripts: parse module.yml for dts bindings
Change BoardYml compliance check from using get_module_setting_root()
to load and parse module.yml directly.

get_module_setting_root cannot be used directly with module.yml.
Instead adjust the code so that the module.yml file is loaded locally
and the dts_root setting is extracted from the dictionary.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-09-01 12:00:42 +02:00
Jamie McCrae
c5ac112506 doc: extensions: kconfig: Add support for sysbuild
Adds support for outputting details on sysbuild Kconfigs for use
with the documentation Kconfig lookup tool

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-01 12:00:33 +02:00
Aksel Skauge Mellbye
c31b9e971e tests: drivers: Add overlays for bg29_rb4420a
Add support for bg29_rb4420a in driver tests.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-09-01 09:32:24 +02:00
Aksel Skauge Mellbye
f2d1da6001 boards: silabs: bg29_rb4420a: Add BG29 WLCSP board
Add EFR32BG29 board with boost DCDC converter and WLCSP package.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-09-01 09:32:24 +02:00
Emil Dahl Juhl
fddd6efb82 dts: arm: st: n6: correct sai1_a address
When compiling, the following warning occurs:

Warning (simple_bus_reg): /soc/sai1@452005804: simple-bus unit address
format error, expected "52005804"

Looking at table 3 in the reference manual[1] for the stm32n6 it seems that
the sai1_a address simply had a typo, where a "4" was added in front of the
correct address.

Fix the typo.

[1] RM0486 Rev 2: https://www.st.com/resource/en/reference_manual/rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics.pdf

Signed-off-by: Emil Dahl Juhl <emil@s16s.ai>
2025-09-01 09:32:16 +02:00
Marek Matej
8752465f41 drivers: flash: shell: add partition listing
Add command `flash partitions` to list all existing partitions.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-09-01 09:32:06 +02:00