Commit graph

18367 commits

Author SHA1 Message Date
IBEN EL HADJ MESSAOUD Marwa
f000e1a58a drivers: i2s : enable rx path for H7 and H5
In i2s_stm32_isr, remove the errors from SR register
   i2s_stm32_configure, enable the rx path for H7 I2S compatible IP

Signed-off-by: Franck Thebault <franck.thebault@st.com>
Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-05-28 12:51:00 +02:00
Ioannis Karachalios
d4209ab6c4 drivers: dma: smartbond: Add support for PM
This commit should add all the functionality needed for the DMA
driver to work when PM is enabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-28 12:49:46 +02:00
Bjarki Arge Andreasen
51bcc5d20d drivers: gnss: LCX6G use modem chat runtime API
Update the Quectel LCX6G device driver to use the modem chat
runtime API to modify the dynamic pair chat script.

This change makes the driver safer and more readible by
ensuring safe modification of the members of the modem chat
structures.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-28 10:02:06 +02:00
Yong Cong Sin
af450ea3cc drivers: gpio: add Broadcom iProc GPIO controller driver
Add device driver, bindings and build-only test for
Broadcom iProc GPIO controller.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 09:59:20 +02:00
Yong Cong Sin
97ba7fd48d drivers: i2c: add Broadcom iProc I2C driver
Add device driver, bindings and build-only test for
Broadcom iProc I2C.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 09:57:40 +02:00
Fin Maaß
cefbcc5323 drivers: i2c: i2c_sbcon: use frequency from device tree
use the clock frequency from the device tree.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 09:56:48 +02:00
Fin Maaß
dd1f9c346d drivers: i2c: litex: add get_config and recover_bus
add get_config and recover_bus for the litex i2c driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 09:56:48 +02:00
Fin Maaß
2be9ed7103 drivers: i2c: litex: use frequency from device tree
use the clock frequency from the device tree.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 09:56:48 +02:00
Fin Maaß
dd897b51e0 drivers: i2c: i2c_sbcon: add get_config and recover_bus
add get_config and recover_bus for the sbcon i2c driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 09:56:48 +02:00
Fin Maaß
e7a088b467 drivers: i2c: gpio: add get_config
add get_config for the gpio i2c driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 09:56:48 +02:00
Fin Maaß
b4e81054f2 drivers: i2c: bitbang: add get_config
add get_config for the i2c bitbang driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 09:56:48 +02:00
Chris LaFlash
e94adf1e2b drivers: crypto: stm32: AES CTR IV is 16bytes
AES-CTR IV is the same as the block size 128-bits(16 bytes)
 regardless of key size.

Signed-off-by: Chris LaFlash <chris-github@laflash.com>
2024-05-28 09:54:30 +02:00
Alvis Sun
fec0aaa80e drivers: i3c: npcx: update ibi error handling
1. Emit stop when not in the correct state and unsupported ibi type.
2. For IBI(MDB), ignore the callback when target not in the
   device tree list.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-05-28 09:54:03 +02:00
Alvis Sun
03580e4a1b drivers: i3c: npcx: add HDR-DDR mode for transfer
1. Support HDR-DDR DMA transfer.
2. Remove polling mode in transfer.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-05-28 09:54:03 +02:00
Erwan Gouriou
8cd8e53faf drivers: ethernet: stm32: Remove deprecated API support on impacted series
In release V3.3 new STM32Cube HAL ethernet API was added to STM32 ethernet
driver for STM32F4, STM32F7 and STM32H7 series. At the same time, the
legacy API was deprecated for these series.
I'm now fully removing the legacy API support for these series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-05-28 09:52:20 +02:00
Pisit Sawangvonganan
f503b7a26d drivers: serial: stm32: replace config parameter with usart
Updated function parameters from `const struct uart_stm32_config *config`
to `USART_TypeDef *usart`. This change reduces the level of pointer
indirection, which minimizes repeated dereferencing and helps reduce
the overall code size.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-28 09:49:09 +02:00
Pisit Sawangvonganan
86e0fe13e1 drivers: serial: stm32: reduce pointer level from config->usart to usart
This change reduces the level of pointer indirection, which minimizes
repeated dereferencing and helps reduce the overall code size.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-28 09:49:09 +02:00
Andrzej Głąbek
7abb9d7593 drivers: watchdog: Allow WDT_DISABLE_AT_BOOT only when supported
Introduce a hidden Kconfig option named HAS_WDT_DISABLE_AT_BOOT and
allow users to enable WDT_DISABLE_AT_BOOT only when that hidden option
is selected by a watchdog driver, i.e. disabling at boot is supported.
Select this new hidden option for all existing watchdog drivers that
refer to WDT_DISABLE_AT_BOOT.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-05-27 08:40:16 -07:00
Pisit Sawangvonganan
512c18393a drivers: clock_control: stm32: clean up unnecessary code
This commit removes unnecessary initialization of the local variable
where its value is guaranteed to be overwritten by subsequent operations.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-27 08:16:30 -07:00
Pisit Sawangvonganan
37466ac887 drivers: clock_control: stm32: fix typo
Use a code spell-checking tool to scan and correct spelling errors in
the following files:
- clock_stm32_ll_common.c
- clock_stm32_ll_h5.c
- clock_stm32_ll_h7.c
- clock_stm32_ll_u5.c
- clock_stm32_ll_wba.c

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-27 08:16:30 -07:00
Reto Schneider
58cb4557f0 net: ppp: Optimize memory allocation
net_pkt_alloc_buffer() deducts the free space from the requested number
of bytes.

As ppp_save_byte() calls net_pkt_alloc_buffer() when the packet has one
byte available still, this causes all but the first net_buf in the
packet to be of size CONFIG_NET_BUF_DATA_SIZE - 1.

Consequences:
 - With CONFIG_NET_BUF_FIXED_DATA_SIZE enabled, one byte per net_buf
   gets wasted.
 - CONFIG_NET_BUF_DATA_SIZE has typically an even, likely even a power
   of two value. Using exactly one byte less per buffer causes
   operations that require aligned memory (e.g. DMA) to become
   inefficient or to not work at all.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-05-27 08:15:36 -07:00
Joakim Andersson
3ad57e3030 drivers: spi_bitbang: Fix timing in SPI bitbang driver
Fix timing in SPI bitbang driver.
The issue occurs with CPHA=1 when the input data is changed immediately
after the clock shift on the last bit of the read.
Because we read the input bit after changing the clock, this bit
becomes invalid.
Instead of doing wait, clock-change, read. Do wait, read, clock-change.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-05-27 05:42:26 -07:00
Aaron Ye
3f56baa295 drivers: bluetooth: hci: add retry mechanism for Apollo SPI busy scenario
The controller may be unavailable to receive packets because it is busy
on processing something or have packets to send to host. Need to free the
SPI bus and wait some moment to try again.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-05-27 03:27:43 -07:00
Aaron Ye
47ce99f7b0 drivers: bluetooth: hci: correct the Ambiq Apollox support BT feature
The BLE controller of some Ambiq Apollox Blue SOC may have issue to
report the expected supported features bitmask successfully, thought the
features are actually supportive. Need to correct them before going to
the host stack.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-05-27 03:27:43 -07:00
Aaron Ye
af54a38827 drivers: bluetooth: hci: add Ambiq Apollo3 Blue SOC support
This commit add the SPI-based HCI support for the Ambiq Apollo3 Blue
SOC (e.g. Apollo3 Blue Plus, Apollo3 Blue) support.
Also correct the dependency of necessary peripheral.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-05-27 03:27:43 -07:00
Aaron Ye
d84874309e drivers: spi: create Ambiq SPI BLEIF driver
Some Ambiq Apollox Blue SOC (e.g. Apollo3 Blue) uses internal designed
BLEIF module which is different from the general IOM module for SPI
transceiver. The called HAL API will also be independent. This driver is
implemented for the BLEIF module usage scenarios.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-05-27 03:27:43 -07:00
Flavio Ceolin
e1685bb421 stm32: power: SoC restores the clock
Clock must be restored as soon as the SoC leaves standby.
Keep the logic inside the SoC instead of delegate it to the pm
subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-27 02:10:03 -07:00
Flavio Ceolin
5ca3bc92c8 intel_adsp: power: SoC restores the clock
The SoC restores the clock only when leaving soft-off only.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-27 02:10:03 -07:00
Lucas Tamborrino
e282b0ea84 soc: esp32xx: refactor clock and RTC subsystems
The RTC subsystem in espressif's SOCs, among other tasks
is responsible for clock selection for CPU and for low
power domain clocks such as RTC_SLOW and RTC_FAST.

This commit allows for proper clock source and rate
selection for CPU, using the espressif,riscv and
espressif,xtensa-lx6/7 bindings.

It also enables clock selection for RTC_FAST and RTC_SLOW,
that impacts some peripherals, such as rtc_timer.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-27 01:37:18 -07:00
Henrik Brix Andersen
6a070ee165 drivers: can: shell: print raw DLC when sending frame, not bytes
Print the raw DLC when enqueuing a CAN frame for sending, not the
corresponding number of bytes.

Fixes: #73309

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-27 07:45:01 +02:00
Henrik Brix Andersen
fb4f67b775 drivers: can: shell: fully initialize frame before sending
Zerorise the CAN frame before filling in data to ensure all data bytes are
initialized.

Fixes: #73309

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-27 07:45:01 +02:00
Yong Cong Sin
7248efcd59 drivers: intc: update to use multi-level API
Update these multi-level interrupt drivers to use the new API.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
a512f68f14 drivers: intc_dw_ace: convert to use instance-based macros
Define the DRV_COMPAT and use instance-based device DT macros.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
5d9e266d13 drivers: interrupt_controller: irq_steer: use new multilevel irq impl
Update the NXP's irq_steer driver to use the new multi-level
interrupt implementation.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
8f9ebb652f drivers: intc: plic: simplify isr handling
Save the reference of the start index of the `_sw_isr_table`
to the config struct, so that the `local_irq` can be used  as
offset directly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
c5f5b964c1 arch: sw_isr: revamp multi-level interrupt architecture
Previously the multi-level irq lookup table is generated by
looping through the devicetree nodes using macros & Kconfig,
which is hard to read and flimsy.

This PR shifts the heavy lifting to devicetree & DT macros such
that an interrupt controller driver, which has its info in the
devicetree, can register itself directly with the multi-level
interrupt architecture, which is more straightforward.

The previous auto-generated look up table with macros is now
moved in a file of its own. A new compatibility Kconfig:
`CONFIG_LEGACY_MULTI_LEVEL_TABLE_GENERATION` is added and
enabled by default to compile the legacy look up table for
interrupt controller drivers that aren't updated to support the
new architecture yet.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
c57f9f12a2 drivers: intc: VPR CLIC should make sure GEN_IRQ_VECTOR_TABLE is enabled
VPR cores CLIC supports vectored mode only. Select
`GEN_IRQ_VECTOR_TABLE` such that it can't be disabled.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Axel Le Bourhis
ee03123dd1 drivers: hci: Add NXP HCI driver
Add HCI driver generic to NXP platforms.
Update west.yml to have ble support for rw61x

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-05-25 11:23:04 +03:00
Andrzej Kaczmarek
2e2aeb13ed drivers: bluetooth: da1469x: Fix deferred buffer allocation
If rx buffer allocation has to be deferred to rx_thread, we need to stop
isr reading from mailbox as otherwise rx_thread won't be able to process
other buffers.

Since CMAC2SYS irq is cleared before data is read from mailbox, in case
rx buffer allocation was deferred we also need to trigger irq manually
to make sure all pending data is processed.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2024-05-25 11:21:16 +03:00
Sreeram Tatapudi
f96e6ccbc0 boards: arm: Introduce Infineon CYW920829M2EVK-02 board
- Add initial version of CYW920829M2EVK-02 board
- [drivers: clock_control] Make it possible to set up both iho and imo
  clocks instead of just one or the other

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-05-24 18:05:11 -04:00
Andrzej Kaczmarek
5ead91d099 drivers: clock_control: smartbond: Update CMAC sleep clock
The CMAC uses lp_clk as a sleep clock so it has to be updated if
frequency of lp_clk has changed. This happens either after XTAL32K
settling or RCX calibration.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2024-05-24 18:03:26 -04:00
Francois Ramu
6db2c2c2c1 drivers: rtc: stm32 rtc driver disable alarm interrupt if not used
Note that the Init of the alarm has no need for BCD2BIN conversion,
the LL_RTC_ALMx_Init will do. Add more log debug
The driver must clear the ALARM enable bit before wrting the alarm
registers.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-24 09:56:29 -05:00
Francois Ramu
2499a4b226 drivers: rtc: stm32 rtc driver configure time and Date
Set a Calendar using the LL functions LL_RTC_TIME_Init
and LL_RTC_DATE_Init. Add more DBG info
On the stm32F2 serie, check RS Flag after setting calendar registers.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-24 09:56:29 -05:00
Flavio Ceolin
693b65583c power_domain: intel_adsp: Use register definitions
Make it a little bit easier to read using already existent
definitions for the registers used here.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-24 09:53:04 -05:00
Jerzy Kasenberg
bd6bb64d8a drivers: timer: smartbond: Fix timer2 timeout set
When function sys_clock_set_timout() is called with small value
(i.e. 1) calculated time to be programmed to TIMER2 reload
register may be such that is expires before code set's it
up. In that case timer interrupt will be scheduled in far
future.

With this change, code checks after it sets reload value if
requested time already passed and if so TIMER2 interrupt
is marked as pending to avoid races.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-05-24 08:04:18 -04:00
Celina Sophie Kalus
051dc14bb6 drivers: mbox: Add driver for STM32 HSEM
This driver implements a simple MBOX device which supports a single
instance, two channels (one for each direction), and only signalling
mode with no data transfer. Signalling to another core is achieved by
taking and giving two hardware semaphores, similar to the STM32 HSEM
IPM driver.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-05-24 07:52:06 -04:00
Robert Hancock
1af474b575 flash: spi_nor: error-checking fixes
Check the return values of commands such as spi_nor_cmd_* and
spi_nor_wait_until_ready and ensure they are propagated back to the
caller on error.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2024-05-24 07:51:20 -04:00
Dominik Ermel
deabfa3c3a drivers/flash/spi_nor: Fix and rework spi_nor_set_address_mode
The commit removes unneeded check for enter_4byte_addr_exist in
the function, as the utility function is supposed to set the address
by parsing enter_4byte_addr parameter, while the enter_4byte_addr_exist
used to exist only for DTS entries that directly set enter-4byte-addr
parameters for a flash node.

The change also moves LOG_DBG reporting enter_4byte_addr before
it is processed, to allow logging what actually function will be working
with, before it does so.

The enter_4byte_addr_exist is removed as it is no longer used anywhere.

Setting of data->flag_access_32bit has been moved in the same code block
as call to the spi_nor_cmd_write, as it can be only consequence of
successful call to that function.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-05-24 07:50:25 -04:00
Aurelien Jarno
18c73de93d drivers: spi: stm32: Skip pinctrl suspend/resume for subghzspi
Subghzspi instances cannot have any pinctrl configs. This causes a
failure of the power management suspend and resume operations for the
subghzspi instance because no "default" pinctrl is found.

Fix that by skipping the pinctrl parts on subghzspi instances.

At the same time fix a copy and paste in the suspend error message.

Fixes: b567a7db83

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-24 07:50:09 -04:00
Yong Cong Sin
e993e994ea sensors: add new channel SENSOR_CHAN_POS_DXYZ
Add new channel: `SENSOR_CHAN_POS_DXYZ`, so that it is
consistent with other 3-axis channels.

Updated pytest, `sensor_shell` & `fake_sensor` accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-24 07:49:27 -04:00