Commit graph

23353 commits

Author SHA1 Message Date
Fabrice DJIATSA
688c9d3101 drivers: i2c: update i2c driver to integrate stm32u0
- enabled combined interrupt configuration for stm32u0x serie.
- since stm32u0 serie doesn't support SMBUS we need to avoid
use SMBHEN and SMBDEN bits register.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-11 13:59:54 -04:00
Pisit Sawangvonganan
847a4eaad2 style: drivers: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-11 07:40:35 -04:00
Chekhov Ma
e79507b5e3 drivers: gpio: pca_series: handle byteorder
Add byteorder handling to support big-endian machine.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Chekhov Ma
d45497e4c8 drivers: gpio: pca_series: add api to get per-port register size
This commit add get per-port reg size api to make it more clear to
understand the design.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Chekhov Ma
5253eb1692 drivers: gpio: extend pca_series driver to pca953x and pca955x
This commit extends pca_series gpio driver to devices pca9538, pca9539,
pca9554 and pca9555.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02:00
Chekhov Ma
ac2d8993cc drivers: gpio: add pca_series gpio expander driver
There are numbers of drivers for different PCA(L) series chip. They
share similiar register layout and control logic. This driver intends
to unify these drivers for PCA(L)xxxx series i2c gpio expanders.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-11 09:38:04 +02: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
Benedikt Schmidt
74476c45b0 drivers: gpio: extract method to apply initial state of PCAL64XXA
Extract method which applies the initial state in the driver
for the port expander PCAL64XXA.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-09-11 09:35:37 +02:00
Yangbo Lu
5bec2a3dde driver: pinctrl: add SCMI-based pinctrl driver for NXP i.MX SoCs
On some i.MX SoCs, such as i.MX95, the System Manager is running on a
Cortex-M core to manage the hardware resources and provide services for
SCMI requests.

So add the SCMI-based pinctrl driver to support these i.MX SoCs.

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
Yangbo Lu
4f99a57b81 drivers: mbox: make mbox_nxp_imx_mu use PRE_KERNEL_1 init level
The MU init should be very early for some platforms. For examples,
i.MX95 is using MU for ARM SCMI. It should be initialzied early
for next power, pinctrl, clock etc. management.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-09-11 09:34:04 +02:00
Adam Kondraciuk
bae4ff6cf0 drivers: timer: grtc: Switch GRTC clock source to LFXO
GRTC needs to use direct clock source path instead of system clock path
to support ELV mode for nRF54L targets.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-09-11 09:30:48 +02:00
Ryan McClelland
0469de9626 drivers: i3c: shell: add ccc deftgts command
Add a command for the ccc deftgts to the i3c shell.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-10 21:52:18 -04: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
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
810e6a19c3 drivers: flash: support flash driver for MCXA156
Add MCXA156 romapi support in flash driver

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-09-10 12:39:18 -04:00
Neil Chen
4af2180731 drivers: gpio_mcux: update gpio_mcux driver for MCXA156
Fix compiler warning issue(unused variable 'config',
uninitialized variable 'int_status')

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-09-10 12:39:18 -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
Reto Schneider
9d3ac80429 drivers: dma: Add initial SiM3U1xx support
This supports the minimum of what is required to allow the AES hardware
to be used (memory to peripheral, peripheral to memory).

In addition, to pass some of the existing unit tests, it also supports
memory to memory operators.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-09-10 12:38:36 -04:00
Mark Wang
f378de7e46 drivers: udc: mcux: move isr context codes to work context
Move the transfer process codes to work context becuase
it lock the mutex, move bus reset process codes too
because it calls some common udc apis (they may add
mutex lock in future).

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-09-10 12:38:03 -04:00
Duy Nguyen
5ff44120e1 Kconfig: Fix issue in KConfig of Renesas modules
Add condition for KConfig Renesas FSP hal module
Move the DUAL_BANK_MODE from SOC to flash driver KCONFIG

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2024-09-10 14:42:55 +01:00
Tahsin Mutlugun
6b14bbc13c drivers: spi: spi_max32: Add DMA support
Add DMA support to MAX32 SPI driver.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-09-10 14:39:51 +01:00
Jordan Yates
632d6b9416 sensor: bme680: only read compensation params once
Only read the compensation parameters from the chip on first power up,
as they are static on the device.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-09-10 11:44:30 +02:00
Jordan Yates
5953a26dc6 sensor: bme680: support power domains
Support the BME680 being on a power domain, which may not be powered at
boot. For example, Nordic Thingy53.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-09-10 11:44:30 +02:00
Pisit Sawangvonganan
ecbcb5b80f drivers: can: shell: use shell_fprintf_normal instead of shell_fprintf
Due to the introduction of `shell_xxx_impl` wrapper functions in
PR #75340 and rename to `shell_fprintf_xxx` in PR #77192 we can minimize
caller overhead by eliminating direct `color` parameter passing.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-10 11:44:23 +02:00
Maochen Wang
a206ab0ac3 drivers: wifi: nxp: add Kconfig to enable Wi-Fi features
Add some default Wi-Fi Kconfig for NXP driver.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-09-10 11:44:03 +02:00
Maochen Wang
55ee1ae4a9 drivers: wifi: nxp: update the correct Macro config.
For Soft-AP case, use CONFIG_WIFI_NM_HOSTAPD_AP to replace the
CONFIG_WIFI_NM_WPA_SUPPLICANT macro.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-09-10 11:44:03 +02:00
Abderrahmane Jarmouni
f7de44dfaf drivers: display: stm32_ltdc: fix return value
Blanking On/Off calls should not return 0 when there is no panel
controller to forward them to, instead they should return ENOSYS to
signal to the application that they were not actually executed.

"device_is_ready" does check for null, but also for
"dev->state->initialized == false", so we need to isolate the
"dev == NULL" case.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
2024-09-10 11:43:48 +02:00
Richard Wheatley
968f674c66 drivers: serial: ambiq uart update
The number of modules is different for each soc.
There is a macro in the HAL that should have been used.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-09-09 18:40:46 -04: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
Sylvio Alves
8233b70ece espressif: clean up unused code
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-09 13:55:39 -04:00
Andriy Gelman
08996a63b0 drivers: can_mcp251xfd: Forward error and remove done label
Currently if initializing one of the registers fails, the return
error gets overwritten by can_set_timing(). Fix by forwarding the
error directly. Also remove unnecessary done label.

Fixes #73586.

Original patch by melvinvdb from #73714.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-09-09 13:55:14 -04:00
Andriy Gelman
59bdb49901 drivers: can_mcp251xfd: Delay initialization after reset
Mcp251xfd devices occasionally fail to initialize after board
resets. It was experimentally found that adding a 5ms delay fixes
the problem.

Fixes #73586.

Original patch by melvinvdb from #73714.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-09-09 13:55:14 -04:00
Grzegorz Swiderski
b97300e414 Revert "drivers: cache: nrf: enable CACHE_NRF_PATCH_LINEADDR for nRF92"
This reverts commit a2bb323861.

nRF9280 does not suffer from the same bit 28 hardware bug as nRF54H20.
This workaround must be disabled to make the DCACHE function properly.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-09-09 13:54:39 -04:00
Jordan Yates
d1abe40fb0 flash: nrf_qspi_nor: wait for erase to complete
Wait until the erase operation triggered by `qspi_erase` completes
before returning. This aligns with the behaviour of other flash drivers
like `spi_nor` and `soc_flash_nrf`.

A delay is added to the `qspi_wait_while_writing` to prevent the check
from monopolising the CPU.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-09-09 15:25:16 +03:00
Anas Nashif
f519dd1411 arch: arm: replace PLATFORM_SPECIFIC_INIT with PLATFORM_RESET_HOOK
Use generic hook infrastrucutre instead of custom Kconfig and hooks for
ARM.

Replace z_arm_platform_init() with platform_reset().

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-09 10:07:33 +02:00
Marek Pieta
8b50d3768f drivers: usb: udc_dwc2: Notify upper layer on failed TX
Change ensures that `dwc2_handle_xfer_next` would notify upper layer if
`dwc2_tx_fifo_write` fails. This is necessary to ensure that upper layer
is aware of the failed TX for the submitted transfer. It also ensures
that the submitted transfer is removed from the TX queue.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-09-09 09:28:29 +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
Anas Nashif
5fdbbf7d7e uart: nrfx: fix config check
we should be checking for config, not data.

Fixes #78114

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-06 17:52:03 -04:00
Daniel Mangum
a80af336c2 drivers: wifi: esp_at: only log errors in active mode with full IPD
Removes constant error logging when parsing IPD headers in active mode and
waiting on remote IP and port. Currently an error message is logged for
every character in the remote IP and port until the full length obtained.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2024-09-06 12:04:49 -05:00
Shen Xuyang
74f3bf3aa4 driver: display: Add driver for diplay controller ist3931
Add the driver of diplay controller ist3931, i2c/spi
128x64 monocolor display driver. Only the i2c mode
driver of the controller is implemented and tested.

Signed-off-by: Shen Xuyang <shenxuyang@shlinyuantech.com>
2024-09-06 12:03:57 -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
4b20c3d4d6 drivers: misc: coresight: Add nrf_etr module
Add module which is dumping data from Coresight ETR buffer. Coresight
ETR is a sink for STMESP data. This module is specific to Nordic SoC
because it does not access ETR registers. Instead it is using Nordic
specific module (Trace Buffer Monitor TBM) to monitor amount of data
in the ETR buffer (which is a circular buffer).

Data from that buffer is sent over UART (in future it may be extended
to other transports). In future, module will be extended with option
to process STM data on chip.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
345dd11e20 drivers: serial: uart_nrfx_uarte: Fix dropping flushed data
When rx_flush() was called with NULL buffer it was an indication to
drop data from the FIFO. However, it is still important to get the
correct amount of dropped data because when PPI+TIMER are used to
count bytes those flushed bytes are also counted (because each
byte generates RXDRDY event). If those bytes are not counted then
total amount of reported bytes is not correctly aligned with bytes
counted by TIMER.

Reworking rx_flush() to correctly count number of dropped bytes and
then add this flushed bytes to the total amount of RX bytes
reported to the user in RXTO event handler.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:10 -04:00
Krzysztof Chruściński
282bc783b1 drivers: serial: uart_nrfx_uarte: Fix interrupt driven TX only mode
When interrupt driven instance is using only TX then low power mode
is automatically enabled and then TXSTOPPED interrupt is disabled in
idle so uarte_nrfx_irq_tx_ready_complete() was returning wrong value.
Adding a dedicate flag which holds information is user enabled TX
interrupt.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:10 -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
Krzysztof Chruściński
5ce801fa2b drivers: serial: uart_async_to_irq: Add RX error handling
Adaptation layer was not correctly handling RX error and when error
occured uart_irq_is_pending() was still returning false.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:10 -04:00
Krzysztof Chruściński
3b232d5e07 drivers: serial: uart_nrfx_uarte2: Disable RX when error is reported
According to the API specification when RX error occurs receiver
shall be disabled. Adding missing disabling to the error handler.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:10 -04:00
Chaim Zax
f54a53b4b3 drivers: ws2812_gpio: Make timing configurable and less hardware dependend
The current driver contains assembly code which is specific for the nRF51
SOC which makes it incompatible with other SOC's. This patch adds support
for other nRF SOC's as well. The timing is calucated based on the CPU clock
frequency, but can be configured manually as well if needed.

Changes have been verified on a Adafruit Feather nRF52840 Express board,
which contains a single NeoPixel RGB LED. Timings have been verified using
a scope connected to the WS1812 data line.

Signed-off-by: Chaim Zax <chaim.zax@zaxx.pro>
2024-09-06 11:31:00 -04:00
Adam Kondraciuk
38575f89ea drivers: timer: nrf_grtc: Add GRTC fix for app and rad cores
Currently function `z_nrf_grtc_wakeup_prepare()` should be available
only for the GRTC manager (`CONFIG_NRF_GRTC_START_SYSCOUNTER` is active).

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-09-06 11:29:06 -04:00