Commit graph

25,525 commits

Author SHA1 Message Date
jacob kung
a0adc1f7f5 drivers: spi: add et171 spi driver
The Egis ET171 SPI controller was based on Andes ATCSPI200,
but has since been modified. In particular, the WrTranCnt and RdTranCnt
fields from the SPI Transfer Control Register have been moved to dedicated
Wr_Tran_Cnt and Rd_Tran_Cnt registers.

Signed-off-by: jacob kung <jacob.kung@egistec.com>
2025-08-16 10:18:58 +02:00
Martin Stumpf
c50a48ac31 display: sdl: add CONFIG_SDL_DISPLAY_COLOR_TINT
Allows the SDL display to be tinted in a specific color,
to allow the simulation of monochrome colored displays
like `R8` (`L8` + tint `0xff0000`)

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2025-08-15 15:34:27 +02:00
Jeppe Odgaard
0970aa2dc1 drivers: sensor: ti: tmp11x: clang-format files and change DEFINE_TMP11X
Run clang-format on tmp11x.c and tmp11x.h and change `DEFINE_TMP11X` to
prevent too long lines when clang-format is run.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-15 15:34:12 +02:00
Jeppe Odgaard
0d01361e5b drivers: sensor: ti: tmp11x: reuse variable
Reuse `value` variable in `tmp11x_attr_set` to reduce the number of local
variables.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-15 15:34:12 +02:00
Jeppe Odgaard
ec02138402 drivers: sensor: ti: tmp11x: add optional attribute storage
Enable optional storage of sensor attribute values in EEPROM. On reset, the
device goes through a POR sequence that loads the values programmed in the
EEPROM into the respective register map locations.

The driver stores sample frequency, offset, oversampling, lower threshold,
upper threshold, alert pin polarity, alert mode and conversion mode if the
value is continuous or shutdown.

The functionality has been tested with sensor shell and power cycling
sensor:

Test (undocumented) temperature offset is stored:
```shell
uart:~$ sensor attr_set ti_tmp11x@48 ambient_temp offset 0
ti_tmp11x@48 channel=ambient_temp, attr=offset set to value=0
uart:~$ sensor get ti_tmp11x@48 ambient_temp
[...] (25.523436)
uart:~$ sensor attr_set ti_tmp11x@48 ambient_temp offset 50
ti_tmp11x@48 channel=ambient_temp, attr=offset set to value=50
uart:~$ sensor get ti_tmp11x@48 ambient_temp
[...] (75.617186)
uart:~$
[15:12:20.088] Disconnected
[15:12:36.106] Connected
uart:~$ sensor get ti_tmp11x@48 ambient_temp
[...] (75.554686)
uart:~$ sensor attr_get ti_tmp11x@48 ambient_temp offset
ti_tmp11x@48(channel=ambient_temp, attr=offset) value=50.000000
```

Test one-shot mode is not stored:
```shell
uart:~$ sensor attr_set ti_tmp11x@48 ambient_temp 18 1
ti_tmp11x@48 channel=ambient_temp, attr=accel_x set to value=1
uart:~$ sensor get ti_tmp11x@48 ambient_temp
[...] (75.562499)
uart:~$ sensor get ti_tmp11x@48 ambient_temp
Read failed
[00:00:21.332,000] <wrn> sensor_compat: Failed to fetch samples
uart:~$
[15:16:24.529] Disconnected
[15:16:33.540] Connected
uart:~$ sensor get ti_tmp11x@48 ambient_temp
[...] (75.406249)
uart:~$ sensor get ti_tmp11x@48 ambient_temp
[...] (75.351561)
```

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-15 15:34:12 +02:00
Jeppe Odgaard
0eebb85297 drivers: sensor: ti: tmp11x: add eeprom await function
Move await eeprom programming into function and add poll loop timeout.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-15 15:34:12 +02:00
Hieu Nguyen
8e40b8a057 drivers: pwm: Add PWM support for Renesas RZ/A3UL
Add PWM driver support for Renesas RZ/A3UL

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2025-08-15 10:30:49 +01:00
Richard Wheatley
d00a734c0c drivers: entropy: add puf-trng entropy driver
add puf-trng entropy driver to apollo510

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2025-08-15 10:10:45 +03:00
Declan Snyder
b70e761d42 modules: hal_nxp: Remove HAS_MCUX_FLEXSPI/SEMC
Remove these legacy kconfig, not necessary.

The DT already has the bindings and nodes required to represent if there
is a FlexSPI and/or SEMC.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
5e3a432fed adc: Remove CONFIG_ADC_MCUX_ETC
This Kconfig does not belong in the ADC folder, because there is not
actually a zephyr ADC driver for this. Also, remove HAS_MCUX_ADC_ETC as
well because it is a useless config.

The cmake line to pull in this driver from the SDK in the zephyr repo is
totally unnecessary. If a user wants to use this SDK driver they can add
it to their build like any other SDK driver or any other
external code module. Zephyr should not be a cesspool of random build
glue for random pieces of code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
5ae654eeef modules: hal_nxp: Removed unused HAS_MCUX_* configs
Remove the configs that are not actually used for anything anymore or
never were, or that are redundant with other configs, and don't have any
code changes outside of Kconfig to remove.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
5f742ac862 modules: nxp: imx: Remove HAS_IMX_* configs
Remove all these legacy configs which are not necessary.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
83420a7139 modules: hal_nxp: Remove CONFIG_HAS_MCUX_FLEXCOMM
The presence of the flexcomm should be driven by DT, not this legacy
kconfig.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Bayrem Gharsellaoui
95934d2abd drivers: crypto: Add STM32 HASH hardware driver
Add STM32 HASH driver with SHA-224/256 support for STM32U5

Signed-off-by: Bayrem Gharsellaoui <bayrem.gharsellaoui@protonmail.com>
2025-08-15 10:10:24 +03:00
Martin Stumpf
4da9a89cd0 display: sdl: Add support for AL_88 color format
The SDL display driver can now handle and display AL_88 content.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2025-08-14 22:38:38 -04:00
Martin Stumpf
a769062aa0 display: sdl: fix clear color for ARGB8888
Clear color for ARGB8888 was set to opaque white, which is an odd
choice.

This change makes the clear color "transparent".

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2025-08-14 22:38:38 -04:00
Declan Snyder
9278404021 dma_mcux_edma: Simplify mmap ifdefs
Halve all this ifdef code by making a macro function for the memory
mapping.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Declan Snyder
0dcc642886 dma_mcux_edma: Extract dmamux code to helpers
Extract and group dmamux related code together for readability.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Declan Snyder
071aa4cc29 dma_mcux_edma: Split configure function into helpers
There was actually three different types of configuration modes
happening here, and this function was getting extremely bulky and hard
to read due to the amount of nesting of conditionals. Split these into
separate functions and call them appropriately depending on the type of
transfer.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Declan Snyder
2379fac44f dma_mcux_edma: Split reload function into helpers
There is two completely different types of reload modes happening here,
therefore we should split this function into two completely separate
functions because it was getting large and hard to read. Removes
one level of indentation.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Declan Snyder
fcfbf247e1 dma_mcux_edma: Simplify max data size code
Instead of having preprocessor code, make a hidden kconfig
to indicate this and be smarter about the C code (these are all powers
of two)

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Declan Snyder
2a2449056c dma_mcux_edma: Simplify channel gap compliation
One #ifdef outside the functions is simpler to read than two #ifdefs
inside the functions.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Declan Snyder
7610eba406 drivers: dma_mcux_edma: Simplify cache attr macros
The dependency on the chosen node for dtcm can be expressed in Kconfig
language.

Cache we care about is CPU DCACHE, not the meaningless "MCUX Cache"

The macros can be reordered to be simpler by having only one level of
conditional (no nesting) instead of three levels.

Move this code closer in the file to where this cache attribute macro is
actually going to be used (the init macro) instead of randomly splitting
up the struct definitions at the top.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-14 22:38:08 -04:00
Sebastian Huber
4d34bee581 drivers: i2c: mchp_mss: Rework
Use a mutex to protect the I2C bus from concurrent access.  Replace busy
waiting with a binary semaphore.  Process the messages in the interrupt
handler state machine to generate a single transaction.  In the
interrupt handler, process the states until nothing more is to do.  This
prevents superfluous interrupt entry/exit pairs.  Return error
conditions to the caller.  Check the messages for consistency and return
an error for unsupported message lists.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2025-08-14 22:37:54 -04:00
Sebastian Huber
a8514b539b drivers: i2c: mchp_mss: Fix mss_i2c_configure()
Clear the clock bits before setting new ones.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2025-08-14 22:37:54 -04:00
Russ Webber
e8972a92da drivers: sensors: as5600: change to raw reading
Changed to use the raw reading rather than the scaled value, as that's
what the angle calculation is expecting. Added log messages that
communicate magnet sense state.

Signed-off-by: Russ Webber <russ@sentryrobotics.au>
2025-08-14 22:37:41 -04:00
Marc Lasch
2c58f8d33c drivers: net: ppp: Set point-to-point interface flag
Set the point-to-point flag because PPP is a point-to-point protocol. This
flag enables specific IPv6 neighbor discovery handling, to select the
correct sending interface. Without it set, a different interface might be
selected based on the destination address.

Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
2025-08-14 15:55:44 +02:00
Tim Pambor
e4e5e7adc8 drivers: uart: emul: Fix uninitialized variable errors
Fix compiler errors about variables potentially being used uninitialized.
These are false positives, as the compiler is confused by the
K_SPINLOCK() macro. Explicit initialization avoids these errors.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-08-14 15:49:49 +02:00
Jakub Zymelka
fe0b6b3b55 drivers: adc: nrfx: Temporary fix for SAADC power consumption
This is temporary fix for SAADC power consumption. Need to be
removed after hal_nrfx version upgrade.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2025-08-14 10:44:43 +01:00
Wai-Hong Tam
8222eee990 led_strip: ws2812_spi: Support configurable symbol width
This commit introduces a new devicetree property, bits-per-symbol, to
allow the symbol width to be configured from 3 to 8 bits. This change
is particularly beneficial for MCUs that lack DMA for their SPI
peripheral and have a limited hardware FIFO.

This property provides flexibility by allowing developers to select a
slower SPI clock frequency and use the symbol width to scale the
timings to meet strict LED strip requirements, minimizing the risk of
FIFO underruns.

Additionally, using higher-density patterns (e.g., 3-bit or 4-bit
symbols) makes more efficient use of the pixel buffer, which reduces
the RAM footprint required for the LED strip data.

The implementation is optimized with a fast path for the common 8-bit
symbol case, while a generic bit-packing loop handles all other
widths.

Signed-off-by: Wai-Hong Tam <waihong@google.com>
2025-08-14 10:44:31 +01:00
Christian Mauderer
144895dc8e pcie: controller: Use device for register accesses
Use the device in register accesses. This allows to use this code with
multiple controllers instead of only the "chosen" one.

Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2025-08-14 10:44:11 +01:00
Hieu Nguyen
7aa3266840 drivers: pwm: Add PWM support for Renesas RZ/T2M, N2L, V2L
Add PWM driver support for Renesas RZ/T2M, N2L, V2L

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2025-08-14 10:40:07 +03:00
Iuliana Prodan
0f0ae97afc Revert "ipm: imx: send firmware ready reply to check for fw boot completion"
This reverts commit 01ab719ed7938481b459ed5df122f935aa6ae3e0.

This is no longer needed, as we now have a scalable solution
using a vendor-specific resource table, which allows each vendor
to define its own supported features.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2025-08-13 22:10:23 -04:00
Yangbo Lu
7c9c8d8f44 drivers: dsa_nxp_imx_netc: add tag protocol support
Added tag protocol support.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
a5f612b86a drivers: eth_nxp_imx_netc: allow to transmit DSA tag frame
Allowed to transmit DSA tag frame.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
b3e4dc1c9d drivers: ethernet: move NXP NETC DSA driver to dsa directory
Moved NXP NETC DSA driver to dsa directory.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
560249bcbc net: dsa: move DSA core options to subsystem
Moved DSA core options to subsystem.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Mikhail Siomin
83f1bd7341 drivers: spi_nxp_lpspi: allow use of SPI_HOLD_ON_CS flag for lpspi v1
Allow use of SPI_HOLD_ON_CS flag for lpspi with major version 1
when cs is controlled by gpio.

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
2025-08-13 14:33:50 +03:00
Jilay Pandya
6f2973953b drivers: refactor setting of dir pin in step-dir common
current the dir-pin is getting set each and every time perform_step
is called, this is inefficient, since the direction pin shall be set
only once, when a motion command(move_by/move_to/run) is called.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-08-13 14:32:59 +03:00
Pieter De Gendt
713603595b drivers: input: chsc5x: Add suspend/resume PM actions
Implement suspend and resume actions for the CHSC5X touch driver.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-13 14:32:44 +03:00
Pieter De Gendt
be216ba9e6 drivers: counter: mcux_snvs: Convert Kconfig symbol to dts property
The SNVS RTC can act as a wakeup source, re-use pm.yaml properties and
remove the Kconfig symbol.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-13 11:10:03 +01:00
Michał Stasiak
4abc1dd67c modules: hal_nordic: remove deprecated error code
NRFX_ERROR_ALREADY_INITIALIZED has beed deprecated and
repleaced by NRFX_ERROR_ALREADY.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-08-13 11:09:47 +01:00
Mike J. Chen
737aa7d9f3 drivers: dma: dma_mcux_lpc: fix multiple bugs with continuous mode
There are multiple bugs related to continuous/circular mode.
Continuous/circular mode is where the DMA runs continuously
until the stop API is called, instead of auto-stopping on
completion on a single transfer. After a stop, the DMA
can then be reconfigured/restarted.

1. Fix bug where stop didn't actually stop. This can cause memory
   corruption if the user thought the DMA stopped and repurposed
   the dest memory, but in fact the DMA is still writing to it.
   The bug was due the incorrect usage of the DMA controller busy
   state. The DMA controller is busy only when a transfer is
   actively in progress, but the driver needed to stop even if
   the transfer is not active but is only enabled (and may become
   active on a subsequent trigger event). Change so that data->busy
   doesn't use the DMA controller busy state but tracks the enable
   state. Also, to make it doubly safe, make stop function always stop
   regardless of data->busy state because it is alway safe/correct
   to do so.

2. Fix race condition where a stop request from another ISR might race
   with a DMA completion interrupt, and the DMA completion callback
   gets invoked after the DMA has already been stopped. The fix
   is to unregister the callback with the sdk DMA driver, so the
   ISR still runs and clear the interrupt without invoking the
   callback. There is potentially still a race if the interrupt
   is restarted before the ISR fires, so the callback might be
   called too early. However, the Zephyr DMA driver doesn't
   have the channel level details that the SDK driver does and
   it cannot clear just the channel interrupt.

Also a couple of general fixes/improvements:

a. Use interrupt B for end of transfer (single transfer or end
   of block list). Use interrupt A for interrupts of a block
   in the middle of a transfer or for continuous/circular transfers.
   This fixes the dma callback so it can properly report
   DMA_STATUS_BLOCK vs DMA_STATUS_COMPLETE.

b. Reorder some fields in struct channel_data to pack a little
   better in memory

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Mike J. Chen
4e0e3c990d drivers: dma: dma_mcux_lpc: fix src_inc/dst_inc for block chain
The dma driver was determining src_inc and dst_inc from the
config of the first block buffer and ignoring the config
flags for any additional buffers in the chain, which could
lead to incorrect transfers (e.g. in a multiple rx buffer
case, if the first buffer was to receive to NULL,
but the subsequent buffers were not NULL, the bug
would manifest as all transfers being made with
dst_inc of 0). Change the driver to setup
each dma descriptor according to the addr_adj flag
of each block_buffer.

Add check that peripheral transfers have addr_adj set to
NO_CHANGE instead of assuming it, to help catch errors.

Also now check for invalid addr_adj request of
decrement, which this controller doesn't support.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Mike J. Chen
1c4351a208 drivers: mcux: spi and dma: add explicit dma channel type for SPI_TX
The spi_mcux_flexcomm driver uses a special last DMA blk_cfg
to trigger a release of the SPI chip select. This transfer
is always a 4-byte transfer, regardless of the width specified
during dma_configure().

The way the spi_mcux_flexcomm driver communicated this special
transfer was kind of a hack, where the dma_mcux_lpc driver would
assume that when a blk_cfg with source_addr_adj and dest_addr_adj
both set to NO_CHANGE was for this SPI_TX special case.

However, this is an unsafe hack since it is perfectly valid
to have dma use cases for both src/dest_addr_adj to be NO_CHANGE
that is not for SPI_TX. One example is when transmitting a
fixed/repeating value to a periperhal address (e.g. send 100
bytes of the same value from a single memory address over SPI).

This CL introduces a dma_mcux_lpc specific dma channel_direction
which the two drivers now use to cleary request this special
transfer case.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Mike J. Chen
df46b30b8b drivers: spi: mcux_flexcomm: add error handling code
In spi_mcux_transfer_next_packet(), if the next
transfer start fails, add calls to
spi_context_cs_control() to release cs and
spi_context_complete() with error code -EIO.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Mike J. Chen
03684e8572 drivers: spi: mcux_flexcomm: make async mode with dma work
The current driver implementation would block even when the async
API was invoked, so it wasn't really async.

This CL also fully chains the DMA transfer using multiple dma blocks
and makes the number of dma blocks available a config value. The
increase in number of dma blocks is needed so that a spi_buf_set
that has many entries can be converted into chained dma transfers
with the last transfer in a separate block that will set the EOT flag.

Also make some improvements:
1) When doing single cnt transfer, don't use the SDK driver but
   use a new fucntion spi_mcux_transfer_single_word().
   It's much more efficient and does not use an ISR
   like the SDK function does just to send one word.

2) Fix calls to spi_context_update_tx/rx() so that the
   correct word size is passed in, instead of previously
   being hardcoded to 1. This only matters when word size
   is two. Evaluate the word_size_bytes and word_size_bits
   once and store the values in data instead of computing
   it multiple times in various parts of the driver

3) When CONFIG_SPI_MCUX_FLEXCOMM_DMA is defined, we
   do not use the IRQ handler, so add #ifdefs to compile
   that code out. This reduces code size.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Mike J. Chen
0c1e9c3e7a Revert "drivers: spi: mcux_flexcomm: use rxignore bit instead of dummy read."
This reverts commit a3530d6a43.

This change incorrect if chip-select is via a GPIO pin,
released by spi_context_cs_control(), and not the controller
default chip-select pin that can be released using a final
FIFOWR.

When GPIO is used for chip-select control, the chip-select could
be released too soon because the transfer callback is invoked
when the last byte is put into the TX FIFO but that byte might
not yet have clocked out yet on the SPI pins. The rx part of
the transfer is really what completes the transfer so ignoring
it is incorrect.

We could try to special case and use ignore only when
spi_context_cs_control() does nothing, but since it is a very
small optimization, it doesn't seem worth the extra
complexity.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-13 11:08:21 +01:00
Yongxu Wang
3b2518382c drivers: firmware: scmi: add cpu lpm interface api
Added scmi_cpu_pd_lpm_set api for nxp imx scmi interface

This api set the lpm setting for some peripherals applied
when cpu enter a low power mode, such as keep iMX95 wakeup mix
power on when M7 core enter suspend mode, scmi agent record and
deal with this request

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
2025-08-13 11:08:00 +01:00
Yongxu Wang
480f01ece8 drivers: firmware: scmi: disable interrupt communication in polling mode
SCMI processor interrupts from agent are enabled by default during the
`setup_chan` initialization phase. This is suitable for interrupt-driven
communication, where the agent triggers an interrupt to notify the platform
after completing a message transaction.

However, when using the polling model, interrupts are not required and may
cause unintended behavior or performance issues in PM.
To ensure correct operation under polling mode, the interrupt should
be explicitly disabled after channel setup.

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
2025-08-13 11:08:00 +01:00