Commit graph zephyr/soc
Author SHA1 Message Date
Zhiyuan Tang
322c996d73 soc: realtek: bee: remove hardcoded TIMESLICE_SIZE default
The SoC-level default of 10 ms is too short when UART tracing is
enabled at 115200 baud: three trace hooks (isr_exit, switched_out,
switched_in) fire back-to-back after each sys-timer ISR and together
emit ~9-12 ms of synchronous UART output, leaving no CPU time for
application threads (sample.tracing.user, sample.tracing.gpio stall).

Remove the override and let the kernel default (20 ms) apply, which
provides sufficient headroom for application code to run between
scheduling events.

Signed-off-by: Zhiyuan Tang <zhiyuan_tang@realsil.com.cn>
2026-08-13 06:32:01 -04:00
Mathieu Choplain
94d4dbfd5a soc: st: stm32: drop the old wake-up pins driver
Now that all series (with wake-up pins) have been migrated to the new
binding, drop the old driver.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-12 19:24:53 -04:00
Mathieu Choplain
971ddd1f51 soc: st: stm32: common: add new driver for wake-up pins/lines management
Add a new STM32 SoC-specific driver for management of wake-up pins at
Power Controller level. The more generic terminology "wake-up lines" is
used for consistency across all series, but the driver currently focuses
only on wake-up lines connected to GPIO pins. This driver is designed to
handle nodes with the new `st,stm32-pwr-wkupctrl` compatible as well as
derivatives (`st,stm32f1-pwr-wkupctrl` and `st,stm32f7-pwr-wkupctrl`).

The old driver is retained for backward compatibility; selection is done
automatically based on whether a node with the new compatible is present
and active in the Devicetree or not.

While at it, also update the STM32 GPIO driver to use the new driver
when appropriate by introducing a new (private) API. The old driver is
considered as deprecated and will be removed in a future commit.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-12 19:24:53 -04:00
Mathieu Choplain
5046274e58 soc: st: stm32: common: gpioport_mgr: move macro to common header
The macro to check whether a node is a valid and active STM32 GPIOport
node will be useful for upcoming drivers, so move it to the common GPIO
header to enable reuse by other components.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-12 19:24:53 -04:00
Mathieu Choplain
f3fe09e0cd soc: st: stm32: common: wkup_pins: inline stm32_pwr_wkup_pin_cfg_pupd()
stm32_pwr_wkup_pin_cfg_pupd() is a trivial function. Inlining it inside
each SoC's `poweroff.c` makes it easier to follow the logic and should
also have a slightly smaller footprint.

Note that nothing remains in `stm32wbax/poweroff.c` because the function
was a no-op: STM32WBA series does not have the `wkup-pins-pupd` property
on its power controller.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-12 19:24:53 -04:00
Mathieu Choplain
acda134f2f include: dt-bindings: power: stm32: replace one-hot encoding line select
Instead of encoding the WKUP line selection as a one-hot value, use a
plain integer value instead and update the associated driver to support
this new encoding. This change should have no impact on existing users
as long as they used the named constants instead of raw values in their
Devicetree.

While at it, also introduce a new macro for the bitmask of all supported
line sources, which is useful for extraction purposes.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-12 19:24:53 -04:00
John Batch
7f61bd8ea4 drivers: mfd: hppass_csg: add comparator IRQ lock and intr helpers
Add helpers to arm the combined comparator interrupt and add a critical
section around it.  Reduce callback register critical section from
irq_lock to irq_disable of the comparator interrupt.

Assisted-by: Github Copilot:claude-opus-4.8
Signed-off-by: John Batch <john.batch@infineon.com>
2026-08-12 19:24:28 -04:00
Fin Maaß
848574b96c linker: clang: fix region name
the clang linker does not like quotation marks
in the name, if the memory region has been
defined before without them. The build will
fail if they are not the same. This fixes it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-08-12 13:10:49 -04:00
Keith Short
0f521cd8df soc: ite: Add deep sleep time measurement support for ITE ECs
Track the time spent in deep doze / sleep states on ITE EC SoCs
(IT8xxx2, IT51xxx) by capturing the 32.768 kHz free-run timer timestamp
before entering deep sleep and accumulating elapsed cycles upon waking.

Add ite_ec_clock_get_sleep_ticks() to convert total deep-sleep cycles
to kernel ticks.

Signed-off-by: Keith Short <keithshort@google.com>
Assisted-by: Antigravity:gemini-1.5-pro
2026-08-12 13:00:41 -04:00
Keith Short
f968be4a80 soc: ite: it8xxx2: Rename ite_ec_timer_block_idle
Rename ite_ec_timer_block_idle() to ite_it8xxx2_timer_block_idle() to
reflect that this DMA clock synchronization idle check is specific to
the IT8XXX2 SoC family. Remove the unnecessary header guard around its
prototype in soc_timer.h.

Signed-off-by: Keith Short <keithshort@google.com>
Assisted-by: Antigravity:gemini-1.5-pro
2026-08-12 13:00:41 -04:00
Tomas Galbicka
bfa8f8aad0 boards: nxp: fix multicore image load addresses
Mapped partitions already resolve to CPU-visible flash addresses. Stop
adding the FlexSPI mapping base a second time when adjusting remote
image load and boot addresses.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2026-08-12 12:58:56 -04:00
Camille BAUD
530022cbf1 bluetooth: bflb: Harmonize interrupts settings where possible
Pick IRQs from DTS when possible

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-08-12 10:03:22 -04:00
Camille BAUD
33579adbfe drivers: bluetooth: wifi: Add BLE and WIFI support for BL616CL
Add support for BLE and WIFI on BL616CL.
Harmonize WiFi6 Blob/HW pair.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-08-12 10:03:22 -04:00
Holt Sun
efa8637ac7 soc: nxp: keep mcux lptmr as an explicit per-SoC default
The MCUX LPTMR system-timer driver previously defaulted to enabled
whenever the /chosen/zephyr,system-timer node was compatible with
nxp,lptmr. On SoCs whose devicetree points zephyr,system-timer at an
LPTMR instance (e.g. frdm_mcxw71/mcxw716c), this forced every build,
including non-power-management builds, to select the 32.768 kHz LPTMR
and disable the Cortex-M SysTick. Tests that rely on the high-resolution
SysTick clock (tests/kernel/timer/timer_api) then failed because the
1024 tick/s LPTMR does not provide the required timing resolution.

Restore the explicit per-SoC policy: the generic driver no longer
defaults MCUX_LPTMR_TIMER on, and each SoC opts in on its own terms.
MCXW7xx, KE1xF and MCXC enable the LPTMR only when power management is
enabled (default y if PM); i.MX95 and i.MX952 M7 enable it only when the
LPTMR is not claimed by the counter driver (default y if
!COUNTER_MCUX_LPTMR). This keeps SysTick as the system timer for plain
builds while preserving the low-power LPTMR configuration for PM builds.

Update the 4.5 migration guide accordingly.

Fixes #115491

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-08-11 20:54:32 -04:00
Chao Liu
27b29b5eac soc: rockchip: add RK3588 Cortex-A76 CPU support
Define labeled Cortex-A55 and Cortex-A76 CPU nodes for RK3588 and select
the combined Cortex-A76/A55 CPU configuration. Keep the existing
ROC-RK3588-PC SMP variant on its supported Cortex-A55 CPUs.

Signed-off-by: Chao Liu <chao.liu@processmission.com>
2026-08-11 20:54:05 -04:00
Sylvio Alves
0cd62bb7a8 soc: espressif: refresh flash timing after psram tuning
PSRAM timing tuning reprograms the MSPI core clock, which is
shared between flash and PSRAM. The esp_flash driver had already
cached the flash timing in its HAL context during
esp_flash_config(), so the stale values made SPI1 erase and write
operations fail once tuning ran.

Re-read the timing settled on by the tuning code after PSRAM chip
init. This restores flash access on ESP32-S3 with octal PSRAM at
80 MHz. Add a Zephyr-side capability symbol for the SoCs that
support MSPI timing tuning instead of relying on the HAL one.

Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-08-11 17:03:25 -04:00
Laurie Fay
890c2e7e6b drivers: pinctrl: migrate musca-b1 pinctrl driver
This commit migrates the existing pinmux driver for the musca-b1
board to the newer pinctrl API. The new implementation also fixes
a bug in the original pinmux driver which would have selected
alternative function 2 instead of ALTF1 as desired.

The musca-s1 pinmux driver has been left as this board is
deprecated.

Signed-off-by: Laurie Fay <Laurie.Fay@arm.com>
2026-08-11 17:01:15 -04:00
Anas Nashif
41cf6fb9ce soc: renesas: define DT_CHOSEN_Z_FLASH where it is used
The Renesas RZ and Smartbond DA1469x Kconfig.defconfig files derive
FLASH_SIZE, FLASH_BASE_ADDRESS and BUILD_OUTPUT_ADJUST_LMA from
$(DT_CHOSEN_Z_FLASH), but never assign that preprocessor variable.

Kconfig.zephyr does assign it, at a point after the SoC Kconfig.defconfig
files have already been sourced, so these trees were picking up the
assignment from an unrelated vendor's tree that happened to be parsed
first, the way the ST, NXP and Realtek trees each assign it for
themselves.

Assign the variable in the files that use it, as the other SoC trees do.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-08-11 13:46:10 -04:00
Jun Lin
8fef51057c soc: nuvoton: npcx4: fix MPU flash region coverage
The npcx4 series did not provide a custom fixed SoC MPU region
definition, so it fell back to the default single-region flash
configuration in arch/arm/core/mpu/arm_mpu_regions.c.

On this SoC the flash is 384 KB based at 0x10060000, which the
default logic rounds up to a single 512 KB (REGION_512K) region.
The ARMv7-M MPU requires a region base aligned to the region size,
but 0x10060000 is not 512 KB aligned. The hardware masks the base
down to 0x10000000, so the region only covers 0x10000000-0x10080000
and leaves flash above 0x10080000 unprotected.

This is latent until the image grows past 0x10080000. With
CONFIG_NO_OPTIMIZATIONS=y the arm_thread_swap test image exceeds
that boundary and takes an MPU fault (Data Access Violation) when
code runs in the upper Code RAM.

Add a custom mpu_regions.c mirroring the npcx7 approach: split the
flash into two properly aligned 256 KB regions covering
0x10060000-0x100c0000

Fixes #114538

Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2026-08-11 13:43:07 -04:00
Iuliana Prodan
b021ca601f soc: nxp: imx8m: adsp: include snippets-data-sections.ld in linker
The ztest benchmark framework places its iterable sections via
zephyr_linker_sources(DATA_SECTIONS ...), which end up in the generated
snippets-data-sections.ld. This linker script did not include that file,
so the _ztest_benchmark_*_list_start/end symbols were undefined and
benchmark tests failed to link.

Include snippets-data-sections.ld to fix it.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2026-08-11 07:44:58 -04:00
Qiang Zhao
83ce2b727a soc: nxp: imx952: fix systick issue for M7
SLEEP_HOLD_EN is enabled by default, which gates SysTick and causes
the system to hang in tests like test_gpio_pin_configure_single_ended.

Set CPU sleep mode to RUN via SCMI CPU domain protocol during
soc_init() to clear SLEEP_HOLD_EN and allow SysTick to run.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2026-08-11 07:43:37 -04:00
Etienne Carriere
07e3149908 soc: st: stm32: Factorize CONFIG_ROM_START_OFFSET
All STM32 SoC and platforms embedding Zephyr MCUboot application or$
embedding TF-M (with or without its BL2 bootloader) do expect
a 1024 bytes header blob in the Zephyr application layout. Factorize
this default value instead of adding the same information in each
SoC series or at board level.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-11 07:43:04 -04:00
Nhut Nguyen
6d4799c571 driver: pinctrl: Add support for Renesas RZ/A3M
Add pinctrl support for Renesas RZ/A3M
Remove the default from the binding and use DT_PROP_OR(..., 0) when
extracting FILNUM/FILCLKSEL, so DT_NODE_HAS_PROP() distinguishes an
explicitly requested filter from an absent property.

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-08-11 07:40:28 -04:00
Nhut Nguyen
8933387fcb soc: renesas: Add support for Renesas RZ/A3M
Add support for Renesas RZ/A3M

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-08-11 07:40:28 -04:00
Nam Nguyen
219b3a04d4 arm64: renesas: R-Car X5H CA720 to support SCMI and MFIS
Adding R-Car X5H (Cortex-A720) to support SCMI and MFIS.

Signed-off-by: Nam Nguyen <nam.nguyen.xn@renesas.com>
2026-08-10 16:31:01 -04:00
Nam Nguyen
b4c5ed20b3 soc: renesas: rcar: Support Cortex A720 for R-Car X5H SoC
Support Zephyr RTOS on Cortex A720 for R-Car X5H.

For more information and documentation, please visit the product page:
https://www.renesas.com/secure/gen5-r-car-x5h

Signed-off-by: Nam Nguyen <nam.nguyen.xn@renesas.com>
2026-08-10 16:31:01 -04:00
Takumi Ando
57dc9653dd soc: xlnx: versal: Add RPU remoteproc linker support
Allow host-side remoteproc to locate a Versal RPU resource table in a
remoteproc-visible RPROC memory region. Publish its location using the
metadata format required when attaching to an RPU started before the APU.

Optionally use RPROC as the load region for initialized runtime data.
This supports layouts whose code and data use different memories without
making that layout a requirement for other Versal boards.

Signed-off-by: Takumi Ando <takumi@spacecubics.com>
2026-08-10 16:22:29 -04:00
Lucien Zhao
cc018de334 soc: nxp: mcxe24x: add NXP SYSMPU region table
Add the fixed NXP System MPU region table for the MCXE24X SoC series and
wire it into the build:

- Select CPU_HAS_NXP_SYSMPU for SOC_SERIES_MCXE24X.
- Compile the SoC MPU region table (nxp_mpu_regions.c) when
  CONFIG_ARM_MPU is enabled.

The region table enforces execute-never for data/heap/stack and
read-only for rodata/text. Because the NXP MPU uses OR semantics (a
region granting access cannot be revoked by another), the background
region is split around SRAM when MPU_STACK_GUARD is enabled so the stack
guard can deny supervisor writes; a single background region is used
otherwise to save one boot region.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-08-10 16:21:25 -04:00
kim lin
1f0399113a soc: st: common: Enable debug in low power modes on F4
Enable/disable debug in Sleep/Stop/Standby modes on F4xx series
upon CONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP.

Signed-off-by: kim lin <2639192425@qq.com>
2026-08-10 16:21:14 -04:00
Tiago Medicci
0f3bad7a02 soc: espressif: make __rom_region_size absolute for PMP
Inside an output section, assigning __rom_region_size without
ABSOLUTE() yields a section-relative ELF symbol. Zephyr's PMP
init casts that symbol's address to a size, so the ROM TOR entry
becomes section_base + size instead of the actual region length
and can cover the peripheral window (0x60000000+), causing
Store/AMO faults on protected accesses.

Force an absolute symbol on ESP32-C5/C6/P4.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-08-10 16:18:06 -04:00
Lucien Zhao
0613469db1 soc: nxp: imxrt: add i.MX RT1151/RT1152 SoC support
Add support for the i.MX RT1150 family (MIMXRT1151/MIMXRT1152),
single Cortex-M7 core SoCs of the i.MX RT11xx series running at up
to 800MHz, to the shared imxrt11xx SoC layer. Clock init configures
the M7 root from the ARM PLL at 798MHz, keeps the bus roots at
240MHz and enables Forward Body Biasing in OverDrive mode. All
orderable part numbers are defined.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2026-08-10 07:10:41 -07:00
Erdem Simsek
0c4d36e90c soc: nordic: nrf71: disable RAM retention by default
Clear RET and RET2 during secure early initialization. Skip the
redundant nRF71 System OFF clear and use the nrfx all-sections helper
for other Nordic SoCs.

Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
2026-08-10 07:08:25 -07:00
Erdem Simsek
a3a9dbfeed drivers: retained_mem: route nrf_ram_ctrl retention via TF-M in NS build
When CONFIG_SOC_SERIES_NRF71_TFM_RAM_CTRL_SERVICE is set, route
z_nrf_retained_mem_retention_apply() to the secure RAM-control service
(tfm_platform_ram_ctrl_retention_set) instead of nrfx_ram_ctrl; the secure
build keeps the direct nrfx path. Apply regions best-effort and return
-EIO if the secure service rejects one.

Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
2026-08-10 07:08:25 -07:00
Erdem Simsek
ac4c2a3a4e soc: nordic: enable the TF-M RAM-control service
Add SOC_SERIES_NRF71_TFM_RAM_CTRL_SERVICE for nRF71 TF-M builds
and pass it to the TF-M build as -DNRF_RAM_CTRL_SERVICE, so the secure
RAM-control service is compiled into the secure image for non-secure
builds.

Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
2026-08-10 07:08:25 -07:00
Erdem Simsek
b1282a3230 soc: nordic: nrf71: select HAS_NORDIC_RAM_CTRL
Enable hardware-backed System OFF RAM retention (MEMCONF RET) for
nRF7120 via the nrfx_ram_ctrl / retained_mem path.

Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
2026-08-10 07:08:25 -07:00
Tony Han
f3fbf1f8f6 soc: microchip: sam: update MMU for sama7d6 TRNG
When TRNG is activated in the DT, configure it's register region with
strong ordered, read and write access.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-08-09 17:42:37 -04:00
Tony Han
1d7a89185e soc: microchip: sam: common: simplify the sources by ${SOC_SERIES}.c
Rename the source file for sama7d6 and simplify the sources file by
using "${CONFIG_SOC_SERIES}.c" in "CMakeLists.txt".

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-08-08 16:35:16 -04:00
Jamie McCrae
b108bbbc44 soc: cmake: Remove usage of duplicate SOC_* variables
Instead uses the Kconfig values directly, which are the source of
truth

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-08-08 16:33:24 -04:00
Steven Chang
bcc398abd0 drivers: i2c: kb106x: i2c driver
- Add i2c driver for ENE KB106X.

Signed-off-by: Steven Chang <steven@ene.com.tw>
2026-08-08 16:30:56 -04:00
TOKITA Hiroshi
30d9c86491 soc: renesas: rcar: enable GIC single security state for R8A779G0
Configure the Cortex-R52 GIC so Group 1 interrupts, including
the virtual timer PPI, are delivered correctly.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-08-08 15:21:44 -04:00
Keith Short
c27b4950e6 soc: ite: it8xxx2: Move timer_5ms_one_shot
Calling timer_5ms_one_shot() from chip_run_pll_sequence() can result
in a R_RISCV_RVC_JUMP linker relocation truncaction error because
timer_5ms_one_shot() links into flash, and chip_run_pll_sequence()
links into RAM.

Move the timer_5ms_one_shot() call out of chip_run_pll_sequence()
and into chip_configure_pll() right before chip_run_pll_sequence()
is invoked.

Tested on IT8xxx2 EC board.

Signed-off-by: Keith Short <keithshort@google.com>
Assisted-by: Antigravity:gemini-1.5-pro
2026-08-07 16:26:32 -04:00
Daniel Leung
54a45000c0 xtensa: move CONFIG_ARCH_HAS_DIRECTED_IPIS to SoC
Xtensa architecture does not have native inter-processor
interrupts and must rely on mechanism on SoC or board to do
that. Because of this, the architecture should not select
CONFIG_ARCH_HAS_DIRECTED_IPIS and should let SoC or board
layer to do that, where CONFIG_SCHED_IPI_SUPPORTED is also
being selected.

Note that CONFIG_XTENSA_LAZY_HIFI_SHARING is now dependent
on CONFIG_ARCH_HAS_DIRECTED_IPIS as it uses directed IPI.
Due to that it keeps sending IPI under the other has saved
HIFI state, it is not really appopriate to broadcast IPIs.
That's why it can only be enabled when directed IPI is
supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-08-07 16:26:21 -04:00
Niyas Hameed
f294c74ca6 soc: microchip: fix stack corruption during SRAM initialization
Perform SRAM initialization before main stack pointer is configured

Signed-off-by: Niyas Hameed <niyas.hameed@microchip.com>
2026-08-07 11:19:26 -04:00
Jérôme Pouiller
04bd1f72c1 soc: silabs: siwx91x: select HAS_SWO and sort selects
The SiWx91x reference manual describes a dedicated JTAG_TDO/SWO pin
that outputs Serial Wire Viewer (SWV) trace data over SWO, same as
the ARM CoreSight infrastructure used on other Silabs SoCs that
already select HAS_SWO. Select HAS_SWO so LOG_BACKEND_SWO becomes
available for this family.

While there, sort the select statements, as done in the rest of the Silabs
SoC Kconfig files.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-08-07 11:18:10 -04:00
Jérôme Pouiller
d9262a1d0c soc: silabs: select CPU_CORTEX_M_HAS_DWT where missing
The xg22 and xg27 Series 2 SoCs (Cortex-M33) and the siwx91x family
(Cortex-M4) did not select CPU_CORTEX_M_HAS_DWT, unlike their sibling
SoCs based on the same core.

The Silicon Labs reference manuals for EFR32xG22 and EFR32xG27
("DBG - Debug Interface" section) and for SiWx917 ("Trace and Debug"
chapter) explicitly list the Data Watchpoint and Trace (DWT) unit as
an implemented feature, same as on xg21/xg23/xg24/xg26/xg28/xg29.

Select CPU_CORTEX_M_HAS_DWT for these SoCs to match the hardware and
be consistent with the rest of the series.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-08-07 11:18:10 -04:00
Raffael Rostagno
a841703cf3 soc: espressif: pm: Reserve heap for peripheral power down
Powering down the peripheral domain in light sleep allocates the CPU
retention frames from the system heap at each sleep entry. Declare the
requirement so builds enabling it get the heap they need instead of
relying on each application to size it.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-08-07 06:49:39 -04:00
TOKITA Hiroshi
185c8c735b soc: renesas: Add R8A779G0 A76 support
Add SoC and devicetree support for the R-Car Gen4 R8A779G0 A76.

Co-authored-by: Yuya Hamamachi <yuya.hamamachi.sx@renesas.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-08-07 06:48:15 -04:00
Mathieu Choplain
3298ddb1cc soc: st: stm32: common: gpioport_mgr: drop GPIO stuff when driver is off
When the STM32 GPIO driver is not enabled, drop the gpio_driver_config
common field from the instance configuration and don't create instance
data blocks as they become unnecessary. This reduces the footprint in
this configuration.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-07 06:46:44 -04:00
Mathieu Choplain
f01aed53b1 soc: st: stm32: common: gpioport_mgr: don't instantiate ports when !GPIO
Stop instantiation of the GPIO port nodes as proper devices when the
STM32 GPIO driver is disabled. This allows application to build but
then fail miserably at runtime because they try to using the GPIO API
without CONFIG_GPIO=y.

Instead, when CONFIG_GPIO_STM32=n, use the DEVICE_DEFINE() macro
to still create `struct device`s (which are needed by our API and to
use PM services), but with a name that doesn't match the one expected
by DEVICE_DT_GET(). This ensures any naive consumer trying to use the
GPIO ports will get a "__device_dts_ord_N not found" linker error at
build, as it would if the GPIO driver (which isn't built in this case)
did handle instantiation, without loosing access to device servicis
since we still creating an actual `struct device`. The only downside
of this approach is that the GPIO ports become "software devices" so
they don't have any dependencies and their initialization priority
is not checked. This should be fine because in this configuration,
the devices are private and very little code will interact with them.
(Really, only the STM32-specific pinctrl driver will...)

An alternative option would be to call Z_DEVICE_DEFINE() directly
to create frankenstein-esque devices which would be recognized as
coming from a Devicetree node but forced to have the "wrong" name.
However, this requires usage of an internal macro so it has been
avoided here.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-07 06:46:44 -04:00
Mathieu Choplain
087f1cd594 soc: st: stm32: common: gpioport_mgr: initialize GPIO common using macro
Use GPIO_COMMON_CONFIG_FROM_DT_NODE() to initialize the GPIO subsystem
`common` field of the instance's configuration instead of manually
initializing each field.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-08-07 06:46:44 -04:00