Now a bus abstraction for Trinamic stepper drivers with
unified interface for SPI/UART communication. Separates
transport logic from device-specific functionality.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
During testing and code inspection, there were various anti-patterns
on this (and U-Blox driver) codebase(s), including obfuscation, and
lack of data validation. This made it increasingly difficult to
introduce further variants of u-blox GNSS modems.
With this patch, both the UBX modem and the M8 driver have been
refactored to ease the reliability and maintainability of these
codebases. Here are some highlights:
WRT UBX modem:
- Helper macros to easily create UBX frames, (including checksum
calculation), at compile time; thus, making it easier to extend UBX
commands.
- Logic validation by the inclusion of the modem_ubx testsuite, used to
refactor the code through TDD.
- Ability to receive unsolicited messages, in order to enable U-Blox
drivers to rely on modem_ubx to transceive all commands, and avoid
hopping between modem_ubx and modem_chat.
WRT M8 driver:
- Remove GNSS specific protocol header files. Instead, unify them under
modem/ubx/protocol.h. Background: After a survey and looking at ubxlib
SDK I conclude the UBX protocol is by definition a GNSS protocol (there
are non-GNSS u-blox modems, but they're not interfaced through UBX
protocol).
- Establish pattern to create and send/receive commands using new
foundations on modem ubx.
- Remove dependency of Modem chat, and instead use UBX unsolicited
messages to get Navigation and Satellites data.
- Switch from the auto-baudrate detection pattern to a pattern of
transitioning between an initial known baudrate to a desired baudrate,
in order to improve initialization time.
- Add dts property to configure default fix-rate.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Following the new feature in the flexcomm driver to be able to wake up
from low power mode, the clock control drivers have to handle the
platform specific details, so this commit adds to the already ugly mess
that is the LPC syscon driver which is used by RW currently and makes
the required devicetree changes.
Make the console/shell uart on the FRDM_RW612 take advantage of this by
default.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add the feature for the flexcomm uart to be able to be a wakeup source
from low power modes. To be able to do this on a relevant platform, the
DT node for the UART needs to have the wakeup-source property and define
a "sleep" clock. The details of handling the sleep clock and default
clock are still platform specific but handled by the clock control
driver of the platform, so that this code should be able to be
applicable to any platform that follows the same DT definition.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There is currently a bug where when entering low power modes, there is a
garbage character sent if the UART is in the middle of a transmit when
entering low power mode. This is because the fifo interrupt happens when
last character is pulled by transmitter from fifo and then we unlock PM
constraints at that moment, instead of waiting for actual transmitter to
become idle. Fix by adding work item to check for this when needed.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The `CONFIG_WIFI` symbol currently covers a number of different
use-cases of Wi-Fi, primarily:
* Wi-Fi AP (Broadcasting a network others can connect to)
* Wi-Fi Station (Connecting to an AP + SSID scanning)
* Wi-Fi AP + Station (Both the above)
* Wi-Fi SSID scanning (SSID scanning only)
Each of these application usages of Wi-Fi requires a different set of
supporting options to operate correctly (`WPA_SUPP`,
`NET_CONNECTION_MANAGER`, etc), and different opportunities for resource
optimisation (System heap, buffer counts, etc).
Currently, optimizing the Wi-Fi drivers depends on driver specific
options, which can be challenging to find and are obviously not portable
across different drivers.
The addition of this choice allows applications to specify in a single
Kconfig option which features of Wi-Fi they use, and enable individual
Wi-Fi drivers to choose defaults based on those features.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The boot report is used to pass information from IRONside to a CPU
being booted.
Integrate the boot report to the update service sample.
Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
Because the same IP supports both device and host, so use
DYNAMIC_INTERRUPTS for KHCI and EHCI if both device and host
are enabled.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Parameter checking of flash read API expects checking for len == 0
before checking dest buffer validation.
Fixes#87021
Signed-off-by: David Leach <david.leach@nxp.com>
rtio_cqe_consume() may return NULL so we need to check before
using any members of the returned struct.
Fixes#90473Fixes#90489Fixes#90497
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Coverity flagged that the return variable ret may not be
initialized when returning. So give it a default value.
Fixes#90509
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
espi: add espi peripheral channel HOST_CMD driver for rts5912
Unlike other chips using IO port 0x800-0x8ff, we utilize shared memory to
transfer host command parameters. The AP firmware must have corresponding
settings for this configuration.
Signed-off-by: jhan bo chao <jhan_bo_chao@realtek.com>
base on DesignWare I2C driver to implement RTS5912 I2C driver.
1. support customize bus recovery function.
2. fix isr timing issue by enable tx empty control.
3. support stuck at low handle by enable bus clear feature.
4. support custom stuck at low timeout set from dts
5. disable block mode in rts5912 i2c.
6. support I2C_ALLOW_NO_STOP_TRANSACTIONS
Signed-off-by: Titan Chen <titan.chen@realtek.com>
Separate out host(local) and FW(remote) statistics and in case of a
FW statistics timeout, return success with a magic value in the FW
statistics, this way atleast host statistics would be handy for
debugging instead of sending failure up.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
A write to the "ctrl_meas" register can cause the sensor to transition
from sleep to normal mode (which is default Kconfig settings). As per
BME280 datasheet, writes to the "config" register in normal mode may be
ignored. This can lead to use BME280_STANDBY_05MS and BME280_FILTER_OFF
instead of the values set by the application. To fix this, write to the
"config" register before "ctrl_meas" in the sensor init function.
Signed-off-by: Loic Domaigne <tech@domaigne.com>
The current I2C driver assumes that at least one byte will be read in CQ
(command queue) mode. However, when a 0-byte read is issued
(e.g., by cmd_i2c_scan),
The read handler uses (len - 1) to set the command queue length.
When len is 0, this underflows to 0xFF, leading to an incorrect transfer
length and possible crash.
To fix this, add a check in cq_mode_allowed() for reads with length 0:
-Fallback to PIO mode in such cases.
-Properly handle 0-byte reads by issuing STOP (E_FINISH) when the slave
address is acknowledged.
-Add appropriate handling for NACK conditions when the slave address is
not acknowledged.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Keep data instance inside of data structure.
Avoid accessing global data or using pointers to out of
data instance.
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
The following parameters are exposed through DTS bindings:
- ODR.
- Dual Frequency Mode.
- Measurement Mode.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Each time this sensor gets a reading, it contains a matrix of 4 x 32
pixels containing distance readings, from which the 1-D result is
calculated. The private channel would expose this array through
Sensor APIs.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
- Add AFBR module as a HAL.
- Platform layer to support running AFBR API using Zephyr.
- Ability to instantiate on device-tree.
- Samples in the module proving foundations works.
- Zephyr Sensor API support, by introducing:
- Read/Decode for SENSOR_CHAN_DISTANCE (1-D results).
- Streaming mode for DATA_READY (1-D results).
Signed-off-by: Luis Ubieda <luisf@croxel.com>
DMA channel stats like pending_length or free is not protected
and can be modified in parallel by a consumer and a producer.
This can result in non-atomic updates which in turn will result
in using stale data.
Fix this by making regions of code accessing dma stats atomic.
Fixes: e94c86f395 ("drivers: dma: Add initial support for NXP SDMA")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Each time we configure an SDMA channel we also compute the total
allocated DMA buffer length but we assume is initialized with zero.
This is true each time a channel is requested. But if there are
multiple calls to configure without releasing the channel the buffer
length is not correctly computed.
So, we need to initialize it with zero each time we reconfigure the dma
channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Removed a logically dead else by doing sensor channel check
in a way that's more aligned with how other drivers do it.
Fixes: CID 505949
Fixes: zephyrproject-rtos/zephyr#90558
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
CLOCK_CONTROL_NRF_HFINT_CALIBRATION depended on the renamed
nordic,nrf-hfxo -> nordic,nrf54l-hfxo. Update config to depend on
DT_HAS_NORDIC_NRF54L_HFXO_ENABLED to match new compat name.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>