Commit graph

15394 commits

Author SHA1 Message Date
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
Nicholas Lowell
d6edc75699 posix: move PTHREAD_STACK_MIN to posix_features
PTHREAD_STACK_MIN is one of the very few posix features
referenced in sysconf that is not defined in posix_features.h
Move it to minimize header dependencies.

Signed-off-by: Nicholas Lowell <Nicholas.Lowell@lexmark.com>
2025-05-30 10:26:22 +02:00
Hake Huang
8e2c053cd1 linker: device_state : add alignment setting
the device_state need realocate when boot as second core.
as the relocation does not know the alignment, this could
be a case that the next data is mis-place after relocation.

fix this by add a alignment in device_state section.

still need revert aec0355380
reported in #86871

fixes: #82841

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-05-29 20:22:57 -04:00
Lyle Zhu
6f2b8f8a97 Bluetooth: Classic: L2CAP: implement ECHO REQ/RSP
Handle the ECHO request/response of classic L2CAP signaling packets.

Add the functions `bt_l2cap_br_echo_cb_register()` and
`bt_l2cap_br_echo_cb_unregister()` to register/unregister the ECHO
callbacks to monitor the ECHO REQ and RSP.

Add the function `bt_l2cap_br_echo_req()` to send the ECHO REQ through
classic L2CAP signaling channel.

Add the function `bt_l2cap_br_echo_rsp()` to reply the ECHO REQ
through the classic L2CAP signaling channel.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-05-29 20:19:38 -04:00
Camille BAUD
11a18da98c drivers: pinctrl: fix SPI pinctrl for CH32V00x/CH32V006
This fixes incorrect/incomplete pinctrl for CH32V006

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-05-29 23:25:49 +02:00
Camille BAUD
f81e7559bf drivers: spi: introduce basic spi driver for wch
introduces a basic SPI driver for CH32 series

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-05-29 23:25:49 +02:00
Lyle Zhu
aaef7eb658 Bluetooth: Classic: HGP_AG: change get_ongoing_call() to async mode
Change the callback `get_ongoing_call()` of the AG from synchronous to
asynchronous mode. It will help to avoid the Bluetooth host stack be
blocked in the context of callback `get_ongoing_call()`.

Add a function `bt_hfp_ag_ongoing_calls()` to set the ongoing calls and
reply the AT command `AT+CIND?` after the callback `get_ongoing_call()`
has been notified.

Add a delayable worker to avoid the AT command `AT+CIND?` never being
replied. After the time exceeds
@kconfig{CONFIG_BT_HFP_AG_GET_ONGOING_CALL_TIMEOUT}, the response of
the AT command `AT+CIND?` will be replied.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-05-29 06:31:32 +02:00
Lyle Zhu
2b4de08c7c Bluetooth: Classic: HFP_AG: Support ongoing calls before SLC
Support the case that there are some calls existed before SLC
established.

Add a callback to get the ongoing calls one by one from upper layer
when the response of the AT command `AT+CIND=?` from HF has been sent.

And set the Call, Call Setup, and Held Call indicators and report the
values int the response of AT command `AT+CIND?`. Then report all
ongoing calls in the `+CLCC` response.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-05-29 06:31:32 +02:00
Benjamin Cabé
af46f628a0 include: kernel: doc: add doxygen for k_sem
It can be confusing for users browsing the API docs to not find any
documentation for the k_sem structure. This commit adds doxygen
comments so that it now shows up.

Fixes zephyrproject-rtos/zephyr#90608.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-28 21:29:37 +02:00
Luis Ubieda
5cd3a7e79c sensor: afbr_s50: Add DTS configuration bindings
The following parameters are exposed through DTS bindings:
- ODR.
- Dual Frequency Mode.
- Measurement Mode.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-05-28 21:29:13 +02:00
Luis Ubieda
820975a409 sensor: afbr_s50: Add private channel to obtain pixel matrix
Each time this sensor gets a reading, it contains a matrix of 4 x 32
pixels containing distance readings, from which the 1-D result is
calculated. The private channel would expose this array through
Sensor APIs.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-05-28 21:29:13 +02:00
Fabio Baltieri
77763a2800 led: fix up the API requirement comment
With the current implementation one can implement either on/off or
set_brigthness, change the comment to reflect that.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-05-28 17:49:59 +02:00
Bjarki Arge Andreasen
400c038008 drivers: clock_control: z_nrf_clock: add get_startup_time API
Implement vendor specific
z_nrf_clock_bt_ctlr_hf_get_startup_time_us() which gets the startup
time of the high frequency clock used for Bluetooth.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-05-28 17:49:41 +02:00
Brandon Allen
979933cfb4 drivers: current_sense_amplifier: add zero-current-voltage binding
some current sense amplifiers have a non zero offset voltage
that correlates to zero current. adding this offset voltage binding
allows the driver to be used with this type of circuitry.

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2025-05-28 17:48:47 +02:00
Neal Jackson
2ef1ddea73 mgmt: hawkbit: interface support for ip addresses and domain name
Previously, hawkbit interface only supported a url/hostname and a port,
and internally it resolves to an IP address. This does not work for
network layers that rely on NAT64, like OpenThread.  Zephyr's
implementation of `getaddrinfo` is not aware of NAT64.  DNS will resolve
an IPV4 address that needs to be converted to IPV6 with the NAT64
prefix.

This commit alters the Hawkbit interface to allow providing an explicit
domain name as a string via `server_domain`, and an already resolved IP
address as `server_addr`.

This commit changes the usage of `hawkbit_runtime_config.server_addr` to
point to either an IP address or domain name. It adds a new Kconfig
(`HAWKBIT_USE_DOMAIN_NAME`) to specify an explicit domain name and adds
a new variable `hawkbit_runtime_config.server_domain`. If
`HAWKBIT_USE_DOMAIN_NAME` is enabled and a user provides an IP address
to `server_addr`, the user must provide a domain name to
`server_domain`.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-28 11:08:53 +02:00
Jukka Rissanen
d718b46ddb net: ipv6: Do not access link address past array length
It is possible to manually set link address length past 6 at runtime
and trying to check IPv6 ll address that way. This should fail
as we could read two bytes past the address buffer.

Coverity-CID: 516242

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-28 10:05:30 +02:00