Commit graph

15409 commits

Author SHA1 Message Date
Lucien Zhao
1f0bea6c08 driver: clock_control_mcux_ccm_rev2.c: update new lpspi support
On RT1180, two lpspis share the same clock root,
support lpspi in clock driver for RT118x

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-01-13 10:08:36 +01:00
Nikodem Kastelik
ee05087935 include: drivers: nrf_clock_control: make nrf_clock inclusion stricter
Some devices do not support nrf_clock HAL.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-01-13 08:45:12 +01:00
Benjamin Gwin
acc5f20357 arch: arm: Allow NMI handlers to be registered from C++
This exports the API function with C-linkage so that it can be used in a
C++ application.

Signed-off-by: Benjamin Gwin <bgwin@google.com>
2025-01-10 18:58:49 +01:00
Patryk Duda
22d3173a61 include: zephyr: sys: Introduce IS_BIT_SET() macro
This macro is defined in a few places which leads to macro redefinition
error e.g. when compiling prometheus network sample for NPCX boards.

Provide one definition of IS_BIT_SET() in util_macro.h to fix the
problem.

Signed-off-by: Patryk Duda <patrykd@google.com>
2025-01-10 14:48:13 +01:00
Fabrice DJIATSA
6292997b03 include: zephyr: drivers: dma: add support for circular DMA
This macro will help us to enable the 5th bit CIRC on the DMA_CCRx
register for all stm32 series having this configuration.
Thus the DMA will be able to handle the circular buffers.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
co-authored-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2025-01-10 11:58:18 +01:00
Lin Yu-Cheng
2656029c3a driver: gpio: Add gpio driver initial version of RTS5912.
Add gpio driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-01-10 11:58:02 +01:00
Lin Yu-Cheng
2c25182572 driver: pinctrl: Add pinctrl initial version of RTS5912.
Add pinctrl driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-01-10 11:58:02 +01:00
Lin Yu-Cheng
6ea7560ce2 driver: clock_control: Add clock controller initial version of RTS5912.
Add clock controller driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-01-10 11:58:02 +01:00
Nicolas Pitre
bc6eded597 kernel: mark z_smp_current_get() with the const attribute
Repeated references to _current won't produce a different result as the
executing thread instance is always the same. Use the const attribute to
let the compiler know it may reuse a previously obtained value. This offset
the penalty for moving z_smp_current_get() out of line and provides yet
more binary size reduction.

This change is isolated in its own commit to ease bisecting in case some
unexpected misbehavior is eventually observed.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00
Nicolas Pitre
7a3124d866 kernel: move current thread pointer management to core code
Define the generic _current directly and get rid of the generic
arch_current_get().

The SMP default implementation is now known as z_smp_current_get().
It is no longer inlined which saves significant binary size (about 10%
for some random test case I checked).

Introduce z_current_thread_set() and use it in place of
arch_current_thread_set() for updating the current thread pointer
given this is not necessarily an architecture specific operation.
The architecture specific optimization, when enabled, should only care
about its own things and not have to also update the generic
_current_cpu->current copy.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00
Nicolas Pitre
46aa6717ff Revert "arch: deprecate _current"
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").

This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.

The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.

Hence this revert.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00
Maochen Wang
bc370ea075 net: wifi: support printing WPA3 enterprise in scan result
Support printing WPA3 enterprise type in scan result for more
accurate display, including the suiteb, suiteb-192 and WPA3
enterprise only.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-10 07:48:40 +01:00
Maochen Wang
f2f2fbb315 hostap: support getting enterprise type by status cmd
For 'wifi status' and 'wifi ap status' cmd of the hostap case,
originally only support getting 'EAP-TLS' for the enterprise
mode, which is not correct. Now support getting the specific
enterprise mode, including the WPA3 enterprise mode and
the EAP method type.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-10 07:48:40 +01:00
Maochen Wang
eb81fba890 net: wifi: fix typo of EAP method
Fix typo of EAP method, instead of EPA.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-10 07:48:40 +01:00
Maochen Wang
c1782420d5 hostap: add WPA3 enterprise security type
Change Wi-Fi suiteb type into WPA3 enterprise security type, it
includes suiteB, suiteB-192 and WPA3 enterprise only mode.
Support setting WPA3 enterprise only mode, which should use
cipher_config->key_mgmt as WPA-EAP-SHA256, and the AKM in RSN
IE will show 00-0F-AC:5.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-10 07:48:40 +01:00
Maochen Wang
4777dfaa28 net: l2: wifi: remove EAP TLS SHA256 security
Remove EAP TLS SHA256 security, as it was added to support the AKM
of 00-0F-AC:5 in RSN IE, but actually this AKM is used by WPA3
enterprise only mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-10 07:48:40 +01:00
Emil Gydesen
48ac31c7a2 Bluetooth: TMAP: Remove double definitions of TMAP roles support
Both the TMAP kconfig file and public header file defined
which roles were supported.

The Kconfig file options were recently added and were more
up to date (and correct), and allows for other Kconfig files
to use these values, thus allowing for more flexibility when
implementing applications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-09 15:49:10 +01:00
Matt Rodgers
b7091ed439 net: http_server: serve resources only for their defined services
Ensure that HTTP resources can only be served to a client connected on
the specific service(s) that the resource was registered against using
the HTTP_RESOURCE_DEFINE macro.

This allows different resources to be registered to different services,
for example to make some resources only available via an HTTPS service
and not via unencrypted HTTP.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2025-01-09 14:13:57 +01:00
Sven Ginka
804e3f6497 soc: sensry: add pinctrl
Add pin control support for the sy1xx soc.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-01-09 04:04:06 +01:00
Matt Rodgers
549e5de277 net: websocket: pass HTTP upgrade request context to user callback
Passing HTTP upgrade request context to the user callback allows the
user to decide whether to accept or reject the websocket connection
based on the HTTP headers in the request. The primary reason for this is
to enable authentication of the websocket connection (e.g. via cookies
or Authorization header).

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2025-01-08 21:02:02 +01:00
Emil Gydesen
e45830893f Bluetooth: CCP: Introduce new CCP API
The CCP API for the Call Control Profile works on top of the
TBS API, and will eventually replace parts of the TBS API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-08 07:50:32 +01:00
Chris Friedt
2423219ea1 posix: include: dirent: rework the dirent.h header
Declare standard functions and split type definitions into
sys/dirent.h .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-01-08 01:29:06 +01:00
Gergo Vari
2759adaf1a drivers: rtc: maxim,ds3231: RTC driver
This is a squash of all the groundwork needed to
get a functioning driver for the DS3231 with the RTC API.

Signed-off-by: Gergo Vari <work@gergovari.com>
2025-01-07 23:00:05 +01:00
Peter Mitsis
85a9cffd0f kernel: cache priority queue index on UP multiq
Even though calculating the priority queue index in the priority
multiq is quick, caching it allows us to extract an extra 2% in
terms of performance as measured by the thread_metric cooperative
benchmark.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-01-07 18:24:09 +01:00
Peter Mitsis
472c71d3f4 kernel: Add method to dequeue from a dlist
Dequeuing from a doubly linked list is similar to removing an item
except that it does not re-initialize the dequeued node.

This comes in handy when sorting a doubly linked list (where the
node gets removed and re-added). In that circumstance, re-initializing
the node is required. Furthermore, the compiler does not always
'understand' this. Thus, when performance is critical, dequeuing
may be preferred to removing.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-01-07 18:24:09 +01:00
Dominik Ermel
bb0fa0746b stream_flash: Enforce size to be explicitly present on init
The commit changes requirements for stream_flash_init, where size
can no longer be 0 and has to be explicitly set, to avoid situation
where size autodetection, invoked by size == 0, would miss changes in
layout and silently allow overflow of Stream Flash into other partitions.

There has also been new Kconfig option CONFIG_STREAM_FLASH_INSPECT,
set to y by default to keep legacy behaviour, that can be used to turn
off stream_flash_ctx vs device inspection, allowing user to shed
inspection code once it is not useful anymore.

Fixes: #71042

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-01-07 15:56:49 +01:00
James Roy
d6b01bc8a0 style: Add parens to the disp expr
Add parentheses to the displacement expression
to prevent priority issues after macro expansion.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-01-07 00:26:47 +01:00
Krzysztof Chruściński
226be20689 drivers: clock_control: nrf: Add helper macro for getting clock frequency
Add NRF_PERIPH_GET_FREQUENCY() that returns the frequency of clock
that is used for the node.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-07 00:25:49 +01:00
Ryan McClelland
acc39e4622 drivers: i3c: add i3c error type in payload
Add the SDR Error Code to be written in to the payload following
section 5.1.10.2 of the I3C v1.1.1 specification.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-01-06 20:33:37 +01:00
Ryan McClelland
7554da7e8b drivers: i3c: add ibi hj reponse api
Add an api to ack or nack ibi hj requests.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-01-06 20:33:26 +01:00
Ryan McClelland
b5f447ced2 drivers: i3c: split up i3c_device_basic_info_get
For ENTDAA, BCR and DCR is always transmitted back up to the controller.
When `i3c_bus_init` is done, it does the ENTDAA then it would get the
basic info would get the BCR and DCR again. This was rather reduntant.
This now splits it up so there is a function called
`i3c_device_adv_info_get` which gets the mrl, mwl, getcaps, and the
mxds. `i3c_device_basic_info_get` now only just gets the bcr and dcr.
There is also an inline function called `i3c_device_info_get` which
will get everything.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-01-06 20:33:16 +01:00
Fabian Blatz
72694a9d09 drivers: stepper: Cleanup doxygen comments
Cleans up the doxygen comments in the stepper api header. Includes:
- documentation for MICRO_STEP_RES_INDEX
- constistent use of microsteps instead of micro_steps or micro steps
- fix for previously renamed set_target_position refrence

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-06 14:42:15 +01:00
Chris Friedt
68c0ff4e85 posix: fcntl.h: define constants in terms of zvfs constants
Define fcntl.h constants in terms of zvfs constants.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-01-05 09:58:54 +01:00
Jamie McCrae
67597cf85a zephyr: storage: flash_map: Fix parameter order
Two functions have parameters in the wrong order in the function
description, fix them to the correct order

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-04 14:15:19 +01:00
Chaitanya Tata
b28f246f53 net: l2: wifi: Fix PHY rate display
The WPA supplicant already converts this to Mbps.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-01-03 11:39:13 +01:00
Jamie McCrae
5871037426 mgmt: mcumgr: grp: os_mgmt: Add error code for invalid responses
Adds a new error code that can be used to signify that a query was
valid but the response was not valid

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-03 10:02:23 +01:00
Armando Visconti
21584003bf sensors: drivers: lsm6dsv16x: add SFLP FIFO support
Add the Sensor Fusion Low Power (SFLP) FIFO streaming capability,
using RTIO. The decode function is now aware of parsing following FIFO
tags:

    - LSM6DSV16X_SFLP_GAME_ROTATION_VECTOR_TAG
    - LSM6DSV16X_SFLP_GYROSCOPE_BIAS_TAG
    - LSM6DSV16X_SFLP_GRAVITY_VECTOR_TAG

To activate SFLP the user should put in DT the proper configuration.
For example, to activate a 60Hz SFLP FIFO batching rate of game rotation
vector, gravity vector and gbias components, the user should add in DT
the following:

  sflp-odr = <LSM6DSV16X_DT_SFLP_ODR_AT_60Hz>;
  sflp-fifo-enable = <LSM6DSV16X_DT_SFLP_FIFO_GAME_ROTATION_GRAVITY_GBIAS>;

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-01-02 18:04:19 +01:00
Armando Visconti
9471df95a5 sensors: add new channels to support sensor fusion
Add three new channels and relative data:

    - SENSOR_CHAN_GAME_ROTATION_VECTOR

      The "game rotation vector" reports the four components x/y/z/w
      (quaternions) of the unit vector representing a 3D spatial
      rotation or orientation.

    - SENSOR_CHAN_GRAVITY_VECTOR

      The "gravity vector" reports the three axis x/y/z of the gravity
      vector separated from the linear acceleration components.
      The measurement unit is m/s^2.

    - SENSOR_CHAN_GBIAS_XYZ

      The "gbias" reports the gyroscope offset x/y/z components.
      The measurement unit is radians/s.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-01-02 18:04:19 +01:00
Jianxiong Gu
638cfede31 dt-bindings: pinctrl: ch32v003: Fix I2C1 remap bit
Corrects definition to match the register map.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-02 10:54:43 +01:00
Henrik Brix Andersen
ee250a11ce drivers: gpio: GPIO_DT_SPEC_GET_BY_IDX_OR: use default if idx invalid
It is not sufficient to check if the given node_id has the requested
property in GPIO_DT_SPEC_GET_BY_IDX_OR(), the index also needs to valid.

Change the logic to test for a valid index (which, in turn, also checks if
the property is valid), otherwise return the default value provided by the
caller.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-12-31 00:06:11 +01:00
Simone Orru
f53aa42b8b tracing: Add calloc
Add the calloc tracing functions.

Signed-off-by: Simone Orru <simone.orru@secomind.com>
2024-12-30 17:32:03 +01:00
Simone Orru
37fd711a45 kernel: Add k_heap_calloc
Add the k_heap_calloc function. The
equivalent of the standard calloc for
the Zephyr kernel.

Signed-off-by: Simone Orru <simone.orru@secomind.com>
2024-12-30 17:32:03 +01:00
Jan Kiszka
fa66a9be57 arch: arm: cortex_r/a: Fix multiple use of ARCH_EXCEPT in same scope
Pull the register variable into the private scope that ARCH_EXCEPT
creates so that the macro can be used multiple times in the same caller
scope. This can happen via k_panic(), e.g. in subsys/fs/ext2/ext2_impl.c.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2024-12-30 11:44:10 +01:00
Dane Wagner
ad7d808aa2 drivers: spi: Explicitly cast void* for C++ compatibility
Fixes two isolated instances of implicit void pointer casting in spi.h.
While this is legal in C, it causes a compiler error in C++.

Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
2024-12-25 11:06:00 +01:00
Mikkel Jakobsen
e4c21da41b drivers: fuel_gauge: make read-only pointer args const in api
For the lists of properties passed as a pointer to the get_props and
set_props functions, there is no reason to not make the pointer const as
the called functions will not and should not alter the pointed-to data.

In practice, not having the pointers const can cause compilation errors
if trying to pass in a const array of properties.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2024-12-24 13:54:15 +01:00
Mikkel Jakobsen
7960747d8d drivers: fuel_gauge: fix missing casts in api functions
The fuel_gauge_get_props and fuel_gauge_set_prop functions were missing
casts for the device struct which causes compiler warnings when using
the -fpermissive compiler flag.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2024-12-24 13:54:15 +01:00
Mikkel Jakobsen
10bb71e54f drivers: fuel_gauge: fix integer comparison in api functions
In the fuel_gauge_get_props and fuel_gauge_set_props functions, an array
len is passed as a size_t but compared against an int, which leads to
C++ compiler warnings when using -Werror=sign-compare. The fix is to use
a size_t for the loop counter.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2024-12-24 13:54:15 +01:00
Dawid Niedzwiecki
be5d44eb7e drivers: flash: stm32: update ex_op API
Use uint64_t instead of uint32_t for the FLASH_STM32_EX_OP_SECTOR_WP
extended operation.

Some chips have two banks, more than 16 sectors each e.g. stm32h7a3xx
chips, so more than 32 bits are required.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-12-24 13:54:04 +01:00
Peter Mitsis
669f2c489a kernel: Add k_reschedule()
The routine k_reschedule() allows an application to manually force
a schedule point. Although similar to k_yield(), it has different
properties. The most significant difference is that k_yield() if
invoked from a cooperative thread will voluntarily give up execution
control to the next thread of equal or higher priority while
k_reschedule() will not.

Applications that play with EDF deadlines via k_thread_deadline_set()
may need to use k_reschedule() to force a reschedule.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-12-24 04:22:51 +01:00
Andrew Featherstone
b6b38e6808 drivers: dma: rpi_pico: Refactor DMA files for Raspberry Pi SoCs
Avoid referring to Pico 2 (the name of a board). In this context,
RPI_PICO is used to refer to the (Zephyr) `SOC_FAMILY` rather than the
Pico 1 board. This clarifies common numerical values between the RP2040
and RP2350 SoC series, and enables existing DTS files to be used with
RP2350-based boards with fewer changes.

Remove the use of Zehpyr's `CONFIG_` macros from the device tree files,
and replace them with `SOC_SERIES`-specific files. Update the driver
implementation to conditionally include the correct file. Update
documentation and samples to match.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2024-12-23 23:57:57 +01:00