Enable the IEEE 802.15.4 radio on the BL70x (BL702) series: add the
ieee802154 devicetree node, compile the RF/platform shim, link the
lmac154/RF blobs, and place the timing-critical lmac154 .tcm_code in ITCM
(otherwise those input sections become orphans at an unloaded address).
Provide CONFIG_BT_HCI_DRIVER_LOG_LEVEL for 802.15.4-only builds so the
shared BLE/802.15.4 platform shim compiles without Bluetooth enabled.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Enable the IEEE 802.15.4 radio on the BL70xL (BL702L) series: add the
ieee802154 devicetree node, compile the RF/platform shim, place the
timing-critical lmac154 code in ITCM, and link the lmac154/RF blobs.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Enable the IEEE 802.15.4 radio on the BL61x (BL616) series: add the
ieee802154 devicetree node, RF/PHY init via the shared wl_api blobs, the
TCM code section, and link the lmac154 blob. The GLB reset / memcpy shims
required by the BL616 blobs live with the other HAL shims.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Add an IEEE 802.15.4 radio driver for Bouffalo Lab SoCs built on the
vendor lmac154 MAC layer. Supports the Zephyr radio API (TX/RX, CCA,
address filtering, energy scan, ACK handling) for use with the OpenThread
L2, covering the BL61x, BL70x and BL70xL series.
Signed-off-by: William Markezana <william.markezana@gmail.com>
The mesh stack allows multiple roots by default, so nodes booting at the
same time can each elect themselves root and stay in separate networks.
Disallow root conflicts so one root yields and rejoins as a child, with
a Kconfig option to restore the previous behavior.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
With the Wi-Fi heap in the system heap, static RX buffers are
taken at init and dynamic RX buffers on every received frame.
HEAP_MEM_POOL_ADD_SIZE_ESP_WIFI covers the default of 10 static
RX buffers. With more of them and a fixed HEAP_MEM_POOL_SIZE,
init still succeeds, but most frames are dropped and throughput
collapses without any hint about the cause.
At build time, add about 1.6 KB per static RX buffer above the
default to the heap requirements and warn when
CONFIG_HEAP_MEM_POOL_SIZE is below that, naming the options to
change. Document in Kconfig where the buffers come from and how
the heap has to grow with the static RX buffers.
Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The async section includes rtl_gdma.h / rtl876x_gdma.h although the
driver uses no symbol from either; DMA goes through the generic API and
the helpers in dma_bee.h. Those headers only reach the include path
when the Bee DMA HAL is built, so enabling UART_ASYNC_API with no
realtek,bee-dma node breaks the build.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION reads the lfclk devicetree
k32src property, but the legacy CLOCK_CONTROL_NRF driver takes the
source from Kconfig, so a board declaring k32src = "rc" enabled
calibration even when built with an XTAL source and tripped the nrfx
"Calibration can be performed only for the RC Oscillator" guard.
Honour the property only when the legacy driver is disabled.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
gicv3_rdist_setup_lpis() calls k_aligned_alloc(), which the kernel only
defines when the system heap is non-empty, so every board that turns on
GIC_V3_ITS without asking for a heap fails to link. Declare the
requirement with HEAP_MEM_POOL_ADD_SIZE_GIC_V3_ITS, which the build sums
into the pool as a minimum, and fold in the equivalent value the FVP
board carried.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
The NETC MDIO driver has no runtime dependency on the NETC Ethernet
driver. Requiring it prevented use cases where an external stack owns
the NETC Ethernet controller while Zephyr manages only the MDIO bus
and PHY drivers.
Drop the Ethernet driver dependency from the MDIO Kconfig. Relax the
NETC bring-up guards in board.c, soc.c, and the clock control driver to
cover MDIO_NXP_IMX_NETC as well, so the NETC clock roots and MII-mode
configuration run whenever either the Ethernet or the MDIO driver is
enabled. Extend the HAL netc component and its SoC sub-component to
build for MDIO-only configurations in the same way, by enabling
driver.netc and the SoC-specific sub-component when MDIO_NXP_IMX_NETC
is set.
Signed-off-by: Tobias Aguiar <tobias.aguiarsilvadealmeida@nxp.com>
Add error handling for RX frames shorter than metadata
size and strip MAC-specific metadata (timestamp and
status) from RX frames before passing them to the
Ethernet stack.
Signed-off-by: Sven Ginka <s.ginka@sensry.de>
The NXP comparator ISRs logged a warning when they found no callback
registered. Logging from interrupt context costs time in the handler,
and the message repeats for every interrupt while the condition holds.
The branch is also not reachable in practice: each driver only enables
its match/edge interrupt while a callback is registered, so an interrupt
that arrives with data->callback still NULL is a disarm race that the
handler already returns from. Keep the NULL guard, drop the log.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
With gPTP enabled, timestamp only PTPv2 frames carried over Ethernet
instead of all received frames.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
When filtering for PTP frames, the snapshot type was left at 0, which
only timestamps Sync, Follow_Up, Delay_Req and Delay_Resp. The peer
delay messages Pdelay_Req and Pdelay_Resp were not timestamped, so the
peer-to-peer delay mechanism could not work.
Select the snapshot type that timestamps all PTP event messages, so
both the end-to-end and the peer-to-peer delay mechanisms are covered.
From core version 3.70 on this is type 1 with TSEVNTENA cleared, as the
Linux stmmac driver does. Older cores, such as the 3.50 in STM32F2, F4
and F7, use the field to select the clock node type instead, where only
the peer-to-peer transparent clock (3) covers all event messages.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add Kconfig options selecting which received frames get timestamped:
either all frames, or only PTP frames with individually selectable
PTPv2 format and Ethernet, UDP/IPv4 and UDP/IPv6 transports.
The defaults match the previous behaviour, which derived the setup
from CONFIG_PTP and the PTP transport options.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The devicetree tells this driver which system power states stop its
output, and nothing read it. A consumer holding a runtime reference on
an instance whose node lists zephyr,disabling-power-states could still
have the policy pick one of those states and lose the voltage it asked
for, with no error anywhere.
Take the per-device policy constraint for as long as the output is on:
when a value is first written, again when a resume restores it, and
released in SUSPEND, which under runtime device PM is where the last
consumer reference goes away. A re-run of dac_channel_setup() releases
it too, because DAC_Init() leaves GCR[DACEN] clear.
That pins the constraint to the one fact the driver does know -- the
output buffer is on -- rather than to the length of an API call, which
for a DAC is not the length of anything. The consumer keeps owning the
output's lifetime through its runtime reference, and no longer has to
name the states that would break it.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
A call that lands on a suspended instance writes GCR[DACEN] and DATA
and returns success while the analog output buffer stays off. On a
device the core has turned off the write goes into a register block
that has lost its contents, and the driver's cached value then
disagrees with the hardware until the next resume replays it.
Check the device state at the point where each API call is about to
touch the registers and return -EBUSY instead. Argument validation is
left ahead of the check so that a bad channel or resolution still
reports -ENOTSUP regardless of the power state.
With CONFIG_PM_DEVICE=n, pm_device_state_get() reports the device as
active, so this costs nothing when device PM is not in use.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Suspend-to-RAM resume re-runs SystemInit() and
board_early_init_hook(), so the clock and the analog power request
come back, but it does not re-run driver init: GCR and DATA stay at
their reset values while the driver still reports a configured DAC,
and the next dac_write_value() writes a value the block cannot convert
with the settings the devicetree asked for.
TURN_ON is the only action that runs after the block lost power, so
the rebuild goes there. Limit it to an instance the application has
already set up, so a DAC nobody has touched keeps the reset state it
had rather than having a configuration written into it on the way
back. The rebuild leaves GCR[DACEN] clear, which is the state the core
records for the device once TURN_ON returns; RESUME is what puts the
output back, and the core does not call it at all when runtime PM will
take over.
TURN_OFF has nothing to do: the core suspends a device before it turns
it off, so the output buffer is already off, and this driver holds no
clock or regulator reference to release.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Route init through pm_device_driver_init() and add a PM callback that
stops and restarts the DAC.
SUSPEND clears GCR[DACEN] and applies the sleep pin state. Clearing
DACEN switches the analog output buffer off; gating the DAC clock
would only freeze the buffer at its current level.
RESUME applies the default pin state and replays the last value
written, so a consumer that was holding the output across a
transition gets it back without calling dac_channel_setup() again. An
instance whose value was never written stays disabled instead of
driving a pin at 0 V. The two new data fields track that value, which
cannot be read back out of a register block whose clock may have been
gated.
Applying the default pin state moves from init to RESUME because it
is now reachable more than once. Init still applies it:
pm_device_driver_init() tolerates -ENOTSUP from TURN_ON, which this
driver does not implement, and then calls RESUME.
The callback is compiled unconditionally. With CONFIG_PM_DEVICE=n the
sequence is the same TURN_ON-then-RESUME, which on a DAC that has not
been set up yet applies the pins and touches nothing else -- the same
register sequence as before this change -- and
PM_DEVICE_DT_INST_DEFINE() and PM_DEVICE_DT_INST_GET() are no-ops
there. Both are parameterized by the instance index, so a
two-instance build is not a redefinition error.
With CONFIG_PM_DEVICE_RUNTIME the driver takes no runtime reference of
its own: the consumer holds one for as long as it wants the output.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
channel_setup() is the only place that writes the devicetree configuration
into the register block, which makes it the only place that can rebuild a
block whose registers were reset. Move those writes into
mcux_lpdac_configure() so a second caller can be added without duplicating
them.
No behavioural change. The DAC_Enable(false) that followed DAC_Init() is
dropped rather than moved: DAC_Init() assigns GCR in full, so DACEN is
already clear when it returns.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
The binding includes pinctrl-device.yaml and every in-tree board that
enables a 12-bit DAC node hands it a pinctrl-0 group, but the driver never
called pinctrl_apply_state(), so those groups had no effect. The DAC output
worked anyway on the affected boards because PORT PCR[MUX] selects the
analog function at reset, which is what the pinmux groups also ask for.
The driver now uses the pinctrl API, so select PINCTRL, which the Kconfig
entry for the other in-tree DAC on these parts already does.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Replace scripts/kconfig/hardened.csv with a distributed YAML database.
The CSV format could not carry any explanation for its recommendations,
had no validation (a malformed line was silently dropped), no notion of
profiles, no ownership story, and no way to extend it out of tree.
The database now lives where the code lives: the central
scripts/kconfig/hardening.yaml defines the hardening profiles (plus
rules for top-level Kconfig symbols), and per-subsystem hardening.yaml
fragments next to the relevant Kconfig files carry the rules, so each
rule is reviewed by the maintainers of the code it hardens. Every rule
has a required rationale and optional references, supports exact-value
and integer min/max recommendations (STACK_POINTER_RANDOM is now
'>=100' instead of '==100'), and belongs to a profile: 'base' (memory
protection and inherently insecure features) or 'strict' (extends base
with debug/observability feature removal). The default profile is
'strict', matching the rule set the CSV checked.
hardenconfig is restructured around a serializable HardeningReport
model so results can be consumed programmatically, and gains:
- a Rationale column in the report
- profile selection:
west build -t hardenconfig -- -DHARDENCONFIG_PROFILE=base
- HARDENCONFIG_SHOW_ALL to also list PASS/NA results
- HARDENCONFIG_STRICT to exit non-zero on failures, for CI use
- HARDENCONFIG_JSON to write machine-readable results, including which
database file each rule came from
- HARDENCONFIG_EXTRA_SOURCES to layer out-of-tree database files that
may add profiles/rules and override in-tree ones
The EXPERIMENTAL/DEPRECATED/NOT_SECURE marker symbol detection is
preserved unchanged.
Three CSV entries are intentionally not carried over because they were
redundant: BT_CONN_DISABLE_SECURITY and BT_OOB_DATA_FIXED can only be
enabled together with BT_TESTING, and TIMER_RANDOM_GENERATOR together
with TEST_RANDOM_GENERATOR, all of which the database already
recommends disabling for the same profiles.
Behavioral fix: the CSV's DEBUG_COREDUMP line used '=' instead of ','
and was silently ignored, so CONFIG_DEBUG_COREDUMP was never actually
checked; it now is.
Also add tabulate to requirements-base.txt: hardenconfig has always
imported it, but it was only pulled in via other requirements files.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
dig_h4 and dig_h5 are signed 12-bit calibration values, but they were
assembled from uint8_t register bytes without sign extension, so any
negative value was read as a large positive one (e.g. -30 became
4066). Both feed into the humidity compensation, which then produces
a wrong reading.
Use sign_extend() to recover the signed values.
Fixes#112381
Signed-off-by: yi chen <94xhn1@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Add IMX_CCM_ARM_PLL_CLK, the clock that drives the Cortex-A cores from
ARM_PLL, so the core frequency can be set through the clock_control API:
clock_control_set_rate(ccm, (clock_control_subsys_t)IMX_CCM_ARM_PLL_CLK,
(clock_control_subsys_rate_t)frequency);
ARM_PLL cannot be reprogrammed while it clocks the cores, so the
transition has to run them off a step clock, reprogram ARM_PLL and select
it again once it has locked. Both the step clock and the ARM_PLL dividers
are SoC specific, so the driver only dispatches to the SoC layer through
imx9_arm_pll_set_rate(), declared in the per-SoC soc.h.
The case is compiled only where CONFIG_CPU_FREQ_PSTATE_SET_SOC is set and
an ARM_PLL node is enabled, so the i.MX9 parts that scale the core clock
through SCMI are unaffected.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Chenhui Zhao <chenhui.zhao@nxp.com>
Add a new display driver and devicetree binding for the Philips PCD8544
LCD controller used on the Nokia 5110 display. The driver continues on
the MIPI DBI SPI framework which the original author chose to use.
Tested on a custom board wired to a Nokia 5110 module, using a sample
application for a custom board. Tests also added under
tests/drivers/build_all/display.
Signed-off-by: Eyitope Adelowo <adeyitope.io@gmail.com>
Signed-off-by: Quentin Lacombe <quentlace2g@gmail.com>
Assisted-by: Claude:claude-sonnet-5
Drive the RA Pulse Density Modulation Interface as a DMIC device through
the FSP r_pdm module, one node per PDM-IF channel. The microphone clock
divider and the sinc filter's decimation and output range are worked out
from the requested rate, and the filter coefficients are left at the
values the hardware manual gives as the registers' reset state.
The interface delivers twenty- or sixteen-bit samples in thirty-two-bit
words, so the driver sign extends and packs them into the width the
stream asked for while the interface fills the other half of its buffer.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add a WiFi driver for the Bouffalo Lab wifi4 MACSW firmware blob,
initially supporting BL60x: net_if integration with the Ethernet L2,
the IPC command mailbox (MM/ME/SM/SCANU message flow), scan with a
result cache feeding both wifi_mgmt and the supplicant, SAE bridging
and hostap supplicant integration; the 4-way handshake runs in the
Zephyr supplicant through the firmware's wpa_funcs bridge.
The driver core lives in drivers/wifi/bflb/wifi4 behind the hidden
WIFI_BFLB_WIFI4 symbol carrying its selects; the blob-ABI-specific IPC
seeding/ISR and TX path hook in from soc/bflb/<series>/wifi. System
defaults the driver needs (work queue and net_mgmt stacks, PSA key
slots, net buffer counts) live in the SoC Kconfig.defconfig, and the
wifi shell sample board fragments only carry the per-board RAM budget
plus overrides of values the sample's own prj.conf pins.
Signed-off-by: William Markezana <william.markezana@gmail.com>
This change marks each instance of the `uart_xxx_config` as `const`.
By using `const`, we ensure immutability, leading to usage of only
`.rodata` and a reduction in the `.data` area.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Remove address-of operator ('&') when assigning `init_fn`
function pointer in `DEVICE_DT_INST_DEFINE` and `DEVICE_DT_DEFINE`
macros.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Since commit c0c10624ad ("drivers: net: canbus: init canbus network
driver for each CAN controller"), the CAN bus network driver defines an
interface for every enabled node of the "can" device class and takes
its controller with DEVICE_DT_GET(), so a build fails to link when one
of those nodes has no driver, for example on frdm_k64f with an MCP2515
shield and CONFIG_CAN_MCUX_FLEXCAN=n.
Define the interface from CAN_DEVICE_DT_DEFINE() instead, next to the
controller's device, so that exactly the controllers with a driver get
one. CAN drivers already define their devices with it.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
On the STM32MP2 the Cortex-M33 only controls the timer gate: the timer
kernel clock is set up by the Cortex-A35 firmware and there is no source
clock to describe. On this series, when a single clock is described,
read the timer clock rate from the gate instead of failing, so such
timers do not need a duplicated clock entry.
Other series keep requiring a source clock and still fail with "Timer
clock source is not specified".
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Jerome LAMY <jerome.lamy@savoirfairelinux.com>
Report the TIM12 kernel clock rate so the STM32 PWM driver can compute
its periods. TIM12 belongs to timer group 1, clocked from APB1: when APB1
is not divided, the timer clock equals the APB1 clock, derived from the
core clock and the LSMCU divider. Other APB1 prescaler settings are not
handled and return -ENOTSUP.
Tested on STM32MP257F-DK, where Linux reports ck_ker_tim12 at 200 MHz.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Jerome LAMY <jerome.lamy@savoirfairelinux.com>
On the STM32MP25 the DCMIPP kernel clock source is selected by the
Cortex-A35 firmware and the Cortex-M33 has no mux to configure. Only
call clock_control_configure() when a dcmipp-ker clock is described, so
such SoCs can list the DCMIPP gate alone.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Jerome LAMY <jerome.lamy@savoirfairelinux.com>
The DW I3C driver stored DT_INST_REG_ADDR as a uint32_t and programmed
sys_read32()/sys_write32() with that physical address. That is valid
on Cortex-M, where there is no MMU. On CONFIG_MMU (Cortex-A) it is a
1st-level translation fault the first time DEVICE_CTRL or a nearby
register is touched.
Zephyr requires DEVICE_MMIO for peripheral MMIO when an MMU, PCI-e, or
external address translation is enabled. i2c_dw already follows that
API.
Use the named DEVICE_MMIO helpers because i3c_driver_config and
i3c_driver_data must remain the first members of the driver structs.
Map the DT range in dw_i3c_init() and access it through
dw_i3c_regs(dev). On no-MMU SoCs DEVICE_MMIO_NAMED_MAP is a no-op and
DEVICE_MMIO_NAMED_GET is still the DT physical address.
The same conversion applies to microchip,xec-i3c, which shares this
file.
Assisted-by: Cursor:Grok-4.6
Signed-off-by: Shreehari HK <shreehari.hk@alifsemi.com>
STM32N6 ADC requires reading data register as 32-bit,
but for DMA we can configure different size for source
and destination.
Signed-off-by: Adam BERLINGER <adam.berlinger@st.com>
Allow mismatch between source and destination size.
Mismatch can be used by peripherals that require 32-bit access,
but produce 16-bit value (e.g. ADC, DAC)
Signed-off-by: Adam BERLINGER <adam.berlinger@st.com>
Add an explicit (void *) cast when assigning the const device pointer
to the FSP context field to avoid the build warning.
Signed-off-by: Hieu Tran Truong <hieu.tran.wx@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Add an explicit (void *) cast when assigning the const device pointer
to the FSP context field to avoid the build warning.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Add an explicit (void *) cast when assigning the const device pointer
to the FSP context field to avoid the build warning.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Add an explicit (void *) cast when assigning the const device pointer
to the FSP context field to avoid the build warning.
Signed-off-by: Duc Bui <duc.bui.vt@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>