Commit graph

15409 commits

Author SHA1 Message Date
Flavio Ceolin
3763737326 smbus: Remove syscalls with callbacks
Remove syscalls that allows user threads to set callbacks that
will be invoked by the kernel.

Userspace is not trusted we can't allow a user thread set callbacks
that will be invoked by the kernel and run with supervisor privileges.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-11-17 09:22:05 +01:00
Lingao Meng
2cd8d40b97 Bluetooth: Mesh: Split Model Structure
Split Model Variables to separate structue.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-16 16:52:14 +01:00
Lingao Meng
ab08f34fd9 Bluetooth: Mesh: Make bt_mesh_model as rodata
Since model struct most of member should not change at run time,
so mark as const will be suitable and safely.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-16 16:52:14 +01:00
Flavio Ceolin
a48e68441b logging: Remove syscall for z_log_msg_runtime_vcreate
This syscall is completely problematic in userspace, it does
not check ANY parameter that is given and it uses variadic argument
that are not copied / checked before being used in the implementation,
instead it just pass a pointer to user stack with unknown data is
blindly consumed by the kernel.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-11-16 09:25:21 -05:00
Henrik Brix Andersen
58e1963c6b drivers: can: mcan: use __nocache_noinit for MRAM data variables
Use __nocache_noinit for the Bosch M_CAN MRAM data variables on SoCs
without dedicated MRAM.

Fixes: #64691

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-16 09:29:09 +01:00
Henrik Brix Andersen
afe1ca6847 linker: allow tagging variables with __nocache_noinit
Allow tagging variables with __nocach_noinit.

With CONFIG_NOCACHE_MEMORY=y, this will resolve to __nocache, which implies
__noinit. With CONFIG_NOCACHE_MEMORY=n, this simply resolves to __noinit.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-16 09:29:09 +01:00
Cong Nguyen Huu
da35f117a4 dt-bindings: clock: update clock to RTD 1.0.0
Update clock sources

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-16 09:28:16 +01:00
Alberto Escolar Piedras
f9685cd347 include: util: Add CONCAT as a general Zephyr utility macro
Provide the CONCAT macro as a general Zephyr utility macro
to paste two tokens during the preprocessor pass.

Note that this macro is based on the _CONCAT macro defined
in toolchain/common.h. This toolchain header needs a CONCAT
like macro, but requires minimal include dependencies.
So we leave _CONCAT where it is.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-16 09:27:29 +01:00
Alberto Escolar Piedras
e92021b7b5 arm arch: Remove definition of CONCAT and TOSTR
One of the ARM architure files, defined since long ago
CONCAT and TOSTR having the exact same purpose as Zephyr's
_CONCAT & STRINGIFY.

This arm header file is included thru dependencies into
almost all code built for ARM, which leads to these
macros being usable everywhere.

This can easily make developers belive the macros
are provided by Zephyr itself, and use them, leading
to code which is not portable between architectures.

Remove this macros definitions from the architecture
headers.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-16 09:27:29 +01:00
Alberto Escolar Piedras
ea2185dd1c arm arch: Replace use of TOSTR with STRINGIFY
One of the ARM architure files, defined since long ago
TOSTR having the exact same purpose as Zephyr's STRINGIFY.

Remove the use of this macro in the tree
(only used in another ARM header file) in favour
of STRINGIFY.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-16 09:27:29 +01:00
Daniel Leung
483dd8a40a doc: doxygen: move mpsc and spsc under data structure API group
Both MPSC and SPSC should be under data structure API group
instead of kernel API group. So move them, and fix some doxygen
cosmetic grouping issues for SPSC.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-15 17:35:06 -05:00
Krzysztof Chruściński
18d28ea144 linker: common-rom-logging: Use DEVNULL_REGION only if it exists
Log string removal is by default enabled for RISCV and Cortex-M
and support is added to the default linker template. However, if
SoC is not using default linker template then DEVNULL_REGION is
not defined. In that case string removal cannot be used.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-15 22:04:10 +01:00
Yong Cong Sin
72fea5df56 shell: backends: uart: add public function to access smp shell data
`smp_shell_input_timeout_handler`. Create a public function in
the `shell_uart.c` for it to get the pointer to the
`smp_shell_data` and fix the compilation error.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-15 16:38:16 +01:00
Daniel Leung
6bb46c7fe7 ipc: pbuf: fix incorrect doxygen group
The ipc/pbuf was tagged as kernel API, which is not correct.
As this is for IPC, move it under IPC doxygen group and also
give it its own subgroup. So now the packed buffer API appears
under IPC in API doc.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-15 14:18:14 +00:00
Andrej Butok
6bd52ae87f doc: dlist: Add "container struct type pointer" description
Add "container struct type pointer" description
to SYS_DLIST_FOR_EACH_CONTAINER() and SYS_DLIST_FOR_EACH_CONTAINER_SAFE().

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-15 12:09:46 +01:00
Jakub Michalski
9265d2de0c drivers: gpio: add rzt2m gpio driver
Add Renesas rzt2m gpio driver with basic functionality.
It supports pin mode configuration and writing/reading to/from gpio ports.
Includes dts changes to build blinky sample.

Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
2023-11-15 11:41:35 +01:00
Wojciech Sipak
9e44f59e9a drivers: pinctrl: add RZT2M driver
This adds a new driver for Renesas RZ/T2M.
The driver allows configuration of pin direction,
pull up/down resistors, drive strength and slew rate,
and selection of function for a pin.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-11-15 11:41:35 +01:00
Fabio Baltieri
be5cb7af7c input: kbd_matrix: move the header to the project wide include directory
Move the input_kbd_matrix.h header out of drivers/ and into include/,
this allows external drivers to use it and doxygen to pick it up.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-15 11:41:25 +01:00
Rodrigo Peixoto
e8c5ca50cc zbus: make ZBUS_CHANNEL_DECLARE compatible with C++
The current implementation of ZBUS_CHAN_DECLARE is not compatible with
C++. It fixes the bug by adding the extern keyword at the channel
definition which will work for both C and C++.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-11-15 10:04:22 +01:00
Tomasz Moń
b5f4d8374a net: buf: Preserve buffer pointer in destroy callback
The use case is to have a netbuf pool that is used exclusively with
net_buf_alloc_with_data() where the destroy callback takes care of
freeing the actual data buffer pointed to by __buf.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-11-15 10:02:55 +01:00
Patryk Lipinski
4a52211432 logging: Changes in the macro statements
Changes in the macro statements that allows to build
with -Wudef flag enebaled, without errors.

Signed-off-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no>
2023-11-15 09:59:56 +01:00
Patryk Lipinski
909c087521 fs: Changes in the macro statements
Changes in the macro statements that allows to build
with -Wudef flag enebaled, without errors.

Signed-off-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no>
2023-11-15 09:59:56 +01:00
Eduardo Montoya
5c6402e76b drivers: ieee802154: add IEEE802154_RX_ON_WHEN_IDLE capability
Introduce `IEEE802154_RX_ON_WHEN_IDLE` capability.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-11-15 09:59:17 +01:00
Georges Oates_Larsen
f5d12102a0 net: tls_credentials: sectag iterators
Add (internal) support for sectag iterating.

Also officially marks negative sectag values as reserved for internal
use.

This will allow a prospective TLS credentials shell to iterate over all
available credentials.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-11-14 10:40:02 +00:00
Christopher Friedt
97668b8b09 libc: common: add support for iso c11 threads
This change capitalizes on newly added support for dynamic
thread stacks and the existing pthread support to provide
an implementation of the ISO C11 `<threads.h>` API.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Daniel DeGrasse
4cc12cb112 include: mipi_dsi: add MIPI DSI detach API
Add MIPI DSI detach API. This API allows the DSI controller to detach
from the DSI device, and power down the DSI PHY. The primary goal of
this API is to provide power savings for DSI devices when the display
they are driving is not active.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-14 09:22:59 +01:00
Krzysztof Chruściński
5e4e944cc0 shell: backends: uart: Rework and add support for async API
Rework UART backend to clearly use single instance approach as
before it was a bit messy with some parts of implementation indicating
multi-instance approach and some single instance. Backend has been
around for years and multi-instance requirement never came.

Added support for UART asynchronous API which is more efficient
in terms of power consumption and performance. Asynchronous API
support is using uart_async_rx helper module for handling data
received asynchronously.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-14 09:21:46 +01:00
Krzysztof Chruściński
165bd2a780 drivers: serial: Add uart_async_rx module
Add module which can handle RX path of UART asynchronous RX API. Module
can be utilized in cases where processing of received data is not performed
directly in the event context but it is delayed. At least two use cases
has been identified (shell async UART backend, asynchronous to interrupt
driven adaptation layer).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-14 09:21:46 +01:00
Jordan Yates
e74676223a bluetooth: host: gatt: statically init callback list
Statically initialise the callback list so that subscriptions can be
registered before the call to `bt_enable`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-14 09:21:16 +01:00
Daniel DeGrasse
aa0b8af577 drivers: dma: mcux_mcux_lpc: support hardware triggering
The LPC DMA IP offers hardware triggering via a series of SOC-specific
signals, often including sources like GPIO pins or hardware timers.
Support hardware triggers via the "dma_slot" field of the DMA
configuration structure. Currently support is offered for setting the
following:
- Trigger polarity
- Trigger level/edge mode
- burst mode
- burst length
- peripheral request

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-13 16:53:53 -06:00
Andy Sinclair
04e18f093f drivers: regulator: Added startup and off/on delay to common driver
A configurable delay during regulator switch on is currently
only supported by the GPIO and fixed regulator drivers.

This functionality has been moved to the common driver, so it can
be easily added to any regulator driver.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-11-13 21:30:10 +00:00
Jeppe Odgaard
b0fdbce4df drivers: sensors: add explorir_m co2 sensor
Add driver for Gas Sensing Solutions' ExplorIR-M CO2 sensor.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-11-13 12:14:08 -05:00
Anisetti Avinash Krishna
316707b7cd drivers: dma: dma_intel_lpss: Enhance LPSS DMA to support UART
Enhance LPSS DMA to support UART and I2C DMA transfer by
enabling init priority of DMA based on dependency on
parent device.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-13 10:07:06 -06:00
Dominik Kilian
28df44946f ipc: add dynamically allocated buffers to icmsg
The icmsg and icmsg_me backends has limitations in context of
concurrent access to single instance. Some limitations are:
* sending by more thread at the same time may cause -EBUSY
* allocating TX buffer will cause errors in other threads that want
  to allocate before first thread sent the message,
* during no-copy receive, when RX buffer is on hold receiving is
  totally blocked.
This backend resolves those limitations by adding dynamically allocated
buffers on shared memory next to ICmsg circular buffer. The data is
passed using those buffers, so concurrency is not a problem. The ICmsg
is used only to pass short 2-byte messages containing references to
those buffers. The backend also supports multiple endpoint.
The ipc/icmsg_me sample was modified to support this backend.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2023-11-13 11:11:43 +01:00
Martin Jäger
c72b9f5048 lorawan: use callback function signature typedefs
This avoids duplication of the function signature in several places and
makes the API documentation more clean.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-11-13 09:53:32 +01:00
Martin Jäger
8b7c8b09ec lorawan: rename lorawan_set_battery_level_callback and make it void
Rename the lorawan_set_battery_level_callback to
lorawan_register_battery_level_callback to make it consistent with other
functions for downlink and data rate changed callbacks.

Also making the function void for consistency. The get_battery_level
already checks if the callback is NULL before invoking it.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-11-13 09:53:32 +01:00
Pieter De Gendt
cbf9680f96 net: lib: coap: Add coap_find_observer
Add a function to the public CoAP API to find and return the unique
observer based on the address and token.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-13 09:50:19 +01:00
Robert Lubos
61c392c5b1 net: iface: Introduce TX mutex locking
A recent iface lock removal in ed17320c3d
exposed issues with concurrent access on TX to drivers that are not
re-entrant.

Reverting that commit does not really solve the problem, as it would
still exist if multiple Traffic Class queues are in use.

Therefore, introduce a separate mutex for TX data path, protecting the
L2/driver from concurrent transfers from several threads.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-11-13 09:49:57 +01:00
Jamie McCrae
6c4b89cb00 mgmt: mcumgr: grp: os_mgmt: Add datetime get/set functions
Adds datetime set and get functions which allow for setting and
getting the current time to/from the rtc alias device

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-13 09:48:13 +01:00
Robert Lubos
8aba7740b8 net: lwm2m: Fix core objects version reporting
Core objects version reporting was broken for LwM2M version 1.1, as the
default object version not necessarily matches the LwM2M version.
Therefore, implement a table with default object versions for particular
LwM2M version, which can be looked up when determining whether it's
needed to include object version or not during Registration/Discovery.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-11-13 09:46:06 +01:00
Ryan McClelland
9ddc94e0d4 drivers: i3c: specify start addr when searching for a free addr
For example, if a driver needed to reserve address before it does a
ENTDAA, it would need to get free address in a loop, but the get
free address func would return the same address everytime. It needs
the start address, which would be the last free address it go, to
be passed in to get the next free address.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-11-13 09:43:26 +01:00
Emil Gydesen
06d5a625a6 Bluetooth: Audio: Add codec cap set functions
Add set functions for codec capability, to set all
assigned number values in the bt_audio_codec_cap
struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:42:35 +01:00
Emil Gydesen
de0c543e62 Bluetooth: Audio: Update some codec cap assigned numbers
Update codec capabiliy frequency, frame duration and
channel count to use enums, and add additional
documentation and missing values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:42:35 +01:00
Declan Snyder
97d991f7d6 drivers: memc: Add NXP FlexRAM driver
Add driver for NXP FlexRAM

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-13 09:42:28 +01:00
Yuval Peress
3c6e66e5b5 sensors: convert fifo_wm to batch_dur
Having a % FIFO watermark isn't very useful as it doesn't convey how long
the SoC can sleep (or do other work) while batching sensor data. Convert
the attribute to a batch duration using ticks. Currently the ticks are
in system ticks, but eventually when an external clock is attached to
the sensor it will be in the external clock's ticks.

Signed-off-by: Yuval Peress <peress@google.com>
2023-11-10 12:16:46 -06:00
Yuval Peress
94dc05b3f2 sensors: Add streaming APIs
Introduce a streaming API that uses the same data path as the async API.

This includes features to the decoder:
* Checking if triggers are present

Adding streaming features built ontop of existing triggers:
* Adding 3 operations to be done on a trigger
  * include - include the data with the trigger information
  * nop - do nothing
  * drop - drop the data (flush)
* Add a new sensor_stream() API to mirror sensor_read() but add an
optional handler to be able to cancel the stream.

Signed-off-by: Yuval Peress <peress@google.com>
topic#sensor_stream
2023-11-10 12:16:46 -06:00
Andrei Emeltchenko
d817a8ebff drivers: timeaware_gpio: Fix include path
Fixes CI after syscall_handler changes path.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-10 14:40:55 +02:00
Andrei Emeltchenko
1f03bad7cb doc: edac: Separate Optional and Mandatory APIs
Make documentation more readable by separating API with help of @name
instead of simple comment in the code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-10 10:41:14 +01:00
Andrei Emeltchenko
44e4425ef7 doc: edac: Do not include hidden API
Exclude hidden API marking them with INTERNAL_HIDDEN.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-10 10:41:14 +01:00
Andrei Emeltchenko
f776188344 doc: smbus: Make smbus fully api covered
Add file description for full API coverage.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-10 10:41:14 +01:00