Commit graph

15409 commits

Author SHA1 Message Date
Stephanos Ioannidis
e1f33b0bba arch: arm64: Make write_sysreg() register size explicit
The A64 `msr` instruction always takes a 64-bit register (`xN`) value
operand.

When a value of size other than 64-bit is specified as an operand to this
instruction, Clang prints out the following warning:

  warning: value size does not match register size specified by the
  constraint and modifier [-Wasm-operand-widths]

This commit modifies the `write_sysreg()` macro to cast its value parameter
into `uint64_t` before specifying it as an operand to `msr` instruction in
order to ensure that always a 64-bit value is specified.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-12-17 15:23:09 +01:00
Gerard Marull-Paretas
0dc18e1236 soc: nordic: nrf54h: gpd: align GPD domain names
nRFs exposes now all power domains, following their actual name in the
specification. Add support for all of them in the GPD service. Note that
this is a breaking change: running this code requires a new SCFW as IDs
have changed in nRFs and so SCFW.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Fabio Baltieri
5b92e7af0e drivers: flash: stm32: add STM32 option bytes extended ops
Add two new flash extended operations for reading and writing STM32
option bytes from the application code.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-12-17 11:35:13 +00:00
Fabio Baltieri
21e389306b drivers: flash: stm32: add include guards
Add missing include guards to flash_stm32.h.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-12-17 11:35:13 +00:00
Gaofeng Zhang
0e59cf41d7 hostap: support legacy roaming
There are currently four types of roaming, 11r roaming, 11v roaming, 11k
roaming and legacy roaming, The priority of the roaming mode is
11r-->11v-->11k-->legacy roaming. If the ap does not support 11r/11v/11k
roaming, we will use legacy roaming. legecy roaming needs to do
full channel scan, which is the same as the general scan connection
process, so the legacy roaming time will be longer.

Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
2024-12-17 05:49:21 +01:00
Girisha Dengi
36e71c839f drivers: clock_control: Agilex5 clock control driver updates
The clock controller/manager registers are updated with
the correct divider values by bootloader via hand-off
data, so now we can use the clock controller to get the
clock value of each peripheral during the run time.

Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
2024-12-16 17:12:34 -05:00
Ryan McClelland
0e5916f8e4 drivers: i3c: add i3c-rtio
This adds rtio along with a default handler for i3c

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-16 20:54:42 +01:00
Neil Chen
89c9dc7f59 drivers: syscon: update syscon driver to add lpi2c clock
Add lpi2c clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-12-16 20:50:37 +01:00
Fabio Baltieri
274c848571 linker: undefine the no-ops dt macros at the end of the file
Undefine the DT_NODE_HAS_STATUS and DT_NODE_HAS_STATUS_OKAY no nop at
the end of the file so other uses can include devicetree.h without
generating a compiler warning.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-12-16 20:48:56 +01:00
Rex Chen
0406f9b403 net: wifi: shell: add parameters for twt setup
Add two parameters for twt setup.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-12-16 13:10:02 +01:00
Rex Chen
a1f579a2f3 net: wifi: shell: add btwt feature support
Add btwt_setup cmd for sap.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-12-16 13:10:02 +01:00
Maochen Wang
91c4482267 net: wifi: fix ap status when enabled
Add WIFI_SAP_IFACE_NO_IR state to keep same as hostapd_iface_state,
which is updated as the hostap upmerge.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-16 13:08:37 +01:00
Maochen Wang
10d4de5237 net: wifi: remove HAPD in Wi-Fi shell layer
For CMD 'wifi ap status', removing HAPD related definition to make it
more commonly used for non-supplicant case.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-16 13:08:37 +01:00
Cla Galliard
a71e0f2a29 posix: pthread: implement non-standard try-join and timed-join
These functions can be used to join pthreads in a non-standard way.
The function pthread_tryjoin will not block and simply test whether the
thread has exited already. The function pthread_timed_join will only block
until the specified time. The functions are wrappers for calling the
k_thread_join with timeout K_NO_WAIT and with a specific timeout as opposed
to calling it with K_FOREVER.

Signed-off-by: Cla Galliard <clamattia@gmail.com>
2024-12-15 19:24:33 +01:00
Nathan Olff
c152453a72 drivers: pwm: implement fake-pwm driver
implement fake-pwm driver with binding using fff

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-12-14 16:14:57 +01:00
Hubert Miś
a7a8469b84 drivers: uart: clarification of poll_out blocking duration
The API docs state that the uart_poll_out is a blocking call,
but it does not specify how long a call to this function should
block the calling thread. This is described in the UART driver
documentation.

This patch clarifies the API docs and alignes it with the driver
documentation.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2024-12-13 20:05:31 +01:00
Francois Ramu
fcc5f9dac1 dts: bindings: pll i2s for the stm32f412 has a Q divider
There is a Q-divider factor [2..15] for the stm32f412 serie
which supplies the 48MHz clock.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-13 20:05:11 +01:00
Francois Ramu
15bdefecc0 drivers: clock control: stm32F412 has PLL48MHz
Add the configuration of the PLL Q divider of main PLL
and I2S_Q of the PLLI2S toset the PLL48MHz clock which feeds
 the USB, SDMMC, RNG through the RCC_DCKCFGR2 register.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-13 20:05:11 +01:00
Krzysztof Chruściński
78ba5cd61a sys: util: Extend IS_EQ to support unsigned literals
Extend IS_EQ to include unsigned integer literals like 0U.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-13 20:04:33 +01:00
Bjarki Arge Andreasen
2aec438b43 drivers: clock_control: nrf: add zero-latency-isr safe APIs
Add zero latency interrupt safe APIs to allow requesting and
releasing HFXO. These will be used from components running
in zero latency interrupt context, like the bluetooth stack.

Co-authored-by: Piotr Pryga <piotr.pryga@nordicsemi.no>

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-12-13 17:44:26 +01:00
Krzysztof Chruściński
0b4818478f devicetree: Add DT_PROP_LAST macro
Add macro for getting the last element of an array type property.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-13 17:44:13 +01:00
Krzysztof Chruściński
fe0e2dbc60 drivers: clock_control: nrf: Add API for synchronous request
Add API for synchronous request for clock attributes.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-13 11:46:41 +01:00
Piotr Pryga
fefc285f54 driver: clock_control: Add to nrf clock control calib in progres API
It may be required to get information if NRF LF clock control calibration
is in progress. Some time sensitive operations could benefit from this
information.

The commit adds simple function that provides the information.
The function is nRF platform specific.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-12-12 16:21:11 +01:00
Nhut Nguyen
cd495936cf drivers: gpio: Add support for RZ/G3S
This adds GPIO driver for Renesas RZ/G3S.

Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Signed-off-by: Binh Nguyen <binh.nguyen.xw@renesas.com>
2024-12-12 11:12:22 +01:00
Nhut Nguyen
25ed9c9d99 drivers: pinctrl: Add support for RZ/G3S
This is the initial commit to support pinctrl driver for Renesas RZ/G3S

Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2024-12-12 11:12:22 +01:00
Li Long
4d178f664c modules: hostap: add tls_cipher param
Add tls_cipher param for client WPA3 enterprise suiteb-192.
Add parameter "-T" to specify tls_cipher:
Specify "-T 1": client use ECC P384.
Specify "-T 2": client use RSA 3K.

Signed-off-by: Li Long <li.long@nxp.com>
2024-12-12 11:09:15 +01:00
Måns Ansgariusson
7545e8d582 tracing: kernel: Add support for stopping workqueues
Adds tracing support for stopping workqueues.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2024-12-12 11:07:39 +01:00
Måns Ansgariusson
82a9bc4589 kernel: Add support for stopping workqueues
This patch adds support for stopping workqueues. This is useful for freeing
resources from workqueues when subsystems/modules is deactivated or
cleaning up the system between tests in ztest to reach a fully normalized
state.

The patch adds a new function k_work_queue_stop() that releases the
workqueues thread and stack when a workqueue is unwanted.
k_work_queue_stop(...) should be viewed as a counterpart to
k_work_queue_start(...).

This would allow to:
k_work_queue_start(...);

k_work_drain(..., true);
k_work_queue_stop(...);

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2024-12-12 11:07:39 +01:00
Alexandre Bailon
bf8cfa7e7c pinctrl: Fix usage of PINCTRL_DT_DEFINE with C++
Using PINCTRL_DT_DEFINE from a C++ file cause a
"designator order field" error.
This updates Z_PINCTRL_STATE_INIT to respect the same order as
defined in struct pinctrl_state.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2024-12-12 11:04:53 +01:00
Emil Lindqvist
6dafb5f4a9 wifi: fix warning on wifi_ps_exit_strategy_txt
This commit fixes a warning when including wifi.h:
type qualifiers ignored on function return type

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-12-11 15:55:03 +00:00
Daniel DeGrasse
b1d1b70ddb drivers: mipi_dbi: add support for mipi_dbi_configure_te
Many MIPI DBI displays support a "tearing effect" signal, which can be
configured to signal each v-sync or h-sync interval. This signal can be
used by the MIPI DBI controller to synchronize writes with the
controller, and avoid tearing effects on the screen (which occur when
the write pointer from the MCU overlaps with the panel's read pointer in
the display controller's graphics RAM).

Add the `mipi_dbi_configure_te` API, which allows display controllers to
configure MIPI DBI controller to wait for a TE edge before streaming
display data. Allow the tearing enable parameters to be configured via
devicetree settings, since these will vary based on the MIPI DBI
controller and display controller in use.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-11 08:00:42 +01:00
Marcin Niestroj
f72ef5c237 drivers: usb: stm32: fix support of STM32U5 OTG_HS with embedded PHY
Introduce new binding "st,stm32u5-otghs-phy" for OTG_HS PHY. This allows to
configure clock source and handle STM32U5 specific OTG_HS PHY behavior in
driver implementation in a more readable way.

Move OTG_HS PHY clock selection (previously <&rcc STM32_SRC_HSI48
ICKLK_SEL(0)>) from OTG_HS node to OTG_HS PHY node.

Rename USBPHYC_SEL -> OTGHS_SEL which matches the definition in the stm32u5
CCIPR2 register (RM0456 Rev 5, Section 11.8.47).

Support enabling OTG_HS PHY clock, which is bit 15 (OTGHSPHYEN) in
RCC_AHB2ENR1. Change OTG_HS clock to be bit 14 (OTGEN).

Calculate in runtime OTG_HS PHY clock source frequency. Try to match that
to supported (16, 19.2, 20, 24, 26, 32 MHz) frequencies and select proper
option with HAL_SYSCFG_SetOTGPHYReferenceClockSelection() API (instead of
hardcoded 16 MHz selection).

Co-authored-by: Adrian Chadd <adrian.chadd@meta.com>
Signed-off-by: Adrian Chadd <adrian.chadd@meta.com>
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-11 08:00:03 +01:00
Marcin Niestroj
fafaa58240 drivers: clock: stm32: support STM32_CLOCK_DIV()
Support specifying divided clock buses by introduction of
STM32_CLOCK_DIV(div) macro. This macro can be used in devicetree to define
clock source of peripherals.

HSE is selected in devicetree using:

   <&rcc STM32_SRC_HSE ...>;

HSE/2 can now be selected with:

   <&rcc (STM32_SRC_HSE | STM32_CLOCK_DIV(2)) ...>;

This allows to use clock_control_get_rate() API in peripherals in order to
get desired clock rate.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-11 08:00:03 +01:00
Yishai Jaffe
59c7d5715b shell: add function to get device by name or label
Added shell_device_get_binding() that wraps device_get_binding() plus
device_get_by_dt_nodelabel() so that a shell can easily get a device by
its full name or label.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-11 07:58:50 +01:00
Armin Kessler
1baf93b1d1 drivers: video: Add timeout tovideo_buffer_alloc
This PR fixes a blocking call to video_buffer_alloc in case of memory
shortage by addign a timeout parameter to the API.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-12-10 20:39:57 +01:00
Krzysztof Chruściński
74d2735dc0 logging: frontend_stmesp: Fix compilation
Casting an argument was missing parenthesis so if argument was an
expression then casting was applied only to the first element and
that could lead to compilation warnings.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-10 16:21:25 +01:00
Krzysztof Chruściński
9d478d7675 logging: frontends: stmesp_demux: Add support for turbo logs
Add support for handling optimized short log messages (aka turbo logs).
There are 2 types of turbo log messages:
- No arguments. D16MTS is used for that on channel > 32768
- One numeric argument. DM16 followed by D32MTS is used.

Additionally, in order to be able to get source name for log messages
coming from owned by cpuapp co-processors (PPR and FLPR) there must
be a way of passing location of constant source data from PPR/FLPR to
cpuapp which handles ETR data. This method is added in the commit as
well. PPR/FLPR sends D32M during the boot with address of constant
source data section. Demultiplexer stores those addresses and it is
able to retrieve source name for log messages from PPR/FLPR.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-10 11:09:55 +01:00
Krzysztof Chruściński
752f8b0176 logging: frontends: stmesp: Add optimized short logs
Add 'turbo' logging feature. When enabled, short logs (no argument
or one numeric, 32 bit argument) are handled in a special way that
is much faster than the default one (5-10x faster). Additionally,
there is an option to remove all other logs from the system which
allows to not include almost any logging framework code in the
binary (~170 bytes of code is needed). It may be especially
valueable for memory constraint targets (ppr, flpr) where with
only 170 byte of code (+code for each log message) we can provide
limited formatted string logging support.

'Turbo' logging is using following to achieve that:
- logging strings are put into a memory section and additional
memory section is created which holds addresses of those strings.
Index in that array is used to identify a string (32 bit address
is encoded into a smaller number, 15 bits is more than enough).
This index is used for a STMESP register set (there are 2^16
available). So STMESP channel encodes string.
- Logging level is stringified and prepended to a string
- Source ID is encoded by using DM16 (so far not used).
- Log without arguments is written as DMTS16
- Log with one argumetn is written as DM16+DMTS32

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-10 11:09:55 +01:00
Pavel Vasilyev
c2488fdd30 bluetooth: buf: Add a callback for freed buffer in rx pool
The Bluetooth data buffer API currently lacks a mechanism to notify when
a buffer is freed in the RX pool. This limitation forces HCI drivers to
adopt inefficient workarounds to manage buffer allocation.

HCI drivers face two suboptimal options:

- Blocking calls: Use bt_buf_get_rx with K_FOREVER, which blocks the
  execution context until a buffer becomes available.
- Polling: Repeatedly call bt_buf_get_rx with K_NO_WAIT, which increases
  CPU load and reduces efficiency.

This commit introduces a callback mechanism that is triggered each time
a buffer is freed in the RX pool. With this feature, HCI drivers can:

- Call bt_buf_get_rx with K_NO_WAIT.
- Wait for the callback notification if a NULL buffer is returned,
  avoiding unnecessary polling.

The new callback improves efficiency by enabling event-driven behavior
for buffer management, reducing CPU overhead while maintaining
responsiveness.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-12-10 11:09:36 +01:00
Pavel Vasilyev
bd9a1cea84 bluetooth: buf: Convert bt_buf_type enum to bitmask
This allows to combine several types in a single value.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-12-10 11:09:36 +01:00
Jukka Rissanen
027760b6d4 net: if: Replace asserts by proper runtime checks
The asserts were not proper here, replace those by runtime
checks as the functions can be called from applications and
asserts are not meant for error checking.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Jukka Rissanen
2416cde90e net: trickle: Remove useless asserts
Replace asserts by runtime checks as the APIs can be used
from applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Gang Li
e73bc712cc net: wifi: add "bandwidth" parameter to "wifi ap enable" command
Add "bandwidth" parameter to "wifi ap enable" command.
Add "ht_capab" and "vht_capab" parameters to "wifi ap config" command.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-10 11:09:09 +01:00
Francois Ramu
cdba98219d include: binding defines MCO division factor for stm32U5
On the stm32U5 serie the MCO prescaler is a value
set in the CFGR1 register to divide the MCO output clock.
See the RefMan for accepted values for this stm32U5 serie

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-10 11:08:30 +01:00
Jianxiong Gu
29436c2b29 include: drivers: usb_c: unify status register data type to uint32_t
The tcpc_get_status_register function was using int32_t for the status
parameter, while the other related functions used uint32_t. This change
unifies the data type across all related functions to uint32_t for
consistency and clarity.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2024-12-09 22:06:09 +00:00
Jianxiong Gu
414ac1895a include: drivers: usb_c: Run clang-format
Run clang format before making changes

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2024-12-09 22:06:09 +00:00
Stephan Linz
a68c1aa4ad drivers: mipi_dbi_spi: add 16-bit transfer to C4
Extends the MIPI DBI SPI driver class for operating mode C4, SPI 4-wire,
with 16 write clocks to send one or multiple byte for commands. Generic
data (e.g. GRAM) aligned to 16-bit are passed through and stuffed with
bytes if required.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2024-12-09 15:12:21 +01:00
Stephan Linz
0c93541bb5 drivers: mipi_dbi: doc: fix clock in waveform diagram
In the Doxygen comments, the amount of SPI clocks now match the
number of data bits shown. The clock was shown half the speed.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2024-12-09 15:12:21 +01:00
Bjarki Arge Andreasen
59779ebe4b pm: policy: event: use uptime ticks
Update events to use uptime ticks, which is a monotonic clock which
in the same res as kernel ticks. This makes comparisons simple and
removes the complexity of dealing with wrapping counter values.

The wrapping is particularly problematic for events since this makes
it quite complex to track if an event has occured in the past, or
will occur in the future. This info is needed to know if an event
has actually been handled or not.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-09 03:55:52 +01:00
TOKITA Hiroshi
51d59fa1d1 include: zephyr: linker: linker-devnull: Fix include-guard
The implementation of include-guard is incomplete, so I fixed it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-07 16:01:25 +00:00