Commit graph

15409 commits

Author SHA1 Message Date
Andrzej Głąbek
7a2ce2882a drivers: clock_control: Add support for nRF54H20 clock controllers
Add custom clock_control API for nRF platforms that allows requesting
clocks with specified minimal required attributes (accuracy, precision,
and frequency). Provide an implementation of this API for FLL16M, HFXO,
HSFLL, and LFCLK controllers in the nRF54H20 SoC.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-09-05 17:00:24 -04:00
Rubin Gerritsen
fe72c4b447 Bluetooth: Document parallel scanner and initiator param selection
When scanning and connecting in parallel with
CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL enabled, a Bluetooth controller
may choose different scheduling approaches based upon the provided
parameters.

Nordic's SoftDevice Controller performs better when both roles
use the same scan window and scan interval. To help customers
choosing the right configuration, this should be documented.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-09-05 12:56:35 -05:00
Jakub Michalski
0cf726b8ef arch/x86: multiboot: add bootargs support
Add bootargs support for multiboot. This
implements get_bootargs() when multiboot and
bootargs are selected in config.

Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-09-05 12:30:39 -05:00
Luis Ubieda
3efc69ebd3 spi: rtio: Add default iodev_submit handler
To emulate SPI RTIO behavior for drivers that do not have native
support yet.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-09-05 11:44:32 -05:00
Adrian Friedli
afcc13a084 net: fix compiler warning -Wtype-limits
Move the lower bounds check of the enum value to a BUILD_ASSERT and make
sure the enum type is an unsigned integer.

Signed-off-by: Adrian Friedli <adrian.friedli@husqvarnagroup.com>
2024-09-05 11:31:30 -05:00
Emil Gydesen
57b35e1047 Bluetooth: TBS: Allow multiple callbacks for client
The TBS client callbacks are just informative so we
provide the information to multiple listeners.

To support this for the long strings, the function
handle_string_long_read was refactored.

This also allows for multiple users of the TBS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-05 12:24:47 +01:00
Yuval Peress
8974c248cf rtio: Add default i2c submit handler
Use the RTIO work queue to fake the i2c submit calls for drivers which
haven't yet implemented the API. Applications can change the size of
the work queue pool depending on how much traffic they have on the buses.

Signed-off-by: Yuval Peress <peress@google.com>
2024-09-04 21:28:26 +02:00
Lucien Zhao
62e5805c57 drivers: sensor: mcux_acmp: update mcux_acmp drivers
add MCUX_ACMP_HAS_HYSTCTR macro to adapt feature if IP
don't exist HYSTCTR bit

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-09-04 21:27:28 +02:00
Nicolas Pitre
ef30aa8626 arm64: linker: leave app_smem before .data
Commit 87f68b4dfe ("arm64: linker: move data section between rodata
and bss") moved .data up a little too far. Keep app_smem in front of it
otherwise user memory partitions end up in general .data with no user
permissions.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-04 21:25:56 +02:00
Attie Grande
e6dc930322 bindesc: Add support for the build version values
This patch adds bindesc support for the build version values for the
kernel and application - BUILD_VERSION and APP_BUILD_VERSION.

The kernel's BUILD_VERSION can be overridden at build time.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-09-04 07:03:47 -04:00
Tomasz Moń
aa6319dcfd usb: device_next: msc: Allow user to sort LUNs
Modify USBD_DEFINE_MSC_LUN() to take in separate id by which the LUNs
are sorted. Previously the disk name itself was implicitly used as a
sorting key. This is a breaking change to Experimental API.

Another advantage of splitting the sorting id from disk name is the
ability to use KConfig symbols as disk name. Currently the MMC disk
driver uses KConfig symbol CONFIG_MMC_VOLUME_NAME.

Mark LUN definitions as static const because the LUNs are ending up in
ITERABLE_SECTION_ROM().

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-04 07:03:06 -04:00
Mykyta Poturai
745c9543c6 xen: Make XEN_INTERFACE_VERSION configurable
Add Kconfig option to specify Xen interface version to use. This will
make it easier to switch between different versions of Xen.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
2024-09-04 12:52:16 +02:00
Jordan Yates
08a7808000 zbus: separate clang-format control comments
Add a line of whitespace between `/* clang-format off */` comments and
the first line of doxygen comment blocks. Some intellisense parsers
will combine all sequential comment blocks when providing code context.
This results in the control comment appearing in the help text for
`ZBUS_CHAN_DEFINE`, for example.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-09-04 12:52:01 +02:00
Jordan Yates
1ed77cb50c zbus: remove unneeded const qualifiers
Remove `const` qualifiers on fields in structures that are only created
or instantiated as `const`.

This if primarily for consistency, in the same way that `struct device`
fields and `device->config` struct fields are not additionally marked as
`const`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-09-04 12:52:01 +02:00
Benjamin Cabé
1858c1512a include: cbprintf: drop deprecated CBPRINTF_PACKAGE_COPY_* macros
Commit bb74b4f028 deprecated a few
CBPRINTF_PACKAGE_COPY_* macros. This drops them and calls out the
change in the release notes.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-04 09:54:32 +02:00
Maciej Panek
62df6108c7 net: l2: ethernet: check if the dev->api->get_capabilities method not NULL
Adds missing checks for get_capabilities method not being NULL.
Fixes crash with netusb and possibly other drivers.

Signed-off-by: Maciej Panek <panekmaciej@outlook.com>
2024-09-04 09:53:20 +02:00
Nicolas Pitre
87f68b4dfe arm64: linker: move data section between rodata and bss
Having .data after .bss creates a big empty gap in zephyr.bin to provide
proper offset for the data section. Reversing them allows for dropping
.bss from zephyr.bin's output as it is typically done, saving precious
flash memory space.

For demonstration purpose, let's consider those changes:

|--- a/samples/hello_world/src/main.c
|+++ b/samples/hello_world/src/main.c
|@@ -6,9 +6,12 @@
|
| #include <stdio.h>
|
|+int dummybuf[1024 * 1024];
|+
| int main(void)
| {
| 	printf("Hello World! %s\n", CONFIG_BOARD_TARGET);
|+	dummybuf[0] = 42;
|
| 	return 0;
| }

Before this commit:

$ ls -l build/zephyr/zephyr.bin
-rwxr-xr-x 1 nico nico 4561908 Aug  2 15:13 build/zephyr/zephyr.bin*

After this commit:

$ ls -l build/zephyr/zephyr.bin
-rwxr-xr-x 1 nico nico 37028 Aug  2 15:17 build/zephyr/zephyr.bin*

While at it, remove some more repetitive comments with no value.
Also defaults CONFIG_LINKER_LAST_SECTION_ID to n as it otherwise screws
everything up for the same reason as above.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-03 14:40:01 +01:00
Emil Gydesen
0e4e7628fd Bluetooth: CAP: Add check for streaming state when starting unicast
When calling bt_cap_initiator_unicast_audio_start on a set of streams
that are all in the streaming state we return early with -EALREADY.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-03 10:43:59 +02:00
Emil Gydesen
8b8f727761 Bluetooth: BAP: Add support for reconfiguring unicast group
This allows applications to modify the values set by an
existing unicast group, assuming that none of the streams in
the CIG has been connected.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-03 10:43:53 +02:00
Yong Cong Sin
3754bb27f8 Revert "arch: riscv: ARCH_STACK_PTR_ALIGN should be 4 for RV32E"
This reverts commit 87b95be52a.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-02 12:33:36 -04:00
Guennadi Liakhovetski
dd50ff5585 llext: add dependencies
When an LLEXT object uses symbols of another such object, it depends
on it. Such dependencies have to be tracked to prevent their
accidental unloading. Ideally we should be able to track arbitrary
numbers of such dependencies, but this is a bit difficult. In this
first implementation we use a fixed-size array, currently consisting
of 8 entries.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-02 12:31:52 -04:00
Guennadi Liakhovetski
c5e305fce6 llext: fix flag evaluation for section grouping
When deciding which sections to group together, only the low 3
section attribute bits are relevant, ignore the rest.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-02 12:31:52 -04:00
Guennadi Liakhovetski
bd09a5c739 llext: make EXPORT_SYMBOL() universal
Currently LLEXT has two ways to export symbols:
EXPORT_SYMBOL() to exort symbols from the main firmware to extensions
LL_EXTENSION_SYMBOL() to export symbols from extensions
but it is possible to write code, that needs to export symbols
regardless of whether it is built into the main image or an
extension. And in fact there's no real need in two distinct macros -
we can use one for both cases and recognise at build time which
direction exporting is happening. This patch extends EXPORT_SYMBOL()
to also work from extensions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-02 12:31:52 -04:00
Simen Eilevstjønn
2c64fe7f37 Bluetooth: Implemented new DIS characteristics
Implemented new DIS characteristics:
    - UDI for medical devices
    - IEEE 11073-20601 Regulatory Certification Data List
    - System ID

Also fixed buffer overflow bug when assigning too long DIS string literals

Signed-off-by: Simen Eilevstjønn <simen.eilevstjonn@laerdal.com>
2024-09-02 12:00:52 +02:00
Jordan Yates
559f58b710 rtio: add helper function rtio_sqe_prep_callback_no_cqe
Add a helper function that constructs a callback operation that doesn't
generate a completion queue event.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-30 09:06:36 +02:00
Jordan Yates
597ed491c7 battery: support additional properties
Support additional properties from the linux `battery.yaml`.

The `ocv-capacity-table-0` definition differs from the Linux version as
we do not have a good way to generate variable length arrays in our
config structs, or a good way to separate out the percentage vs voltage
in the mapping.

We reduce the flexibility by enforcing a step size of 10%, which removes
the need for the percentage to be in the array and solves the variable
length problem.

To simplify the effort of defining these voltage curves, default curves
for a variety of chemistries have been added, extracted from datasheet
graphs of discharge curves from reputable manufacturers.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-29 16:12:36 -04:00
Jordan Yates
5cb2e019de math: interpolation: linear interpolation
Add linear interpolation function that respects floating point rounding
rules (away from zero).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-29 16:12:36 -04:00
Anuj Pathak
7e1dc5ae3e bluetooth: services: hrs: added control point write callback
- HRS control point was added to server but no write callback is
defined, this causes issues if control point characterstic is
written by the client

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-29 16:12:12 -04:00
Marcio Ribeiro
902104d795 drivers: i2s: esp32s3/esp32c3
i2s support added for esp32s3 and esp32c3

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-08-29 18:06:23 +02:00
Raffael Rostagno
ba078b4032 pinctrl: esp32c2: Add LEDC config
Add LEDC pinctrl configuration for ESP32C2/ESP8684

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-29 18:05:12 +02:00
Peter van der Perk
44f7928ecf clock: mcux_ccm: add flexio clock
Adds flexio1 and flexio2 clock definitions to get the clock rate

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2024-08-29 18:04:56 +02:00
Fabian Blatz
6ae753f5bd drivers: stepper: Fix missing _driver_api suffix
The gen_kobject_list.py script expects the __subystem declaration to end
with _driver_api. Adjust the stepper api and existing driver implementation
accordingly.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-08-29 18:03:01 +02:00
Efrain Calderon
ce9bf1071e devicetree: introduce DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY
Add a new macro, DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY
name, evaluates to 1 if any enabled instance of `compat` has the
property or to zero if it hasn't.

This macro can be useful in drivers for a family of devices.

Signed-off-by: Efrain Calderon <efrain.calderon.estrada@gmail.com>
2024-08-29 15:55:14 +02:00
Vit Stanicek
5d8b5c0188 api: codec: Extend API
Add sample rates. Add dai_route_t enum to allow codec configuration for
duplex operation. Allow for audio inputs to be controlled. Add functions
for signal routing.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2024-08-29 15:53:26 +02:00
Vit Stanicek
673b3db80a drivers: clock_control_mcux_syscon: Add I2S MCLK
Add support for the I2S MCLK signal (provided by CLOCK_GetMclkClkFreq).

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2024-08-29 15:53:26 +02:00
Anuj Pathak
957d59814b bluetooth: services: added current time service
- added ctc implementation
- updated Kconfig & CMake files
- updated service doc

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-29 11:38:28 +02:00
Anuj Pathak
836514c9dd sys: timeutil: expose and use macro for base year
timeutil internally uses 1900 as base year for calculation,
that is hidden from caller context. Thus declared a macro in
the public header file, and uses that macro will let caller adjust the
calulations accordingly.

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-29 11:38:28 +02:00
Nicolas Pitre
cfaaf0135a sys_clock.h: remove deprecated sys_clock_timeout_end_calc()
No one has used this for a while.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-08-29 11:38:11 +02:00
Benedikt Schmidt
c9c0c4fc2f include: zephyr: drivers: gpio: add include guard to gpio_intel.h
Add an include guard to gpio_intel.h

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-08-29 11:37:38 +02:00
Benedikt Schmidt
38bce0a534 include: zephyr: drivers: gpio: add missing C-linkage in headers
Add missing extern "C" statements in headers for GPIO drivers.
Fixes #77605.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-08-29 11:37:38 +02:00
Dominik Lau
74e84a9dfd drivers: input: common properties parsing for touchscreen drivers
Adds a way of reporting touchscreen events
taking common properties into account.

Signed-off-by: Dominik Lau <dlau@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-08-28 14:02:43 -04:00
TOKITA Hiroshi
37b24ab8b9 driver: clock_control: renesas_ra: Defining MSTP regs in devicetree
Allows MSTP register addresses to be changed in the device tree
to support different configuration SoCs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-08-28 06:51:25 -04:00
Daniel Leung
d26b7d4ed1 debug: thread_analyzer: display privileged stack usage
This adds the bits to display privileged stack usage for
architectures that support obtaining this information.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-08-28 06:50:30 -04:00
Lucas Tamborrino
5dc545290c soc: espressif: psram as shared multi heap
Currently, if the user wants to allocate heap on external RAM
he needs to enable CONFIG_ESP_SPIRAM and set a threshold defined
with CONFIG_ESP_HEAP_MIN_EXTRAM_THRESHOLD.

This approach requires that we re-implement `k_malloc` and allocate
the memory on the proper region based on the block size.

By using the shared multi heap feature the proccess of allocating
memory from external memory becomes more fluent and simple.

The attribute SMH_REG_ATTR_EXTERNAL was added to reference the
external memory.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-08-27 18:37:47 -04:00
Ian Morris
a329a0c09f drivers: sensor: tmp116: Add ability to set operating mode of TMP116/7
Adds support for setting the operating mode of the TMP116/7 sensor to
either shutdown, continuous conversion or one-shot mode.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-08-27 15:14:59 -04:00
Emil Gydesen
f1b182b585 Bluetooth: Mesh: Move testing.h to mesh subsys instead of include
The file is only ever used by mesh and it is even stated in the
header of the file that it is internal APIs.

The include file has been merged with the host testing.h file
as that was mesh specific as well. Similarly the testing.c
file was also moved

This is part of a process to clean up the file structure of
Bluetooth as it's a bit messy, which is evident from the
MAINTAINERS.yml file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-27 15:14:08 -04:00
Mariusz Dziębowski
b7bf2091f8 zbus: fix error on ZBUS_CHAN_DEFINE
There appear error on `ZBUS_CHAN_DEFINE` when `CONFIG_CPP`
is enabled. Error: `zephyr/zbus/zbus.h:352:9: error: designator
order for field 'zbus_channel_data::highest_observer_priority'
does not match declaration order in `zbus_channel_data`.

Solution: change order in `ZBUS_CHAN_DEFINE` macro according
to zbus_channel_data structure.

Signed-off-by: Mariusz Dziębowski <mdziebowski@meden.com.pl>
2024-08-27 10:51:15 -04:00
Mathieu Choplain
e4a7c0f9ce drivers: intc: stm32: rebrand EXTI API to be hardware-agnostic
This commit rebrands the STM32 EXTI API to a more hardware-agnostic
"GPIO interrupt controller" API, in anticipation of the introduction of
new series lacking the EXTI peripheral. The GPIO and EXTI drivers are
updated to match the rebranded API.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
5cd274ce48 drivers: intc: stm32: make stm32_exti_line_t opaque
This commit makes the contents of the stm32_exti_line_t data type opaque to
the EXTI GPIO interrupt controller API users. The GPIO driver is updated
to comply with this API change.

N.B.: while some assertions are removed as part of this commit, they were
broken since forever anyways, so nothing of value is lost.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00
Mathieu Choplain
0551825ca3 drivers: gpio: stm32: move EXTI line port configuration to proper driver
Move the functions that interact with EXTI configuration registers to
select or get the GPIO port that triggers events on a given EXTI line
to the EXTI driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-27 10:50:39 -04:00