Commit graph

15409 commits

Author SHA1 Message Date
Daniel Flodin
9c5fda3e11 include: kernel: arch: sys: Use new TLS macro
PR #78645 replaced uses of the GNU keyword `__thread` with a new macro
`Z_THREAD_LOCAL` which expands to correspond C/C++ standard keyword if
applicable, else it falls back to `__thread`.

This PR addresses some missed replacements in headers files for #78645.

Signed-off-by: Daniel Flodin <daniel.flodin@iar.com>
2024-10-05 14:06:26 -04:00
Mykhailo Lohvynenko
03029e7bd7 json: support parsing and serializing 'uint64_t'
Introduce support for 'uint64_t' type, so that unsigned numbers
can be serialized into JSON payloads.

Signed-off-by: Mykhailo Lohvynenko <Mykhailo_Lohvynenko@epam.com>
2024-10-05 14:04:48 -04:00
Fabio Baltieri
09a643ee2c devicetree: make DT_..._REG_SIZE return unsigned
Simiarly to f98fde07b3, make the SIZE macros return unsigned literal
values.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-10-04 13:23:23 -05:00
Aleksander Wasaznik
357427aee5 Bluetooth: GATT: Remove note on flow-control from `bt_gatt_write_without
It's not clear what this note is trying to convey. I assume it's
outdated.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-10-04 16:35:51 +01:00
Luca Burelli
17be7ffca5 device.h: fix inconsistent semicolon logic for DEVICE_DT_DEFINE
When CONFIG_LLEXT_EXPORT_DEVICES is not enabled, the DEVICE_DT_DEFINE
macro ends with the contents of the Z_DEVICE_DEFINE macro, which always
includes a terminating semicolon.

When CONFIG_LLEXT_EXPORT_DEVICES is enabled, the macro ends with
Z_DEVICE_EXPORT, which does _not_ include a terminating semicolon. This
leads to a syntax error in places where the DEVICE_DT_DEFINE macro is
used without it.

Fix this by adjusting the added code when CONFIG_LLEXT_EXPORT_DEVICES is
enabled to include a semicolon after the Z_DEVICE_EXPORT macro; also use
the opportunity to remove a stray backslash.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-10-04 16:35:18 +01:00
Olivier Lesage
9e3943d13e bluetooth: host: Add CONFIG_BT_CHANNEL_SOUNDING_TEST
Makes it easier to make sure the CS test code is removed if desired.
It should hopefully allow for a clean split in general.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-04 16:34:45 +01:00
Olivier Lesage
a12b869eac bluetooth: host: Add support for processing CS subevent results
Adds support for:
- LE CS Subevent Result event
- LE CS Test End Complete event

For now, recombination of subevent results with more steps than could
fit within a single HCI event is not supported, and such events
are discarded.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-04 16:34:45 +01:00
Emil Gydesen
dc97bbd35f Bluetooth: Audio: Rename bt_audio_codec_qos -> bt_bap_qos_cfg
The QoS structure is not related to a codec, but rather a
stream, and should thus not use the "Codec" name.

The BAP and ASCS specs refer to the QoS as
"QoS configuration" several places, so it is an obvious
choice for a name.

Since the structure is defined and used by BAP, the prefix
was changed from bt_audio to bt_bap.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-04 16:34:22 +01:00
Eric Ackermann
5275d44409 llext: Add RISC-V arch-specific relocations
This commit introduces architecture-specific ELF relocations for RISC-V,
in accordance with the RISC-V PSABI specification:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc
Also, the necessary compiler configurations for compiling LLEXT
extensions on RISC-V are added, and the llext tests are executed on
RISC-V targets.
Calling llext extensions from user threads in RISC-V is still
unsupported as of this commit.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2024-10-03 21:59:42 +01:00
Seppo Takalo
73a3438b82 net: lwm2m: Remove hostname_verify flag from context
Use security mode (PSK or X509) to detect if we should
set the socket option to verify hostname.

PSK security mode cannot verify hostnames as this information
is coming in the certificate, so don't set the options.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-10-03 17:09:32 +01:00
Robert Lubos
2e1d89619f net: Avoid compiling native network stack parts w/o NET_NATIVE
In case NET_NATIVE is disabled, certain network stack components do not
need to be compiled. Otherwise, they could throw errors if
--no-gc-sections compiler options is enabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-10-03 17:08:29 +01:00
Chris Friedt
5d29e13e09 sys_sem: add a for-loop-like macro similar to spinlocks
Add SYS_SEM_LOCK() and SYS_SEM_LOCK_BREAK which are mostly the
same as K_SPINLOCK() and K_SPINLOCK_BREAK.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-03 17:07:05 +01:00
Yong Cong Sin
52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Yong Cong Sin
5aebd1276d devicetree: add DT_NODE_HAS_STATUS_OKAY
We already have `DT_HAS_COMPAT_STATUS_OKAY` and
`DT_NUM_INST_STATUS_OKAY`, it seems intuitive to assume that
`DT_NODE_HAS_STATUS_OKAY` exists, so much so that it was used
before it's implemented.

This patch implements `DT_NODE_HAS_STATUS_OKAY`, which is
equivalent to: `DT_NODE_HAS_STATUS(<node_id>, okay)`

Added test for it in `tests/lib/devicetree/api`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Andrew Sonzogni
70de35d9c9 drivers: sensor: lis2dw12: add inactivity detection
Add inactivity mode or stationary detection

Signed-off-by: Andrew Sonzogni <andrew@safehear.fr>
2024-10-03 11:41:51 +01:00
Yong Cong Sin
c710f8892b drivers: intc: plic: implement irq affinity configuration
- Implement irq-set-affinity in RISCV PLIC.
- Added new affinity shell command to get/set the irq(s)
  affinity in runtime, when `0` is sent as the `local_irq`, it
  means set/get all IRQs affinity.
- Some minor optimizations

Updated the build_all test to build this new configuration.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 13:48:05 -05:00
Pieter De Gendt
476c12fdde include: zephyr: net: coap_service: Use _CONCAT expansion
Passing MACRO arguments that need expansion require _CONCAT.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-02 13:44:42 -05:00
Lyle Zhu
c0ce5b419b Bluetooth: Host: smp: Add function to get bonding setting
Add a function bt_get_bondable to get the bonding setting.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-10-02 15:54:30 +02:00
Håvard Reierstad
0fe6d34f8a Bluetooth: Mesh: Remove duplicate brg declaration
Removes duplicate declaration of the bridging direction, keeping the
one in the public header file.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-10-02 14:54:13 +01:00
Håvard Reierstad
8049c24994 Bluetooth: Mesh: Add prefix to Subnet Bridge API
Adds the `bt_mesh_brg_cfg` prefix to the public Subnet Bridge API, and
aligns the function and callback naming with the rest of the Bluetooth
Mesh API.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-10-02 14:54:13 +01:00
Johann Fischer
35c9e54961 include: usb_ch9: add note about USB_CONTROL_EP_MPS
This value may not be correct for devices operating at speeds other than
high speed.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-10-02 14:54:04 +01:00
Luca Burelli
aeec014cbe llext: rename symbol struct identifiers
This patch renames the identifiers for the structs in the LLEXT symbol
tables to have a prefix of "__llext_sym_". This is done so existing
scripts like gen_device_deps.py do not confuse them with the object
they are referring to.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-10-02 14:42:37 +01:00
Fabio Baltieri
f98fde07b3 devicetree: make DT_..._REG_ADDR return unsigned
`DT_..._REG_ADDR` macros do not always return an unsigned value. This
commit adds and unsigned 32bit prefix to ensure the value is always
unsigned.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-10-02 14:41:32 +01:00
Alberto Escolar Piedras
71afbaf66e irq_multilevel: explicitly initialize all members to avoid a warning
As this is a header, let's explicitly initialize all members of the
struct to avoid a "missing initializer for member" warning in case the
file is built with -Wmissing-field-initializers, or worse, that warning
set to be an error.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-02 15:03:25 +02:00
Mirko Covizzi
5742b27078 ipc: icmsg: fix typo
Fix typo in header.

Signed-off-by: Mirko Covizzi <mirko.covizzi@nordicsemi.no>
2024-10-02 10:09:09 +02:00
Yong Cong Sin
8bfdff3cb1 irq: multilevel: add API to increment a multilevel IRQ
Unlike a normal IRQ, a multilevel IRQ can't be incremented by
simply `irq++`, as that would always increment the L1 of a IRQ,
regardless of its level. A function that understands the level
for which the IRQ operates in is required.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
4b2f5c7de2 irq: multilevel: avoid manipulations with bits by using union type
Use a union struct to partition the bits in a
multilevel-encoded interrupt number instead of manipulating
the bits manually, which is tedious and error prone.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
3fa7d783d6 irq: multilevel: allow to APIs to always work
When `CONFIG_MULTI_LEVEL_INTERRUPTS` is enabled, bits in a
`uint32_t` is always partitioned into 3 levels, we can safely
remove the `CONFIG_*_LEVEL_INTERRUPTS` checks so that the
APIs always works.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
cb6417cff4 irq: multilevel: fix irq_parent_level_3()
The IRQ for level 1 and above is incremented by 1 when encoded
with Zephyr's multilevel IRQ scheme, so it should be
decremented by 1.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Lyle Zhu
832753b80c Bluetooth: BR: Change the type of resolving to bool
The `resolving` is used to flag the status that the stack is requesting
remote device name.

It is better to use the type `bool` instead of the original type
`uint8_t`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-10-02 10:05:32 +02:00
Lyle Zhu
b1dc7ff242 Bluetooth: BR: Optimize _priv of struct bt_br_discovery_result
Move `struct discovery_priv` to classic.h

Rename `struct discovery_priv` to `struct bt_br_discovery_priv`.

Modify the structure `struct bt_br_discovery_priv` with `@private`.

Change field `_priv` of `struct bt_br_discovery_result` from
`uint8_t _priv[4]` to `struct bt_br_discovery_priv _priv`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-10-02 10:05:32 +02:00
Lyle Zhu
f670e3a52f Bluetooth: Classic: Remove callback from bt_br_discovery_start
Remove BR discovery callback from bt_br_discovery_start.

All discovery results will be notified through callback
registered by bt_br_discovery_cb_register.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-10-02 10:05:32 +02:00
Lyle Zhu
b0258c919d Bluetooth: classic: Move classic source to sub folder
Move source code of classic from bluetooth.h to
./classic/classic.h.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-10-02 10:05:32 +02:00
Lyle Zhu
d0f5b6c351 Bluetooth: BR: Add listener cb for discovery
The results of inquiry and extended inquiry
are only reported from application level
after the inquiry complete event notified.

While the event of inquiry result is notified
by controller in real time.

It is not a good user experience.

Just like scanning of LE, add a listener
cb for discovery.

When the event of inquiry result, extended
inquiry result, or remote name request
complete notified, call listener `recv`
cb to notify the upper layer.

When the event of inquiry complete
notified or no pending of remote name
request , call listener `timeout`
cb to notify the upper layer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-10-02 10:05:32 +02:00
Andrew Davis
be4a4ee324 ipc: ipc_service: Remove intermediate metal generic device
A libmetal "generic" device is created, then opened and used for its IO
regions. Since we are adding these IO regions in the first place there
is no reason for this layer of indirection.

Signed-off-by: Andrew Davis <afd@ti.com>
2024-10-02 10:04:59 +02:00
Andries Kruithof
8295deb966 Bluetooth: Audio: CAP implement broadcast reception stop
Implement the CAP broadcast reception stop procedures and
add unit tests

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-10-02 09:59:23 +02:00
Jordan Yates
5bd53b6e2e uart: update meaning of uart_irq_tx_ready return code
Update the documented value range that `uart_irq_tx_ready` returns in
order to provide more information to the callers about the number of
bytes that could be writted with `uart_fifo_fill` without fragmentation.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-02 09:56:45 +02:00
Daniel Flodin
f8299b66eb include: types.h: toolchain.h: Move TLS macro definition
Move the `Z_THREAD_LOCAL` macro from
`include/zephyr/toolchain/common.h` to `include/zephyr/types.h`.

This is needed since some `syscall.h` files are using TLS but aren't
including `zephyr/toolchain.h` (but they are including
`zephyr/types.h`).

Signed-off-by: Daniel Flodin <daniel.flodin@iar.com>
2024-10-01 10:46:10 +01:00
Krzysztof Sychla
5d76b563ea arch: Add Cortex-R8 support
Enable Cortex R8 support, similar to Cortex-R5.

Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
Signed-off-by: Marek Slowinski <mslowinski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-10-01 09:58:22 +02:00
Emil Gydesen
fa4f2ffc47 Bluetooth: CAP: Add support for doing just disable for unicast stop
The unicast_stop function is changed to primarily do a
BAP disable instead of a release, with optional
support for releasing the streams once they have been disabled.

This also adds unittests for the procedure which also
allow us to remove the invalid param testing from the BSIM tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-01 09:54:04 +02:00
Florian Grandel
6733efdc84 arch: x86: ia32: linker.ld: add missing DT sections macro
Generating sections via DT memory attributes did not work for the
platform as only the memory region was created so far.

This change adds the DT_LINKER_SECTION() macro to the linker script so
that the appropriate sections will be generated, too.

Fixes #79085

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-10-01 09:47:15 +02:00
Ryan McClelland
901044f1e7 drivers: i3c: add ccc setbuscon
Add helpers and defines for the i3c ccc setbuscon.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-30 16:56:04 -05:00
Aksel Skauge Mellbye
bda8ae8c3f drivers: clock_control: silabs: Add clock control driver
Add clock control driver for Silicon Labs Series 2 and newer.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-09-30 17:12:01 +01:00
Aksel Skauge Mellbye
46367ff15a sys: util: Make FIELD_* available from device tree
Move FIELD_* macros from zephyr/sys/util.h to zephyr/sys/util_macro.h,
as zephyr/sys/util.h cannot be used from device tree.

Device tree uses zephyr/dt-bindings/dt-util.h, which includes
zephyr/sys/util_macro.h.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-09-30 17:12:01 +01:00
Gerard Marull-Paretas
740eba1341 pm: device: allow optional support of TURN_ON action
Some devices, e.g. SoC level devices like I2C peripheral, can never be
powerd off as they are always energized. Such devices can only go from an
active state or to a low power state (suspended). Allow them to simply
return -ENOTSUP when called with TURN_ON (or TURN_OFF).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-09-30 17:11:20 +01:00
Gero Schwäricke
d411421a2b input: fix missing namespace prefix for named input callbacks
Using INPUT_CALLBACK_DEFINE_NAMED would not add the _input_callback__
prefix to the given callback name. This can result in namespace clashes.

Signed-off-by: Gero Schwäricke <gero.schwaericke@posteo.de>
2024-09-30 12:10:29 +01:00
Simon Maurer
4ce6a217d8 arm: cortex_a_r: rom_start relocation configuration
This commit makes the rom_start relocation introduced in
commit 8ef8e8b497 available for Cortex-A/R CPUs.

Signed-off-by: Simon Maurer <mail@maurer.systems>
2024-09-29 21:22:23 +02:00
Guennadi Liakhovetski
c6bf743df2 LLEXT: add support for detached sections
Some LLEXT objects can include sections, that should not be merged
with other sections of the same type. E.g. when such sections should
be placed into locations, other than the default. Add support for
such sections.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-29 21:21:24 +02:00
Guennadi Liakhovetski
43a69f868b llext: make llext_loaded_sect_ptr() available to all LLEXT code
Make llext_loaded_sect_ptr() a proper function to be able to call it
from platform LLEXT code.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-29 21:21:24 +02:00
Chandler Keep
a9be21038e drivers/pinctrl.h: Resolve PINCTRL_DT_STATE_INIT Cpp Compatibility
This commit adds C++20 onwards support for the
PINCTRL_DT_STATE_INIT macro. Since C++20, support was
added for designated initializers but with the restriction that
they're ordered. PINCTRL_DT_STATE_INIT initializes a
pinctrl_state struct but the current initializer list is un-ordered,
this PR resolves that for >= C++20 compat

Signed-off-by: Chandler Keep <chandlersamkeep@gmail.com>
2024-09-28 08:22:36 -05:00