Commit graph

15409 commits

Author SHA1 Message Date
Mathieu Choplain
32a1b0cc54 drivers: intc: add STM32WB0 GPIO interrupt controller
Adds a driver for the STM32WB0 series GPIO interrupt controller.
This driver implements the STM32 GPIO INTC API, along with an extension
function used to check if a specific line is available on current board.

This also extends the GPIO INTC API to support level-sensitive interrupts,
as this feature is available on STM32WB0.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-12 10:03:37 +02:00
Mathieu Choplain
20c45fe10a drivers: clock: add STM32WB0 clock control
Add control driver for STM32WB0 series, with support for all clock sources.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-12 10:03:37 +02:00
Mathieu Choplain
fb224d139a include: dt-bindings: add STM32WB0 reset header
Adds the reset controller dt-bindings header for STM32WB0 series.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-09-12 10:03:37 +02:00
Karthikeyan Krishnasamy
20288c254b include: posix: fcntl: add O_TRUNC flags for posix open()
introduction of O_TRUNC flag has conflict with libc flags,
so realtered posix open flags based on the commit
499a633976 ("posix: device_io: use mode argument correctly in open()")

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-09-12 10:02:57 +02:00
Nicolas Pitre
be279d878e arm64: demand_paging: add support for on-demand mappings
This makes ARM64 compatible with K_MEM_MAP_UNPAGED.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Nicolas Pitre
322865773b arm64: mmu: architecture specific hooks for demand paging support
A page table entry used for demand paging is always from the last level
page table and never completely zeroed. Anything else is considered
ARCH_DATA_PAGE_NOT_MAPPED.

Loaded pages use a PTE_PAGE_DESC table entry type. Paged-out pages use a
PTE_INVALID_DESC table entry type and the physical address field is
reused to hold the backing store location token value.

ARCH_DATA_PAGE_ACCESSED corresponds to the AF flag. It is initially
unset and manually set to catch when pages are being accessed and
eventually do something about it.

ARCH_DATA_PAGE_DIRTY corresponds to the lack of the AP_RO flag.
Similarly to the AF flag, pages are initially made read-only to catch
writes.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Fredrik Danebjer
c9da274eb2 Bluetooth: ascs: Add dynamic ASE registration
Added option to set the ASE count through the bap API, making ASE
configuration runtime available. The upper limit of ASEs are still
bound by the Kconfig options set for ASEs.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-09-11 07:41:12 -04:00
Benedikt Schmidt
4b657f7a2c drivers: gpio: implement possible manual reset of PCAL64XXA
Implement an option manual reset of the PCAL64XXA to allow the external
implementation of a retention of the port expander state.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-09-11 09:35:37 +02:00
Yangbo Lu
20cde899bf dts: arm64: nxp: add device tree for i.MX95 Cortex-M7
Added device tree file for i.MX95 Cortex-M7 and added i.MX95
clock ID header file.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-09-11 09:34:04 +02:00
Yong Cong Sin
ee08ebd9ca devicetree: add DT_INST_NUM_IRQS()
Add `DT_INST_NUM_IRQS()` to get the number of interrupt lines
of the current `DT_DRV_COMPAT`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-11 09:30:17 +02:00
Ryan McClelland
e31a96cbda drivers: i3c: add ccc deftgts
Add support the ccc deftgts. This also includes a function to check if
there is a secondary controller on the bus, and will transmit deftgts
after initialization or a hotjoin event.

This also adds dynamic_addr to the config_target in order to retrieve
the currently configured dynamic address to be used with deftgts.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-10 21:52:18 -04:00
Nicolas Pitre
1e4fd23e58 kernel: mmu: install demand mappings for the on-demand linker sections
This sets initial unpaged mappings for __ondemand_func code and
__ondemand_rodata variables. To achieve this, we have to augment the
backing store API.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-10 17:17:30 -04:00
Nicolas Pitre
cbbd8579b8 linker: introduce on-demand linker section tags
This provides __ondemand_func and __ondemand_rodata tags for annotating
functions and read-only data that should be loaded on demand so not to
exhaust all available RAM. The demand paging mechanism will be leveraged
to load so designated code/data as needed and to evict it from memory
when unused.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-10 17:17:30 -04:00
Ryan McClelland
9d345fc447 drivers: i3c: add support for setaasa initialization
Adds a new DTS prop for i3c devices as support for the CCC SETAASA
requires prior knowledge of the target if it supports it according
to i3c spec v1.1.1 section 5.19.3.23.

This will be used as an optimization for bus initialization.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-10 17:17:04 -04:00
Neil Chen
9ee6717125 drivers: syscon: update syscon driver for MCXA156
Add MCXA port and lpuart clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-09-10 12:39:18 -04:00
Neil Chen
f11e4b6b90 drivers: syscon: clang-format syscon driver
clang-format syscon driver

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-09-10 12:39:18 -04:00
Neil Chen
b593e054b1 include: pinctrl: Support MCXA in pinctrl_soc_kinetis_common.h
Add bitfield IBE to support MCXA

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-09-10 12:39:18 -04:00
Tomasz Moń
de8710bf46 usb: device_next: uac2: Handle speed properties
Generate full and high speed descriptors based on UAC2 instance
properties. Fail the build if an instance does not have speed properties
or if the instance with given speed property exceeds the bandwidth
available at the selected speed.

Remove obsolete no longer used macros to determine offsets inside
complete UAC2 descriptors blob. Only speed-specific descriptors arrays
are supported.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-10 14:41:32 +01:00
Yong Cong Sin
26d75ab796 arch: riscv: optionally stores a pointer to csf in struct arch_esf
The callee-saved-registers can be helpful to debug the state of
a core upon an exception, however, currently there's no way to
access that information in user-implemented
`k_sys_fatal_error_handler()`, even though the csf is already stored
in the stack.

This patch conditionally add a `csf` member in the `arch_esf` when
`CONFIG_EXTRA_EXCEPTION_INFO=y`*, which the `_isr_wrapper` would update
when a fatal error occurs before invoking `z_riscv_fatal_error_csf()`.

Functions such as `k_sys_fatal_error_handler()` would then be able
to access the callee-saved-registers at the time of exception via
`esf->csf`.

* For SoCs that select `RISCV_SOC_HAS_ISR_STACKING`, the
  `SOC_ISR_STACKING_ESF_DECLARE` has to include the `csf` member,
  otherwise the build would fail.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-10 11:43:40 +02:00
Shrek Wang
54942ec9a8 net: Add ipv6 prefix mask function
Use the IPv6 unicast address and the prefix-len to get the IPv6
network address.

Signed-off-by: Shrek Wang <shrek.wang@nxp.com>
2024-09-10 11:43:32 +02:00
Margherita Milani
5032f099c6 drivers: sensor: add apds9253 driver
Add all the necessary files to add apds9253 Avago sensor driver.

Sensor available at https://docs.broadcom.com/doc/APDS-9253-001-DS

Signed-off-by: Margherita Milani <margherita.milani@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-09-09 13:56:17 -04:00
Riadh Ghaddab
12a437c4c9 pm: policy: change the policy event handling
Some events needs to be handled with a very low latency constraint.
If the system is in deep sleep, exit latency from this low level state
exceeds sometimes the maximum latency constraint of these events.

Before suspending the system, select which events is happening sooner,
kernel events or normal events.
CPU will be up just before the next event occurs taking into account the
exit latency of the current power state

Change also the policy event API to take as argument absolute time in HW
cycles instead of time in us

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-09-09 13:56:04 -04:00
Pisit Sawangvonganan
d207edb1cf shell: rename shell_xxx_impl wrapper functions to shell_fprintf_xxx
Since the `_impl` naming convention is intended for internal use only,
renaming these functions to the `shell_fprintf_xxx` variant is
more suitable for calls outside the module:
- `shell_info_impl` to `shell_fprintf_info`
- `shell_print_impl` to `shell_fprintf_normal`
- `shell_warn_impl` to `shell_fprintf_warn`
- `shell_error_impl` to `shell_fprintf_error`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-09 13:55:31 -04:00
Emil Gydesen
79fa6b3f54 Bluetooth: ISO: Update includes for ISO files
Updates the includes for ISO file so that it conforms to
IWYU (include what you use).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-09 13:55:20 -04:00
Johan Hedberg
68b8cd6d2c Bluetooth: HCI: Add definition for Bluetooth 6.0
Add a definition for HCI version 6.0, now that the new core specification
version has been released.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-09-09 15:23:25 +03:00
Anas Nashif
e260d03686 init: introduce soc and board hooks
Introduce soc and board hooks to replace arch specific code
and replace usages of SYS_INIT for platform initialization.

include/zephyr/platform/hooks.h introduces the hooks to be implemented
by boards and SoCs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-09 10:07:33 +02:00
Bjarki Arge Andreasen
a28ba1d1a2 drivers: gnss: api: Remove periodic configuration
The GNSS device driver API includes an API for setting the periodic
power configuration at runtime. This API is not used in-tree, and is
antithetical to the pm device subsystem.

The periodic config configures the GNSS to search for a fix for a
given amount of time, then suspend itself for a given amount of time,
and repeat this pattern. The issue with this is that both the
application and the GNSS modem itself can be in a conflicting power
state, where the device is resumed (pm device), but actually suspended.

Applications which wish to periodically resume/suspend the modem, even
in more sophisticated ways like suspended after first fix, can simply
implement this logic, using the pm_device calls and the GNSS callbacks.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-09-09 09:28:45 +02:00
Henrik Brix Andersen
159f7dbbb1 lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.

Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-09-07 11:19:05 -05:00
Jukka Rissanen
6986b1ef71 net: bridge: Overhaul the code to use virtual interfaces
The legacy bridging code prevented normal IP traffic to the
bridged Ethernet interfaces. This is not intuitive and differs
how bridging setup works in Linux. This commit changes that and
creates a separate virtual interface that is doing the actual
bridging. This enables the bridged Ethernet interfaces to work
normally and provide IP connectivity.

How this works in practice:

* User needs to enable CONFIG_NET_ETHERNET_BRIDGE
* User needs to have a device with more than one Ethernet
  interface
* After booting, the net-shell or program API can be used
  to add interfaces to the bridge like this.
     net bridge addif 1 3 2
  where the 1 is the bridge interface index and
  2 and 3 are the Ethernet interface indices.
* The bridging is then finally enabled / started when the
  bridge interface 1 is taken up
     net iface up 1
* If bridged interfaces are removed from the bridge (minimum
  of two interfaces are needed there), then the bridging is
  disabled automatically. The bridge interface stays up in
  this case and can be taken down manually.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-06 18:01:15 -04:00
Emil Gydesen
fc4b21b3e2 sys: atomic: Minor upates to atomic_test* function docs
Minor updates the atomic_test* functions to indicate
that only the get/clear/set part of the functions are
atomic, and not the test part. Also made the wording
and pattern of the functions more similar.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-06 10:46:22 -05:00
Krzysztof Chruściński
09ab0ba20b drivers: misc: coresight: nrf_etr: Add standalone mode
Extend ETR buffer handler to support standalone mode where data from
ETR buffer is decoded and printed in human readable format on UART.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
5b26b21bad logging: Add demultiplexer for log_frontend_stmesp
Add module which demultiplexes stream of log message which are
encoded into STPv2 stream by log_frontend_stmesp. There are 3 types of
messages that can be present in the stream:
- Log message (starts with DMTS32, followed by Dx and closed by FLAG)
- Tracepoint (FLAGTS or DMTS32)
- STM HW event (DMTS8 on 0x80 master and 0x00 channel)

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
89ef8a097b logging: Add Coresight STMESP dictionary-based frontend
Add frontend which is using Coresight STMESP for dictionary based
logging.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
fa8e6d8701 drivers: misc: Add support for coresight STMESP
Add header with STMESP register set and set of inline functions
that can be used to write data to STMESP.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
fc162f74c0 debug: mipi_stp_decoder: Align naming to 2.4 standard
Align naming to STP v2.4. Changing Master to Major.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
e48053fdb5 drivers: serial: async_to_irq: Fix initialization
Callback was set in uart_async_to_irq_rx_enable() which is only called
when RX is enabled. Callback shall be called in the init function.
uart_async_to_irq_init() signature changed to take device as the
input argument instead of data and config for the adaptation layer
(which can be retrieved from the device). Device is needed when
setting a callback during the initialization.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:10 -04:00
Ryan McClelland
6a824079df drivers: i3c: add ccc setaasa helper
Add a function helper for the CCC SETAASA.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
3067b41ccc drivers: i3c: add vendor ccc helpers
Add helper commands for sending Vendor CCCs

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Duy Phuong Hoang. Nguyen
e1f990c176 drivers: flash: Initial support flash driver on EK-RA8M1
Initial commit for flash driver support on board using RA8 MCUs
* drivers: flash: implementation for flash driver on EK-RA8M1
* dts: arm: add device node for flash of EK-RA8M1
* boards: arm: enable support flash driver for ek_ra8m1, update
board documentation

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-09-06 11:28:04 -04:00
Matt Rodgers
0c8bdbc45d net: lib: http_server: allow application to access request headers
Allow application to register certain HTTP request headers to be stored
by the server. These stored headers can then be accessed from a dynamic
resource callback.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-09-06 11:27:37 -04:00
Luca Burelli
af302cd5fe llext: add bringup, teardown, and bootstrap APIs
llext_bringup() and llext_teardown() are intended to be used to call the
extension's own initialization and cleanup functions, respectively. They
are meant to be called by the developer after loading an extension and
before unloading it. The list of function pointers to be called is
obtained via the new llext_get_fn_table() syscall, so that they are
compatible with user mode.

llext_bootstrap() is intended to be used as the entry point for a thread
created to run an extension, in either user or kernel contexts. It will
call the extension's own initialization functions and then an additional
entry point in the same context (if desired). The same function can also
be called directly in the main thread, if only initialization is
required.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-09-06 11:27:15 -04:00
Luca Burelli
04d7e4f490 llext: add support for ELF init/fini arrays
Load the .preinit_array, .init_array and .fini_array sections in ELF
files. These sections are arrays of function pointers that are filled by
the compiler with the addresses of functions that need to be called at
startup or termination by the loader, such as C++ constructors and
destructors.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-09-06 11:27:15 -04:00
Adam Wojasinski
fc114e85dd llext: Add filesystem based extension loader
Added loader allowing to load extensions stored in a filesystem.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-09-06 11:26:09 -04:00
Adam Wojasinski
93ffeced6a llext: Add new methods to loader API
Introducing `llext_prepare()` and `llext_finalize()` APIs
that are invoked and the beginning and the end of the `llext_load()`
function.

The purpose of these functions is to bring possibility of initializing
loader before it is used and uninitialize or clean up when
it is no longer needed. Both functions are optional.

The buffer loader has been aligned to methods introduced in the patch.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-09-06 11:26:09 -04:00
Nicolas Pitre
c692136f21 mmu: introduce k_mem_update_flags()
It is sometimes necessary to modify/update memory permissions on some
pages, especially with LLEXT where some allocated segments have to be
executable.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-06 11:25:54 -04:00
Ryan McClelland
b4d9c9dea6 drivers: i3c: add ccc enttm
Add helper function for the i3c ccc enttm

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:25:24 -04:00
Ryan McClelland
9d2dd99ee8 drivers: i3c: add i3c ccc entas
Add helper functions for the I3C CCC ENTAS0, ENTAS1, ENTAS2, and
ENTAS3.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:24:40 -04:00
Jukka Rissanen
6162bf91bf net: http_server: Clarify the host parameter in service define
Clarify the HTTP service definition so that the host parameter can
be set as NULL in which case the server will listen all addresses.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-06 09:58:50 -05:00
Emil Gydesen
fcdfdae95b Bluetooth: Audio: Add to_str functions for some assigned numbers
Add to_str functions for context, parental rating, active state,
codec cap freq, codec cap frame duration,
codec cap channel count and location.

The remaining values are just numeric values and does not
need a to_str function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-05 17:02:41 -04:00
Michal Smola
ecf6e347f8 include: dt-bindings: kinetis sim: Add clock sources definitions
Add OSCERCLK, MCGIRCLK, and MCGPCLK clock sources definitions
to the kinetis_sim.h in include dt-bindings.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2024-09-05 17:01:33 -04:00