Commit graph

15409 commits

Author SHA1 Message Date
Carles Cufi
03f46db859 include: sys_clock: Fix compilation when SYS_CLOCK_EXISTS is disabled
If `CONFIG_SYS_CLOCK_EXISTS=n`, then
`CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC` will likely not be defined at all.
Fix the compilation by moving the check for it being `== 0` to a
separate preprocessor #if statement.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-06-06 08:45:57 +02:00
Luca Arato
ab0218ed7e sys: Remove static modifier
Remove static struct modifier from SPSC_DECLARE macro.
This solves a warning emitted when compiling for native_sim.

Signed-off-by: Luca Arato <luca.arato@secomind.com>
2025-06-06 08:43:03 +02:00
Bjarki Arge Andreasen
8f9eae25c9 kernel: workq: introduce work timeout:
Introduce work timeout, which is an optional workqueue configuration
which enables monitoring for work items which take longer than
expected. This could be due to long running or deadlocked handlers.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-06 08:42:53 +02:00
Fin Maaß
75ab4d5507 devicetree: add DT_ALL_INST_HAS_PROP_STATUS_OKAY() macro
add DT_ALL_INST_HAS_PROP_STATUS_OKAY() macro.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-06 08:42:41 +02:00
Fin Maaß
35a8e37ac2 devicetree: add DT_ALL_INST_HAS_BOOL_STATUS_OKAY() macro
add DT_ALL_INST_HAS_BOOL_STATUS_OKAY() macro.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-06 08:42:41 +02:00
Fin Maaß
ca6645d508 devicetree: shorten DT_ANY_INST_HAS_*_STATUS_OKAY
shorten DT_ANY_INST_HAS_*_STATUS_OKAY macros

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-06 08:42:41 +02:00
Anas Nashif
6559c7f554 sys: slist/sflist: remove stray FIXME
The FIXME asking a question that is not valid anymore, remove the FIXME.

Fixes #90764

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-05 09:34:55 +02:00
Bjarki Arge Andreasen
b642925491 pm: policy: fix mocks of CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
The APIs pm_policy_device_power_lock_get and
pm_policy_device_power_lock_put are not mocked properly as they
should be excluded based on CONFIG_PM_POLICY_DEVICE_CONSTRAINTS,
not CONFIG_PM.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-05 09:34:31 +02:00
Jiafei Pan
b0ba009d4d dts: add i.MX 943 Cortex-A Core dts
Added i.MX 943 Cortex-A Core dts file and clock binding header file.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-06-04 15:51:36 -04:00
Alex Ivanov
5a9394a1e0 llext: add dynamic heap allocation support
Some applications require loading extensions into the memory which does
not exist during the boot time and cannot be allocated statically. Make
the application responsible for LLEXT heap allocation. Do not allocate
LLEXT heap statically.

Signed-off-by: Alex Ivanov <alexivanov@google.com>
2025-06-04 15:50:57 -04:00
Peter Mitsis
e3aa34972e doc: arch: Update file summary for kernel interfaces
Updates the file summary on the various arch-specific kernel
interfaces to accomplish two things:
  1. Fix the path in the comment
  2. Standardize on language/format.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-06-04 15:50:02 -04:00
Bjarki Arge Andreasen
6aeca71a4d drivers: clock_control: nrf_clock_control: introduce startup time
Introduce get_startup_time API which allows users to request
clocks specs to be met in time for an event.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-04 17:00:40 +02:00
Bjarki Arge Andreasen
b1a5588c79 drivers: clock_control: nrf_clock_control: introduce resolve API
Introduce API which allows users to determine what the actual
minimum spec will be resulting from a requested minimum spec. This
is useful for optimizing code as the requested minimum may be
way worse than what will actually be applied.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-04 17:00:40 +02:00
Tien Nguyen
9a03938015 drivers: pinctrl: Add support for Renesas RZ/V2H
Add support for Renesas RZ/V2H

Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
2025-06-04 17:00:01 +02:00
Jiafei Pan
abcdb18568 arch: arm64: cache: optionally enable APIs for operation all dcache
Added new configuration item to optionally enable APIs for operation
all data cache, by default these APIs are disabled.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-06-04 16:59:43 +02:00
Jiafei Pan
6aba505eaf Revert "arch: arm64: cache: delete arm64_dcache_all"
In order to clean and invalidate all D-Cache, so reverts commit:
867ba172b4.

Although no software broadcast between different CPU Cores for  D-Cache
maintaining operation, but the hardware bus system should make sure it
is safety for all CPU Cores, because it is common for other SMP OS.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-06-04 16:59:43 +02:00
Johan Lafon
cf569036d1 driver: adc: add MCP3561/2/4R driver
Add driver for the microchip MCP3561/2/4R ADC. Registers lock and
CRCCFG protection mecanism is not implemented. Tested on an MCP3564R.

Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
2025-06-04 16:58:52 +02:00
Derek Snell
6db433bada dt-bindings: adc: mcux-lpadc: add more channel options
Expands the list of macros for more ADC channels needed on MCXN947.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2025-06-04 08:46:25 +02:00
Luis Ubieda
b402a47604 gnss: u_blox_f9p: Introduce High-precision GNSS module
Basic support: initialization for sending/handling UBX messages and
run-time navigation configurability through GNSS API.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-06-04 08:44:59 +02:00
Tom Hughes
2c851d998c sw_isr_table: Add braces around subobject
When building with clang, it warns:

subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_shi_npcx.c:1000:2:
error: suggest braces around initialization of subobject
[-Werror,-Wmissing-braces]

IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), shi_npcx_isr,
            DEVICE_DT_INST_GET(0), 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/irq.h:49:2: note: expanded from macro 'IRQ_CONNECT'
ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/arch/arm/irq.h:124:2: note: expanded from macro
'ARCH_IRQ_CONNECT'
Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/sw_isr_table.h:227:2: note: expanded from macro
'Z_ISR_DECLARE'
Z_ISR_DECLARE_C(irq, flags, func, param, __COUNTER__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0
to see all)
include/zephyr/sw_isr_table.h:218:16: note: expanded from macro
'_Z_ISR_DECLARE_C'
{irq, flags, _MK_ISR_ELEMENT_SECTION(counter)}
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/sw_isr_table.h:197:42: note: expanded from macro
'_MK_ISR_ELEMENT_SECTION'
#define _MK_ISR_ELEMENT_SECTION(counter) _MK_ISR_SECTION_NAME(irq,
                                         __FILE__, counter)
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/sw_isr_table.h:195:2: note: expanded from macro
'_MK_ISR_SECTION_NAME'
"." Z_STRINGIFY(prefix) "." file "." Z_STRINGIFY(counter)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-06-03 20:33:33 +02:00
Stephan Gatzka
c4c1d92cee drivers: gpio: Use BIT(n) macro to define GPIO constants
This change would also solve that according to the C11 standard,
section 6.5, paragraph 4, the usage of bitwise operators on
signed integers is implementation defined.

Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
2025-06-03 20:32:33 +02:00
Tomasz Bursztyka
c14ee16463 device: Provide de-init device function only if requested
This feature, fixing a specific corner case, is unilateraly growing
all struct device with a pointer that 99% of the time is not used.
Thus uselessly utilizing ROM.

Making the feature Kconfig controlled.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-06-03 17:08:50 +02:00
Johann Fischer
703e2c5d9d usb: device_next: do not list high-speed functions if not used
Do not add functions to the high-speed iterable section when high-speed
support is disabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-06-03 14:48:29 +01:00
Johann Fischer
fe3c001eeb usb: device_next: disable high-speed USB device descriptor if not used
Disable the high-speed USB device descriptor if it is not in use.
Add checks to the code where the high-speed descriptor may be used.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-06-03 14:48:29 +01:00
Johann Fischer
6ea06038d9 usb: device_next: allow message callback to be executed from USBD thread
Allowing message callback execution from the USBD thread saves about 800
bytes. For small devices, the option can be useful to reduce flash/RAM
usage, those with enough resources should not bother about it.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-06-03 14:48:29 +01:00
Johann Fischer
187703c777 usb: device_next: allow vendor request support to be disabled
Disabling it if not needed can save about 100 bytes of flash memory.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-06-03 14:48:29 +01:00
Johann Fischer
ed4c27bd41 usb: device_next: allow BOS support to be disabled
Disabling it if not needed can save about 400 bytes of flash memory.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-06-03 14:48:29 +01:00
Rubin Gerritsen
b8bff65fcb include: common: sys_bitops: Specify sign when bitshifting
When left-shifting '1' by 31, the result is undefined. This is
something ASAN detects.

Solve this by explicitly defining that the integer is unsigned.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2025-06-02 20:22:20 +02:00
Jakub Michalski
43b3781f93 docs: virtio: add virtio docs
This commit adds virtio section in documentation, describing
virtio-related concepts

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2025-06-02 17:37:07 +02:00
Jakub Michalski
c7107fc4d6 virtio: add API for VIRTIO devices and add VIRTIO PCI driver
This commit adds the API for accessing VIRTIO devices, and adds a driver
for a VIRTIO PCIE device based on the newly added API.

This commit is based on the Virtual I/O Device (VIRTIO) Version 1.3
specification:
https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.pdf

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2025-06-02 17:37:07 +02:00
Adam Kondraciuk
f691d8e020 drivers: pinctrl: nrf: Add support for TDM peripheral
Add support for configuring pins of the nRF TDM peripheral.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2025-06-02 13:29:10 +02:00
Alain Volmat
b0432a8f48 video: add LINK_FREQ ctrl and a helper to retrieve it
Add a ctrl VIDEO_CID_LINK_FREQ to indicate to a sink
the frequency at which a device streams data over
CSI2. Since not all source device currently provide the
LINK_FREQ control, add a helper function to retrieve
it, with a fall-back by doing an approximate via the
PIXEL_RATE control.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-06-02 05:48:03 +02:00
Alain Volmat
b5d8aee7d7 video: common: addition of INTEGER_MENU control type
Add a new INTEGER_MENU type allowing to store signed 64bits
integer into a menu.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-06-02 05:48:03 +02:00
Alain Volmat
a459f1dbe8 video: addition of CSI2 standard data-type defines
Add standard data-type macros within the video.h in order
to avoid having to redefine them all in each and every CSI
based driver.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-06-02 05:48:03 +02:00
Mathieu Choplain
c8c0c294b1 arch: arm: cortex_a_r: use correct name for TLB Conflict Abort
Commit 87719828ac introduced FSR definitions
for ARMv7-A/R; however, the value 16 which is documented in the ARM[1] as
a "TLB Conflict Abort", was introduced as "TLB Conflict Fault" instead and
described as a "Table Conflict Fault".

Update all affected files to use the ARM's naming for this error instead.

[1] Architecture Reference Manual (Document ID: ARM DDI 0406C.d)
    "ARM Architecture Reference Manual for ARMv7-A and ARMv7-R Edition"

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2025-05-31 07:01:36 -04:00
Tom Hughes
db726c40a9 sw_isr_table: Add spaces to fix compiler warning
When using clang to build a C++ file that includes this file, it warns:

include/zephyr/sw_isr_table.h:195:28: error: invalid suffix on literal;
C++11 requires a space between literal and identifier
[-Wreserved-user-defined-literal]
         "." Z_STRINGIFY(prefix)"."file"." Z_STRINGIFY(counter)

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-05-31 05:56:28 -04:00
Luis Ubieda
94a7f028ef ubx: Refactor codebase in order to improve usability
During testing and code inspection, there were various anti-patterns
on this (and U-Blox driver) codebase(s), including obfuscation, and
lack of data validation. This made it increasingly difficult to
introduce further variants of u-blox GNSS modems.

With this patch, both the UBX modem and the M8 driver have been
refactored to ease the reliability and maintainability of these
codebases. Here are some highlights:

WRT UBX modem:
- Helper macros to easily create UBX frames, (including checksum
calculation), at compile time; thus, making it easier to extend UBX
commands.
- Logic validation by the inclusion of the modem_ubx testsuite, used to
refactor the code through TDD.
- Ability to receive unsolicited messages, in order to enable U-Blox
drivers to rely on modem_ubx to transceive all commands, and avoid
hopping between modem_ubx and modem_chat.

WRT M8 driver:
- Remove GNSS specific protocol header files. Instead, unify them under
modem/ubx/protocol.h. Background: After a survey and looking at ubxlib
SDK I conclude the UBX protocol is by definition a GNSS protocol (there
are non-GNSS u-blox modems, but they're not interfaced through UBX
protocol).
- Establish pattern to create and send/receive commands using new
foundations on modem ubx.
- Remove dependency of Modem chat, and instead use UBX unsolicited
messages to get Navigation and Satellites data.
- Switch from the auto-baudrate detection pattern to a pattern of
transitioning between an initial known baudrate to a desired baudrate,
in order to improve initialization time.
- Add dts property to configure default fix-rate.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-05-30 19:40:19 +02:00
Declan Snyder
f1df21278c soc: rw: Enable flexcomm wakeup/sleep clocking
Following the new feature in the flexcomm driver to be able to wake up
from low power mode, the clock control drivers have to handle the
platform specific details, so this commit adds to the already ugly mess
that is the LPC syscon driver which is used by RW currently and makes
the required devicetree changes.

Make the console/shell uart on the FRDM_RW612 take advantage of this by
default.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-05-30 19:40:11 +02:00
Declan Snyder
6bd6e50838 pm: Add API to check if a state disables a device
Add an API function that can be used by client code to check if a state
disables a device.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-05-30 19:40:11 +02:00
Bjarki Arge Andreasen
3d24070890 kernel: work: add k_work_queue_run()
Add the ability to block and process a work queue by invoking
`k_work_queue_run` from an existing thread. This can be particularly useful
for using the main thread to process work items, in the same vein as the
system work queue, but from a lower priority/preemptible thread.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2025-05-30 16:37:02 +02:00
Fabio Baltieri
033672114b led: fix up the ENOSYS condition to pass coverity
The current ENOSYS check code can proceed for a driver that
hypothetically implements the on() but not the off() function of
vice versa, which would result in a null pointer dereference.

This would be a weird use case but Coverity catches the situation, no
harm in changing the ENOSYS check to fail if the on/off is half
implemented, so let's change it to do that.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-05-30 16:35:30 +02:00
Håkon Amundsen
801107eb4d drivers: firmware: add IRONside boot report
The boot report is used to pass information from IRONside to a CPU
being booted.

Integrate the boot report to the update service sample.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2025-05-30 16:35:15 +02:00
Mark Wang
a8796ca6ee boards: nxp: add uhc support for frdm_k22f, rt1060, lpc55s69 and lpc55s28
add uhc related items to dts.
add clock initialization
add BM4 if CONFIG_USB_UHC_NXP_KHCI is enabled
add pin mux
update board related CMakeLists.txt
update sdk-ng CMake to include NXP controller drivers
update west.yml to contain the hal_nxp pr

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-05-30 16:34:41 +02:00
Anas Nashif
0a6e579987 Revert "posix: net: move static inline gethostname() to lib definition"
This reverts commit e60070d91b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-30 08:27:19 -04:00
Anas Nashif
da48a04572 Revert "posix: sysconf: match _SC* defines with newlib/picolib"
This reverts commit c5f1c43b8c.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-30 08:27:19 -04:00
Anas Nashif
a098f5c3a3 Revert "posix: move PTHREAD_STACK_MIN to posix_features"
This reverts commit d6edc75699.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-30 06:20:59 -04:00
David Leach
298f6d8d6c drivers: flash: Add documentation on read API
Add some clarity on expected parameter validation order to have
consistency between implementations.

Signed-off-by: David Leach <david.leach@nxp.com>
2025-05-30 10:27:26 +02:00
Adrian Gielniewski
47f39a1323 net: openthread: Remove OpenThread module API from net header
Use OpenThread module header instead of redefining its API.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2025-05-30 10:26:44 +02:00
Nicholas Lowell
c5f1c43b8c posix: sysconf: match _SC* defines with newlib/picolib
It's possible for newlib/picolib libc libraries to
internally call sysconf() which would execute zephyr's
implementation.  However, if the _SC* defines do not have
matching values, then the incorrect switch case executes.

This issue arises when using newlib/picolib libc that includes
sysconf implementation for ARM.  With current defaults, the
zephyr sysconf() overrides the original libc sysconf() so
we must ensure proper operation.

We will switch to the #define list just like newlib/picolib.
We can't currently use their unistd.h directly due to a domino
of declaration conflicts.
For the "small" macro implementation, we have to drop using
CONCAT to prevent pre-expansion of the new #defines

Signed-off-by: Nicholas Lowell <Nicholas.Lowell@lexmark.com>
2025-05-30 10:26:22 +02:00
Nicholas Lowell
e60070d91b posix: net: move static inline gethostname() to lib definition
static inline gethostname() in unistd.h can cause declaration collisions.
we should just move it to a normal function definition like the
rest of the network functions.

Signed-off-by: Nicholas Lowell <Nicholas.Lowell@lexmark.com>
2025-05-30 10:26:22 +02:00