Commit graph

23353 commits

Author SHA1 Message Date
Robert Hancock
68a24863c0 drivers: spi_xlnx_axi_quadspi: Optimize FIFO handling
Add an optional DT property to specify the size of the RX/TX FIFO
implemented within the SPI core. The property name used is the same one
used by Xilinx's device tree generator.

When the FIFO is known to exist, we can use the RX FIFO occupancy register
to determine how many words can be read from the RX FIFO without checking
the RX FIFO empty flag after every read. Likewise with the TX FIFO, we can
use the FIFO size to avoid checking the FIFO full flag after every write.
This can increase overall throughput.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2024-06-15 05:15:46 -04:00
Robert Hancock
cff3811613 drivers: spi_xlnx_axi_quadspi: add STARTUP block workaround support
Add support for a workaround required when using the Xilinx Quad SPI core
with the USE_STARTUP option, which routes the core's SPI clock to the
FPGA's dedicated CCLK pin rather than a normal I/O pin. This is typically
used when interfacing with the same SPI flash device used for FPGA
configuration. In this mode, the SPI core cannot actually take control
of the CCLK pin until a few clock cycles are issued, which would break
the first transfer issued by the core. This workaround applies a dummy
command to the connected device to ensure that the clock signal is in the
correct state for subsequent commands.

See Xilinx answer record at:
https://support.xilinx.com/s/article/52626?language=en_US

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2024-06-15 05:15:46 -04:00
Adam Berlinger
19b39406eb soc: st: Add support for STOP3 on STM32U5
LPTIM is not available in STOP3 mode, so RTC needs to be used instead.
This code usese similar approach as STM32WBAx for suspend to ram.
The STOP3 is disabled by default in device tree.

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
2024-06-15 04:44:26 -04:00
Adam Berlinger
2c88cc08b3 drivers: timer: Fix timing in suspend-to-ram
Fix timing in suspend-to-ram when using STM32WBA.
Switch to use RTC timer should be done only when idle is set
and LPTIM clocks should be switched off

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
2024-06-15 04:44:26 -04:00
Trent Piepho
971227180b drivers/sensor: si7006: Switch to undef DT_DRV_COMPAT
This style is used in sensor drivers.  It's more complicated than the
other way, which is used in different drivers that are not sensor
drivers.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Trent Piepho
0f219e1e6d drivers/sensor: si7006: Fix math for calculating sensor values
The existing code rounded the result to an integer, then multiplied that
integer by 1000000 to get micro-degrees or micro-percent, and then
divided by 1000000 to get whole degrees/percent and took the modulus to
get fractional degrees/percent.

Obviously, multiplying and then dividing an integer by the same value
has no effect!

The result is the humidity and temperature were always rounded down to
the nearest integer.

Fix this to properly keep the fractional component.  This is done in a
way that avoids any integer divisions, which are slow on all CPUs, but
especially most microcontrollers, e.g. Cortex-M, lack any integer
division instruction.

Avoiding the base 10 math does not require more code.  One just needs to
think in binary and use binary fractions instead of base 10 fractions.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Trent Piepho
88649dad1a drivers/sensor: si7006: Mask off low two bits of data reads
The low two bits are not part of the data, but rather "status" bits that
should be masked off.

This is documented in the HTU21D datasheet Edition 8, date 05/2017, pp.
15, and Sensirion SHT21 datasheet version 6, date 10/2022, §6 (wording
exactly the same):

"The two status bits, the last bits of LSB, must be set to ‘0’ before
calculating physical values."

Also Silicon Labs Si7006 example driver code:
        /* Swap the bytes and clear the status bits */
        return ((data.byte[0] * 256) + data.byte[1]) & ~3;

Since these are the LSBs, it has only a small effect and might not have
been noticed despite being wrong.

While editing this code, switch to using the Zephyr endian conversion
functions intead of a written out conversion.

Add error code to error log message.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Trent Piepho
c7b3b13119 drivers/sensor: si7006: Clean up headers
Some, like stdio.h, don't belong here at all and aren't needed.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Trent Piepho
d7e03dd148 drivers/sensor: si7006: Support SHT21 and HTU21D
These three sensor types are all largely compatible.  The SHT21 and
HTU21D can be supported by this driver by sending command 0xE3 instead
of 0xE0 to read the temperature.

Mention the sensor names in bindings and Kconfig to help those looking
for support to find it.  There have been at least five PRs attempting to
add SHT21 and/or HTU21D support that did not realize the Si7006 is the
same.

As mentioned in PR #22862, the Sensirion SH21 is the original.  The dts
bindings are adjusted (in a backward compatible way!) to make the sht21
the base binding and si7006 is derived from that.

Examples of dts compatibles:

TE Connectivity née Measurement Sepcialties HTU21D:
compatible = "meas,htu21d", "sensirion,sht21";

Sensirion SHT21:
compatible = "sensirion,sht21";

Silicon Labs Si7006
compatible = "silabs,si7006";

Silicon Labs Si7021
compatible = "silabs,si7021", "silabs,si7006";

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Trent Piepho
6817ac34b6 drivers/sensor: si7006: Remove unused struct device field
Use was removed but the field itself wasn't deleted.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Jakub Zymelka
8091e93838 drivers: mbox: nrf: Change VEVIFs and BELLBOARD nomenclature
Renaming 'LOCAL' to 'RX' and 'REMOTE' to 'TX'.
This seems more descriptive and intuitive to use.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-06-15 04:41:47 -04:00
Jakub Zymelka
bace4a102d drivers: mbox: add initial driver for nRF VEVIF event
Add a mailbox driver for VEVIF events (VPR irq).
The driver can be built in either 'rx' or 'tx' configuration.
The VPR sends the event, so it uses the 'tx' configuration,
while the master core uses the 'rx' configuration of the driver
to receive the VPR events.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-06-15 04:41:47 -04:00
Dawid Niedzwiecki
3b85e8b8ea drivers: counter: add missing include
Add missing include for get_value_64 in the counter_handlers.c file.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-06-14 21:14:43 -04:00
Swift Tian
ece0c9b0d3 drivers: mspi: Add ATXP032 NOR flash driver
The ATXP032 is a NOR flash device that supports up to ~100MHz
octal SDR/DDR with 4MB nonvolatile memory.
The device driver uses MSPI bus API and could be used across different
SoC controllers that implement the MSPI bus API.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
c7ed0b6aa8 drivers: memc: Add APS6404L device driver
The APS6404L psram is a quad SDR SPI device that runs up to 100MHz.
It can provide 8MB of external RAM for SoCs that supports XIP feature.
The device driver uses MSPI bus API and could be used across
different controllers that implement the MSPI bus API.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
43e23cf9f2 drivers: mspi: Add Ambiq apollo3p mspi controller
The Ambiq MSPI controller is implemented using the MSPI bus API.
The hardware supports up to 48MHz octal SDR with XIP, scrambling and
hardware command queue features.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
eccc2ba8c4 drivers: flash: Add a flash emulator
Add a flash emulator that uses MSPI API to emulate a flash device
on MSPI bus.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
f5554ca762 emul: mspi: Add the mspi controller emulator
Add bus emulator support for MSPI and the MSPI controller emulator.
The mspi_emul.c not only serves as an emulator but also provides an
example implementation of the MSPI API. It does not actually do anything
other than validating parameters and forwarding transceive request back
to the device driver emulators.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
8a2bf58826 drivers: mspi: Add the new MSPI API
The MSPI(multi-bit SPI) is provided as a generic API to accommodate
advanced SPI peripherals and devices that typically require command,
address and data phases, and multiple signal lines during these phases.
While the API supports advanced features such as XIP eXecute In Place
and scrambling, it is also compatible with generic SPI.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Flavio Ceolin
e452bc36a6 dai: ssp/ptl: Add missing definition in PTL
SSCR0_ACS is missing in PTL header.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-14 19:08:07 -04:00
Raffael Rostagno
6096a10b9a drivers: clock_control: Refactor for ESP32C6
Added support for C6 to allow CPU clock config

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Raffael Rostagno
d59168eecb drivers: ledc: Clock source update to support ESP32C6
Clock source SCLK added for C6 on LEDC

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Raffael Rostagno
67e43f6a81 drivers: intc: Fix for ESP32C6 interrupt sources allocation
Fix to properly allocate IRQs for interrupt sources over 60.
It also screens out non-allocatable IRQs used by the CPU.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Raffael Rostagno
7500f4e620 drivers: spi: Add suport to ESP32C6
Added GP-SPI2 (general purpose SPI2) support for ESP32C6

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Raffael Rostagno
909f7922d6 drivers: watchdog: Added support to C6
Added support to watchdog timer to ESP32C6

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Lucas Tamborrino
a62423f391 drivers: Update to add support for esp32c6
Changes to bring support for esp32c6 SoC.
- clock control
- gpio
- pinctrl
- serial
- timer

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-06-14 18:51:46 -04:00
Pisit Sawangvonganan
47390f7244 drivers: disk: remove sdmmc_sdhc.h since no longer used
Removed `sdmmc_sdhc.`h header file from `drivers/disk` and updated
`CODEOWNERS` to reflect this.

At the point of pull-request, there are no references to this file
in the `codebase`, indicating it is no longer needed.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-06-14 18:50:47 -04:00
Benjamin Lemouzy
5c8937fbac drivers: sensor: lm75: add alert threshold support
Add SENSOR_ATTR_ALERT and SENSOR_ATTR_HYSTERESIS attributes support.
The code is heavily inspired by the one for lm77 sensor.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2024-06-14 18:48:32 -04:00
David Ullmann
35740a8322 drivers: lora: implement reyax lora driver
implementation of reyax lora module

Signed-off-by: David Ullmann <davidl.ullmann@gmail.com>
2024-06-14 17:12:49 -04:00
David Ullmann
de6274f302 lora: add config for reyax lora module
adding the Kconfig for reyax lora module

Signed-off-by: David Ullmann <davidl.ullmann@gmail.com>
2024-06-14 17:12:49 -04:00
Daniel DeGrasse
be23e70fff drivers: display: gc9x01: convert to MIPI DBI API
Convert galaxycore GC9X01 to MIPI DBI API. In tree boards and tests
using this display have also had their devicetrees updated to use the
new MIPI DBI SPI emulated device.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-14 17:11:20 -04:00
Sylvio Alves
f6fdfd4ee1 soc: esp32c3: add systimer clock disable option
When both MCUBoot and application run, systimer is initialized twice.
As a consequence, application freezes as systimer new initialization
conflicts with previous.

This PR adds the systimer clock disable function, that shall be called
before mcuboot jump to application, making sure it will
work as expected.

Fixes #74189

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-06-14 17:10:07 -04:00
Damian Nikodem
a2386efbce drivers: ssp: update SSP driver to support Intel ACE30 PTL
This commit refactors the SSP driver to support the Intel ACE30 PTL
platform. The changes include:
- Adding new structures ssp_rx_dir and ssp_tx_dir to hold the TDM
slot configuration for RX and TX directions
- Adjusting the dai_ssp_set_config_blob functions to work with
the new TDM slot configuration.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-06-14 20:33:18 +02:00
Robert Hancock
2d171efcec drivers: sensors: Add driver for LM95234 temperature sensor
Add a driver for the National/TI LM95234 Quad Remote Diode and Local
Temperature Sensor with SMBus Interface and TruTherm Technology.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2024-06-14 19:34:01 +02:00
Daniel DeGrasse
9fdaf43e79 drivers: display: uc81xx: convert to MIPI DBI API
Convert UC81XX display to use MIPI DBI API, as this display uses a SPI
3/4 wire bus. In tree shields using this driver have also had their
devicetrees updated to use the new MIPI DBI SPI driver

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-14 19:32:39 +02:00
Fabio Baltieri
12405a64d4 input: analog_axis: implement power management support
Implement suspend and resume, just stop and restart the timer that kicks
the main thread update cycles.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-06-14 19:22:25 +02:00
Jiafei Pan
5c95d04b26 clock: mcux_ccm: add enet clock support for imx8m serial
Add ENET clock support for imx8m serial platforms.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Jiafei Pan
671aaf48b5 drivers: mdio_nxp_enet: using MMIO mapped address
Use ENET module MMIO mapping address directly.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Jiafei Pan
bbf34ad6a0 drivers: mdio_nxp_enet: remove unused header file
soc.h is not used, and some platform has no such header file, so
remove it.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Jiafei Pan
c8d8dce755 drivers: ptp_clock: ptp_enet: use MMIO mapped address
Get MMIO mapped address from ENET module driver.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Jiafei Pan
cca390d243 drivers: ethernet: eth_enet: add MMIO mapping
Adding MMIO mapping support in ENET module driver before MDIO, MAC
and PTP drivers initialization, so that they can reuse this mapping.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Jiafei Pan
0c958ae212 drivers: ethernet: eth_enet: remove building error
Don't block building in case of there is no unique ID provided.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Jiafei Pan
f1aa5d9391 drivers: eth_nxp_enet: fix cache maintain
Need to disable cache maintain by driver in case of
using noncache DMA buffer.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-14 19:21:18 +02:00
Tom Burdick
3b94af2b5c sensors: Submit call returns void
The integer return of sensor_submit should be void as the call is
asynchronous and the response is meant to be delivered using RTIO APIs
signaling that the submission completed with error or success.

Change the function signature to void and fix all uses of the submit
API, fixing some bugs in the process.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-14 19:13:02 +02:00
Yong Cong Sin
0103c56dd6 zephyr: remove deprecated headers
These headers have been deprecated for > 2 full releases,
let's remove them to keep them out of v3.7.0 LTS.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-14 19:12:00 +02:00
Guillaume Gautier
fe05606630 drivers: flash: select ncs line for stm32 xspi
Add support to select the nCS line for XSPI from the device tree.
Disable the nCS override.
This setting only works with series that have an XSPIM (so not H5)

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-06-14 15:44:38 +02:00
Thibo Verheyde
ddef306394 drivers: serial: esp32: Fix next buffer release on rx disable
Set event data rx buffer as next buffer instead of current buffer.

Signed-off-by: Thibo Verheyde <thibo@dptechnics.com>
2024-06-14 15:38:02 +02:00
Daniel Leung
e98e4ed067 serial: convert kconfig source to rsource
Simple cosmetic change to convert all the source commands
to rsource so that includes are relative to driver/serial.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-14 15:37:31 +02:00
Yangbo Lu
b77dab6199 drivers: ethernet: phy_realtek_rtl8211f: enable RGMII TX/RX delay
The RGMII specifies output TXC/RXC and TXD/RXD without any clock skew.
Need to add skew on clock line to make sure the other side sample
right data. This can also be done in PCB traces.
This patch is to enable RGMII TX/RX delay to ensure timing.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-06-14 15:36:39 +02:00
Yangbo Lu
e5f6cee9fb drivers: ethernet: phy_realtek_rtl8211f: fix monitor work schedule
Monitor work should be scheduled for non-interrupt mode.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-06-14 15:36:39 +02:00