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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Changes to bring support for esp32c6 SoC.
- clock control
- gpio
- pinctrl
- serial
- timer
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>