The `AT+CGSN` query has several variants, the base `AT+CGSN` which
returns the `<sn>` without any prefix, and several explicit serial
number types, which include a `+CGSN: ` prefix.
```
AT+CGSN // <sn>, serial number as determined by manufacturer
AT+CGSN=0 // <sn>, serial number as determined by manufacturer
AT+CGSN=1 // <imei> International Mobile station Equipment Identity
AT+CGSN=2 // <imeisv> IMEI & Software Version Number
AT+CGSN=3 // <svn> Software Version Number
```
According to the specification, while `<sn>` is "typically" the IMEI,
manufacturers may choosed to provide whatever information they want in
the response. The new common match objects allows modem to explicitly
request the IMEI, instead of the manufacturer specific `<sn>`.
Reference: 3GPP 27.007 Ch. 5.4.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Output the `CELLULAR_MODEM_INFO_SERIAL_NUMBER` event from inside the
`modem_cellular_chat_on_imei` callback, as the callback runs in response
to `AT+CGSN`, which is documented as returning the serial number, not
IMEI.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Define a new information type for the modem serial number. While the
serial number is often the same as the IMEI, it is not always
(e.g. nRF93M1).
Signed-off-by: Jordan Yates <jordan@embeint.com>
GPIO_OPEN_DRAIN and GPIO_OPEN_SOURCE share the GPIO_SINGLE_ENDED bit and
differ only in GPIO_LINE_OPEN_DRAIN. The open-source rejection test
masked with GPIO_OPEN_SOURCE, which also matches open-drain, so any
attempt to configure a pin as open-drain wrongly returned -ENOTSUP.
Detect open-source on the GPIO_LINE_OPEN_DRAIN bit instead so open-drain
is accepted, and reject open-drain only on RTL8752H: open-drain is
supported on all current and future Bee ICs, and RTL8752H is the sole
older part without a hardware open-drain output mode, so a blacklist is
intentional here.
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Without a deadline the do/while loop can spin forever if the hardware
never asserts the Conversion Ready Flag (e.g. a faulty device). Add a
5-second timeout using k_uptime_get() so the function returns -ETIMEDOUT
instead of hanging, while preserving immediate propagation of I2C errors.
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
In triggered mode, ina237_sample_fetch() called
ina237_trigg_one_shot_request() which only writes to the ADC_CONFIG
register to start a one-shot conversion, then returned immediately
without waiting for the conversion to complete.
This violates the sensor API contract: after sensor_sample_fetch()
returns, the data must be ready to read via sensor_channel_get().
Fix by polling the DIAG_ALRT register until the CNVRF (Conversion
Ready Flag, bit 1) is set before calling ina2xx_sample_fetch() to
read the converted data.
Fixes#98547
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
Add an optional TCPC operation reporting whether a port applies the
USB-C dead battery resistors to its CC lines, and implement it for
ucpd_stm32 and ucpd_numaker.
Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
Add the mbox driver implementation on top of
IPC hw block as a native Zephyr driver.
Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
The STM32 FMC MIPI DBI driver only supported the Intel 8080 16-bit bus
mode and rejected any other configuration. Displays wired to the FMC
over an 8-bit parallel bus could not be used.
Add support for MIPI_DBI_MODE_8080_BUS_8_BIT:
- Validate the DBI mode against the configured FMC bus width, accepting
both the 8-bit and 16-bit combinations and rejecting mismatches.
- Use 8-bit accesses (sys_write8) for command and data transfers when
the bus is configured in 8-bit mode.
- Compute the data address offset without the extra bit shift in 8-bit
mode, since the register-select line maps directly to the byte
address instead of the half-word address used in 16-bit mode.
Signed-off-by: Michele Vaccari <michele.vaccari@outlook.com>
A frame handed to the ENET QoS transmit DMA when the link goes down is
never written back, so the completion interrupt that returns the packet
and frees the single transmit slot never arrives. The slot stays taken
across the link coming back, every later send on the interface fails
with -EBUSY, and the packet and its fragments are gone from their pools
for good, so a handful of link transitions exhaust the buffer pool and
the interface stops transmitting.
Give the driver a claim and release pair so that completion and
abandonment race for the packet and exactly one of them returns it, and
arm a transmit watchdog, CONFIG_ETH_NXP_ENET_QOS_TX_TIMEOUT_MS, that
takes the descriptors back, flushes the transmit queue and reinitializes
the ring when the DMA does not finish. Abandon an outstanding frame from
the PHY callback on carrier loss, and program speed and duplex with the
transmitter and receiver disabled before the carrier is announced, so
the MAC configuration write cannot land on a frame the stack has already
handed to the DMA.
Publish the packet, arm the watchdog and start the DMA as one step under
irq_lock so an abort can never observe a half-built submission, and flush
the transmit queue with a bounded wait.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Every RX descriptor writeback clobbers RDES0, which in read format is
the buffer address: the writeback formats alias it with the VLAN tag or
the timestamp low word. The success path restores it before handing the
descriptor back to the DMA, but the four drop paths (errored frame,
packet alloc failure, bad length, fragment alloc failure) re-arm the
descriptor with whatever the writeback left there, so the next use of
that slot makes the DMA write into flash or reserved address space and
receive stops permanently. Restore the reserved buffer's address on
every drop path, as the success path does.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Allow connecting the `fuel-gauge-composite` instance to a charger
device, to limit the reported SoC to 99% while still charging, and
forcing it to 100% when charging terminates.
Signed-off-by: Jordan Yates <jordan@embeint.com>
If we have a measured current and a configured internal resistance,
adjust the measured voltage to provide a less jumpy state-of-charge
computation under charging conditions.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Set the time for the next sample from the point the sampling finishes,
not from when `composite_get_prop` is called.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add support for the Analog Devices ADIN1140 10BASE-T1S MAC-PHY:
ethernet driver, MDIO bus driver and PHY driver.
Signed-off-by: Raluca Bozdog <raluca.bozdog@analog.com>
Co-authored-by: Jason Murphy <jason.murphy@analog.com>
Add a warning to recommend to move the stm32h5 devices
to the mspi stm32 controller with the mspi stm32 xspi driver.
The flash stm32 xspi driver will be deprecated v4.5.0
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Extend the stm32 flash driver config to the MSPI st,nor compatible
device to enable the external flash in MemoryMapped mode.
This commit checks the KconfigFormat correctly.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add a new video driver for NXP FlexIO-based parallel camera
interface (DVP). The driver captures 8-bit parallel pixel data
via FlexIO shifters, with pixel clock (PCLK) gating and horizontal
sync (HREF) line synchronization. Pixel data is transferred to
memory using eDMA, with frame boundaries synchronized via VSYNC
GPIO interrupt. An optional XCLK output can be generated by a FlexIO
timer for camera sensor clock supply.
Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
Enable the esp32 HCI driver on the ESP32-C61: extend the
controller Kconfig gates, report the C61 vendor hardware
variant id, add the hci devicetree node and enable it on the
esp32c61_devkitc board. The C61 BLE controller reuses the C6
controller sources and blobs through the hal.
Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Currently driver only acknowledged the boot handshake when
TARGET_BOOT_DONE was already asserted.
On a cold boot the virtual wire reads back 0, so the condition never
held and the EC never sent TARGET_BOOT_STS/TARGET_BOOT_DONE together,
leaving the host stalled waiting for boot-load-done.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Fixes the same issue addressed in #114981 but for CS40L26. For
CS40L26, this issue leads to malformed masks for the first
IRQ register and then IRQ storms. This is only a problem when
disabling runtime PM because otherwise the power sequencer
correctly writes IRQ masks when exiting hibernation.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
BT_USERCHAN is currently limited to BOARD_NATIVE_SIM, but the
driver is implemented for native simulator based targets that use
the native host environment rather than for that specific board.
Bluetooth host-only applications can be built separately from the
controller and communicate with an external controller over HCI.
Allow native simulator based targets to use the same userchan HCI
transport when the application devicetree selects a
zephyr,bt-hci-userchan device.
Relax the dependency from BOARD_NATIVE_SIM to NATIVE_LIBRARY so
host-only Bluetooth applications can use userchan on native simulator
based targets, including out-of-tree boards, when they run in real
time.
This enables split host/controller simulation setups where the
Bluetooth host runs as one native simulator process and connects
over userchan to an external HCI controller process.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
The expression 'drv_data->clk_dev' is invalid because the pointer
'drv_data' is not declared anywhere. Since 'nrf_clock_control_release()'
is the counterpart to 'nrf_clock_control_request()', the pointer part
'drv_data->' can be safely removed.
Signed-off-by: Stephan Linz <linz@li-pro.net>
Move radio test and FICR programming shell commands into the nRF70
Wi-Fi driver. Register the command sets behind NRF70_RADIO_TEST_SHELL
and NRF70_RADIO_TEST_FICR_SHELL Kconfig options so radio test builds
can use the built-in shell or provide a custom integration.
Signed-off-by: Sachin D Kulkarni <Sachin.Kulkarni@nordicsemi.no>
Assisted-by: Cursor:cursor-agent
Instead of including the header containing the generic implementation of
certain arch services, include the top-level <zephyr/arch/cpu.h> header
which will provide the correct implementation for the target arch.
Notably important for `sys_io.h` which has memory barriers on Cortex-A.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Generic snps,dwc2 instances do not have the vendor quirk data/config
objects emitted by the vendor-specific quirk headers. The driver already
allowed the quirk table pointer to be NULL, but still initialized
quirk_data and quirk_config unconditionally. This causes generic-only
instances to fail to build because the corresponding vendor symbols do
not exist.
Use the same vendor-quirk condition for the table, data, and config
pointers so generic instances get NULL quirk pointers.
Fixes: 89a75416b7 ("drivers: usb: uhc_dwc2: add initial support")
Signed-off-by: Duc Viet Le <levietduc0712@gmail.com>
Advertise ETHERNET_HW_VLAN when CONFIG_NET_VLAN is enabled. The
capability is an acceptance gate that permits VLAN interfaces on the
iface. The L2 keeps inserting the tag in software, so the transmit
path needs no offload change.
Account for the four extra bytes a single VLAN tag adds to a frame in
the transmit size cap and the receive buffer capacity assert. The MAC
recognizes the VLAN type and extends its own receive length limit by
the same four bytes, so no length register needs adjusting.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Enable the receive checksum offload engine through the MAC_CONFIGURATION
IPC bit so the MAC verifies the IPv4 header and the TCP and UDP checksums
of incoming frames, and advertise ETHERNET_HW_RX_CHKSUM_OFFLOAD so the
stack does not repeat the check in software. Because the stack then trusts
the offload, drop any frame the engine flags with an IP header or payload
checksum error in the RDES1 write-back status, which is valid only when
the receive status word is present.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
The stack computes the IPv4 header and the TCP and UDP checksums in
software for every transmitted frame. On the MCXN947 Cortex-M33 that
per-packet cost is the largest single consumer of CPU on the transmit
path and it saturates the core well below the link rate.
The DesignWare Ethernet QoS MAC can insert these checksums in hardware.
Set the TDES3 checksum insertion control field to full insertion on the
first descriptor of every frame and advertise ETHERNET_HW_TX_CHKSUM_OFFLOAD
so the stack leaves the checksum fields cleared for the engine to fill.
The MAC only rewrites IP frames with a known protocol and leaves other
frames untouched, so the control field can be set unconditionally.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Query the frequency of the OTG_HS PHY and compute the appropriate CLKSEL
value at runtime if the `clock-reference` property is not specified.
This removes the user burden of providing the same value twice in DTS.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add a clock_control driver for the CLKOUT feature of the Series
2/3 Clock Management Unit. The driver configures shared properties
such as exportclk and clkout dividers, and interprets the
subsys argument to clock management functions as the clock output
to enable or disable.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Instead of using a hardcoded FSEL for 24 MHz input, query the frequency
of the USBPHYC clock and determine the correct value automatically at
runtime.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The clock signal `hsi_div2_osc_ck` should be documented as a distinct
source because it is derived from the HSE clock with a configurable
prescaler.
Document the exact effect of `hse-div2` on st,stm32n6-hse-clock in the
binding: it enables the prescaler for `hse_div2_osc_ck` whose frequency
is `hse_osc_ck / 2` when enabled, and `hse_osc_ck` otherwise. Add new
clock source `STM32_SRC_HSE_DIV2_OSC` in stm32n6_clock.h, and update the
corresponding clock control driver to handle this new source.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Enable the esp32 Wi-Fi driver on the ESP32-C61: extend the FTM
and mesh Kconfig gates, add the wifi devicetree node and enable
it on the esp32c61_devkitc board.
Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When CONFIG_NET_TEST is enabled the PPP driver drops the packet in
ppp_send() because there is no UART to write it to. That leaves the
tests with no way of checking what the PPP stack actually sends.
Add an optional callback, registered with
ppp_driver_register_send_cb(), that is invoked with the outgoing packet
before it is dropped. The callback is only compiled in for
CONFIG_NET_TEST builds and nothing changes when it is not registered.
Assisted-by: Claude:claude-sonnet-5 Simantic
Signed-off-by: Ahnaf Shahriar <shahriarahnaf007@gmail.com>
Replace direct NVIC pending-state calls with k_irq_set_pending()/
k_irq_is_pending()/k_irq_clear_pending(), dropping the dependency on
cmsis_core.h where nothing else needed it.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This capability was deprecated in Zephyr 3.6 (see issue #63670): every
OT-capable driver implements transmission directly from a low-power
state, so the bit conveyed no information and only coupled the radio
API to OpenThread's capability and device model.
Drop it from the radio API and from the four drivers still advertising
it, and renumber the subsequent capability bits. The OpenThread
platform glue now behaves as if the capability were always present: it
unconditionally advertises OT_RADIO_CAPS_SLEEP_TO_TX and allows
transmitting from the sleep state.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Remove enabling of the HW RNG and its interrupts from configure_rng()
local helper function. It is already done from acquire_rng() that
is always called when the RNG is used. For consistency, enable RNG
and its interrupts only once it's configured.
This is more consistent with the RNG disabling sequence that is
implemented in release_rng() local helper function.
A side effect it that the RNG is no more enabled at device initialization
which allowed it the accumulate entropy to serve quicker its first
consumer, at least on single-core MCUs.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add some assertion and inline comment to clarify when the HSEM shall be
taken and released to ease maintenance. HSEM acquisition/release
sequences must be consistent knowing that there are no reference
counting support in HSEM management.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Merge entropy_stm32_resume() into acquire_rng() and
entropy_stm32_suspend() into release_rng() to make the implementation
a bit more easy to read.
Remove semaphore acquisition from release_rng() (previously inside
entropy_stm32_suspend() sequence) since the function is only
called when the semaphore was already acquired.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Move configure_rng() local function definition in entropy_stm32.c
source file to ease factorization in other local helper functions.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Remove entropy_stm32_resume() return value as it is not used and
we don't expect enabling of the RNG clock to fail.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
On STM32WBAX series we must wait a few cycle before disabling the RNG
clock once it is switched off. Clarify the sequence implementation
so that RNG clock remains enable but semaphore is released. This change
addresses an issue where entropy_stm32_suspend() return value was
not used.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Allow project configuration to select use of either the Zephyr system
workqueue or a dedicated workqueue for fillings the random bytes pools.
By default, the driver uses the Zephyr system workqueue. Projects
can enable CONFIG_ENTROPY_STM32_WORKQUEUE and tune ENTROPY_STM32_WQ_PRIO
to use the dedicated wrokqueue.
Workqueue is configured only at POST_KERNEL initcall level, considering
that the driver init level depends on the STM32 SoC used (i.e. when
IRQLESS_TRNG local macro is enabled or not).
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Split the initialization function in 2 and call only hardware
initialization on S2RAM resume to fix an issue where S2RAM resume
previously called entropy_stm32_rng_init() and corrupted some software
resource like the system workqueue by calling k_work_init() on an
existing and possibly submitted work.
Prevent entry in PM suspend state unless the ISR random sample pools
are filled so that any interrupt requesting random bytes at wakeup have
a chance to get random bytes. As a side effect, this change makes
entropy_stm32_rng_pm_action() much simpler.
Rename device driver initialization function for consistency.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
#112908 killed any other use-case besides openthread for the mcxw72 radio.
This patch fixes the dependency to only the vendor-specific radio use-case
of openthread.
Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
Chain-loaded STM32N6 applications may execute from external XSPI NOR or
PSRAM whose controller depends on the bootloader clock tree. Add an opt-in
MCUboot configuration that preserves the retained RCC state while keeping
the SRAM gates required by the application.
Require the application devicetree to describe retained clock and external
memory hardware. Refresh SystemCoreClock without reinitializing the
application-domain oscillators, PLLs, interconnect, prescalers, ICs, or
SYSCLK.
Tests: git diff --check
Tests: python3 scripts/ci/check_compliance.py -c origin/main..HEAD
Assisted-by: OpenCode:gpt-5.6-sol
Signed-off-by: Tobias Meyer <tobias.meyer@hula.earth>