Commit graph

23353 commits

Author SHA1 Message Date
Andrei-Edward Popa
ea1cafbee7 drivers: clock_control: Added clock driver for Raspberry Pi Pico
Added clock driver for Raspberry Pi Pico platform

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Francois Ramu
6e678e3bae drivers: usb stm32H5 and stm32U5 have an independent power supply
The stm32H5 mcu has an independent USB supply to be enabled
at init with LL_PWR_EnableVDDUSB function like the stm32U5 serie.
Both series have PWR_USBSCR_USB33SV bit in their USBSCR POWER reg.
and other series all have PWR_CR2_USV bit in their CR2 POWER reg.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-12-19 22:53:26 +00:00
Jordan Yates
60a9f33f37 drivers: flash: spi_nor: boot into DPD
Boot into the deep power down state when `SPI_NOR_IDLE_IN_DPD` is not
enabled. DPD is the correct hardware state for the `SUSPENDED` software
state. Without this change, it takes a cycle of
`SUSPENDED->ACTIVE->SUSPENDED` to get to the low power state.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-12-19 16:53:27 +01:00
Manuel Aebischer
5b9a0e5456 drivers: usb_dc_rpi_pico: handling of data toggle after endpoint setup
The previous behaviour led to an issue where we already expected data1
on the first transfer instead of data0. The DesignWare USB DC actually
implements the same behaviour. Also, the next_pid flag has to be reset
on setting up the endpoint.
Fixes #66283.

Signed-off-by: Manuel Aebischer <manuel.aebischer@netmodule.com>
2023-12-19 12:45:52 +01:00
Fabio Baltieri
0442fe3bbf input: npcx_kbd: clear pending interrupts before reenabling detection
The driver right now re-enters polling mode a couple times after the
matrix has been detected as stable as the key interrupt is still pending
and fires again once detection is reenabled.

Clear pending WUI interrupts before reenabling key press detection to
avoid that.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-19 10:57:38 +00:00
Andrei Emeltchenko
c78bff954e drivers: intc_ioapic: Fix get ioapic_id
Information about IOAPIC can be located not in the first
DMAR Hardware Unit Definition subtable. Iterate them all.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-19 11:04:19 +01:00
Anisetti Avinash Krishna
eb2cd31407 drivers: sdhc: intel_emmc_host: Fix return value
Fixes uninitialized variable return by returning zero
at the end of function.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-19 08:52:00 +01:00
Anisetti Avinash Krishna
fcc572e040 drivers: dma: intel_lpss: Fix channel count condition
Fixes channel count comparison by using connect const.

Signed-off-by: Anisetti Avinash Krishna	<anisetti.avinash.krishna@intel.com>
2023-12-19 08:51:54 +01:00
Lukasz Majewski
eccc64fc49 drivers: ethernet: lan865x: Trigger IRQ routine when rca>0 read from TX ftr
This code fixes following issue:

The TX data chunk (with NORX set) is send to chip (via SPI) and at the
same time a frame is received (by the LAN8651 chip), there will be no IRQ
(the CS is still asserted), just the footer will indicate this with the
rca > 0.

Afterwards, new frames are received by LAN865x, but as the previous footer
already is larger than zero there is no IRQ generated.

To be more specific (from [1], chapter 7.7):
----->8-------
RCA – Receive Chunks Available
Asserted:
The MAC-PHY detects CSn deasserted and the previous data footer had no
receive data chunks available (RCA = 0). The IRQn pin will be asserted
when receive data chunks become available for reading while CSn is
deasserted.

Deasserted:
On reception of the first data header following CSn being asserted
------8<------

Doc:
[1] - "OPEN Alliance 10BASE-T1x MAC-PHY Serial Interface"
OPEN_Alliance_10BASET1x_MAC-PHY_Serial_Interface_V1.1.pdf

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-19 08:51:27 +01:00
Lukasz Majewski
f426ad16e1 drivers: ethernet: Update ETH_LAN865X_TIMEOUT Kconfig description
The description is a bit misleading as the packet is not even read in
the mentioned case by the OA TC6 Zephyr driver.

When the timeout occurs the data (packet) received by LAN865x may be:
- Read latter if still in the RX buffer of LAN865x
or
- Is (probably) dropped by LAN8651 itself as the RX buffer gets overrun

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-19 08:51:27 +01:00
Lukasz Majewski
4903ec7478 drivers: ethernet: tc6: Check footer parity before updating struct oa_tc6
The parity of the received footer from data transfer (also including the
NORX) shall be checked before members of struct tc6 are updated.

This prevents from updating the driver's crucial metadata (i.e. struct
oa_tc6) with malformed values and informs the upper layers of the driver
that error has been detected.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-19 08:51:27 +01:00
Lukasz Majewski
d2e864f17b drivers: ethernet: lan865x: Don't wait on semaphore if no memory for pkt
With the current approach, the driver prevents from TX transmission
when waiting on timeout (standard 100ms) for available memory to be
able to allocate memory for RX packet.

It is safe to just protect the part of reading chunks. In that way
pending TX transmission can be performed.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2023-12-19 08:51:27 +01:00
Declan Snyder
410990825a drivers: mdio_nxp_enet: Support MDC freq prop
If the DT node for mdio of nxp enet has a mdc freq specified,
use this when configuring the module.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-19 08:51:05 +01:00
Erwan Gouriou
54d7793e82 drivers: bluethooth: stm32wba: Add HCI driver for STM32WBA
Add HCI Driver for STM32WBA devices.
Based on B91 HCI driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-18 17:31:08 +00:00
Bryan Zhu
67099d2bba timer: ambiq_stimer: fixing disabling tickless not working issue
In init function, start timer with period CYC_PER_TICK if tickless is
not enabled, This change is for fixing the issue that disabling
CONFIG_TICKLESS_KERNEL the OS tick is not work issue, this
causes the OS not starting scheduling correctly.

Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
2023-12-18 15:03:35 +01:00
Murlidhar Roy
eb006b992f drivers: sdhc: add cdns sdhc/combophy driver files
Add SDHC driver files with new SD framework changes
SDHC driver includes combophy configurations.

Added mmc binding yaml file

Signed-off-by: Murlidhar Roy <murlidhar.roy@intel.com>
2023-12-18 15:00:38 +01:00
Aaron Ye
d385150bb0 drivers: bluetooth: Add Ambiq HCI driver for Apollo4 Blue Plus.
This commits create the dts binding for Ambiq BT HCI instance.
And create the SPI based common HCI driver for Ambiq Apollox
Blue SoC and the extended soc driver for HCI.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2023-12-18 14:54:53 +01:00
Fabio Baltieri
ecce235322 input: kbd_matrix: fix possible race condition
Fix a possible race condition in the keyboard matrix library where a key
would get pressed between the last read and reenabling the (edge
sensitive) interrupt and the even would be lost.

The window for this to happen is very narrow and had to artificially add
a sleep to reproduce it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 12:25:19 +01:00
Fabio Baltieri
ffbd0397dd input: gpio_kbd_matrix: use edge-to-active interrupt
Change the interrupt setup from both edge to edge to active. Edge to
active is all was needed anyway and it makes this compatible with gpio
controller that only support single edge interrupt.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 12:25:19 +01:00
Fabio Baltieri
f9313b1745 input: add a linux-evdev device
Add a device driver to read events from a Linux evdev device node and
inject them back as Zephyr input events.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 12:23:59 +01:00
Johann Fischer
cc2fdf2053 drivers: udc: add initial support for DWC2 controller
The driver currently supports only dedicated FIFO mode (with
dynfifosizing if enabled). Control, bulk and interrupt transfers are
supported, isochronous transfers are not yet supported. The driver
accesses controller registers using sys_io.h, but for debugging purposes
one can get a register map from the driver's config, similar to the
usb_dc_dw.c driver.

Initial support also has vendor quirks for the STM32F4 SoC family.
Tested on NUCLEO-F413HG.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-18 09:48:58 +01:00
Johann Fischer
ffbe257c76 drivers: usb: use common usb_dwc2_hw.h header
Use new common header and remove usb_dw_registers.h.
No functional changes, only renaming of registers and field identifiers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-18 09:48:58 +01:00
Johann Fischer
ef124718aa drivers: usb: add common DWC2 register header
This header is based on drivers/usb/device/usb_dw_registers.h and
describes registers of the DWC2 controllers IP and is intended for use
in both device controller drivers and a host controller driver. The
difference to usb_dw_registers.h is that this header does not confuse
offsets with bit positions, contains all the definitions required for
device mode, has register and bit field names identical to the databook
and no annoying underscores.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-18 09:48:58 +01:00
Marek Vedral
6068255512 drivers/timer/arm_arch_timer: Fix cycles overflow with GDB stub
If GDBSTUB is enabled and the kernel runs in tickless mode, the timer
must not convert the delta cycles to a 32-bit data type (cycle_diff_t in
this case). The delta_ticks variable would overflow and the next timeout
would be set before the current timestamp, thus generating an interrupt
right after leaving the handler. As a result, the system would receive
tens of thousands of interrupts per second and would not boot.

Cc: Michal Sojka <michal.sojka@cvut.cz>
Signed-off-by: Marek Vedral <marek.vedral@gmail.com>
2023-12-18 09:31:42 +01:00
Adrien Bruant
9e8c00f28c drivers: stm32-rtc: return -ENODATA when RTC is uninitialized
rtc_get_time() on STM32 does not implement the -ENODATA return code.
This prevents testing the initialisation status of the RTC.

Fixed by reading INITS flag and adding a error path in
rtc_stm32_get_time().

Signed-off-by: Adrien Bruant <adrien.bruant@aalberts-hfc.com>
2023-12-18 09:31:23 +01:00
Daniel Gaston Ochoa
5781b6a05f Revert "drivers: spi: stm32h7: Use FIFO"
This reverts commit bffa0c6bddbc91d39f4b01baa34e3d0595760d50.

This FIFO implementation causes a regression by which the SPI
peripheral generates several spurious SCK cyles after the last
data has been sent.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-12-18 09:31:00 +01:00
Tom Chang
4dc7c89f40 drivers: espi: npcx: introduce espi taf driver
This CL implements espi taf read/write/erase function for NPCX.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2023-12-18 09:30:01 +01:00
HaiLong Yang
640a493c1d drivers: adc: stm32 adc support h7 dual core lines
For STM32H7 dual core lines, M4 can not access to linear calib addr
ADC_LINEAR_CALIB_REG_1_ADDR.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2023-12-18 09:29:17 +01:00
Tomi Fontanilles
490a02fda7 drivers: net: ppp: improve CONFIG_NET_PPP_ASYNC_UART_TX_TIMEOUT
Its default value (100 ms) resulted in PDUs big enough to never make it
through on a slow enough UART (e.g. ~1152-byte PDUs on a UART@115200).
The UART TXs were silently aborted.

A no-timeout value is now allowed and made the default.
Additional warnings are logged when it is likely that a UART TX
was aborted due to a too low timeout for the used baud rate.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2023-12-18 09:29:07 +01:00
Tomi Fontanilles
9b78b4e894 drivers: net: ppp: various fixes
- Disable UART when the PPP interface is brought down.
  This prevents an error when it is next brought up.
- Change the level of certain logs to be less concerning
  and less verbose.
- Fix warnings regarding the passed parameter types of %p conversions.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2023-12-18 09:29:07 +01:00
Fabio Baltieri
38d5c0a8ac input: kbd_matrix: make the thread priority configurable
Add a config entry for the keyboard matrix thread priority. This
changes the current default, but that was pretty much an arbitrary numbe
anyay and the exact one should be picked the application so it should be
alright to do so.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 09:27:53 +01:00
Fabio Baltieri
cc5cef8179 input: gpio_keys: add power management support
Add power management support to the gpio keys driver. When in suspend,
disable all the button gpios and interrupts.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 09:27:42 +01:00
Ryan McClelland
b4768d5d42 drivers: i3c: cdns: run clang-format
Run the clang-formatter. This just changes white-space on defines.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-12-15 14:39:38 +01:00
Ryan McClelland
9c22c82604 drivers: i3c: cdns: handle controller aborts
Some targets do not give EoD at the end of a register read. They will
auto increment their address pointer on to the next address, but that
may not be of interest to the application where the buffer size will
only be set to the size of only that register. If the target, does
not give an EoD, then the Controller will give an Abort... but this
should not be treated as an error in this case.

There is still however a case where an abort Error shall still be
considered as an error. Athough the driver does not support it yet,
threshold interrupts are to be used if the length of the buffer
exceeds the size of the fifo. There could be the case where the
cpu can not get around fast enough to pop out data out of the rx
fifo and it will fill up. The controller will just give an abort
as it can not take any more data.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-12-15 14:39:38 +01:00
Richard Wheatley
a40a8a5f49 boards: arm: apollo4p_evb add connector to apollo4p_evb
Generic Connector for the apollo4p_evb
Ran tests/drivers/gpio/gpio_basic_api
Ambiq does not support DUAL Edged Interrupts.
Added Connector Usages as defined by the Ambiq BSP.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2023-12-15 14:35:32 +01:00
Mahesh Mahadevan
d77c706f94 drivers: dma_lpc: Suppport dest_scatter and source_gather
Process dest_scatter_interval and source_gather_interval
configurations and accordingly set the source and destination
increment values.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-12-15 14:04:52 +01:00
Gustavo Silva
f684e299b9 drivers: stm32: use IF_ENABLED() macro in config structs
Use the IF_ENABLED() macro to increase readability in some of
the STM32 drivers.

Fixes #62962

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
2023-12-15 14:04:12 +01:00
Vudang Thaihai
cf5781a148 drivers: gpio: gpio_pca953x: Adding input latch and interrupt mask
The gpio_pca953x gpio driver doesn't have
the input latch and interrupt mask
configuration which causes a lack of accessing
and using those features on an gpio expander
device. Fix it by adding input latch and
interrupt mask configurations in this driver.

Signed-off-by: Vudang Thaihai <vudang.thaihai@brillpower.com>
2023-12-15 12:22:39 +00:00
Daniel DeGrasse
c9404e0174 drivers: usb: usb_dc_kinetis: fix k_heap_alloc wait duration
Change k_heap_alloc wait duration to K_NO_WAIT in kinetis USB driver,
since the usb_dc_ep_configure function may be called from an ISR
context, where only K_NO_WAIT would be allowed as a duration for this
function.

Fixes #66507

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-12-15 11:41:56 +00:00
Fabio Baltieri
c0b103bfb1 input: ft5336: add suspend and resume support
Add power management support to ft5336. The chip can go to hibernate and
reduce power consumption to a minimum, the only way to wake it up though
is by pulsing the reset or wake signal. Only reset is implemented in the
driver right now so only allow this functionality if the reset pin is
defined.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-15 11:32:56 +00:00
Kai Vehmanen
c7e3ccd51a drivers: dma: intel_adsp_gpdma: fix issue with stop and PM refcounts
The DMA interface allows start and stop to be called multiple
times and driver should ensure nothing bad happens if the calls
are not balanced.

Fix an issue where after a start-stop sequence the DMA would be
powered down, and then a subsequent stop would result in a crash
as driver accesses registers of a powered down hardware block.

Fix the issue by handling stop without actually reading the hw
registers to check channel status.

Link: https://github.com/thesofproject/sof/issues/8503
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-12-15 11:32:41 +00:00
Dawid Niedzwiecki
b0753d9c10 entropy: stm32: enable interrupt when RNG is resumed
Enable the RNG module interrupt every time it is resumed.

It is done to make sure the interrupt is always enabled. The CR register
may not persist when the device clock is disabled on some chips.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-12-14 19:07:19 +00:00
Dawid Niedzwiecki
87f2486e1c entropy: stm32: enable rng module if needed
Move enabling/disabling the RNG module to acquire/release functions.
It causes enabling the RNG module for the get_entropy_isr function.

It fixes hanging in the get_entropy_isr function.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-12-14 19:07:19 +00:00
Weifeng Li
93869605eb drivers: flash: flash_stm32l5x: fix the STM32U5X flash bank issue
STM32U5X has 128k/256k/512k/1M/2M dual bank Flash.
The address of the 2 bank are continuous, so it's no need a "Dummy page"
in "stm32_flash_layout", which cause wrong slot1 section (for secondary
image), and the BANK2_OFFSET is not right either, which cause
"flash_stm32_valid_range" return a failure.
To fix the issue, just set CONFIG_FLASH_SIZE to STM32_SERIES_MAX_FLASH
Tested on NUCLEO-U545RE with mcuboot.

Signed-off-by: Weifeng Li <weifeng.li@aofrio.com>
2023-12-14 19:06:36 +00:00
Adam Wojasinski
c88b492842 drivers: spi: nrfx: Update doc for RAM_BUFFER_SIZE Kconfig symbol
Update documentation for SPI_NRFX_RAM_BUFFER_SIZE Kconfig symbol
to reflect new usage of it. Now the symbol specifies size of RX buffer.
The change introducing support for RX buffer placed by a linker in
memory region defined in SPIM devicetree node is in a parent commit
of that one.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-12-14 10:14:26 +01:00
Adam Wojasinski
ae75a8f73a drivers: spi: spi_nrfx_spim: Add support for RX buffer from RAM region
This patch adds support for RX buffer placed by a linker in
memory region defined in SPIM devicetree node. The buffer is placed
in memory region defined as devicetree node. The memory region node's
reference is then stored in `memory-regions` property of SPIM node.

Added build time assertion to check if `CONFIG_SPI_NRFX_RAM_BUFFER_SIZE`
Kconfig symbol has value greater than 0 when given SPIM node has
`memory-region` property.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-12-14 10:14:26 +01:00
Marc Desvaux
4dc0bd1800 drivers: ethernet: remove sections.ld for SOC_SERIES_STM32H5X
remove section(".eth_stm32_desc") and
section(".eth_stm32_desc") for SOC_SERIES_STM32H5X


Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-12-14 09:32:35 +01:00
Alessio Lei
733b81d2c7 drivers: modem: remove dependency of modem_socket
Fixed Kconfig to remove dependency between modem_socket and
modem_context, the two do not depend on each other and
should be possible to use independently

Signed-off-by: Alessio Lei <alelei94@yahoo.it>
2023-12-14 09:31:51 +01:00
Declan Snyder
1011acd4d7 drivers: nxp_enet: Improve code readability
Improve code readability of this driver by simplifying and reworking
some of the source code, formatting and comments.
This commit is not meant to cause any functional difference.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-14 09:30:05 +01:00
Armando Visconti
1badec4bfd drivers/sensor: add support to LIS2DU12 accelerometer
The LIS2DU12 is a linear 3-axis accelerometer with advanced digital
functions whose MEMS and ASIC have been expressly designed to build
an outstanding ultralow-power architecture in which the anti-aliasing
filter operates with a current consumption among the lowest in the
market.
This driver is based on stmemsc HAL i/f v2.3

https://www.st.com/en/datasheet/lis2du12.pdf

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-12-14 09:28:52 +01:00