Propagate LOG_INST_ERR_DEVICE_NOT_READY() updates to
Cirrus Logic init functions for device checks. Also cleans
up some minor logic issues and unifies the init
implementation across CS40L26/27 and CS40L5x drivers.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The interrupt mask register uses active-low polarity: a bit value of 0
enables the interrupt on the corresponding pin, while 1 masks it
(per PCAL9539A datasheet section 6.2.10).
The standard interrupt configure function was computing:
int_mask = int_fall | int_rise;
This set bits to 1 for every interrupt-enabled pin, which masked all
interrupts rather than enabling them. Fixed by computing the input latch
first, then deriving the mask by inversion:
input_latch = int_fall | int_rise;
int_mask = ~input_latch;
Signed-off-by: Christoph Baechler <cbaechler@gmail.com>
The driver C source incorrectly references the new devicetree
property "scl-sda-low-timeout" by the symbol "scl_sda_low_timeout_ms".
Drop the trailing "_ms" so the property value is correctly used by the
driver.
Tested on an it82002aw evaluation board.
Signed-off-by: Keith Short <keithshort@google.com>
Three correctness fixes for the Infineon SDHC driver:
- WAIT_FOR() takes a total timeout in microseconds, not a loop count.
sdhc_host_poll_transfer_complete(), sdhc_poll_buf_read_ready() and the
buffer-read-enable poll passed the raw retry count (1000 -> 1 ms), so
slower cards timed out during the non-DMA PIO reads used by CMD6
(SWITCH_FUNC) and ACMD51 (SEND_SCR), producing "Buffer read is not
ready" and ACMD51 timeouts. Pass retries * per-iteration delay, matching
sdhc_poll_cmd_complete(). Also drop the duplicate IFX_SDHC_RETRY_TIMES
macro in favour of IFX_SDHC_RETRY_TIME.
- Add a clock-settle delay in sdhc_change_clock() after re-enabling the SD
clock: 2000 us for the 400 kHz identification clock (cold bring-up) and
500 us for later speed changes. Fixes intermittent cold-start CMD8
failures where commands were issued before the divider settled.
- Restrict sdhc_infineon_card_busy() to the DAT[3:0] line level. The
DAT_LINE_ACTIVE / CMD_INHIBIT_DAT present-state bits reflect host-side
transfer activity and caused false-positive "busy" reporting, which
breaks the CMD11 voltage-switch checks in the SD subsystem.
Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
Expose the firmware version obtained during ESP-Hosted initialization
through the Wi-Fi management version API.
Signed-off-by: Daniele Cloralio <d.cloralio@arduino.cc>
The shub humidity converters stored the whole relative humidity scaled
by 1e6 in val2 instead of only the fractional part, so consumers using
val1 + val2/1000000 saw roughly double the actual reading. Use
sensor_value_from_float() to split the value correctly.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The drain loop exited only once every STATUS_REG data-ready bit was
clear, but those bits are cleared as a side effect of a registered
handler reading the output registers, so a source with no handler (e.g.
temperature) spun the loop forever. Qualify the exit condition by
handler presence and cap the number of iterations in both variants.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
lsm6dso_enable_tilt_int() assigned only the tilt bit of an
uninitialised lsm6dso_emb_sens_t, and lsm6dso_embedded_sens_set()
writes all six bits into EMB_FUNC_EN_A/B, so stack residue could
enable the pedometer, significant motion or FSM engines. Read the
current state first and modify only the tilt bit.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Full-scale for Vout and bEMF on CS40L26/27 is 12.3 V, not
24 V. Update full-scale for CS40L26/27 to be a struct
sensor_value and change scale to multiply.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
nxp_wifi_cpu_reset() previously required both sd-gpios and pwr-gpios to
be present in devicetree before any reset logic ran, silently making
the function a no-op on boards that only wire sd-gpios (e.g. an SDIO
module using its reset line as WL_EN with no separate power-enable
GPIO). Make pwr-gpios independently optional so sd-gpios alone is
sufficient to drive reset.
Also fix the enable path: reset was previously asserted and left
asserted while pwr-gpios was raised, with no release step, so the
module never actually came out of reset before communication started.
Explicitly release sdio_reset after the assert delay, before waiting
out the release hold time.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
Some USDHC instances are permanently wired to a non-removable device,
such as an SDIO Wi-Fi module, with no card-detect GPIO or host
card-detect line available. Previously this relied on falling through
to the "no card detection method configured" warning path and assuming
the card was present. Add an explicit non-removable boolean property so
boards can declare this intent directly; when set, the driver reports
the card as always present and skips card detection.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
Add ARM SCMI Reset shell interface for demonstration and testing
purposes, defined as a sub-command of the *scmi* command.
The ARM SCMI Reset shell interface defined as following:
uart:~$ scmi reset
reset - Reset proto commands
Subcommands:
version : get protocol version
Usage: version
num-domains : get total number of reset domains
Usage: num-domains
summary : get summary for all reset domains
Usage: summary
info : show domain info
Usage: info <domain_id>
assert : domain assert
Usage: assert <domain_id>
deassert : domain de-assert
Usage: deassert <domain_id>
autoreset : domain Autonomous reset
Usage: autoreset <domain_id>
Add the file `shell/reset.c` and update the `CMakeLists.txt` to include
support for building the reset domain shell commands when
CONFIG_ARM_SCMI_RESET_HELPERS is enabled.
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
Added kconfig option to disable onoff manager,
in order to limit code size for LFCLK only applications.
Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Made HFCLK, LFCLK, HFCLK192M, HFCLKAUDIO, XO, XO24M Kconfigs
not selectable by user.
Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
The Multi-function Digital Filter (MDF) is dedicated to the connection of
external Σ∆ modulators. It is mainly targeted for the following
applications:
* audio capture signals
* motor control
* metering
The MDF features:
* 6 serial digital inputs:
– SPI interface
– Manchester coded interface
– PDM interface
* 2 common clocks input/output
* Flexible connection between filters and digital inputs
* 6 flexible digital filter paths, with:
– configurable CIC filter
– reshape filter
– high-pass filter
– An offset error cancellation
– Gain control
* Short-circuit detector
* Clock absence detector
* 16 or 24-bit signed output format
* Independant delay for each bitstream
* DMA read access
* Interrupt services
Signed-off-by: Raphaël Gallais-Pou <raphael.gallais-pou@foss.st.com>
in several subsystems, Kconfigs are ordered by vendors. In audio
subsystem, the border is more blurry on how it is handled.
Prepare the arrival of a new driver by factorizing common properties and
files.
Signed-off-by: Raphaël Gallais-Pou <raphael.gallais-pou@foss.st.com>
The print about the configuration of UAOL carries important information
for debugging and it should be visible above debug level.
Split up the prints and also output the final configuration of the pcmsctl
register in detail.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
According to the API, len is the length of the transmission buffer.
All DSI hosts respect this, except the ST one, which reads len + 1
bytes: short writes take an extra byte from after the buffer, and long
writes pass len as NbParams while passing the first buffer byte
separately as Param1, so the packet carries one byte too many. Either
way the driver reads past the end of the caller's buffer.
Align the ST driver with the API and the other hosts, and send exactly
the bytes the caller provided.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Renesas RX driver package
(e.g. R_RIIC_MasterSend, R_RIIC_MasterReceive, riic_info_t.p_slv_adr)
are kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
z_vrfy_i3c_transfer() validated target->bus with K_SYSCALL_OBJ but then
passed the caller's live descriptor on, and the implementation reloads
target->bus and dispatches through it, so the value that was checked is
not necessarily the value that gets used.
Copy the descriptor into a local with k_usermode_from_copy(), validate
the bus in that copy and pass the copy down. The copy suffices because
the i3c_xfers implementations only read scalar fields out of the
descriptor.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
Update the MCXW7x clock control driver to support future
MCXW70 non-secure board enablement.
No functional change for current upstream configurations.
Signed-off-by: Waqar Tahir <waqar.tahir@nxp.com>
The i2s_configure verifier skipped the K_SYSCALL_OBJ() check on
cfg->mem_slab whenever the caller passed frame_clk_freq == 0, leaving
that pointer unvalidated when it reached the driver.
Zero mem_slab and block_size in the copied-in config on that path
rather than requiring a valid slab, so a stream can still be
unconfigured without owning one, as the API documents.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
commit 98500853d9 ("drivers: timer: nrf_rtc_timer: fix RTC init issue")
added an unconditional 46 us busy wait between the CLEAR and START tasks,
so that a counter value left behind by a bootloader is gone by the time
timer_core_init() reads the counter. On a cold boot the counter is
already zero, and on the simulated nRF targets tasks take effect
immediately, so there the wait only starts the system clock 46 us later.
That shifts the kernel tick phase relative to the radio timeline, and on
nrf52_bsim it made tests.bsim.bluetooth.mesh.bridge (the
brg_net_key_refresh.sh scenario) fail with the seed CI uses; every pull
request's bsim-test run has failed on it since the commit merged.
Only clear the counter, and wait for the clear to take effect, when it
holds a non-zero value, which is the case the wait exists for. Verified on
an nRF52 DK with a PRE_KERNEL_1 hook that starts LFCLK and RTC1 and lets
the counter run before the driver initializes: the counter register keeps
returning the old value for up to 46 us after CLEAR, so with START issued
immediately timer_core_init() can read it, while after the wait it reads
zero; k_msleep() and the uptime clock behave the same as on a cold boot.
The bsim mesh scenario passes again with the default seed. That scenario
is timing sensitive on its own (it also fails for other seeds without this
change), which is tracked in #118188.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add a dwc_mac platform glue driver for the Synopsys DesignWare MAC
integrated in the Infineon XMC4XXX SoC family. The driver applies
pinctrl, configures the port control, connects the interrupt and
provides a small clock-control shim reporting the Ethernet and PTP
clock frequencies from the SCU.
The new ETH_XMC_DWC_ETHER_1000 symbol depends on !ETH_XMC4XXX, so the
generic dwc_mac driver can be used as an alternative to the XMC4XXX
Ethernet driver.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
The Infineon XMC4XXX MDIO driver was tied to the SoC series, so it
was enabled on any XMC4XXX SoC regardless of the Ethernet driver in
use. Depend on ETH_XMC4XXX instead, so the MDIO driver is only built
together with the XMC4XXX Ethernet driver and is left out when the
generic dwc_mac driver is selected.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Introduce polling-based SPI driver for the NXP Kinetis-L series.
The driver implements spi_context and utilizes standard Zephyr
Clock Control and Pinctrl subsystems.
Signed-off-by: Gabriel Ivo <gabriel.bozi@usp.br>
The WCH ESIG unit holds a 96 bit unique ID. Expose via the hwinfo
driver.
The WCH RCC unit accumulates the recent reset causes. Expose via the
hwinfo APIs.
Tested on the `bluepillplus_ch32v203` by running
`tests/drivers/hwinfo/api` and verifying the ID matches minichlink, and
that pressing the reset button makes the cause change.
Signed-off-by: Michael Hope <michaelh@juju.nz>
Missing support for POR code for nrf54h20, add it.
Also fix some issues around secure WDT reset reasons (enum value was used
in a `#if defined(` expression).
Signed-off-by: Noah Pendleton <noah.pendleton@nordicsemi.no>
The CH32V series has between 16 KiB and 480 KiB of in-place
programmable program flash. Add a driver that implements the Zephyr
flash API, the appropriate Devicetree nodes, and overlays for the
`flash_shell` sample.
For the sample, trim back the default settings to fit within the ~64
KiB of flash and 8 to 20 K of RAM and add test partitions.
Use Devicetree to define the erase value. For the 003 and 006, this is
the common 0xFF but for the 20x/30x this is 0xE339. The flash API
works correctly on the 20x/30x but systems that require the erase
value to be a single byte, or assume that it is 0xFF, will not. This
can be addressed in future PRs.
Tested on the ch32v00x_core and bluepillplus_ch32v203 board by loading
the sample and running `flash test ...`. The
tests/drivers/flash/common test passes on the bluepillplus except for
the erase test which fails due to the ch32v203's half word erase
pattern.
Signed-off-by: Michael Hope <michaelh@juju.nz>
Move the stm32n6 specific axisram driver out of the drivers/misc
folder since soc specific drivers should be located into the
related soc folder instead of misc.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
On the stm32U3 series, the Voltage Scale 2 (lower-range) is
accessible for a system clock freq up and equal to 48MHz.
This is specified by the RefMan RM0487 and prefered to minimize
the power consumption.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
The SCL/SDA stuck low hardware timer is limited to about 255ms.
Add a new devicetree property scl-sda-low-timeout-ms that allows
designs to either modify the SCL/SDA stuck low timer or to disable
the timer completely.
Signed-off-by: Keith Short <keithshort@google.com>
Assisted-by: Antigravity:gemini-1.5-pro
Remove the redundant default n from the STM32 RTC counter Kconfig.
Boolean Kconfig symbols already default to n when no default is set.
Signed-off-by: Yiming Sun <ys160@rice.edu>
The driver initialization routine has been changed to use the generic
`timer_core_init`. As per nRF52840 RTC specification / section section
TASK and EVENT jitter/delay, a delay of 46usec should be observed after
a TASK CLEAR event before the counter is reset to 0.
Failing to do so will cause a spurious RTC wrap under certain
conditions, such as on the Arduino Nano 33. The timer core logic will
incorrectly assume that the RTC has wrapped, setting the main thread's
initial timeslice far in the future. As a result, k_msleep() blocks for
a very, very long time.
This bug was present before the driver rework, but changes to the driver
initialization code likely exposed it.
Fixes: #117522
Signed-off-by: Loic Domaigne <tech@domaigne.com>
The driver meanwhile supports the MCX N and MCX A series as well,
but the help text still mentioned the MCX E series only. List all
currently supported families instead.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
The explanation about the MAC raising DMA transfer completion on the
dedicated tx/rx lines and everything else on the common line only
applies to the MCX E31 series. Move that part into the corresponding
#if block and keep the generic note outside of it, so the comment
matches the code it documents.
No functional change.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
zephyr/drivers/pinctrl.h was included unconditionally and pulls in
pinctrl_soc.h. SoCs without a pinctrl driver (for example Rockchip
RK3588) fail to build when enabling snps,dwmac-mdio without pinctrl-0.
Guard the include with CONFIG_PINCTRL to match other drivers. Keep
DWMAC_MDIO_PINCTRL_ENABLED for optional pinctrl config and apply paths.
Signed-off-by: Yanzhao Cui <cuiyanzhao@kylinos.cn>
The SENSOR_CHAN_MTCH9010_OUT_STATE fetch path called gpio_pin_get_dt()
unconditionally, dereferencing a NULL port when the optional
output-gpios property is absent (e.g. UART-only configurations). Return
-ENOTSUP in that case, mirroring the guard used by the other fetch path.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
config->sleep_time holds the devicetree enum index used as the UART
command argument, but the fetch timeout math treated it as seconds, so
any sleep period of 4 s or more timed out early. Store the period in
seconds separately and widen the timeout values to uint32_t, since
256 s no longer fits in uint16_t once converted to milliseconds.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The decode entry guard rejected any buffer whose first character was
not a digit, so DELTA-only packets carrying a negative delta (e.g.
"-99\n\r") always failed with -EINVAL. Allow a leading minus sign; the
per-format range checks still reject negative measurements.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The pinmux controller provides the total number of muxable pins.
Read this number during initialization and check against it
during each pin configuration.
Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
The soft-reset half of reset_status() placed the "!= 0" comparison
inside the sys_test_bit() call, so it was evaluated as the bit index
argument instead of testing the returned bit. For any reset line
whose bit index is >= 2 this read the wrong bit of SOFT_RESET_CR and
misreported the reset state.
Move the comparison outside sys_test_bit() so the SOFT_RESET_CR bit
for the requested line is tested, matching the SUBBLK_CLOCK_CR half.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Fix the MemoryMapped mode for the mspi_stm32_xspi driver
Co-authored-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Fix compilation warning when building the mspi_stm32_xspi driver
without DMA config enabled.
The dts can declare a DMA channel but CONFIG_MSPI_DMA not set should
not use the DMA.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
With the commit c3109b9ebe
("usb: device_next: cdc_acm: rx throughput improvements"),
the CDC implementation queues as many buffers as are available. This may
trigger an error log, "<err> udc_rpi_pico: Endpoint 0x01 busy".
There is nothing wrong with the driver, it is just that another transfer
is queued while an endpoint is busy.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>