Commit graph

15372 commits

Author SHA1 Message Date
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
Benson Huang
3e8ec3aaf2 driver: flash: Add Set/ Get write protect function
Add Set_WP function to set SPI flash WP line to low
Add Get_WP function to obtain status of the SPI flash WP line

Signed-off-by: Benson Huang <benson7633769@gmail.com>
2025-05-28 08:14:27 +02:00
Tony Han
cc206e05b9 drivers: mfd: add FLEXCOM drivers for Microchip SAM devices
The FLEXCOM offers several serial communication protocols that are
managed by the three sub-modules USART, SPI, and TWI (I2C).

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-05-28 08:14:08 +02:00
Tony Han
8f5a0559c6 drivers: clock_control: microchip: add drivers for sama7g5 PMC
Initialize the configurations for PMC driver.
Add implement of the API for PMC clocks.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-05-28 08:14:08 +02:00
Alain Volmat
5d10955863 video: common: add checks of frame interval values
Add checks regarding specific values (numerator / denominator) not being
0 for frame intervals.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-05-28 05:54:15 +02:00
Alain Volmat
08df2fd92e video: common: add __ASSERT_NO_MSG in video api function entry
Protect video API functions via __ASSERT_NO_MSG call to ensure that
required pointers are valid when entering functions.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-05-28 05:54:15 +02:00
Phi Bang Nguyen
66e8a6f873 drivers: video: Combine some API function pointer types
Some API function pointer types such as set/get_format(),
set/get_frmival() are indentical. Combine them to save some spaces.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2025-05-28 01:46:32 +02:00
Jilay Pandya
2ef1558896 drivers: stepper: add missing include guard
Add missing include guard in drv84xx pubic header

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-05-27 17:56:13 +02:00
Flavio Ceolin
437b56d22e pm: device_runtime: Make async optional
Async now uses its own work queue, which means it consumes more
resources. Since not all applications need the async API, we can make
it optional without any penalty for those applications.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-05-27 14:45:07 +02:00
Neal Jackson
d9be126eca mgmt: hawkbit: add check for valid domain name length
This commit adds a `strnlen` length check for `server_addr` to ensure that
it will not be truncated and result in a silent failure. Instead, the
call to `hawkbit_set_config` will return -EINVAL if the supplied
`server_addr` is too long for the internal buffer.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-27 11:50:52 +02:00
Jianxiong Gu
b25bdc4fa7 usbc: tcpc: Update set_drp_toggle function
Updated set_drp_toggle to handle differences in TCPCI revisions.
Added a macro for TCPCI revision and read it from the chip register
during initialization.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-05-27 11:50:29 +02:00
Jianxiong Gu
d18308cde1 usbc: tcpc: Add generic TCPCI related functions
Add generic functions that will be common to TCPCI compliant drivers.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-05-27 11:50:29 +02:00
Jianxiong Gu
a4cf7d11a7 usbc: fix errors in TCPC_REG_PD_REV and TCPC_REG_PD_INT_REV macros
Corrected macro definitions.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-05-27 11:50:29 +02:00
Chris Friedt
13e827fe1b sys: timeutil: add missing copyright for recent changes
Add copyright for changes that were included with #90060.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-05-27 06:51:38 +02:00
Adrian Gielniewski
4d8ffcca93 net: if: Add dummy member to anonymous union in net_if_addr
When both CONFIG_NET_IPV6_DAD and CONFIG_NET_IPV4_ACD are disabled, the
anonymous union in struct net_if_addr ends up with no members, which
results in a different struct layout between C and C++.

In C, an empty union has size 0, while in C++ it has size >=1, which
shifts the offsets of the following fields.

Add a 1-byte dummy member to the union to ensure consistent layout
across both compilers.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2025-05-26 23:35:51 +02:00
Lars-Ove Karlsson
64ac57abcb arch: arm: Added IAR support to ARM irq header macros
Added IAR support to the macros ARCH_ISR_DIAG_OFF and
ARCH_ISR_DIAG_ON and updated the IAR warning macros.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2025-05-24 18:04:20 +02:00
Lars-Ove Karlsson
8cfd84986d arch: arm: mpu: Fix alignment check for iccarm
The IAR C/C++ compiler can't resolve a cast on a pointer
to a constant expression. This is used in the
_ARCH_MEM_PARTITION_ALIGN_CHECK macro.

This fix checks if an IAR compiler is used and disables the
start-alignment check if it is.

This was already fixed for v7 in rev d34d554d.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2025-05-24 18:04:09 +02:00
Robert Lubos
3572c9f825 net: http: client: Allow to abort download from response callback
Update the response callback function signature to allow the callback to
return an error code, which in turn will cause the HTTP client to abort
the download.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-23 17:20:24 +02:00
Rodrigo Peixoto
c71f51c829 api: zbus: Make zbus a stable API
Make zbus stable API since it fulfills all the requirements that
makes an API stable.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2025-05-23 15:30:48 +02:00
Chris Friedt
d3ec91674a sys: timeutil: check for 32-bit time_t to avoid warning (part 2)
Same error had to be fixed in the branch where optimizations were done.

This is probably a good example of where using `if (IS_ENABLED()) ...`
is a better choice than using `#ifdef`. Because the compiler would have
caught this error last time as well.

Anyway, same problem - different line(s)!

A warning was propogated to error when building for
native_sim/native.

```
timeutil.h:682:17: error: result of comparison of constant \
  -9223372036854775808 with expression of type '__time_t' (aka 'long') \
  is always false [-Werror,-Wtautological-constant-out-of-range-compare]
timeutil.h:680:17: error: result of comparison of constant \
  -9223372036854775808 with expression of type '__time_t' (aka 'long') \
  is always false [-Werror,-Wtautological-constant-out-of-range-compare]
```

This is due to the issue described in #90029.

Add workarounds for `timespec_to_timeout()` and `timespec_negate()`
until 90029 is resolved.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-05-23 14:04:53 +02:00
Veijo Pesonen
68f8c1b256 toolchain: gcc: ramfunc with Clang
With Clang you can't set long_call attribute on function basis. Instead
of converting all calls to long calls let the linker create veneers when
necessary.

Signed-off-by: Veijo Pesonen <veijo.pesonen@alifsemi.com>
2025-05-23 09:37:16 +02:00
Chris Friedt
d61a7a80ad sys: timeutil: check for 32-bit time_t to avoid warning
A warning was propogated to error when building for
native_sim/native.

```
timeutil.h:519:17: error: result of comparison of constant \
  -9223372036854775808 with expression of type '__time_t' (aka 'long') \
  is always false [-Werror,-Wtautological-constant-out-of-range-compare]
```

This is due to the issue described in #90029.

Add workarounds for `timespec_to_timeout()` and `timespec_negate()`
until 90029 is resolved.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-05-23 09:36:41 +02:00
Chris Friedt
21b8bd1ba1 sys: timeutil: add utility functions for struct timespec
Add a number of utility functions for manipulating struct timespec.

* timespec_add()
* timespec_compare()
* timespec_equal()
* timespec_is_valid()
* timespec_negate()
* timespec_normalize()
* timespec_sub()
* timespec_from_timeout()
* timespec_to_timeout()

If the `__builtin_add_overflow()` function is available, then the
API is mostly branchless, which should provide decent performance on
systems with an instruction cache and branch prediction. Otherwise,
manually written alternatives exist that are also perhaps more
readable.

The two functions at the end convert time durations between
representation as `struct timespec` and `k_timeout_t`.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-05-22 23:57:17 +02:00