Per the SX1261/2 datasheet (13.1.12) 0x000000 selects Rx Single mode
and 0xFFFFFF Rx Continuous mode; the two defines had their values
swapped.
No functional change: SX126X_RX_TIMEOUT_SINGLE (0xFFFFFF) was never
referenced, and the continuous receive paths (lora_recv_async, and
lora_recv with K_FOREVER) re-arm RX after every packet in
sx126x_rx_restart(), so they kept receiving even with the chip wrongly
in single mode. The blocking recv path needs only one packet and
sleeps the radio in the RxDone handler regardless. After the swap
those paths use true Rx Continuous mode, with identical observable
behavior.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
GPR bit 0 is Write-Only (WO per DM9051A spec), reading returns
undefined values (default XXh). The previous code read GPR and only
powered on the PHY if bit 0 was set to 1. If the read returned 0x00
(random undefined value), the PHY would never be powered on.
Fix by unconditionally writing GPR = 0x00 to power up the PHY,
ensuring it is always enabled regardless of any prior state.
Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
Add code comments to make sure the common data/config fields stay in the
correct place in the driver-specific struct if those structs ever get
modified.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
There's no point in having driver specific data structs if the only thing
they contain is the common data struct. Just declare the common data struct
directly as dev->data.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Now that we have a common data struct, we can take advantage of it and
move the recv callback into it. This way the common layer takes care of
assigning, dispatching and clearing the callback. Drivers now have to use
the new bt_hci_recv() API to pass data to the layer above them (typically
a host stack). Additionally, the drivers no longer get a recv parameter as
part of their open() callback, since that's all handled by the common
layer.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add a display driver for monochrome and grayscale LED matrices driven by
charlieplexed GPIOs. With N GPIO lines such a matrix can drive up to
N*(N-1) LEDs: each pixel sits between an ordered pair of lines and is lit
by driving one line high and one low while every other line is held at
high impedance. Only one LED is lit at a time; a timer scans the pixels
fast enough for persistence of vision.
The driver implements the display API. It keeps a per-pixel framebuffer
and uses a counter device as the scan time source, lighting the next
pixel on each top-value callback. Grayscale is produced by duty
modulation over a configurable number of sub-frames. To stay portable
across SoCs it drives the matrix purely through the generic GPIO API,
configuring the inactive lines as disconnected to obtain the required
high-impedance state rather than touching the GPIO registers directly.
The GPIO bank, the per-pixel high/low pin-pair map, the scan timer,
refresh rate and grayscale depth are all described in devicetree through
the new charlieplex-led-matrix binding.
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Assisted-by: Claude Code:claude-opus-4.8
Use min/max DT properties for reset num-resets DT properties to factorize
documentation and build time check of the property values against its
valid range.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Use min/max DT properties for ADC nchannels DT properties to factorize
documentation and build time check of the property values against its
valid range.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Place the I2S DMA callbacks and transfer helpers in IRAM and
mask the interrupt status to the relevant TX/RX events, returning
early on spurious interrupts to keep the ISR path coherent.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
ESP32-P4 does not provide soc/rtc_cntl_reg.h. Skip including
it on P4 along with the existing skip for C5/C6/H2.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
On SoCs with AXI GDMA, derive the DMA slot from the trigger
peripheral ID base. Flush the tx buffer and invalidate the rx
buffer around the transfer so CPU and DMA see coherent data.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Flush tx and invalidate rx DMA buffers around UART async DMA
transfers so the CPU and DMA engine see coherent data on SoCs
with an L1 data cache.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Wire ESP32-P4 specific IOMUX paths and status register layout,
use the combined raw interrupt status field, and align the DMA
descriptors to the cache line for coherent flush and invalidate.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Scale the RNG APB-cycle wait based on the CPU frequency on
ESP32-P4. The RNG has been characterised at around 75 kHz
on P4 ECO5+ silicon.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Explicitly enable the timer clock source via esp_clk_tree
before programming the counter. Required on P4 where the
source clock is gated by default.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Invalidate the DMA buffer after a DMA transfer so the CPU
reads the freshly captured samples instead of stale cache
lines.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add SOC_SERIES_ESP32P4 to the dependency list of the Espressif
systimer driver so it is selected by default and provides the
sys_clock_elapsed implementation the kernel needs.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add ESP32-P4 to the Espressif UART driver and the USB-serial-JTAG
backend, including the SoC-specific clock source selection
for the P4 UART HAL.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Select the gpio1 register field layout used by C5/C6/H2 on P4 and
switch the device definition to DEVICE_DT_INST_DEFINE.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Store the allocated interrupt level in the vector descriptor and
match it on reuse for flexible-INTC SoCs, widen the source field
and allow IRAM handlers placed in ROM.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Select the gpio1 register field layout used by C5/C6/H2 on P4 and
fold the initial pin-level set into a single gpio0/gpio1 path.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Wire ESP32-P4 into the Espressif clock_control driver: PLL (CPLL)
and XTAL CPU clock selection, RTC slow/fast clock setup and the
regi2c DBIAS handoff to PMU.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Port the eeprom shell to use shell_strtoul helper, instead of open code.
Previously, we warned for arguments that parsed as integers, but were
out of range. Parse failures, such as below, would simply write 0 for
the failing bytes.
eeprom write <dev> <offset> 05 06 07 08
or
eeprom write <dev> <offset> fa ce be ef
While this change doesn't make the read format viable to feed back to
what write expects, it will at least warn now that it has failed to
parse, instead of silently proceeding with 0 bytes substituted.
Signed-off-by: Karl Palsson <karl.palsson@marel.com>
Updates haptics shell to provide support for:
- calibration
- output level control
- selecting playback sources
- integrated sensor readings
- streaming samples to the device
Notably, DAI configuration from the shell is not supported.
Additionally, the shell supports driver-specific monitors and
sources using integers.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The newly introduced haptics_select_source() is a mandatory API feature, so
update existing haptic drivers to implement a placeholder. Subsequent PRs
can implement this function at a later point.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Extends the existing haptics subsystem API to provide generic support for:
- playback source selection
- integrated sensor readings
- output level control
- calibration
- streaming effects over a control port
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Currently, there was no check in place if set_power_save()
was called in AP mode which might result in undefined
behavior.
Additionally, esp_wifi_get_config() doesn't return an
error when querying for STA config in AP mode.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
The debug prints were showing the maximal length of operations, instead
of the operation length actually used.
Signed-off-by: Karl Palsson <karl.palsson@marel.com>
Factor the m2m software-trigger check into a helper using
FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(base) for per-instance
detection, and gate all four m2m-software-only branches (SG -ENOTSUP,
burst-length override, manual start trigger, suspend -ENOSYS) on the
new dma_mcux_edma_m2m_software_only().
Fixes parallel display output on MCXN947 (FlexIO-triggered m2m
channels were treated as software-only and lost their per-minor-loop
pacing).
Fixes: efe48ea674Fixes: #108367
Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
The NWP ignored the host programmed listen_interval and fell back to
its ~1s default, so both WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL and
WIFI_PS_WAKEUP_MODE_DTIM woke the device roughly once per second
regardless of the AP's DTIM period or the host-requested LI.
Set SL_WIFI_JOIN_FEAT_PS_CMD_LISTEN_INTERVAL_VALID in
siwx91x_iface_init() so the NWP honors the listen_interval supplied
via the host-side power-save command path (i.e. the value programmed
through sl_wifi_set_performance_profile_v2()) instead of substituting
its built-in default.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
Fixes zephyrproject-rtos#106241
When the RNG peripheral is enabled in the device tree but its kernel
clock source is not configured (e.g. HSI48 missing on STM32H7), the
driver currently hangs indefinitely inside generate_from_isr() with
interrupts locked, because RNG_SR.DRDY never asserts. This makes the
system completely unresponsive and very difficult to debug.
Three changes are made to address this:
1. Replace __ASSERT_NO_MSG(res == 0) after clock_control_on() with a
proper error check that returns the error code and logs a message.
2. Replace __ASSERT(res == 0) after clock_control_configure() with
the same pattern, returning the error code with a LOG_ERR.
3. Add a runtime clock source check that verifies the domain clock is
present in the DTS and running at a non-zero rate using
clock_control_get_rate(), following the same pattern as
sdmmc_stm32.c. Returns an error instead of hanging indefinitely.
4. Add LOG_MODULE_REGISTER so LOG_ERR messages are routed through
the standard Zephyr logging subsystem.
Based on approach suggested in zephyrproject-rtos#106241 by @FRASTM.
Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
The syscall verifier validated msg->data directly from live userspace
memory and then forwarded the original mutable userspace struct pointer
to z_impl_mbox_send(). A concurrent thread could race msg->data to a
supervisor address after the access check.
Fix this by copying struct mbox_msg into a kernel-stack variable.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
I was working with an STM32WB55RG that had the IWDG_STOP bit
unset by a previous developer. It took me hours to figure
out why WDT_OPT_PAUSE_IN_SLEEP didn't do what it's supposed to.
I hope this note helps the next one coming around to this issue.
I also wrote an article about this:
https://chris-besch.com/articles/soc_option_bytes
Signed-off-by: Christopher Besch <mail@chris-besch.com>
Add a bit of history about the driver (the information I would like to
forward to my future me). Try to explain why this driver has this design.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
By replacing "udma_table = cfg->chan_desc" by "chan_desc =
&cfg->chan_desc[channel]", we can simply many statements. So, all the
statements now fits on one line.
desc_src_addr and desc_dst_addr are in fact useless.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Scatter Gather transfers are not supported by siwx91x_udma_reload(). Detect
and reject them.
Also check the size of valid regarding the operation width.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Some fields names contained irrelevant information (eg. "addr" in
"sg_desc_addr_info" and in "sram_desc_addr", "dma" in "dma_desc_pool").
In other case, it lacked of consistency, (eg. "chan" vs "channel",
"config_zephyr" vs "dma_config" vs "config").
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
We try to prefix all the symbols in a file with the same prefix (so the
developer easily understand if a symbols is provided by Zephyr, the HAL or
is internal to the driver).
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Sanity checks were duplicated in siwx91x_udma_config_sg() and
siwx91x_udma_config_single(). Move them in the caller function.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
The UDMA drivers includes some functions to translate Zephyr values in
hardware values. However, these conversion are either trivial or not very
consistent. It is more readable to directly work with the native (Zephyr)
values. We just have to check the values requested by the caller are valid
before the processing.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Rather than using internal enum type to store the direction, store the
native (Zephyr) value. It will help to simplify the code in the next
changes.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
We try to prefix all the symbols in a file with the same prefix (so the
developer easily understand if a symbols is provided by Zephyr, the HAL or
is internal to the driver).
A few symbols in dma_silabs_siwx91x_gpdma.c did not follow this rule.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>