Commit graph

15409 commits

Author SHA1 Message Date
Jonathan Rico
e1ac3866ee Bluetooth: L2CAP: document memset requirement
The `struct bt_l2cap_le_chan` and `struct bt_l2cap_br_chan` objects
should be memset before passing them to the stack.

This was not stated anywhere, but all the in-tree users are doing it, so
it must be API.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-13 18:18:34 -04:00
Emil Gydesen
7331b071eb Bluetooth: Audio: Fix double "not" in bcast immediate get
The description of ENODATA had an extra "not".

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-13 18:17:51 -04:00
Marcin Niestroj
878640fa08 json: support parsing and serializing 'int64_t'
Up to now there was only support for parsing/encoding 32-bit integer
numbers, with no support for larger ones.

Introduce support for 'int64_t' type, so that large numbers can be
serialized into JSON payloads.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-08-13 14:58:06 +02:00
Aleksander Wasaznik
5783d4873a Bluetooth: GATT: Document bt_gatt_attr
Improve the documentation of `bt_gatt_attr`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-08-13 14:57:26 +02:00
Krzysztof Chruściński
e18254901c logging: When strings are stripped keep source name pointers
90ab94f61d added a change that source name pointers were not stored
in the const data structure associated with a logging source. That was
done because those string pointers were invalid (on purpose pointing to
non-existing memory) and reading those strings could lead to a fault.
However, those pointers are used by scripts which are building the
dictionary database and after this change script was no longer
able to retrieve source names from elf file and database was incomplete.

This patch brings back storing of source name string pointers but in
API for reading those source names guards are added to not return
invalid addresses.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-13 14:56:14 +02:00
Krzysztof Chruściński
530b8ccbed debug: coresight: Add coresight_trace_deformatter
Add module which decodes data encoded using Coresight Trace
Formatter.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-12 19:23:19 -04:00
Manuel Argüelles
2786cb9512 drivers: intc: gic: implement set pending interrupt
Implement a function to set pending interrupts for Arm GIC.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-08-12 15:54:42 +02:00
Jan Peters
b8bef42add device_dt_metadata: handle dt_meta being NULL
Using  DEVICE_DEFINE, a device without a corresponding DT node can be
defined (for example CRYPTO_MTLS), Z_DEVICE_INIT() does not initialize
dt_meta for such devices, leaving the field as NULL.
device_get_dt_nodelabels() and functions calling it have to handle
dev->dt_meta == NULL to prevent fatal errors.

Signed-off-by: Jan Peters <peters@kt-elektronik.de>
2024-08-12 15:54:22 +02:00
Gerard Marull-Paretas
f463e6d88a soc: nordic: pinctrl: rework nordic,clock-enable
Instead of forcing users to provide this setting, allow to describe
which signals require CLOCKPIN enablement at device nodes. This is later
captured by the pinctrl macros and applied in the pinctrl driver. Note
that name has been adjusted to nordic,clockpin-enable to avoid confusion
with clock related settings.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-12 12:58:58 +02:00
Jiafei Pan
f498644106 drivers: eth: phy: add AR8031 PHY driver
Add PHY driver support for Qualcomm AR8031, it can use fixed link
or use auto negotiation.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-08-12 12:43:54 +02:00
Yuval Peress
81f163e6fb i2c: Add/update utility inline functions
- Change the argument for i2c_is_read_op to a const pointer
- Add function i2c_is_stop_op to test if a message has a stop flag.

Signed-off-by: Yuval Peress <peress@google.com>
2024-08-09 08:40:51 -04:00
Matt Rodgers
d28080e277 doc: fix code samples in dns_sd documentation so that they compile
Macros for registering TCP and UDP services accept a port as a number,
not a pointer. Also added missing parameter to UDP service macro, and
missing type of bar_txt

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-08-08 20:23:00 -04:00
Matt Rodgers
9de1342f99 net: dns-sd: include iterable_sections.h header
Service registration macros in dns_sd.h require iterable_sections.h to
compile.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-08-08 20:23:00 -04:00
Ricardo Rivera-Matos
b5a5bddf60 haptics: Introduces support for DRV2605 Haptic Driver
Adds support for the DRV2605 haptic driver.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2024-08-08 15:57:12 +02:00
Ricardo Rivera-Matos
977c70a6c0 haptics: Introduces a haptics API
Introduces a haptics API for use with LRA driver ICs to
create haptic feedback events.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2024-08-08 15:57:12 +02:00
Jordan Yates
2709879c06 spi: expose overrun-character property from dt
Expose the new common property `overrun-character` from the devicetree
nodes, falling back to the `SPI_MOSI_OVERRUN_UNKNOWN` value.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-08 06:17:45 -04:00
Kapil Bhatt
2f088fabc2 net: wifi: Add Current PHY rate
Current PHY rate
It represents the current PHY rate of transfer
of data in bits per second. It will a TX data rate.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-08-07 19:02:32 -04:00
Kapil Bhatt
459a63b137 net: wifi: Add over run count statistics
Over run count
It represents the number of packets dropped either at
received and sent due to lack of buffer memory to retain
all packets on the network interface.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-08-07 19:02:32 -04:00
Yong Cong Sin
87b95be52a arch: riscv: ARCH_STACK_PTR_ALIGN should be 4 for RV32E
Stack alignment for RV32E is 4 bytes

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-07 19:00:53 -04:00
Dawid Niedzwiecki
ff668a6bed libc: newlib: add config to use custom sbrk
Add a config to use the custom _sbrk function, defined by a user.

It is possible that an application doesn't want to use the entire
remaining RAM for the heap.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-08-07 07:25:46 -04:00
Duy Phuong Hoang. Nguyen
0c93268e52 driver: clock: Update clock control driver for RA8
This update is to support clock API for RA8
Move the clock initialize function into clock driver
Peripheral clock now has 2 more property in clock cell for enable
and disable clock to peripheral module

Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-08-07 07:16:45 -04:00
Yiding Jia
eb351436ad drivers: pinctrl: rp2040: oe-override option
This change adds the device tree property for specifying oe-override
(output-enable override behavior), as well as defines for possible values
of the property.

RP2040 GPIOs can be configured to automatically invert the output-enable
signal from the selected peripheral function. This is useful for tasks like
writing efficient PIO code, such as in the i2c example in the rp2040
datasheet.


Signed-off-by: Yiding Jia <yiding.jia@gmail.com>
2024-08-07 07:16:28 -04:00
Derek Snell
2b601fa3a0 drivers: dma: dma_mcux_pxp: Add flip feature
PXP can flip an image in input buffer horizontally, vertically, or both.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-08-07 07:14:20 -04:00
Johann Fischer
5ddaa3b1a1 drivers: udc: add opaque pointer to store upper layer private data
Add an opaque pointer to store upper layer private data and initialize
it with the USB device context during controller initialization. Use the
pointer in event processing to get the correct context.

Fixes commit 48f2a4bc1a
("usb: device_next: remove initialized state checks in event processing")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-08-06 17:17:41 -04:00
Tahsin Mutlugun
910d88741a dts: arm: adi: Add MAX32680 DMA instance and binding file
Add DMA0 node to MAX32680 dtsi file and add binding file for DMA slots.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-08-06 17:16:35 -04:00
Furkan Akkiz
b64c0b829a dts: arm: adi: Add MAX32672 DMA instance and binding file
Add DMA0 node to MAX32672 dtsi file and add binding file for DMA slots.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-08-06 17:16:35 -04:00
Mert Ekren
fd52e38aef dts: arm: adi: Add MAX32670 DMA instance and binding file
Add DMA0 node to MAX32670 dtsi file and add binding file for DMA slots.

Signed-off-by: Mert Ekren <mert.ekren@analog.com>
2024-08-06 17:16:35 -04:00
Furkan Akkiz
53cb59cfc4 dts: arm: adi: Add MAX32690 DMA instance and binding file
Add DMA0 node to MAX32690 dtsi file and add binding file for DMA slots.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-08-06 17:16:35 -04:00
Sadik Ozer
def2dcb70b dts: arm: adi: max32: Add MAX32 DMA driver bindings
Add MAX32 DMA driver bindings and DMA instance for MAX32655 MCU.

Co-authored-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-08-06 17:16:35 -04:00
Gerard Marull-Paretas
5e3188605e drivers: pinctrl: nrf: add support for nordic,clock-enable
Driver will be capable of retrieving such property from DT and apply it
accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 14:32:40 +02:00
Gerard Marull-Paretas
02a30c1c2b dts: bindings: regulator: add nordic,nrf5[2]x-regulator[-hv]
Some Nordic SoCs, like nRF52 contain an internal regulator for the main
SoC supply. Depending on the SoC, the regulator can have multiple
configurations (e.g. single/double stage), which mainly depends on
supporting "high-voltage" mode or not (VDDH pin supply). This patch adds
bindings for nRF5X regulator and nRF52X HV regulator.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 09:17:10 +01:00
Fengming Ye
1640826fc5 net: wifi_mgmt: add hostap DPP support
Add wifi l2 mgmt dpp handlers.
Add wifi subcommand dpp to call l2 mgmt dpp handlers.

DPP l2 handlers will parse params to hostap wpa_cli format args
and send wpa_cli commands to hostap.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-08-05 18:40:17 -04:00
Flavio Ceolin
4eb3db13bc sys: util: Add macro to declare flexible arrays
Flexible arrays are arrays declared without a specific size, e.g:
uint8_t my_array[];

They are widely used as as last member in structs that are dynamically
allocated.

Since C99 they are part of the C standard, but for historical reasons
many places still use an older GNU extension that is declare zero
length arrays.

Although zero length arrays are flexible arrays, we can't blindly
replace [0] with [] because of some syntax limitations. This macro
workaround these limitations while get rid of this non standard
extension.

Using true flexible arrays allows the compiler to calculate the size
of the array better and improve potential issue checking.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-08-05 18:38:42 -04:00
David van Rijn
f65fe18273 net: lwm2m: Fix c++ cupport for lwm2m.h
lwm2m.h was missing the extern "C" block
and it used a forward declaration to an enum,
which is illegal in c++.

Signed-off-by: David van Rijn <david@refractor.dev>
2024-08-05 18:37:59 -04:00
Kapil Bhatt
3d38b5e094 wifi_mgmt: Add new API to reset Wi-Fi statistics
Add a new offload API to reset Wi-Fi statistics from
the Wi-Fi driver.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-08-05 16:29:21 +02:00
Yong Cong Sin
8e1ac56847 lib: posix: mutex: stubs remaining of _POSIX_THREAD_PRIO_PROTECT
Create stub functions for the remaining of
`_POSIX_THREAD_PRIO_PROTECT` option group.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-08-05 11:32:43 +02:00
Yong Cong Sin
0c4870a0f0 lib: posix: mutex: implement pthread_mutexattr_setprotocol
Implement and test `pthread_mutexattr_setprotocol()`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-08-05 11:32:43 +02:00
Ryan McClelland
853f306b83 drivers: i3c: add i3c hdr ddr inline helper func
Add I3C High Data Rate Double Data Rate Mode inline helper functions.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-08-05 11:32:29 +02:00
Yong Cong Sin
2ccfe8202d lib: posix: add stubs for thread-safe grp & pwd functions
Create stubs for getpwnam_r, getpwuid_r, getgrgid_r
& getgrnam_r.

These functions are in the _POSIX_THREAD_SAFE_FUNCTIONS
option group.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-08-05 10:17:27 +02:00
Yong Cong Sin
b7ad4c53b0 posix: fs: implement readdir_r
Add implementation for `readdir_r()`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-08-05 10:17:27 +02:00
Aleksandar Stanoev
db9bcdc05e bluetooth: host: Add support for LE Connection Subrating
Adds support for LE Connection Subrating as defined in Core 5.4
Vol 6, Part B, Section 5.1.19.
As this is primarily a controller feature, the host support is mostly
a wrapper around the relevant HCI commands.

Note that subrating provides a new method to update the connection's
peripheral latency and supervision timeout alongside subrating parameters.

Signed-off-by: Aleksandar Stanoev <aleksandar.stanoev@nordicsemi.no>
2024-08-05 10:16:27 +02:00
Robert Lubos
5f43388308 net: coap: Parse more flag in coap_get_block2_option()
Parse the more flag in coap_get_block2_option(), so that the function
can be used not only with requests but also with replies (where the more
flag should not be ignored).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-02 22:12:47 -05:00
Robert Lubos
3902a990e5 net: coap: Fix underlying type for block number
The block number in block1/2 options can be encoded on up to 20 bits
according to RFC 7959, therefore the underlying type used in helper
functions to retrieve the block number should be large enough to hold
the result. Therefore, replace the container for block number with
uint32_t instead of uint8_t.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-02 22:12:47 -05:00
Manuel Argüelles
d2ba31d503 drivers: intc: nxp: convert wkpu to native driver
Convert NXP WKPU to a native driver, all existing functionalities are
retained.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-08-02 15:14:33 -05:00
Manuel Argüelles
db07ff36a6 soc: nxp: s32: fix siul2 instance for input pinmuxing
Split SIUL2 instance index for the MSCR and IMCR registers as required
by some pins. Pinmux macros definitions in hal_nxp must be updated
accordingly.

Fixes #76147

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-08-02 13:41:15 +02:00
Mark Holden
45684a598d coredump: Add config for capturing thread data in core dump
Update core dump file format to support a new section which contains
metadata about threads necessary for debugging.

Define configs to capture that metadata and include it in the dumps
when enabled.

Update documentation to reflect the changes.

Signed-off-by: Mark Holden <mholden@meta.com>
2024-08-02 03:32:09 -04:00
Fabio Baltieri
f3a6454f93 pm: refactor pm_device_driver_init
Refactor pm_device_driver_init code to keep the normal execution path
inline and the early exit branches at a single indentation, this is
commonly done throughout the code base.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-08-02 03:31:17 -04:00
Chris Friedt
91e0a4b9ac misc: move lorem ipsum text to zephyr/misc/lorem_ipsum.h
Instead of duplicating Lorem Ipsum in several places, let's
consolidate in one location.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-08-02 03:31:06 -04:00
Peter Mitsis
8c48665868 kernel: Remove k_thread_priority_set() restriction
Removes the ISR restriction from k_thread_priority_set().
Since the first commit, the routine k_thread_priority_set() has
had a restriction preventing it from being called from within
the context of an ISR. As there does not (any longer) appear to
be a reason why the restriction exists, it is being removed.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-08-02 03:29:55 -04:00
Rubin Gerritsen
d31caf90b5 ring_buffer: Remove duplicate documentation line
No need to have the same documentation line twice.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-08-01 16:49:44 +01:00