Commit graph

4737 commits

Author SHA1 Message Date
Gerson Fernando Budke 5903c7a669 drivers: watchdog: sam0: initialize GCLK2 in wdt_sam0_init
Initialize GCLK2 to output 1.024kHz required by watchdog timer.

Co-authored-by: Vlad Laba7 <vlad@laba7.com>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-02-05 13:27:54 +01:00
Anas Nashif d7678f1694 xtensa: move to use system cache API support for coherency
Remove custom implementation and use system cache interface instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-03 13:42:33 -05:00
Grant Ramsay 211ddf1c7e soc: arm: xilinx_zynqmp: Add "Execute Never" MPU flag to non-code RAM
Executing from RAM sections other than rom/code should cause a fault.
This is tested as part of the kernel mem_protect tests.

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2024-02-02 17:05:01 -06:00
Gerard Marull-Paretas 426bbf5649 soc: riscv: nordic_nrf: nrf54h: introduce PPR support
Add support for the nRF54H PPR (Peripheral Processor), based on the VPR
RISC-V core.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas ba16e3dd13 soc: riscv: nordic_nrf: add initial support for VPR core
Add initial support for the VPR RISC-V core found in the new nRF54 SoCs.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas 1a6b88608e soc: arm: nordic_nrf: move Kconfig.peripherals to common folder
Because RISC-V cores also need to include this file, so it is no longer
ARM specific.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas d7dc942382 soc: common: nordic_nrf: move pinctrl_soc.h to a common dir
Because both, RISC-V and ARM cores share the same pinctrl driver. The
top level common folder will disappear with the introduction of HWMv2,
where multi-arch SoCs will be well supported.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek 976de4edbe drivers: serial: nrfx: Allow new UARTE instances to be used
Extend Kconfig definitions and nrfx_config translations so that UARTE
instances that are available in nRF54H20 can be used.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Grzegorz Swiderski be8b2663c6 modules: hal_nordic: Integrate nrf-regtool
nrf-regtool is a Python utility from Nordic Semiconductor, which is used
for generating binary files with register values for given peripherals.
It sources the descriptions of peripheral registers from CMSIS-SVD files
(typically ones bundled with nRF MDK).

For some peripherals, such as UICR, nrf-regtool supports parsing values
from devicetree as well, based on the bindings already found in Zephyr.

Currently, this tool is not submitted as a script to Zephyr, but it can
be installed from PyPI.

Having nrf-regtool installed is recommended when working with nRF54H20.
Booting the Application or Radiocore CPU requires flashing not only its
firmware, but also its respective UICR instance. On this SoC, the UICR
is used to assign ownership of global hardware resources, including
memory and peripherals, to individual cores. The Zephyr build system can
call nrf-regtool to generate the UICR based on devicetree, to reflect
the boot-time hardware configuration required for a given application.
The generated `uicr.hex` is then merged with `zephyr.hex`, so that they
can be flashed together using west.

The build system integration takes the form of a CMake package, which
includes a version check and reusable components; over time, some of
these components can be reused by sysbuild. This package is located in
the `hal_nordic` module, because it depends on the `SOC_SVD_FILE` CMake
variable, which is defined there as well.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek abb0934def soc: nordic: Add initial support for nRF54H20 EngA
Add nrfx and Kconfig related infrastructure plus SoC initialization
code to allow building for nRF54H20 targets (Application and Radio
cores).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek 2efd34bda3 modules: hal_nordic: nrfx_glue: Include cmsis_core_m_defaults.h
... to cover missing __ICACHE_PRESENT and __DCACHE_PRESENT symbols that
should be defined in MDK files.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Manuel Argüelles 1b302f51ea soc: arm: nxp_s32: s32k1: add support for RTC
Add support for the Real Time Clock (RTC) counter.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-02-02 12:43:00 +01:00
Martin Åberg f033f31728 soc/gr716a: Enable SPIMCTRL support on LEON GR716A
GR716A has two SPIMCTRL SPI controllers.

This adds the SPIMCTRL description to the DTS and makes the SPI
option available in the kernel configuration.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2024-02-01 14:06:38 +01:00
Daniel DeGrasse a10fee2d5e drivers: clock_control: ccm_rev2: add support for reclocking FlexSPI
Add support for reclocking flexspi in ccm_rev2 driver. Clock update
functions are provided for the RT11xx.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 10:57:35 +01:00
Daniel DeGrasse f81113e948 drivers: clock_control: add support for FlexSPI reclock on NXP iMX RT10XX
Add support for reclocking the FlexSPI on NXP iMX RT10XX. This
functionality requires an SOC specific clock function to set
the clock rate, since the FlexSPI must be reset directly
before applying the new clock frequency.

Note that all clock constants are defined in this commit, since the
memc flexspi driver now depends on a clock node being present.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-02-01 10:57:35 +01:00
Dino Li a059da947c soc/it8xxx2: add support for raising EC bus to 24MHz
This change was made to reduce read/write EC registers latency.
Without enabling CONFIG_SOC_IT8XXX2_EC_BUS_24MHZ:
- Read EC register 64 times takes 80us latency.
- Write EC register 64 times takes 60us latency.
With enabling CONFIG_SOC_IT8XXX2_EC_BUS_24MHZ:
- Read EC register 64 times takes 40us latency.
- Write EC register 64 times takes 30us latency.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-01-31 16:43:46 +00:00
Andrzej Głąbek eb78b71914 soc: arm: nordic_nrf: Clean up and unify a bit cmake code
Consistently use `zephyr_library*` cmake functions for all nRF Series
and set the Cortex-M linker script in a common place for all of them.
Remove no longer needed include directories.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-01-31 09:40:48 -06:00
Magdalena Pastula e4aebf9cea soc: arm: nordic_nrf: align soc_secure.h to nRF54L
In nRF54L15 FICR can be accessed also from non-secure code,
so it does not have NRF_FICR_S defined.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Witold Lukasik 1d9f702260 soc: arm: nordic_nrf: add support for Nordic nrf54l family
Add soc files for new Nordic family.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Witold Lukasik a5eeb6d6db soc: arm: nordic_nrf: add source code for validating rram partitions
RRAM is a part of nRF54L15 SOC.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Magdalena Pastula a6bd4dbc33 soc: arm: nordic_nrf: add nRF54L15 peripherals instances
Add support for nRF54L15 instances of UARTE, TIMER and WTD.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Magdalena Pastula 70b21845b2 soc: arm: nordic_nrf: add support for nRF54L15 GRTC instance
Add GRTC as possible clock source.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Witold Lukasik daa888c37b soc: arm: nordic_nrf: move NRF_RTC_TIMER not to be selected as default
NRF_RTC_TIMER will not be a default timer in the next
version of Nordic timer. It should be soc selection specific.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Ian Morris b1a15718aa dts-bindings: pinctrl: renesas_ra: enabled config of i/o ports 4-7
The RA_PINCFG macro is used to generate a value that can be written
directly to the pin function select register. In addition to the pin
function this value also contains port and pin number information,
located in bit fields that are unused by the register. The bit field
used to store the port information consists of 3-bits. However, a typo in
the mask definition limited the field to two bits meaning only ports 0-3
could be configured. This patch resolves the issue, allowing ports 0-7 to
be configured. If the port is greater than 7 another field (port4) is used
to store an additional bit (allowing an additional 8 ports to be
supported). However, use of this field has not yet been implemented.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-01-30 15:38:51 -05:00
Andriy Gelman c7dab3df08 drivers: can: Add xmc4xxx CAN support
Adds CAN drivers for XMC4xxx SoCs.

XMC4xxx has multiple CAN nodes. The nodes share a common clock and
a message object pool.

The CAN nodes do not have a loopback mode. Instead there is an
internal bus which can be used to exchange messages between
nodes on the SoC. For this reason tests/samples which rely on the
loopback feature have been disabled.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-30 19:06:06 +01:00
Navinkumar Balabakthan 05c38cb2f5 soc: arm64: intel_socfpga: changes in system_manager
SOCFPGA_SYSMGR_REG_BASE base address now read from Device tree

This commit changes the way the SOCFPGA_SYSMGR_REG_BASE base address is
determined. Previously, the address was hard-coded in the system_manager
source file. This commit changes the code to read the address from the
Device tree. This makes the code more flexible and allows the base
address to be different for different boards.

Signed-off-by: Navinkumar Balabakthan <navinkumar.balabakthan@intel.com>
2024-01-30 18:01:31 +01:00
Guillaume Gautier 6b681bcbcc soc: arm: stm32wba: add support for standby mode with ram retention
Add support for STM32WBA Standby low-power mode with RAM retention.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-30 18:01:00 +01:00
Flavio Ceolin 3e5a593de9 intel_adsp/cavs: power: Fix INTLEVEL value
In pm_state_set we can't just call k_cpu_idle() because
this will clear out PS.INTLEVEL. Use k_cpu_atomic_idle instead
since Zephyr's expect interruptions to be locked after pm_state_set.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-30 10:28:57 -06:00
Flavio Ceolin ff43667497 intel_adsp/ace: power: Restore PS after power gate
We are arbitrarily setting a value to PS after power gates and
losing valid information like OWB, CALLINC and INTLEVEL.

We need to properly save/restore them to avoid possible wrong behavior.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-30 10:28:57 -06:00
Sharad Patil 296c1e4768 soc: Added Support for Silabs EFR32MG12P432F1024GL125
Added support in board directory for EFR32 MG12 BRD4161A board

Signed-off-by: Sharad Patil <p.sharad@capgemini.com>
2024-01-30 08:46:25 +01:00
Declan Snyder a37bd8e7ba soc: rt5xx: Restore ISP pins state in soc init
ROM configures the ISP boot pins as gpio to determine what boot mode to
be in. But some ROM revisions have a bug where they do not restore the
reset state of these pins before booting application. This can cause
power leakage on these pins and is not an intended configuration from
Zephyr user/board point of view, so restore the reset state as part of
early SOC init (disable the pins). Configuration of pins should be
left up to app/board devicetree.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-01-29 17:15:01 +00:00
Mahesh Mahadevan b8bdc60427 soc: nxp: rt5xx: Remove deepsleep pin changes
SOC level code should not be dynamically changing pin configurations.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-01-29 17:15:01 +00:00
Tyler Ng 432f4a0b9a soc/riscv/opentitan: Kconfig.defconfig.series: Set NUM_IRQS to 256
The OpenTitan PLIC has support for up to 255 interrupt vectors, so
set it to that. Previously was set to number of IRQs used.

Signed-off-by: Tyler Ng <tkng@rivosinc.com>
2024-01-26 19:34:09 -06:00
Ren Chen 9dfd368165 it82xx2/usb: disable 15K-ohm default pull-down if device isn't enabled
There is default 15K-ohm pull-down for USB controller.
To disable the default pull-down to avoid signal contention in GPIO mode.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-01-26 22:26:55 +00:00
Erwan Gouriou 3d0c391ff2 soc: stm32: PM: Disable jtag port pins if no debug
At chip startup, jtag pins are configured by default to enable
debug.
This configuration adds consumption and when using PM profile,
we can save ~40uA by resetting this configuration and setting pins
to analog mode.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-26 15:52:38 +00:00
Jan Bylicki 6400e3f437 drivers: pinctrl: Add ZynqMP / Mercury XU pinctrl support
Add a pinctrl driver for the ZynqMP SoC and the
Mercury XU board powered by it.

Signed-off-by: Jan Bylicki <jbylicki@antmicro.com>
2024-01-26 12:47:11 +01:00
Daniel Leung cc25637126 soc: intel_adsp/ace: fix assert for uncached pointer
Only when CONFIG_MP_MAX_NUM_CPUS > 1, then .bss is put in
uncached region. Otherwise, .bss is in cached region.
So the assertion that g_key_read_holder must be in uncached
region must take into account how many CPUs are enabled on
build.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-01-25 20:12:28 +01:00
Manuel Argüelles f38b01c7ac soc: arm: nxp_s32: s32k1: enable watchdog driver
Enable on-chip watchdog driver support for S32K1 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-25 18:26:25 +00:00
Kai Vehmanen f6995feae9 soc: xtensa: intel_adsp: cavs: fix XCC build
Commit 3b99fb1b4a ("xtensa: do not imply atomic ops kconfig") removed
ATOMIC_OPERATIONS_ARCH at xtensa arch level. This triggers a bug in
intel_adsp cavs builds with XCC compiler as
CONFIG_ATOMIC_OPERATIONS_BUILTIN is not defined but neither is
CONFIG_ATOMIC_OPERATIONS_ARCH anymore, resulting in failed builds.

Fix the XCC build by defining CONFIG_ATOMIC_OPERATIONS_ARCH at
soc level.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-01-25 17:54:26 +01:00
Adrien MARTIN c1ae6e5b4e soc: stm32g0: add fdcan2
The STM32G0 soc has 2 CAN controllers. The 2nd on was not working
with zephyr yet as both controllers shares the same IRQ. Recently, the
shared irq system was integrated on now, both can controllers can work
on this chip. Shared interrupts must be enabled only if both can
controllers are enabled.

Signed-off-by: Adrien MARTIN <adrienmar@kickmaker.net>
2024-01-25 16:01:40 +00:00
Greter Raffael 33ffe001f8 linker: Generate snippets files for dtcm and itcm
This allows to link code and data blocks, e.g. the vector table, into
tightly coupled memory using `zephyr_linker_sources`.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-24 22:10:11 -06:00
Tim Lin 8317f9ea4f ITE: drivers/gpio: Add keyboard-controller property
When set, this GPIO controller has pins associated with the
keyboard controller. In this case the reg_gpcr property is
overloaded and used to write the keyboard GCTRL register

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-01-24 21:48:12 +01:00
Sateesh Kotapati a03c1ace6b gecko: service files updated | Update to GSDK 4.4.0
Updated the files present in device_init, hfxo_manager, power_manager
and sleeptimer folder as per latest version of gecko_sdk.
Added SL_DEVICE_INIT_HFXO_PRECISION in sl_device_init_hfxo_config.

Signed-off-by: Sateesh Kotapati <sateesh.kotapati@silabs.com>
2024-01-24 13:23:00 +01:00
Laurentiu Mihalcea 033d87d53f soc: mimx9: Remove SAI and EDMA static mappings
With the introduction of the SAI and EDMA drivers, there's
no longer a need to map the MMIOs using the mmu_regions.c
method since this is taken care of by the drivers via
device_map(). As such, remove entries for EDMA and SAI from
mmu_regions.c.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-01-24 10:43:19 +01:00
Gerard Marull-Paretas 68799d507d arch: riscv: make __soc_is_irq optional
It looks like all SoCs in tree check if an exception comes from an IRQ
the same way, so let's provide a common logic by default, still
customizable if the SoC selects RISCV_SOC_ISR_CHECK.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-23 09:57:57 +01:00
Gerard Marull-Paretas 49e2bc69a2 arch: riscv: add RISCV_HAS_(C|P)LIC from soc/riscv
Because these are general RISC-V options, not soc specific.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-23 09:57:57 +01:00
Gerard Marull-Paretas 2dcbb0ee3f soc: riscv: make RISCV_HAS_(C|P)LIC promptless
These options are meant to be selected by SoC series supporting
(C|P)LIC.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-23 09:57:57 +01:00
Anas Nashif 6df6935b67 intel_adsp: ace: do not use external kconfigs in code
use CONFIG_SOC_INTEL_ACE15_MTPM instead of CONFIG_ACE_VERSION_1_5.

CONFIG_ACE_VERSION_1_5 leaked from SOF.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-22 17:02:47 -05:00
Pieter De Gendt 1c190045b3 soc: arm: atmel_sam: samv71: Rework clock_init
Update clock_init for the Atmel SAMV71 SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 23edb87cab soc: arm: atmel_sam: same70: Rework clock_init
Update clock_init for the Atmel SAME70 SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 5bba8dd101 soc: arm: atmel_sam: sam4e: Rework clock_init
Update clock_init for the Atmel SAM4E SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 89f23f7947 soc: arm: atmel_sam: sam3x: Rework clock_init
Update clock_init for the Atmel SAM3X SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt a69d611de8 soc: arm: atmel_sam: sam4s: Rework clock_init
Update clock_init for the Atmel SAM4S SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 20f1f44120 soc: arm: atmel_sam: common: Add PMC API for clock management
Add functions to Atmel SAM SoC PMC API. This is an effort to hide
most of the internal registers used in different SAM families.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Gerson Fernando Budke e9b26b5eb6 soc: sam0: samd: Fix switching between clocks
The clock z_arm_platform_init hangs switching between clocks when using
MCUboot. This fixes the issue using the 8MHz internal clock as gclk_main
source when configuring PLL/DFLL.

Fixes: #67220

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-01-20 14:36:30 +01:00
Ryan McClelland 2ee2b6ac08 drivers: spi: dw: remove HAS_SPI_DW Kconfig
The HAS_SPI_DW Kconfig is rather unncessary. If the synopsys designware
spi is to be included. It should come from the devicetree.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Gerard Marull-Paretas 48dbcf5479 soc: riscv: remove empty soc.h files
Because they're just not needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 788fda525a soc: riscv: virt: reduce the scope of SIFIVE_SYSCON_TEST
It was used nowhere else, there's no need to expose it publicly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 874513439b soc: riscv: sifive_freedom: move PRCI base address to prci.h
Instead of soc.h. This likely needs to be DT-ized at some point.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas cce467034f soc: riscv: opentitan: reduce the scope of some definitions
Some definitions were only used in soc.c, there's no need to expose them
in a public header like soc.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 95c573f02e soc: riscv: openisa_rv32m1: add missing includes
<soc.h> is needed to pull some APIs defined in soc.h.
<fsl_device_registers.h> is needed to access EVENT0/1 addresses.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 0c5a2b1fe4 soc: riscv: microchip_miv: miv: move MIV_UART_0_LINECFG to driver
Instead of soc.h, since it's not used by anything else.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas c5699fac7f soc: riscv: ite_ec: add missing soc_common.h include
File uses some API declared in soc_common.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 3765b90c77 soc: riscv: ite_ec: it8xxx2: reduce the scope of some definitions
Do not expose them in soc.h, just move them to the module making use of
them.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 68a0f0a377 soc: riscv: andes_v5: ae350: remove redundant include
<soc.h> is not needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 13e02a00f0 soc: riscv: andes_v5: include soc_v5.h
Instead of catch-all soc.h (which was now just being a proxy for
soc_v5.h).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 7e3b3dd258 drivers: pinctrl: sifive: use DT ngpios property
Instead of hardcoded definitions from soc.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas a5ded8aa9f arch: riscv: smp: define MSIP_BASE
Instead of relying on definitions included indirectly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Tomasz Lissowski 042cb6ac4e soc: intel_adsp: enable DfTTS-based time stamping on ACE platforms
This patch enables time stamping controlled by DSP Timers / Time Stamping
logic on ACE1.5 / ACE2.0 platforms.

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2024-01-19 12:59:00 +01:00
Laurentiu Mihalcea f14c3e06f4 xtensa: nxp_adsp: common: Remove soc.c
The soc.c interrupt-related definitions are supposed to
provide support for multi-level interrupts. At the moment,
the way the functions work is they only process the LEVEL 1
interrupt from the encoded INTID and treats the provided INTID
as if it were simply a LEVEL 1 interrupt, which is wrong. Another
issue with soc.c is the fact that the definitions from it clash
with the ones provided by the IRQSTEER driver. To fix this, remove
the soc.c file altogether and change the corresponding CMakeLists.txt
to only contain the necessary statements.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-01-18 20:12:13 +01:00
Ben Wolsieffer 37352d3d29 soc: nrf53: fix building anomaly 168 workaround
With GCC 12.3 and binutils 2.40, the build fails with:

<...>/zephyr/arch/arm/core/cortex_m/cpu_idle.S: Assembler messages:
<...>/zephyr/arch/arm/core/cortex_m/cpu_idle.S:51: Error: junk at end of line, first unrecognized character is `n'
<...>/zephyr/arch/arm/core/cortex_m/cpu_idle.S:133:   Info: macro invoked from here

Because the SOC_ON_EXIT_CPU_IDLE macro puts all the statements on a
single line, there must be a semicolon after .rept

Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
2024-01-18 12:53:12 +01:00
Krzysztof Chruściński a0382bd0f3 soc: arm: nordic_nrf: Disable UART runtime configuration
Since it takes 400 bytes of code and it is rarely used disable
by default this feature.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Greter Raffael 899ee686d8 riscv: irq: Adjust initialization of mtvec in non-legacy CLIC
If CONFIG_LEGACY_CLIC is disabled, i.e. we adhere to the current CLIC
spec, the mode bits of mtvec have to be 0x3. Everything else is
reserved. Therefore if CONFIG_RISCV_VECTORED_MODE is enabled, the
current implementation is correct. If CONFIG_RISCV_VECTORED_MODE is
disabled, the mode bits have to be set, too.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-18 10:53:27 +01:00
Mykola Kvach 72758f96d1 drivers: pinctrl: pfc_rcar: add support of voltage control to pfc driver
Add support of voltage control to Renesas PFC driver. Voltage register
mappings have been added to r8a77951 and r8a77961 SoCs.

Allow 'power-source' property for 'renesas,rcar-pfc' node. This property
will be used for configuring IO voltage on appropriate pin. For now it
is possible to have only two voltages: 1.8 and 3.3.

Note: it is possible to change voltage only for SD/MMC pins on r8a77951
      and r8a77961 SoCs.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-18 10:53:17 +01:00
Dino Li b09cd03085 soc: it8xxx2: Disable EGAD pin output of external gpio control
Setting IT8XXX2_EGPIO_EEPODD bit will disable EGAD pin output driving
to avoid leakage when GPIO E1/E2 on it82002 are set to alternate
function.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-01-18 10:51:19 +01:00
Rander Wang 6a0b1da158 soc: intel_adsp: call framework callback function for restore
When exiting power gated state, call the CPU start function
passed to arch_start_cpu().

Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-01-17 11:57:20 -05:00
Markus Swarowsky 11175c3ad3 tf-m: Change NS include path for TF-M 2.0.0
The place where TF-M places its non-secure api header files has changed
Therefore changing it for for all applications that use it.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
2024-01-17 16:52:52 +01:00
Daniel DeGrasse 6d562f1750 soc: arm: nxp_imx: rt5xx: clock DMIC0
Clock DMIC0 from the audio PLL when DMIC driver class is enabled.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Co-authored-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-01-17 14:43:52 +01:00
Guennadi Liakhovetski e7217925c9 ace: use a 'switch' statement in pm_state_set()
Use 'switch' to emphasise that we're handling different values of
'state' in pm_state_set().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-17 09:55:48 +01:00
Guennadi Liakhovetski c99a604bbf ace: remove superfluous variable initialisation
'ret' in pm_state_set() is always set before it's used, no need to
initialise it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-17 09:55:48 +01:00
Anas Nashif a0ac2faf9b intel_adsp: ace: enable power domain
Enable power domain drivers for this soc series as it is now needed in
the boot process.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-16 21:12:40 -08:00
Chekhov Ma e1d495be81 driver: add new gpio driver "gpio_mcux_rgpio"
Add RGPIO gpio driver. This driver is used for i.MX93 and i.MX8ULP.
GPIO pinctrl, read/write and interrupt is supported. Runtime mmio
configuration is enabled, so no need for region definition in
mimx9/mmu_region.c

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-01-16 20:50:11 -05:00
Guennadi Liakhovetski 4204ca9bcb ace: fix DSP panic during startup
pm_device_runtime_get() must be called after pd_intel_adsp_init() is
called for each device, because the latter calls
pm_device_runtime_enable(), which sets the device runtime PM use
count to 0. The current wrong calling order causes a DSP panic
because of an unbalanced pm_device_runtime_put(). Fix this by
delaying pm_device_runtime_get() until the POST_KERNEL initialisation
step.

Fixes commit c3a6274bf5 ("intel_adsp: ace: power: Prevent HST
domain power gating")

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-16 07:31:24 -05:00
Erwan Gouriou 7a2e74604f soc: stm32: common: Define STM32_LPTIM_CLOCK from device tree inputs
Now that:
1 - LS Clocks sources values are identical accross series
2 - We're able to extract this value from device tree

define STM32_LPTIM_CLOCK choice symbol from device tree

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 10:07:02 +00:00
Greter Raffael 87916d7af3 soc: gd32vf103: Correct vector table alignment
For a CLIC the vector table has to be aligned by 512 bytes, if there are
between 65 and 128 interrupts, which is the case for the gd32vf103.

`isr_wrapper` has to be aligned to 64 bytes, s.t. the lower 6 bits of
mtvec are 0.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-16 10:00:36 +01:00
Greter Raffael 8460ed093e soc: gd32vf103: Link soc-specific before common code
For a proper initialisation,  the soc-specific `__nuclei_start` has to
be executed before the common `__start`. To ensure that `__nuclei_start`
is linked first, I added the linker section init.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-16 10:00:36 +01:00
Greter Raffael 43490289ff soc: gd32vf103: Remove redundant code from entry.S
A lot of the entry.S is again implemented in common/vector.S.
I removed everything redundant and changed the jump to the common
symbol __start at the end.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-16 10:00:36 +01:00
Guennadi Liakhovetski ca12fd13c6 xtensa: intel_adsp: fix a cache handling error
.bss and .data are uncached in Zephyr builds for intel_adsp. No need
to try to manipulate cache of objects in those sections.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-15 09:59:07 +01:00
Gerard Marull-Paretas 6876f9eea1 soc: riscv: riscv-privileged: drop soc_common.h
The header file is no longer needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas 0addc80d10 arch: riscv: define local soc_interrupt_init prototypes
Instead of relying on messy soc.h files which are included via a fragile
chain of includes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas c725c91d95 arch: riscv: define RISC_IRQ_MSOFT/MEXT
Instead of relying on spread definitions within SoC files.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas 452a2f67cd arch: riscv: use CONFIG_RISCV_MCAUSE_EXCEPTION_MASK
Instead of custom SOC_MCAUSE_EXP_MASK definition. Note that SoCs
selecting RISCV_PRIVILEGED already used such config indirectly (see
changes in soc_common.h).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas ee60977958 arch: riscv: remove SOC from RISCV_SOC_MCAUSE_EXCEPTION_MASK
Just to stay consistent with other RISC-V related settings.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas 6edb0624d8 soc: riscv: gd32vf103: simplify MCAUSE exception mask handling
The exception mask needs to cover MCAUSE bits 11:0, there's no need to
overengineer this setting using DT properties.

Ref. https://doc.nucleisys.com/nuclei_spec/isa/core_csr.html#mcause

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas a364420b30 soc: riscv: cleanup usage/definition of MCAUSE IRQ flag
The MCAUSE register has the "Interrupt" flag defined defined at XLEN-1
position (31 for 32-bit, 63 for 64-bit). This is not an SoC specific
option, and there's no need to expose it publicly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Gerard Marull-Paretas fcbfe74df1 arch: riscv: define some RISC-V exception codes
As defined in Table 3.6 of "The RISC-V Instruction Set Manual, Volume
II: Privileged Architecture". Delete all spread definitions of the same,
weirdly prefixed with "SOC".

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Lucas Tamborrino 11fc182315 soc: esp32: refactor esp32_net
SOC_ESP32_NET is now SOC_ESP32_APPCPU, following espressif's
naming convention in the same manner as ESP32S3 app cpu.

SOC_ESP32_APPCU is now a subset of SOC_SERIES_ESP32.

This commit also changes the necessary files, samples and tests
for bisect purposes.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-01-13 00:22:24 +00:00
Manuel Argüelles 6d53c2aed2 soc: arm: nxp_s32: s32k3: select CONFIG_CACHE_MANAGEMENT
Commit 447a492 switched to `sys_cache*` to enable caches at SoC init. To
preserve the old behavior of enabling caches at init, is missing to
select `CONFIG_CACHE_MANAGEMENT`.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-12 09:21:58 -06:00
Derek Snell 11d52f71e5 soc: arm: nxp: increase NUM_IRQS for RT5xx series
This enables the PVT Sensor IRQ.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-01-12 10:00:00 +01:00
Gerard Marull-Paretas f885763b50 arch: riscv: drop RISCV_HAS_CPU_IDLE
Because it was exclusively used by the "common" RISC-V privileged code
to build CPU idle routines that are now handled by arch level code.
Also, all platforms defaulted to "y", making it pointless in practice.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-12 09:58:31 +01:00
Gerard Marull-Paretas 7631e0ddfa soc: riscv: riscv-privileged: remove redundant idle implementation
Default RISC-V arch level implementation is equivalent.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-12 09:58:31 +01:00
Gerard Marull-Paretas 1dbcef9d3c soc: riscv: espressif_esp32: use arch idle
It is equivalent to the provided custom implementation.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-12 09:58:31 +01:00
Daniel DeGrasse 55fe95a5f6 soc: arm: nxp_imx: enable CONFIG_CACHE_MANAGEMENT for RT1xxx M7 cores
Since d992683db5 (soc: arm: replace redundant config option for
caches for nxp_imx), RT1xxx series will not have cache enabled at boot
unless CONFIG_CACHE_MANAGEMENT=y. Since this will improve performance,
enable CONFIG_CACHE_MANAGEMENT by default.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-11 16:17:03 +00:00
Tomasz Leman 1c0c900cbb intel_adsp: ace15: Enhance HST domain power-down sequence
This patch enhances the power-down sequence for the HOST (HST) domain
within the Intel ADSP ACE 1.5 architecture. It introduces a check to
ensure that a specific condition, represented by a magic key value, is
met before disabling the HST domain. This additional verification step
ensures that the HST domain is only powered down when it is safe to do
so, thereby maintaining the stability and reliability of the system.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-01-11 10:05:12 +01:00
Tomasz Leman c3a6274bf5 intel_adsp: ace: power: Prevent HST domain power gating
This patch introduces power management for the HOST (HST) domain within
the Intel ADSP ACE IP. It adds macros to access the node identifier and
device pointer for the HST power domain and integrates power management
calls into the system initialization and power state transition
functions.

The patch ensures that power gating of the HST domain is prevented when
the primary core of the audio DSP is active. Preventing power gating is
crucial for maintaining the functionality of the HST domain while the
primary DSP core is performing critical tasks.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-01-11 10:05:12 +01:00
Jun Lin a897b8a09c drivers: spi: npcx: add driver for the SPI peripheral
This commit adds the driver support for the NPCX SPI peripheral.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-01-11 10:04:21 +01:00
Gerard Marull-Paretas b3d8fc5e82 soc: arm: gigadevice: s/gigadevice/gd_gd32
Gigadevice was inconsistent with the convention established by other SoC
families, that is, use <vnd_prefix>_<family>. For example, ST STM32 uses
st_stm32. Note that GD32VF103, under soc/riscv, has already been
adjusted.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-10 20:59:21 -05:00
Benedikt Schmidt 10c0b86f83 soc: arm: use sys_cache* to enable caches for stm32f7 and stm32h7
Use sys_cache* functions to enable the caches for stm32f7 and
stm32h7. This ensures that CONFIG_CACHE_MANAGEMENT is
considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 8b4516226b soc: arm: use sys_cache* for enabling the caches on same70 and samv71
Use the sys_cache* functions to enable the caches on same70 and
samv71. This will ensure that CONFIG_CACHE_MANAGEMENT is
considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 1f1b430d88 soc: arm: remove redundant cache config options for kv5x
Remove the redundant cache config options for kv5x and use
the sys_cache* functions to enable the caches. This will automatically
consider CONFIG_CACHE_MANAGEMENT.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt d992683db5 soc: arm: replace redundant config option for caches for nxp_imx
Replace the redundant cache config options for the nxp_imx and
use sys_cache* functions to enable the caches. These will automatically
consider CONFIG_CACHE_MANAGEMENT.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 49d3244798 soc: arm: use sys_cache* for enabling the caches in nxp_s32
Use sys_cache* for enabling the caches in nxp_s32. This automatically
considers CONFIG_CACHE_MANAGEMENT and will activate the
cases only if this is active.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Andriy Gelman d540407fc8 drivers: mdio: Add xmc4xxx mdio drivers
Add mdio drivers for xmc4xxx SoCs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-09 10:00:47 +01:00
Gerard Marull-Paretas 14ff171411 soc: riscv: drop RISCV_PRIVILEGED_STANDALONE
This option is no longer needed, all SoCs have been moved out from
soc/riscv/riscv-privileged folder.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 724a967c1a soc: riscv: renove_virt: reorganize SoC folder
Move out from riscv-privileged, and convert to a standalone SoC.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 8729a782f9 soc: riscv: niosv: reorganize SoC folder
Move out of riscv-privileged, create new family for it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas b5fb00bdc8 soc: riscv: opentitan: reorganize SoC folder
Remove from riscv-privileged, and create a standalone SoC.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 38a44e683e soc: riscv: sifive-freedom: reorganize SoC folder
Reorganized as follows:

- Created a new SiFive Freedom family
- Created 3 new series: E300/E500/E700
- Created Socs within each series (e.g. E340)

Also moved out of riscv-privileged folder.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas b2b86556a7 soc: riscv: miv/mpfs: reorganize SoC folder
Merge both series into a new family: microchip_miv [1], moving them out
of riscv-privileged. Updated naming to stay closer to what vendor
announces on their website.

[1]: https://www.microchip.com/en-us/products/fpgas-and-plds/
     fpga-and-soc-design-tools/mi-v

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 4c4beabecc soc: riscv: efinix-sapphire: reorganize SoC folder
Move things out from riscv-privileged, and convert to single SoC.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 7da6342dff soc: riscv: virt: reorganize SoC folder
Move out of riscv-privileged, and convert to single SoC (no
family/series).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas b7b19b8b05 soc: riscv: neorv32: reorganize SoC folder
Move out of riscv-privileged and convert to a standalone SoC. Note
that the family/series structure has been dropped in favor of a single
SoC (what NEORV32 seems to be).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 7a44806a53 soc: riscv: s/litex-vexriscv/litex_vexriscv
To be consistent with other SoCs in the same folder.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 4a0d880350 soc: riscv: ite: reorganize SoC folder
Follow the vendor structure [1]:

- Family: ITE Embedded Controller SoCs
- Series: IT8XXX2
- SoCs: IT81202BX, IT81202CX, etc.

[1]: https://www.ite.com.tw/en/product/category?cid=1

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 8027689392 soc: riscv: andes_v5: reorganize SoC folder
Split out from riscv-privileged folder, and create a new family.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 87f3b07292 soc: riscv: starfive_jh71xx: reorganize SoC folder
Move it out from RISC-V privileged folder, and create a standalone
family.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 5a98d87335 soc: riscv: gd32vf103: reorganize SoC folder
Move things out from riscv-privileged, and create the new RISC-V GD32
family. New family folder follows the <vnd>_<family> naming convention.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 72e52a06aa soc: riscv: telink_b91: reorganize SoC folder
Reorganize following the hierarchy found in the vendor website [1]:

- SoC Family: Telink TLSR
- SoC series: TLSR951X
- SoC: TLSR9518

Also split out from riscv-privileged folder. Note that B91 was the name
of a starter kit [2].

[1]: http://wiki.telink-semi.cn/wiki/chip-series/TLSR951x-Series/
[2]: https://wiki.telink-semi.cn/wiki/Hardware/
     B91_Generic_Starter_Kit_Hardware_Guide/

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas d8c0cc2e35 soc: riscv: introduce temporary RISCV_PRIVILEGED_STANDALONE
So that SoCs can be ported outside of riscv-privileged folder, setting
their own family name. This will be removed once all SoCs are ported.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 0106e8d14c arch: riscv: introduce RISCV_PRIVILEGED
Introduce a new arch level Kconfig option to signal the implementation
of the RISCV Privileged ISA spec. This replaces
SOC_FAMILY_RISCV_PRIVILEGED, because this is not a SoC specific
property, nor a SoC family.

Note that the SoC family naming scheme will be fixed in upcoming
commits.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 9a35ad858c soc: riscv: gd32vf103: move nuclei CSR header
The header is common to all Nuclei based cores (not strictly related to
RISCV privileged spec). Since only GD32VF103 uses a Nuclei core, move
the file to its SoC folder.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Gerard Marull-Paretas 6443c50bd0 soc: riscv: move privileged code to common folder
Add a new riscv/common directory where to store common code between
SoCs, e.g. those implementing the privileged spec.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-09 09:40:07 +01:00
Manuel Argüelles 58f5720eb4 dts: arm: nxp: add FlexCAN support for S32K1xx
S32K1xx devices have a maximum of 3 FlexCAN peripherals. Each part may
define a different maximum number of instances and message buffers,
hence the interrupt lines are defined in the part specific dts.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-08 08:30:49 -06:00
Sylvio Alves b19c164e7b soc: espressif: add common linker tls entry
Adds common thread-local-storage.ld provided
by Zephyr. This also fixes a wrong xtensa_core entry
that should be riscv_core.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-01-08 15:09:48 +01:00
Yong Cong Sin c328a38a94 soc: riscv: add support for Renode Virt RISCV32 SoC
Add a beef-ed up version of Renode's `riscv_virt` SoC

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:10 +01:00
Bjarki Arge Andreasen 95c5f9b6f3 soc: arm: stm32f4 increase IDLE stack in case of PM
When Power Management is enabled (CONFIG_PM=y),
the CONFIG_IDLE_STACK_SIZE of 320 is not enough :
Increase its size to 512.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-08 12:34:30 +01:00
Bjarki Arge Andreasen 01e94e0766 soc: arm: stm32: Fix invalid Kconfig PM entry in defconfig file
The defconfig.series file for the stm32f4 incorrectly redefines
the PM Kconfig in order to select two dependencies, COUNTER and
COUNTER_RTC_STM32_SUBSECONDS, instead of setting a default for
them if PM is included.

This commit fixes the error described above.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-08 12:34:30 +01:00
Jakub Zymelka dfbcc8911a dts: arm: add new gpiote instances definition
Added GPIOTE0, GPIOTE1 instances for legacy devices,
GPIOTE20, GPIOTE30 for Moonlight and GPIOTE130,
GPIOTE131 instances for Haltium.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-01-08 11:19:37 +01:00
Jamie McCrae 6f226eb153 various: Remove BOOTLOADER_SRAM_SIZE overrides
Removes settings this Kconfig to 0, because the default already
is 0

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-08 10:06:24 +01:00
Tomasz Leman d7af6f3710 intel_adsp: ipc: pm action in busy state
Currently SOF has disabled CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE option and
use pm_suspend_devices() to suspend and resume IPC device during D3
power flow. The pm_suspend_devices() function skips suspending devices
that are busy. In very rare cases, the IPC device is busy during the
power state transition, which results in the device not being restored
during reboot. This happens when FW sends a message to the HOST and
waits for ACK, and the HOST simultaneously sends a SET_DX message to the
DSP. This suspend/resume logic in IPC driver does not work well when the
system enters the D3 state because it is not a suspend state, but rather
a power-off. IPC does not require suspending, only reinitialization when
exiting D3. We cannot avoid this one missing ACK and it cannot block the
DSP from turning off.

When FW receives a SET_DX message it checks whether it can enter the D3
state and then returns an error (via IPC) or calls the pm_state_force
function. Success response is sent directly from power_down assembly and
not via ipc driver. This is because after receiving the response, the
HOST will turn off the DSP.

In order for the transition to D3 to take place, only the primary core
can be active, all pipes must be stopped (and therefore all modules in
FW). The only active thread at this time is the Idle thread. Driver on
the host will not send another ipc because is still waiting for
response. FW can try to send only two notification:

- FW exception: from this place there is no return to continue the power
  transition,
- log buffer status: skipped, they remain in the queue without being
  sent.

I'm moving pm_device_busy_clear(dev) from IRQ handler to
intel_adsp_ipc_send_message function so the pending ACK does not block
power transition.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-01-06 14:17:15 +01:00
Manuel Argüelles aeebe484f2 soc: arm: nxp_s32: s32k1: add FlexTimer support
Add support for FlexTimer (FTM) module on S32K1xx devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-05 09:03:00 +01:00
Derek Snell 44885cbca5 boards: mimxrt595: add CONFIG_MIPI_DPHY_CLK_SRC
Give option in soc.c to initialize the MIPI DPHY clock from the default
AUX1_PLL, or from the FRO using CONFIG_MIPI_DPHY_CLK_SRC_FRO.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-01-05 09:02:25 +01:00
Derek Snell 3f2ded3455 soc: arm: nxp_imx: r5xx: add Kconfig to clock FC0 from FRO
Flexcomm0 has option to clock from FRO.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-01-05 09:02:25 +01:00
Aaron Ye c3e8b731ef soc: arm: ambiq: Remove the redundant configurations.
These non-cached SRAM size and base address configurations
are not needed now.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-01-04 11:06:37 +00:00
Tomasz Lissowski 61cb7d4358 adsp: hda: accept 16 byte alignment for HDA buffer size
HDA DMA driver uses an excessive value of 128 bytes as required alignment
for DMA buffer size. This may result in the correct buffer size (e.g.
32-byte aligned, which is DT-compliant) being silently truncated before
writing it into DGBS register. This patch changes the requirement to the
value implied by DGBS register format (effectively reduces to 16 bytes).

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2024-01-03 18:59:55 +00:00
Jaro Van Landschoot be6cf5c268 soc: arm: atmel_sam: Sys_arch_reboot using RSTC
The previous implementation of the sys_arch_reboot function
for the Atmel SAM series was using NVIC_SystemReset.
This caused a reboot time of around 20 seconds on a SAM4SA16CA,
which is now reduced by directly writing to the
reset controller control register (RSTC_CR).

Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-28 12:05:53 +00:00
Chekhov Ma d1c6bb5cb4 imx8m: auto generate mmu_regions array from dt compatiable
Adopt the "MMU_REGION_DT_FLAT_ENTRY" macro to automatically generate
elements in "mmu_regions" according to devicetree "compatible" and
"status".

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2023-12-27 16:09:42 +00:00
Chekhov Ma 81c5a093f3 imx93: auto generate mmu_regions array from dt compatiable
Adopt the "MMU_REGION_DT_FLAT_ENTRY" macro to automatically generate
elements in "mmu_regions" according to devicetree "compatible" and
"status".

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2023-12-27 16:09:42 +00:00
Anisetti Avinash Krishna b7609ff5a8 soc: x86: raptor_lake: soc_gpio : Modified to support RPL-P
Added Modifications to support RPL-P platform.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-27 16:06:19 +00:00
Daniel Leung debb9f6352 xtensa: dc233c: force invalidating TLBs during page table swap
QEMU MMU tracing showed that there might be something wrong with
its Xtensa MMU implementation, which result in access violation
when running samples/userspace/hello_world_user.

Here is the MMU trace from QEMU from failed runs:

  get_pte: autorefill(00109020): PTE va = 20000424, pa = 0010c424
  get_physical_addr_mmu: autorefill(00109020): 00109000 -> 00109006
  xtensa_cpu_tlb_fill(00109020, 1, 0) -> 00109020, ret = 0
  xtensa_cpu_tlb_fill(00109028, 1, 0) -> 00109028, ret = 0
  xtensa_cpu_tlb_fill(00109014, 0, 2) -> 00103050, ret = 26

The place where it fails is during reading from 0x109014.
From the trace above, the auto-refill maps 0x109000 correctly
with ring 0 and RW access with WB cache (which should be correct
the first time under kernel mode). The page 0x109000 is the libc
partition which needs to be accessible from user thread.
However, when accessing that page, the returned physical address
became 0x103050 (and resulting in load/store access violation).
We always identity map memory pages so it should never return
a different physical address.

After forcing TLB invalidation during page table swaps, the MMU
trace is:

  get_pte: autorefill(00109020): PTE va = 20000424, pa = 0010c424
  get_physical_addr_mmu: autorefill(00109020): 00109000 -> 00109006
  xtensa_cpu_tlb_fill(00109020, 1, 0) -> 00109020, ret = 0
  get_pte: autorefill(00109028): PTE va = 21000424, pa = 0010e424
  get_physical_addr_mmu: autorefill(00109028): 00109000 -> 00109022
  xtensa_cpu_tlb_fill(00109028, 1, 0) -> 00109028, ret = 0
  get_pte: autorefill(00109014): PTE va = 21000424, pa = 0010e424
  get_physical_addr_mmu: autorefill(00109014): 00109000 -> 00109022
  xtensa_cpu_tlb_fill(00109014, 0, 2) -> 00109014, ret = 0
  xtensa_cpu_tlb_fill(00109020, 0, 0) -> 00109020, ret = 0

Here, when the same page is accessed, it got the correct PTE
entry, which is ring 2 with RW access mode (but no cache).
Actually accessing the variable via virtual address returns
the correct physical address: 0x109014.

So workaround that by forcing TLB invalidation during page swap.

Fixes #66029

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-27 15:59:05 +00:00
Lucas Tamborrino ff62faac07 soc: xtensa: esp32s2/s3: remove HEAP_MEM_POOL_ADD_SIZE_SOC
There is no need for this config here and it is messing
with total sys heap calculation.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-12-27 10:08:47 +02:00
Daniel DeGrasse beb43bdf20 soc: arm: nxp: add MK22F12 definition
Add SOC definition for MK22F12 series, larger LQFP-144 K22 series
parts that feature additional peripheral instances.

Additionally, these parts differ from the standard MK22 in the following
ways:
- SYSMPU peripheral is present, so an MPU definition is required
- No external oscillator divider is present

This commit also updates the NXP HAL to include pin control files for
these SOCs.

Signed-off-by: Daniel DeGrasse <daniel@degrasse.com>
2023-12-23 10:00:36 +00:00
Erwan Gouriou 79599a15d4 soc: stm32: stmw32wba: Get stop mode compatible with BLE
Supporting Stop1 mode while BLE RF is enabled requires some specific
adaptation and usage of STM32WBA Cube BLE controller scm API.

scm (Secure clock manager) is in charge of switching clock depending
on RF status and should be informed of PM stop modes scheduling.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-22 09:53:33 +01:00
Erwan Gouriou 2908458554 soc: stm32wba: hci_if: Implement HW_RNG_EnableClock API
STM32WBA controller uses a PKA driver to perform cyphering operations
on keys. Since PKA hardware block requires RNG clock to be enabled, a
synchronization with zephyr RNG driver is needed.

Use RNG enable status to check if RNG could be switched off or needs to
be switched on.
Similarly in entropy driver, don't cut RNG clock if PKA is enabled.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-21 09:18:53 +01:00
Ren Chen 5762d022dc drivers: usb: usb_dc_it82xx2: optimize the basic/extend endpoints control
This commit refactors the basic and extended endpoint control functions to
enhance readability.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen e23ae3b678 drivers: usb: usb_dc_it82xx2: refactor usb driver with macros
Refactor the code using macros to enhance readability.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Andrei-Edward Popa ea1cafbee7 drivers: clock_control: Added clock driver for Raspberry Pi Pico
Added clock driver for Raspberry Pi Pico platform

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Johan Hedberg ec23622b07 soc: xtensa: Use HEAP_MEM_POOL_ADD_SIZE KConfig options
Kconfig options with a HEAP_MEM_POOL_ADD_SIZE_ prefix should be used to
set the minimum required system heap size. This helps prevent
applications from creating a non-working image by trying to set a too
small value.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-12-20 11:01:42 +01:00
Johan Hedberg 95b1d586b9 soc: arm: Use HEAP_MEM_POOL_ADD_SIZE KConfig options
Kconfig options with a HEAP_MEM_POOL_ADD_SIZE_ prefix should be used to
set the minimum required system heap size. This helps prevent
applications from creating a non-working image by trying to set a too
small value.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-12-20 11:01:42 +01:00
Andrej Butok abcfd0cbd8 soc: lpc55xxx: Fix TFM
TFM is using flash, so sys. clock must be decreased.
Fixes #65957

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-12-19 08:51:45 +01:00
Erwan Gouriou 6f6410061d soc: stm32wba: Implement BLE controller lib APIs over Zephyr
In order to enable BLE support on STM32WBA, following APIs are implemented:
- HostStack_: BLE Controller scheduling
- ll_sys_: Link layer API required for scheduling
- UTIL_TIMER_: BLE Controller timer utility
- LINKLAYER_PLAT_: BLE controller utilities

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-18 17:31:08 +00:00
Daniel Leung d59e7be1ec soc: xtensa/dc233c: turn on i-cache and d-cache
The DC233C core has support for both i-cache and d-cache.
So mark it as such so we can test caching of Xtensa in QEMU.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-18 12:25:04 +01:00
Daniel Mangum 987eb10faf soc: posix: fix kconfig description
Fixes a small typo in kconfig description for the posix port.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-12-18 10:11:18 +01:00
Tom Chang 4dc7c89f40 drivers: espi: npcx: introduce espi taf driver
This CL implements espi taf read/write/erase function for NPCX.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2023-12-18 09:30:01 +01:00
Fabiola Kwasowiec 28d5d23a23 intel_adsp: lnl: add missing definition for lnl
Definition of ADSP_FORCE_DECOUPLED_HDMA_L1_EXIT_BIT,
which is used in the intel_adsp_force_dmi_l0_state function,
is missing.

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2023-12-14 22:22:22 +09:00
Zoltan Havas e7039bc37f zephyr: Kconfig: SOC_GECKO_CUSTOM_RADIO_PHY option for RAIL for proprietary
Currently on zephyr, RAIL library is used only by Bluetooth applications,
with this update, it will be able to be used for sample applications
for custom radio phys.
All files were copied from Silicon Labs GSDK v4.2.4.

Signed-off-by: Zoltan Havas <zoltan.havas@silabs.com>
2023-12-14 14:21:21 +01:00
Marc Desvaux 4dc0bd1800 drivers: ethernet: remove sections.ld for SOC_SERIES_STM32H5X
remove section(".eth_stm32_desc") and
section(".eth_stm32_desc") for SOC_SERIES_STM32H5X


Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-12-14 09:32:35 +01:00
Anas Nashif 28445d62c6 soc: intel_adsp: share adsp_imr_layout.h across SoC generations
This header is shared across all ace intel_adsp platforms, so move it to
a common place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-14 09:30:13 +01:00
Evan Perry Grove a54a52b085 dts: arm: Add support for STM32F722 SoC
The STM32F722 is similar to the STM32F723, but lacks the latter's
more advanced USB PHY. Otherwise, they are virtually identical.

Signed-off-by: Evan Perry Grove <evan@4grove.com>
2023-12-13 13:57:55 +01:00
Fabiola Kwasowiec 431da79dfa hda: separation of l1 settings to new function
Separating two new functions force and allow l1
to have the current state with separated functions
in the ipc file so that SOF can call these
functions via IPC DMI_FORCE_L1_EXIT. Change related
to the addition of a new parameter to force
DMI L1 exit on IPC request.

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2023-12-13 10:39:17 +01:00
Daniel Leung a819bfb2d5 xtensa: rename z_xtensa to simply xtensa
Rename the remaining z_xtensa stuff as these are (mostly)
under arch/xtensa.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 6d5e0c25a6 xtensa: rename z_xtensa_irq to simple xtensa_irq
This gets rid of the z_ prefix.

Note that z_xt_*() are being used by the HAL so they cannot be
renamed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 8bf20ee975 xtensa: mmu: rename prefix z_xtensa to xtensa_mmu
This follows the idea to remove any z_ prefix. Since MMU has
a large number of these, separate out these changes into one
commit to ease review effort.

Since these are no longer have z_, these need proper doxygen
doc. So add them too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 86b7210dc7 soc: xtensa: dc233c: no need to include xtensa_mmu_priv.h
It does not use anything inside xtensa_mmu_priv.h so remove
the include.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 43b0b48de7 xtensa: move files under core/include/ into include/
Header files under arch/xtensa/include are considered internal
to architecture. There is really no need for two places to
house architecture internal header files.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 106061b307 xtensa: rename files with hyphens to underscores
Simply to provide some consistencies on file naming under
arch/xtensa.

These are all internally used files and are not public.
So there is no need to provide a deprecation path for
them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Sebastian Schlupp 0462cc060d soc: same51 and same54: added DFLL48 frequency information
Specified the value 48000000 for the DFLL48 clock source

Signed-off-by: Sebastian Schlupp <sebastian.schlupp@gmail.com>
2023-12-12 16:25:46 +01:00
Flavio Ceolin ebf50eee42 soc: stm32f4: Fix PM dependency
COUNTER_RTC_STM32_SUBSECONDS depends on DT_HAS_ST_STM32_RTC_ENABLED.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-12 10:57:34 +01:00
Tomasz Leman 3732aae0e0 intel_adsp: power: clock gating in idle
This patch enables DSP clock gating for ACE platforms. By default, clock
gating is blocked by the firmware in the hardware configuration. If
CONFIG_ADSP_IDLE_CLOCK_GATING is enabled, this prevent is not active and
clock can be gated when core is in idle state. WIth this option disabled
clock gating will only be enabled in hardware during power gating.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-12-12 10:57:07 +01:00
Andreas Sandberg 5767c8d78c dts: stm32g4: Add ITM support
The STM32 G4 series has a built-in Arm Instrumentation Trace
Macrocell. Set CONFIG_HAS_SWO to enable this.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2023-12-12 10:56:44 +01:00
Francois Ramu 5bacc2eaac soc: arm: stm32 SYS_CLOCK_TICKS_PER_SEC config with STM32_LPTIM_TIMER
Configure the SYS_CLOCK_TICKS_PER_SEC directly from the
DTS st-prescaler property of the lptim node
aka stm32_lp_tick_source

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-12-12 09:52:30 +00:00
Luca Burelli 11d4f8e5e5 soc: stm32: unify cache conditionals for F7 and H7 targets
The instruction cache in the STM32F7 and H7 was enabled regardless
of the value assigned via Kconfig to the CONFIG_ICACHE parameter.
This commit adds the missing conditional checks; note that this does
not affect the compiled behavior unless CONFIG_ICACHE is explicitly
disabled by the user.

Remove a redundant low-level check on DCache being already enabled,
since it is also performed inside the SCB_EnableDCache function.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-12-12 09:51:11 +00:00
Anas Nashif 699880a430 arch: arm: cortex_m: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Andrzej Głąbek 23e15c480a soc: nrf53: Add implementation of workaround for anomaly 168
Use the already available in the tree mechanism of adding assembly
instructions right after WFI/WFE to implement the workaround for
nRF5340 anomaly 168 (replace the 4 NOP solution used on the network
core as it turned out to be insufficient) and provide two related
Kconfig options so that users are able to adjust the workaround to
their actual needs (disable it entirely or use it in the extended
version).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-12-11 14:31:41 +01:00
Maximilian Deubel 84f4ffce7c soc: arm: nordic_nrf: nrf91: add nRF9151 LACA
This patch adds definitions for the nRF9151,
which is software-compatible with nRF9161.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2023-12-11 10:24:50 +01:00
Anas Nashif 0ebeca2eb7 intel_adsp: ace: add firmware loading tool
Add python script for loading intel_adsp ACE FW into hardware.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 09:58:18 +01:00
Joakim Andersson 08413e1fb8 soc: nordic_nrf: Enable the TF-M NS storage partition for nordic boards
Enable the TF-M NS storage partition for nordic boards.
This partition is otherwise not used, and configured as secure.

Fixes: #59376

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-12-11 09:56:55 +01:00
Declan Snyder 17a99367d2 soc: rt11xx: support nxp_enet in soc
Support NXP ENET on RT11xx soc

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-11 09:50:58 +01:00
Declan Snyder e66876126e soc: k6x: Support NXP ENET Driver
NXP ENET driver support from soc.c for k6x series

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-11 09:50:58 +01:00
Manuel Argüelles 0ee6632967 soc: arm: nxp_s32: s32k1: use HAL to init code cache
Use the HAL cache driver to initialize the Code Cache.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-08 10:22:12 +00:00
Manuel Argüelles 6aa242cdfb soc: arm: nxp_s32: s32k1: fix code cache init
Currently Code Cache cannot be enabled because its initialization is
guarded by Kconfig options which depend on CPU core cache support,
but S32K14x devices has a SoC specific L1 cache controller. Hence,
introduce a SoC-specific symbol to enable Code Cache.

Note that the cache controller is not available for S32K11x devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-08 10:22:12 +00:00
Alberto Escolar Piedras 8add7cb62f soc/posix posix_native_task: Replace native_posix in description
Replace native_posix in the NATIVE_TASK description.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-07 10:39:31 +00:00
Manuel Argüelles 18202d0db3 soc: nxp: s32k146: add LPSPI support
Add LPSPI nodes to S32K1xx devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-06 20:57:42 -06:00
Manuel Argüelles 3b354bfc57 soc: nxp: s32k146: add LPI2C support
Add LPI2C nodes to S32K1xx devices. S32K146 has a single
LPI2C instance.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-06 20:57:42 -06:00
Keith Short 8fb92ba9cd espi: npcx: Fix driver Kconfig
Update the Kconfig for the npcx eSPI driver so it's automatically
enabled if the devicetree node is enabled.

Signed-off-by: Keith Short <keithshort@google.com>
2023-12-06 21:35:29 -05:00
Conor Paxton dc5cf9cb1c soc: mpfs: describe the correct amount of irqs available.
Microchip's PolarFire SoC (MPFS) has 186 available interrupts.
Fix the Kconfig symbols.

While we're at at: remove commented out code

Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2023-12-06 17:54:29 +00:00
Attie Grande 9f76adbfa8 soc: atmel_sam0: Setup clocks for USB on SAML21 parts
GCLK Gen 2 was dedicated to USB, but never setup... this patch
configures it for 48 MHz, derrived from DFLL.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2023-12-05 16:27:00 -06:00
Erwan Gouriou 7c96ebc2a8 soc: stm32: Make POWER_SUPPLY_CHOICE available for SOC_STM32WBA55XX
POWER_SUPPLY_CHOICE is available for SOC_STM32WBA55XX, with two
possible options: LDO or SMPS.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-05 14:53:39 +00:00
Erwan Gouriou 31b493128f soc: stm32wba: Introduce STM32WBA55 SoC variant
STM32WBA55 is a new STM32WBA SoC variant featuring SMPS.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-05 14:53:39 +00:00
Manuel Argüelles 673f38f3d1 soc: arm: nxp_s32: s32k1: unselect CPU_HAS_xCACHE
Following changes in #64978, align CPU_HAS_xCACHE symbols with
the CMSIS feature definitions in the device headers so that
both have the same value.

Fixes #66147

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-05 13:18:23 +01:00
Wilfried Chauveau af3a19106a soc: arm: fix missing configs & defines
Some SoC have missing feature selections in their Kconfig.
Some others are missing includes of CMSIS-Core headers.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-12-05 10:19:15 +00:00
Wilfried Chauveau 29ffaaa0b6 arch: arm: cortex_m: Remove CPU_HAS_*CACHE from CPU_CORTEX_M7
Caches are optional on cortex-m7, having CPU_HAS_*CACHE in CPU_CORTEX_M7
definition renders them mandatory.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-12-05 10:19:15 +00:00
Wilfried Chauveau 7226f985fc soc: arm: nxp_kinetis: remove unecessary includes
This changes remove extraneous includes causing issues with cycles in
includes subsequently having code requiring definitions from CMSIS
while it’s configuration hasn’t completed yet.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-12-05 10:19:15 +00:00
Wilfried Chauveau 8d91ba200f modules: cmsis: Move cortex_m default configuration to its own file
Kconfig parameters, header’s default & silicon vendor’s SDK configuration
for CMSIS Core, must be consistent. Depending on the inclusion order of
the headers, this is currently not always the case.

This change introduces consistency checks & enusers defaults match their
Kconfig settings.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-12-05 10:19:15 +00:00
Wilfried Chauveau a00aa3bcfa arch: arm: cortex_m: add config for PMU
This adds kconfig entries for Performance Monitoring Unit (PMU).

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-12-05 10:19:15 +00:00
Zhang Peng 9dd10c2f3c soc: xtensa: adsp: add support for NXP ADSP for i.MX8ULP
Add support for i.MX8ULP target.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2023-12-04 16:41:00 +00:00
Manuel Argüelles 91293187d8 soc: nxp_s32: introduce support for S32K1 devices
Introduce support for NXP S32K1 family of 32-bit MCUs, and
particularly for S32K146 devices. S32K1 share a fair amount of
similarities with Kinetis family, so most of the peripheral drivers
can be reused.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-30 11:21:59 -05:00
Jamie McCrae 93f537552d soc: arm: nordic_nrf: Remove deprecated GPREGRET Kconfig option
Removes the Kconfig NRF_STORE_REBOOT_TYPE_GPREGRET which was
deprecated in zephyr 3.4

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-29 13:38:29 +01:00
Adam Wojasinski 38739368dd modules: hal_nordic: watchdog: Add Kconfig symbols for new WDT instances
This commit is a part of introduction of new WTD instances.
It adds new Kconfig symbols that can be used in WDT shim and
nrfx driver.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-29 13:12:42 +01:00
Declan Snyder c8375659fb soc: nxp: rt10xx: Increase workqueue size for enet
Increase the size of the system workqueue stack if using
nxp ethernet driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-28 14:34:02 -06:00
Declan Snyder 0e935ea180 soc: rt10xx: enable phy clock with new driver
when using either old or new driver for nxp enet,
enable the phy clock

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-28 14:34:02 -06:00
Chen Xingyu 3f7e73416d soc: riscv: privileged: efinix-sapphire: Enable CONFIG_RISCV_HAS_CPU_IDLE
In an earlier commit, the riscv-privileged level implementation of
`arch_cpu_idle()` is not included unless `CONFIG_RISCV_HAS_CPU_IDLE` is
enabled.

This commit ensures the option is enabled on all the existing CPUs, thereby
maintaining the existing behavior.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2023-11-28 15:34:06 +01:00
Chen Xingyu 34d2c4d6b2 soc: riscv: privileged: Conditionally override arch_cpu_idle()
The current configuration comes with a common implementation of
`arch_cpu_idle()` for the whole riscv-privileged family, utilizing the
`WFI` instruction to place the CPU into a light sleep state, with the
assumption that it will be awakened later by interrupts such as SYSTICK.
However, this approach is not always effective, particularly in scenarios
where the SYSTICK is not a valid wake source.

This commit uses `CONFIG_RISCV_HAS_CPU_IDLE` as the build condition of the
family-level `idle.c`, allowing CPUs that do not enable this option to
fallback to a generic arch-level implementation in
`arch/riscv/core/cpu_idle.c`.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2023-11-28 15:34:06 +01:00
Marek Pieta 00d8263a93 soc: arm: nrf52: Configurable EGU instance for anomaly 109 workaround
Change makes EGU instance used for anomaly 109 workaround configurable.
The default EGU instance (5) may be used for other purpose.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2023-11-28 14:23:49 +00:00
Jun Lin 91fdef0783 soc: npcx: add support for npcx9mfp
Add new SoC npcx9mfp support for npcx9 series.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-28 09:13:23 +00:00
Sylvio Alves ca346ba216 soc: esp32: call reset cause reason init
Reset cause reason was not initalized properly, making
hwinfo feature not to work as expected.

Fixes #65634

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-11-27 19:59:45 +01:00
Dat Nguyen Duy 513ba04168 soc: nxp_s32: cmsis rtos v2 adaptation
There are symbols are both defined by the NXP S32 HAL and
the CMSIS RTOS V2 wrapper, to avoid interference between
them, redefine the symbols under an enum.

Also this is may a common issue for all NXP S32 platforms,
move to common place to be reused

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-11-27 19:58:57 +01:00
Anas Nashif aed0c451f8 arch: introduce DSP_SHARING and CPU_HAS_DSP configs
introduce global DSP_SHARING and CPU_HAS_DSP to be used by all
architectures and change existing usage in ARC to use those global
configs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-27 09:05:54 +00:00
Aymeric Aillet f2061a073a soc: arm: reneas: Add r8a779f0 support
r8a779f0 SoC is part of the Renesas R-Car Gen4 SoC series.

This SoC has a dual core lockstep Cortex-R52 CPU.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2023-11-25 08:50:47 -05:00
Aymeric Aillet 6033db5360 drivers: pinctrl: rcar: Add r8a779f0 support
Enable PFC controller for r8a779f0 SoC.
Declare pin list for r8a779f0 SoC.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2023-11-25 08:50:47 -05:00
Aymeric Aillet 1738543c5d drivers: pinctrl: Add R-Car Gen4 support
Renesas R-Car Gen4 is different from Gen3 regarding pinmux.

While Gen3 had only one base address to manage all pins,
Gen4 has one set of pinmux registers per GPIO banks.

We could expose one pinmux register per GPIO controllers,
but that would break potential compatibility with Linux
Device tree.

Instead create a reg_base array to parse all reg base from
device tree and identify proper base address based on the pin
definition.

This imply to add a pfc_base parameter to most of the pfc_rcar
function.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2023-11-25 08:50:47 -05:00
Jun Lin 3f9d24e4c0 mgmt: ec_host_cmd: shi_npcx: support the enhanced mode
The original SHI module only has one output FIFO buffer. It costs a lot
when the driver has to send/change the protocol control code because it
must fill out all 128 bytes of output FIFO. In npcx4, we introduce
another output buffer in 1-byte depth. These two buffers can switch back
and forth during the transaction. We can use the single-byte buffer
to send the control code and the 128-byte FIFO to send the data payload.
It helps improve the SHI driver's efficiency.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-24 11:45:13 +01:00
Jun Lin 74f07b04ff soc: npcx: shi: add new registers for npcx4
Add the SHI enhanced buffer mode register definition for npcx4.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-24 11:45:13 +01:00
Martin Gritzan 86cf5829a4 dts: arm: stm32: add stm32f303xb bindings
The STM32F303xB is very similar to the xC, the only difference being the
RAM and flash sizes.

Signed-off-by: Martin Gritzan <martin.gritzan@gmail.com>
2023-11-24 09:24:14 +01:00
Marek Matej d34f725df8 soc: xtensa: esp32s3: Update SOC variant list
Add missing combinations of the ESP32-S3 Wroom module.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-11-22 21:56:39 +01:00
Rander Wang efc3208189 soc: intel_adsp: cavs: mask idc interrupt before halting cpu
Secondary dsp is idle and waiting for interrupt before it is totally
halted. The other active cores can trigger idc interrupt to this core,
this can wake it up and result to fw panic. Mask idc interrupt as timer
interrupt to prevent this case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-22 14:57:07 +00:00
Peter van der Perk 5edb7cbe41 soc: arm: nxp_imx: rt11xx: add support for CONFIG_ETH_MCUX_RMII_EXT_CLK
ENET_REF_CLK as an input during rt11xx clock initialization.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2023-11-22 14:56:38 +00:00
Alberto Escolar Piedras ab896ad6ef arch posix: annotate posix_exit and nsi_exit as noreturn
Annotate posix_exit() and nsi_exit() as noreturn
mainly to ease the life of static analysis tools.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:52:52 +01:00
Flavio Ceolin c47880af0d arch/xtensa: Add new MMU layer
Andy Ross re-implementation of MMU layer with some subtle changes,
like re-using existent macros, fix page table cache property when
direct mapping it in TLB.

From Andy's original commit message:

This is a reworked MMU layer, sitting cleanly below the page table
handling in the OS.  Notable differences from the original work:

+ Significantly smaller code and simpler API (just three functions to
  be called from the OS/userspace/ptable layer).

+ Big README-MMU document containing my learnings over the process, so
  hopefully fewer people need to go through this in the future.

+ No TLB flushing needed.  Clean separation of ASIDs, just requires
  that the upper levels match the ASID to the L1 page table page
  consistently.

+ Vector mapping is done with a 4k page and not a 4M page, leading to
  much more flexibility with hardware memory layout.  The original
  scheme required that the 4M region containing vecbase be mapped
  virtually to a location other than the hardware address, which makes
  confusing linkage with call0 and difficult initialization
  constraints where the exception vectors run at different addresses
  before and after MMU setup (effectively forcing them to be PIC
  code).

+ More provably correct initialization, all MMU changes happen in a
  single asm block with no memory accesses which would generate a
  refill.

Signed-off-by: Andy Ross <andyross@google.com>
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-11-21 15:49:48 +01:00
Flavio Ceolin 8dd84bc181 arch: xtensa: Rename xtensa_mmu.c to ptables.c
Initial work to split page table manipulation from
mmu hardware interaction.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-11-21 15:49:48 +01:00
Daniel Leung a36e39c2a6 xtensa: dc233c: enable userspace support
This massages kconfig and linker script to enable userspace
support on dc233c core.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-21 15:49:48 +01:00
Dawid Niedzwiecki 43ef398614 pm: add power management for stm32f4x
Add soc power management for the STM32F4x chips.

One low power state is added supported by all chips from the family -
the Stop mode with voltage regulator in low-power mode.

The Stop mode for STM32F chips has to work with the IDLE timer -
CORTEX_M_SYSTICK_IDLE_TIMER, because PLL and HSI are disabled in the
Stop mode (Systick is not clocked). The only possible wakeup source is
RTC, which works as a IDLE timer for the Systick.

The exit latency may need to be adjusted per system, depending on the
system tick frequency and other variables.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-21 08:46:17 +00:00
Abderrahmane Jarmouni f8a9d95549 soc: arm: st_stm32: stm32u5: Add STM32U5A9 support
Add support for STM32U5A9XX SoC series

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2023-11-21 08:44:34 +00:00
Franciszek Zdobylak 6f91fd858c dts: arm: silabs: Configure hfxo in dtsi
This commit moves configuration of hfxo from headers defined on board level
to device trees of SoCs.

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-11-20 13:01:39 +01:00
Rander Wang 954901296c arch/xtensa: clean up arch_cpu_idle function
Some workarounds were introduced for intel cavs2.5 platform bring up.
It is not general so move them to platform code.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-20 11:14:41 +01:00
Rander Wang 0c27d772f6 soc: intel_adsp/cavs: add arch_cpu_idle support
Cavs platforms starts from Apllolake to Raptorlake. Some of them need some
workaround for arch_cpu_idle so create a bespoken one. Each workaround is
configured by kconfig setting.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-20 11:14:41 +01:00
Iuliana Prodan 9af6825874 nxp_adsp: linker: Add snippets to linker script
The xtensa/nxp_adsp_imx8m linker script is missing
the necessary include statements for linker snippets.
So we need to add them.

This fixes compile warnings like: orphan section `.unstable_id'
from `modules/chre/lib..__modules__lib__chre__platform__zephyr.a
(version.cc.obj)' being placed in section `.unstable_id'.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Iuliana Prodan 9cac089f8c nxp_adsp: linker: Fix _heap_sentry reference
Add _heap_sentry value to fix build errors for
newlib, like: "undefined reference to `_heap_sentry'"

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Iuliana Prodan 23c49e554a nxp_adsp: linker: Update linker scripts for C++ build
When linking, in crtbegin.o for C++ exception support, we pull in
the .tm_clone_table section.
Update the linker scripts to handle this, otherwise we get a
"warning: orphan section `.tm_clone_table'".

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Iuliana Prodan 24f2d2e136 nxp_adsp: linker: Rename text area variables
Use Zephyr's convention for text region start and end.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Iuliana Prodan edc0b7f352 board: xtensa: imx8m: Remove unnecessary configs
Remove unnecessary configs.
Some were moved to Kconfig.series from soc/.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Iuliana Prodan afc3606116 soc: xtensa: imx8m: Remove unused definitions
Remove unused macro definitions.

While here, use Zephyr's convention for
include guard.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Iuliana Prodan 85a1124d5d soc: xtensa: imx8m: Remove unused file
Remove platform.h since is no longer used for SOF.
Move memory.h to include folder and modify the linker
to reflect this.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-11-20 11:13:44 +01:00
Adam Wojasinski 4f1823c616 soc: arm: nordic_nrf: Add Kconfig symbol for new I2S instance
Add I2S 20 instance

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-20 09:24:05 +01:00
Natalia Pluta d7d11ef09f soc: arm: nordic_nrf: Add Kconfig symbols for QDEC instances
Add QDEC instances 20, 21, 130, 131

Signed-off-by: Natalia Pluta <natalia.pluta@nordicsemi.no>
2023-11-20 09:19:45 +01:00
Manuel Argüelles 2c9255fbba soc: nxp_s32: include soc.h instead of individual headers
The SoC header already includes the necessary device headers for
all SoC variants supported.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-16 17:53:43 +01:00
Manuel Argüelles 927445325c soc: nxp_s32: s32ze: include device headers in soc.h
To simplify the inclusion of device headers in common code for
NXP S32 devices, make sure all SoCs are including their respective
device headers. This PR adds the missing headers for S32Z/E.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-16 17:53:43 +01:00
Cong Nguyen Huu 8dcd61e36e soc: nxp_s32: pinctrl: update to RTD 1.0.0
Add alias "FEATURE_SIUL2_MAX_NUMBER_OF_INPUT"
for compatibility with with previous RTD versions.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-16 09:28:16 +01:00
Mulin Chao 76b0aab6cc soc: arm: npcx: fix clock reference of APB4/FIU1 buses
This CL fixes the clock reference of APB4/FIU1 buses by introducing new
Kconfig options.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-11-16 06:50:57 +00:00
Manuel Argüelles 1a05cfc03a soc: nxp_s32: consolidate part number options
Currently, the NXP S32 SoCs have three redundant Kconfig hidden
options to define the part number. To streamline this, we will
retain `CONFIG_SOC_PART_NUMBER` to store the part number as a
string and `CONFIG_SOC_PART_NUMBER_<part>` that can be selected
by the boards.

Furthermore, for drivers requiring conditional code compilation
based on the target SoC, they should utilize the series or SoC
config option as applicable, instead of the part number config.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-15 10:25:43 -06:00
Manuel Argüelles 8ca4f5b4a1 soc: nxp_s32: s32k3: drop M7 suffix from options
The existing S32K3 Kconfig options employ the `M7` suffix, which is
redundant given that all cores in this series utilize an Arm Cortex-M7
core. Therefore, we should remove it.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-15 10:25:43 -06:00
Manuel Argüelles 589f3f435b soc: nxp_s32: rename s32k to s32k3 for series alignment
To accommodate support for S32K1 devices, it is necessary to rename
the existing `s32k` directory, which currently houses support for
the S32K3 series, to align with the respective series names. This
adjustment is necessary given the distinct differences in core
architecture, MPU, peripherals, and other key aspects between
the two series.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-15 10:25:43 -06:00
Sebastian Bøe 6348a973c3 soc: arm: Remove CPU_HAS_NRF_IDAU's dependencies
CPU_HAS_NRF_IDAU is depending on SOC_SERIES_NRF91X and
SOC_NRF5340_CPUAPP.

This makes it more difficult to have an out-of-tree nrf SOC.

It is also an unnecessary dependency. There is no prompt for
CPU_HAS_NRF_IDAU, so it will not show up in menuconfig and it won't be
possible to enable it from a users Kconfig fragment.

The only way to enable it is to select it, and those that select this
option can themselves make sure that they only do so when appropriate.

Also, move NRF_SPU options out to SOC Kconfig files to also make
out-of-tree SoCs possible. With the added benefit of not polluting the
common soc/arm/Kconfig.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2023-11-15 12:15:49 +01:00
Jiafei Pan 8fe2c95807 soc: arm64: mimx8m & 9: define SOC name followed by Core name
In hal driver, MCUX_DEVICE is defined from CONFIG_SOC, so unify
MCUX_DEVICE definition with mcux-sdk.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-11-15 11:42:06 +01:00
Wojciech Sipak 9e44f59e9a drivers: pinctrl: add RZT2M driver
This adds a new driver for Renesas RZ/T2M.
The driver allows configuration of pin direction,
pull up/down resistors, drive strength and slew rate,
and selection of function for a pin.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-11-15 11:41:35 +01:00
Wojciech Sipak b1c83c0335 soc: Add support for RZ/T2M
This adds a new SoC: SOC_RENESAS_RZT2M
and a new board: rzt2m_startek_kit

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
Co-authored-by: Roman Dobrodii <rdobrodii@antmicro.com>
2023-11-15 11:41:35 +01:00
Jamie McCrae b4ce96d161 soc: arm: nordic_nrf: Imply XIP instead of select
This allows XIP to be disabled for applications that execute in
RAM, which do not need XIP support from flash

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-15 10:03:24 +01:00
Charles Dias 63ceeb3bba soc: arm: st_stm32: add support for stm32h7b0xx and stm32h7b0xxQ
Add Kconfig SoC configurations.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
2023-11-15 10:02:06 +01:00
Chekhov Ma 2c13e53081 imx93: add lpuart1
imx93: add dts node and mmu region for lpuart1

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2023-11-14 07:10:59 -06:00
Daniel DeGrasse 5854821b65 drivers: mipi_dsi: add support for mipi_dsi_detach to dsi_mcux_2l
Add support for mipi_dsi_detach API to dsi_mcux_2l driver, and
update RT5xx SOC interface to enable halting clocks for the MIPI DPHY.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-14 09:22:59 +01:00
Manuel Argüelles 434a40470c drivers: mbox: nxp_s32: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-13 12:18:34 -05:00
Chekhov Ma 4e99da8599 imx93: change ccm driver to "imx-ccm-rev2"
i.MX93 share similiar register layout with i.MX RT11xx. Change ccm driver
to align with i.MX RT11xx, and make it easier to enable other drivers.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2023-11-13 10:51:12 -06:00
Manuel Argüelles b3f950c648 drivers: mdio: nxp_s32_netc: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-13 09:49:26 +01:00
Declan Snyder 2d1fdb5586 soc: nxp: rt1xxx: Enable NXP FlexRAM
Enable NXP FlexRAM in DTS and SOC code.

Do not configure flexram at runtime if the code is in the RAM.

Fix RT1060 DT to be more accurate.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-13 09:42:28 +01:00
Daniel Schultz a2f971795f soc: arm: ti_k3: am62x_m4: Lower Initialization level for init
Other drivers like the pinctrl_ti_k3 rely on a fully initialized system.
Move the am62x_init to an earlier stage than PRE_KERNEL_1 to keep both
PRE_KERNEL_{1,2} free for drivers.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2023-11-13 09:42:11 +01:00
Jason Kridner 26f30db8ad soc: arm: ti_simplelink: cc13x2x7_cc26x2x7: add caparray delta config
- Make caparray delta a Kconfig variable
- Set caparray delta for beagle_bcf at beagleconnect_freedom_defconfig

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
2023-11-11 18:49:25 -05:00
Declan Snyder fef0018cca soc: lpc55xxx: Support, enable, test NXP MRT
Support NXP MRT on LPC55XXX SOC series, enable on
lpcxpresso55s69_cpu0, add test overlay to counter basic api test

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-10 10:40:54 +01:00
Declan Snyder 93c59793c2 soc: rt6xx: Add NXP MRT
Add NXP MRT to RT6xx DT definition and add peripheral reset to soc.c

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-10 10:40:54 +01:00
Declan Snyder ff83745c9a soc: rt5xx: Enable NXP MRT
Enable NXP MRT on RT5xx soc and MIMXRT595_EVK board

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-10 10:40:54 +01:00
Manuel Argüelles 595a9c11c8 counter: nxp_s32_sys_timer: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-09 18:21:19 +01:00
Laurentiu Mihalcea 707759bd12 soc: xtensa: imx8: Add pinctrl support
This commit introduces support for pinctrl-related operations
on i.MX8QM/QXP.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-09 18:21:05 +01:00
Laurentiu Mihalcea eb12bae048 soc: xtensa: imx8: Configuration cleanup
As the name suggests, this commit attempts to cleanup some
of the configurations for the i.MX8 series. This cleanup
consists of either relocating the configuration or removing
unnecessary configurations.

As a rule of thumb, SoC-specific configurations have been moved
to Kconfig.series. If the configuration is by default 'y' and
needs to be set to 'n' or it has a numeric value then it has
been moved to Kconfig.defconfig.series. Configurations that
are default 'n' and were also explicitly set to 'n' have been
removed. Also, enabling logging has been moved to the board
level to avoid having to force all boards based on the same
SoC to enable logging.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-09 18:21:05 +01:00
Laurentiu Mihalcea ad7e858938 soc: xtensa: imx8: memory.h: Cleanup
This commit attempts to clean the memory.h header by doing
the following changes:
	1) Change the include guard to the standard
	ZEPHYR_....
	2) Remove unused macro definitions.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-09 18:21:05 +01:00
Laurentiu Mihalcea f29d6edece soc: xtensa: imx8: Remove include/soc directory
Since platform.h is a SOF-specific header that's no
longer used there's no point in keeping the include/soc directory.
As such, move memory.h to include/ and modify the linker script
to reflect this location change.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-09 18:21:05 +01:00
Laurentiu Mihalcea a0ecc05cdf soc: xtensa: imx8: Split generic i.MX8 SoC into i.MX8QXP and i.MX8QM
This commit attempts to split the generic i.MX8 SoC into its
QXP and QM variants. As things are now, the i.MX8 SoC doesn't
have any NXP HAL files to back it up. As a consequence, the
native Zephyr drivers cannot be used.

To solve this issue, the generic i.MX8 has been split into
i.MX8QXP and i.MX8QM, each of them having different NXP HAL
files.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-09 18:21:05 +01:00
Yong Cong Sin e538b0e5a6 drivers: plic: support multiple instances for multi-level
Most of the public APIs in `riscv_plic.h`
(except `riscv_plic_get_irq` & `riscv_plic_get_dev`) expect the
`irq` argument to be in Zephyr-encoded format, instead of the
previously `irq_from_level_2`-stripped version. The first level
IRQ is needed by `intc_plic` to differentiate between the
parent interrupt controllers, so that correct ISR offset can be
obtained using the LUT in `sw_isr_common`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-09 18:20:43 +01:00
Declan Snyder 345f079e49 dts: bindings: Fix NXP USB bindings
NXP USB bindings were combined into one binding and using
a property corresponding to HAL enums which is improper use
of devicetree.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-09 15:34:39 +01:00
Mulin Chao f9a4a3597b soc: arm: npcx: move soc-specific register definitions to soc.h
This CL is to minimize `CONFIG_SOC_SERIES_XXXX` definitions when we
introduce a new chip series. Most of them are relevant to register
layouts in different npcx soc series. It moves soc-specific register
definitions from `reg_def.h` to its own soc.h file.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-11-09 10:20:39 +00:00
Manuel Argüelles 6744d6084d watchdog: nxp_s32: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-09 10:20:27 +00:00
Tim Lin f1dc11174c ITE: drivers/i2c: Add a property for I2C located channel
Add a property for I2C channel switch selection. This property will
write to the SMBxxCHS register according to the I2C node you selected,
which can make channel swapping.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-11-08 10:08:28 +01:00
Manuel Argüelles bda3b101d3 serial: nxp_s32: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics and defining the driver's ISR within the shim
driver itself.

Note that for some peripheral instances is needed to redefine the
HAL macros of the peripheral base address, since the naming is not
uniform for all instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-08 10:06:46 +01:00
Dmitrii Golovanov 82ec6394a1 soc: arm: Fix cmake linker.ld warning for arduino_uno_r4_minima
Fix cmake depreciation warning on pre-defined linker.id
(soc/arm/renesas_ra/ra4m1/linker.ld) used for arduino_uno_r4_minima.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-07 09:53:57 +01:00
Daniel DeGrasse 883f604f12 soc: arm: nxp_imx: rt11xx: allow user to disable CONFIG_ADJUST_DCDC
Allow user to disable CONFIG_ADJUST_DCDC for their board, rather than
selecting it at the SOC level. The symbol still defaults to enabled,
preserving existing behavior unless a user explicitly chooses to disable
it.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-07 09:48:35 +01:00
Manuel Argüelles 237ec65ad3 intc: nxp_s32: use instance-based DT macros
At present, many of the NXP S32 shim drivers do not make use of
devicetree instance-based macros because the NXP S32 HAL relies on an
index-based approach, requiring knowledge of the peripheral instance
index during both compilation and runtime, and this index might not
align with the devicetree instance index.

The proposed solution in this patch eliminates this limitation by
determining the peripheral instance index during compilation
through macrobatics.

Note that for some peripheral instances is needed to define the
HAL macros of the peripheral base address because there are gaps
in the instances or there are SoCs with a single instance.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-06 19:02:56 -05:00
Torsten Rasmussen ba7e6fa69f cmake: cleanup and simplify the standard include logic in Zephyr
Several paths are checked for existence before added as global Zephyr
include path.

The existence check was needed because some tooling emit warnings on
non-existing paths.

Only few SoCs are using those pre-defined paths, yet this code runs
for all SoCs. The principle originates back from Kbuild days, and with
CMake it's more common and generally more visible to let the CMake code
defining libraries to specify include paths.

Furthermore it appears that several SoC implementation following the
<soc-path>/include was unaware that the path would be automatically
added as include path, cause they contain lines like:
    zephyr_library_include_directories(include)

Remove pre-defineds path except the `<SOC_PATH>` path, which is
guaranteed to exists.
This simplifies the CMake logic in the top-level Zephyr CMakeLists.txt
file.

This cleanup further prepares for future work where SoCs need not to
be organised under architectures which is important for multi-arch SoCs.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-06 18:57:30 -05:00
Huifeng Zhang abde709b5e arch: arm: cortex_a_r: introduce USE_SWITCH
This commit introduce 'USE_SWITCH' feature into cortex-A/R(aarch32)
architecture

For introducing USE_SWITCH, the exception entry and exit are unified via
`z_arm_cortex_ar_enter_exc` and `z_arm_cortex_ar_exit_exc`. All
exceptions including ISR are using this way to enter and exit exception
handler.

Differentiate exception depth and interrupt depth. Allow doing
context switch when exception depth greater than 1 but not allow doing
this when interrupt depth greater than 1.

Currently, USE_SWITCH doesn't support FPU_SHARING and USERSPACE.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-06 15:32:01 -06:00
Charlie Xiong 8fe6e0130e boards: arm64: provide support for ROC-RK3568-PC
This is support for AArch64 development board.
The board uses 4-core Cortex-A55, which are based on
the ARMv8.2 architecture.
In addition,we support smp support and
it can use 4-cores to run basic samples.

Signed-off-by: Charlie Xiong <1981639884@qq.com>
2023-11-06 10:14:20 +01:00
Gerson Fernando Budke 3ed1c990dc soc: st: l010xb: Fix the number of IRQs
Change the NUM_IRQS value from 32 to 30 following the rm0451.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-11-06 10:14:10 +01:00
Gerson Fernando Budke 6e3bae727b soc: st: Add all missing stm32l010 SoCs
Add minimal SoC entries to enable the whole stm32l010 family.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-11-06 10:14:10 +01:00
Caspar Friedrich 8242ef0a37 soc: arm: st_stm32: stm32l0: Add support for STM32L081
Add support for the STM32L081xx soc series.

Signed-off-by: Caspar Friedrich <c.s.w.friedrich@gmail.com>
2023-11-06 10:11:40 +01:00
Declan Snyder 4d654250a5 soc: lpc55xxx: Fix system hw clock cycle rate
Commit c6e3bac4f changed the core clock frequency of LPC55XXX series.
That clock is used by the cortex-m systick timer, which is the
default timer used for system time in zephyr on this series.
The bug is that the config SYS_CLOCK_HW_CYCLES_PER_SEC default was not
updated on the affected platforms to account for this change, so system
time is currently recorded as 150% of reality. Fix this by changing the
kconfig to be set automatically at SOC level and remove board defaults.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-06 10:11:25 +01:00
Grzegorz Swiderski e4448ed498 soc: mimx8mm6_m4: Restore linker script
For this SoC, an additional section is conditionally included on top of
the default linker script for Cortex-M. Set `SOC_LINKER_SCRIPT` to the
local `linker.ld`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-11-06 10:10:55 +01:00
Daniel DeGrasse 29ab2b13f6 drivers: ipm: Remove CONFIG_IPM_IMX_REV2
Remove CONFIG_IPM_IMX_REV2, as this Kconfig is no longer needed. The
driver can now be enabled with CONFIG_IPM_IMX.

Update NXP HAL to remove this Kconfig as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-06 10:09:59 +01:00
Daniel DeGrasse 8d5322b8ff drivers: ipm: remove nxp,imx-mu-rev2 compatible
Remove nxp,imx-mu-rev2 compatible. This IP block is the same as the
nxp,imx-mu device, and should be handled by the same compatible

Instead, use CONFIG_HAS_MCUX to determine which HAL APIs should be used
to interact with the messaging unit IP.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-06 10:09:59 +01:00
Torsten Rasmussen e57f0a4f7e cmake: x86: update x86 SoC to use SOC_LINKER_SCRIPT variable
This commit updates all x86 SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 4b02bbc329 cmake: xtensa: update xtensa SoC to use SOC_LINKER_SCRIPT variable
This commit updates all xtensa SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 2d96b31129 cmake: sparc: update sparc SoC to use SOC_LINKER_SCRIPT variable
This commit updates all sparc SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 10fea41f5c cmake: riscv: update riscv SoC to use SOC_LINKER_SCRIPT variable
This commit updates all riscv SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 59bcef3692 cmake: posix: update posix SoC to use SOC_LINKER_SCRIPT variable
This commit updates all posix SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 5130a69987 cmake: mips: update mips SoC to use SOC_LINKER_SCRIPT variable
This commit updates all mips SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 84e4f62e5b cmake: arm64: update arm64 SoC to use SOC_LINKER_SCRIPT variable
This commit updates all arm64 SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen 4812884f84 cmake: arm: update arm SoC to use SOC_LINKER_SCRIPT variable
This commit updates all arm SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Torsten Rasmussen b2de93cff6 cmake: arc: update arc SoC to use SOC_LINKER_SCRIPT variable
This commit updates all arc SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-03 11:01:23 +01:00
Rander Wang a4b9692155 soc: intel_adsp/cavs: add secondary dsp context save support
Save secondary dsp context when it is powered off in idle thread
and restore it when the secondary dsp is powered up. The algorithm
is aligned with ace platform.

Tested on a tgl platform.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-02 07:29:38 -04:00
Torsten Rasmussen b31afe1d27 sparc: add SPARC dependency to SPARC_CASA
Settings which defaults to `y` but is architecture related should have
a arch dependency for safety reasons.

Thefore add `if SPARC` to the SPARC_CASA Kconfig to ensure this setting
is only enabled on the sparc arch.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-02 09:48:16 +01:00
Rander Wang 0891448ac9 soc: intel_adsp: don't enable interrupt before k_cpu_idle
Fix a bug on cavs platform that secondary core is not powered off
by SET_DX ipc message sometimes. Secondary core is set into idle
state when switching to SOF_OFF state and then halted by primary
core. The interrupt is enabled before entring idle state, so the
secondary core may be woken up by interrupt and soc_cpus_active
is set to true before it is halted by hardware power gating. This
result to error when SOF check soc_cpus_active after the secondary
is halted.

This patch doesn't enable interrupt before idle entry to avoid above issue.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-02 09:45:55 +01:00
Torsten Rasmussen 3e82eb976e soc: move arm cortex_m common mpu code to arch/arm/core/mpu
Locate common mpu code together with other arm / nxp mpu code in the
arch folder where it logically belongs.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-02 09:45:18 +01:00
Ederson de Souza 928e22c302 soc/riscv/riscv-ite/it8xxx2: Support DEVNULL_REGION
it8xxx2 uses a custom linker script, which was not updated on
dfb3674c4c. This patch naively updates it
to support DEVNULL_REGION.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2023-11-01 18:48:24 -04:00
Mike J. Chen 385ceb7145 soc: xtensa: nxp_adsp: rt595: move .noinit
Mark .noinit section as NOLOAD and move it
next to the other NOLOAD sections. This way
it is removed from a generated image that is
embedded in the rt595 app image.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2023-11-01 11:19:02 +00:00
TOKITA Hiroshi a9e49918cf drivers: interrupt_controller: Add icu driver for Renesas RA series
To avoid complicating the initial code for supporting the SoC,
I have implemented only the bare minimum for now.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-11-01 10:56:46 +00:00
TOKITA Hiroshi 04b723e900 drivers: pinctrl: Add pinctrl driver for Renesas RA series
To avoid complicating the initial code for supporting the SoC,
I have implemented only the bare minimum for now.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-11-01 10:56:46 +00:00
TOKITA Hiroshi 1741b3a356 drivers: clock_control: Add clock driver for Renesas RA series
Add initial support for Renesas RA clock generation circuit.

It returns a fixed value to simplify the first commit to get the UART
working now.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-11-01 10:56:46 +00:00
TOKITA Hiroshi 5ccc0eb319 soc: arm: add support for Renesas RA4M1 series SoC
Add essential support for RA4M1 Series.
It only defines `r7fa4m1ab3cfm` currently.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-11-01 10:56:46 +00:00
Yong Cong Sin d7302f417e irq: relocate multi-level irq out of irq.h
Relocate multi-level interrupts APIs out of `irq.h` into
a new file named `irq_multilevel.h` to provide cleaner
separation between typical irq & multilevel ones.

Added preprocessor versions of `irq_to_level_x` as `IRQ_TO_Lx`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Andriy Gelman d0961756a6 drivers: watchdog: Add xmc4xxx support
Adds watchdog support for Infineon xmc4xxx MCUs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-10-27 12:58:07 -05:00
Mike J. Chen ca19b40733 soc: arm: nxp_imx: rt5xx: make some clock init functions weak
Allows a board to provide their own functions if
they wish to init clocks differently.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2023-10-27 10:51:28 +02:00
Flavio Ceolin 76cb2a54f5 intel_adsp: Do not include device_runtime header
Device runtime header is not needed in intel_adsp_ipc header.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-27 10:51:14 +02:00
Daniel Leung 1fac5ed2a6 soc: xtensa/nxp_adsp: put guard in Kconfig.defconfig
This adds a if CONFIG_SOC_FAMILY_NXP_ADSP guard in
Kconfig.defconfig for nxp_adsp. Or else all of its default
get applied everywhere. For example, qemu_xtensa fails
kernel.logging.message_capture tests because
CONFIG_TEST_LOGGING_DEFAULTS is disabled in
nxp_adsp/Kconfig.defconfig which should not have applied
to qemu_xtensa at all. So put a guard in there.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-26 19:16:53 -04:00
Anas Nashif 51f6c4269b soc: microchip_mec: do not enable PM in soc
PM should not be enabled by default at the soc level. This is an
application decision and not a platform decision whether to enable or
disable PM features.

Enabling PM by default will result in descripencies and test scope and
failures in tests that do not account for PM being enabled.

Fixes #60359

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-26 12:28:18 -05:00
Erwan Gouriou 54fa6f30b8 soc: stm32: Enable Debug in stop mode when ZTEST is used
Force STM32_ENABLE_DEBUG_SLEEP_STOP option when running tests.
This option enables Debug in Sleep/stop states and disables it when
disabled (default state).

When disabled, it may be impossible to flash the device with runner
such as openocd. It's generally working using cubeprogrammer, but it might
fail as well with fault configuration.

Instead of fixing each test or breaking CI each time a new test is created
with CONFIG_PM=y, force this option to be enabled when ZTEST=y (as it was
already the case when DEBUG=y).

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-10-26 09:49:42 +02:00
Manuel Argüelles a7bda08960 nxp: s32ze: take exceptions in Arm mode
Cortex-R52 supports both Arm and Thumb-2 mode, but Zephyr's ASM
code for Armv-8 Aarch32 is written for Arm mode only. This Soc
has a general purpose register that can set the core TEINIT signal
to change the mode exceptions are taken before booting up the core.
The debugger startup scripts or firmware booting up the core may
configure this bit to Thumb mode, as is the case of the NXP S32 debug
probe startup scripts for S32ZE.

Due to above reason, clear SCTLR.TE bit at reset so that TEINIT value
is ignored and exceptions are always taken into Arm mode, compatible
with current Zephyr ASM code. At least until taking execeptions in Thumb
mode is supported in Zephyr.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Michael Arnold 973e226bfd arch: Enable ramfunc feature on RISC-V PRIVILEGE SOC family
Allow to place functions in ram.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Dmitry Lukyantsev 357d6cec45 boards: Add support for the NXP MIMXRT595 DSP core
Add board and soc files for the NXP MIMXRT595 DSP core.

Signed-off-by: Dmitry Lukyantsev <dmitrylu@google.com>
2023-10-25 09:55:10 -04:00
Dmitry Lukyantsev 0ae68a3857 soc: nxp_adsp: Refactor imx8/imx8m Kconfig
In preparation for RT500 ADSP enablement, consolidate common Xtensa
configuration parameters in top level Kconfig.defconfig.

Signed-off-by: Dmitry Lukyantsev <dmitrylu@google.com>
2023-10-25 09:55:10 -04:00
Sylvio Alves 3f5ea785f2 linker: esp32: fix linker to enable proper MMU usage
ESP32 flash_mmap() function requires `_rodata_reserved_start` address
to be at the beginning of RODATA. This allows adding memory-mapped flash
areas.

Fixes #52764

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-10-25 09:57:48 +02:00
Bjarki Arge Andreasen 9b21d4d366 soc: sam: Add poweroff implementation
This commit adds an implementation of poweroff, which first
uses SUPC to enable all defined wakeup sources (except for
sam4l), followed by entering backup mode.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-24 11:35:43 +02:00
Bjarki Arge Andreasen 312c8b1930 soc: sam: Add SUPC driver and dts model
This commit adds a driver and dts model for the ATMEL SAM
SUPC component.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-24 11:35:43 +02:00
Nikodem Kastelik a4cbe9e9c6 soc: arm: nordic_nrf: align nrf_power calls to new scheme
Now the API to manage GPREGRET register is unified for all devices
having one or more GPREGRET entries.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-24 11:13:53 +02:00
Nikodem Kastelik f3f2c113d1 soc: arm: nordic_nrf: nrf53: align nrf_regulators calls to new scheme
Now more generic regulators API is available.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-24 11:13:53 +02:00
Joakim Andersson 17fd1f8fba boards: Enable TF-M by default for nordic SoC NS boards
Enable TF-M by default for nordic nRF5340 and nrf9160 SoC boards.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-10-24 09:40:16 +02:00
Joakim Andersson 33a44d0ed8 tfm: nordic_nrf: Add generic SoC support for nordic SoCs
Add generic SoC support for the supported nordic SoCs:
- nrf5340
- nrf9160
- nrf9120

Add generic SoC support by taking board specific configurations from
zephyr devicetree and kconfig.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-10-24 09:40:16 +02:00
Alberto Escolar Piedras 9834fabe2d nrf53: Correct sync_rtc kconfig dependencies for simulation
Let's make the sync_rtc kconfig depend on the SOC_COMPATIBLE
options which are set both by the real and simulated targets,
so this code works in the same way for both.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:09 +02:00
Alberto Escolar Piedras 32d0c8d8e5 nrf53: Refactor sync RTC options to their own file
So they can be reused by the simulated board

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:09 +02:00
Tomasz Leman adf6d0e3d8 soc: intel_adsp: lpsram enable retention mode
This patch enables memory retention mode on lpsram.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Tomasz Leman eeb4f2f76d soc: intel_adsp: hpsram enable retention mode
This patch enables memory retention mode on hpsram.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Tomasz Leman 16f729214b soc: intel_adsp: lpsram init refactor
This patch contains small refactor of lpsram init function (defines
registers and adds new macro).

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Tomasz Leman 112611378f soc: intel_adsp: hpsram init refactor
This patch reuse existing macro for better readability.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Jun Lin e5e599c100 soc: npcx: add HAS_PM to npcx4
The Kconfig option HAS_PM, which must be needed for SoCs providing PM
hooks, is missing in npcx4.
This commit adds it to soc/arm/nuvoton_npcx/npcx4/Kconfig.series.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-10-20 15:11:14 +02:00
Tim Lin 35e3dfed2d ITE: soc: Add the variant of it82002aw
This variant uses the same die as IT82202/IT82302 series and has
a pinout compatible with IT513xx series packages.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-10-20 15:07:28 +02:00
Adam Wojasinski 5685af0923 modules: hal_nordic: Add support for new TWIM instances
Add Kconfig and symbols for twim: 20-22, 30, 121, 130-137 instances

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-10-20 15:04:10 +02:00
Adam Wojasinski 5c1daef5ab drivers: spi: nrfx: Add SPIM Kconfig symbols for new instances
Add support for upcomming SPIM instances.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-10-20 15:03:17 +02:00
Daniel Leung 7a7aeb21e2 boards: qemu_xtensa: use dc233c core
This changes qemu_xtensa to use dc233c core instead of
sample_controller. The sample_controller uses a very
basic configuration which lacks features usually needed
in real world applications. Instead, use the dc233c core
as the base for qemu_xtensa so we can use QEMU to cover
more of our code path.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-20 15:00:14 +02:00
Niek Ilmer 9e6b1d5ba6 SOC: Smartbond: Add DA14695
This commits adds the DA14695 variant.
The main difference with the DA14699 is a smaller package with less
GPIO.

Signed-off-by: Niek Ilmer <niek.ilmer.aj@renesas.com>
2023-10-20 14:51:49 +02:00
Sylvio Alves 4b5331ba45 linker: esp32: move snippets-section within rom boundary
This will guarantee that application snippets will be placed
into ROM section properly.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-10-13 13:10:22 +03:00
Peter Ujfalusi 8dfa116750 drivers: dma: intel-adsp-hda: Correct DGCS:SCS bit for 32bit sample size
If the channel was used for 16bit in the once, subsequent 32bit sample size
audio will be broken since the SCS bit remains set.

Example sequence with SOF:
normal audio playback with 16bit
ChainDMA audio playback with 16bit
normal audio playback with 16bit

The last playback results garbled audio.

Introduce intel_adsp_hda_set_sample_container_size() helper function
to handle the SCS bit and use it in the driver.


Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-10-12 17:31:23 +03:00
Nazar Palamar 4d76e26f17 drivers: pinctrl: Update Infineon CAT1 pinctrl driver
- if we have input enable use CY_GPIO_DM_xxxx else
CY_GPIO_DM_xxx_IN_OFF;

- added bias_high_impedance option

- Updated HIGHZ drive mode, now it sets if:
--- we have bias_high_impedance
--- or if input_enable and no addition bias mode

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2023-10-12 15:17:35 +03:00
Andrzej Kuros adec56bcee nrf5340: pretick decoupled from workaround anomaly 160
Coupling in code between workarounds for anomaly 160 and anomaly 165
(pretick) is decreased.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-10-11 11:09:29 +02:00
Andrzej Kuros 3eef769209 nrf53: fix RTC pretick for RTC rescheduling by other interrupts
It might happen that while some interrupt handler other than for RTC0
or RTC1 (e.g. for RADIO) is executed, the scheduled pretick CC triggers.
This starts pretick pulses due to the loop through IPC. The change
in pretick schedule did not stop the pretick pulses going through IPC
loop, what caused heavy increase in power consumption.

This commit fixes this behavior.
Added also clarifications for Kconfig option `SOC_NRF53_RTC_PRETICK`.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-10-11 11:09:29 +02:00
Andrzej Kuros c4e53dabf7 nrf53: fix RTC pretick power usage for events on RTC0
For RTC0 events the RTC1 pretick event was not cleared what caused the
WDT to be not stopped. This resulted in increased power usage.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-10-11 11:09:29 +02:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Daniel DeGrasse faf5593272 soc: arm: nxp_lpc: Only clock core from PLL1 when CONFIG_FLASH=n
Do not clock the LPC55xxx cores from PLL1 when CONFIG_FLASH is set. This
is required due to the following limitation of the flash controller
(documented in the reference manual):

Flash operations (erase, blank check, program) and reading a single word
can only be performed for CPU frequencies of up to 100 MHz. These
operations cannot be performed for frequencies above 100 MHz.

The PLL1 clock source will result in a core clock of 150MHz, which
violates this requirement.

Fixes #62963

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-10-08 11:25:02 +01:00
Detlev Zundel 42ea06cf21 soc: xtensa,riscv: esp32c3: Fix SOC_PART_NUMBER choices
Add the ESP32-C3-WROOM-02 modules with 4 or 8 MiB flash. The
temperature and antenna / connector variants are not mentioned
explicitely as they do not influence the software.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2023-10-06 12:24:49 +01:00
Yong Cong Sin 93cbfcfee9 board: riscv: qemu: increase ndev of PLIC to 1024
Increase the `ndev` of PLIC to the max of 1024 from 53, as
supported by the RISCV PLIC. The total number of IRQs is now
1035(1024 + 11), up from 64(53 + 11).

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-05 06:10:06 -04:00
Yonatan Schachter c461441cc5 soc: silabs: Added Kconfig to indicate the existence of a radio PHY
Added SOC_GECKO_HAS_RADIO symbol, to indicate that a SoC has a radio
phy, so that radio related code would only apply to devices with radio.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-10-04 10:30:00 +03:00
Li Feng 4b17907621 intel_ish: Enable ISH boards for coverage.
When build ISH project in Chromium repo, the coverage report error:

zmake build --coverage rex-ish
lcov: ERROR: no valid records found in tracefile.

To fix this, enable coverage config to link ISH boards with coverage
library.

Signed-off-by: Li Feng <li1.feng@intel.com>
2023-10-03 09:20:49 +02:00
Kai Vehmanen 8c4eec7ac6 intel_adsp: boot_complete must be done PRE_KERNEL_1
Commit 759e07bebe ("intel_adsp: move memory window setup to
PRE_KERNEL_1") moved memory window setup from EARLY to
PRE_KERNEL_1. Similar change must be done to boot_complete, or
otherwise boot-up sequence will not be completed correctly
on all platforms.

Suggested-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-10-02 13:40:40 +01:00
Andrzej Kuros d44e96e486 nrf53: pretick with NRF_802154_RADIO_DRIVER
The `SOC_NRF53_RTC_PRETICK` option is now allowed to be used with
`NRF_802154_RADIO_DRIVER`.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Andrzej Kuros e03d5d4c6d nrf53: RTC pretick allows user channels and require just one CC
The nrf53 pretick can be used with non-zero
`NRF_RTC_TIMER_USER_CHAN_COUNT` Kconfig option.

The nrf53 pretick requires just one RTC1 CC channel.

The nrf53 pretick handles also RTC1 and RTC0 both CCs and OVERFLOW
events by examination of events scheduled on them. The pretick is set
based on number of ticks to the closest event scheduled that can trigger
an interrupt.

Because the operation in `z_arm_on_enter_cpu_idle` hook would
take too much time with interrupts disabled, the
`z_arm_on_enter_cpu_idle_prepare` hook enabled by Kconfig option
`ARM_ON_ENTER_CPU_IDLE_PREPARE_HOOK` is used. It performs RTC0 and RTC1
examination, and sets pretick without interrupts being blocked.

The LDREX/STREX are leveraged to detect if exception took place
between start of `z_arm_on_enter_cpu_idle_prepare` and
`z_arm_on_enter_cpu_idle`. If exception has not been taken, the pretick
calculation can be trusted because source data could not changed and
too much time could not pass. Otherwise the sleep attempt is disallowed,
the idle will loop again and try later.

Prompt for `SOC_NRF53_RTC_PRETICK` Kconfig option allows to control
this option by an user and turn the feature off if necessary.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Krzysztof Chruściński 31eaffdf05 nrf53: Add RTC pretick
Add RTC pretick option that triggers HW activity one tick before and
RTC event that leads to the interrupt. Option is active only on nrf53
network core.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Alberto Escolar Piedras fa470ca57d native SOC: Add option to make a MCU to boot on its own
As a development helper, add a kconfig option to
automatically start the MCU this Zephyr image is built
for during HW boot, even if in other circumstances
this MCU would not start automatically (for ex. because
another core is meant to release its reset).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras 6e30d10c09 native SOC: Rename option NATIVE_SIMULATOR_CPU_N to MCU_N
To be more accurate, as this option represents a microcontroller
number, not a CPU number.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Guillaume Gautier 6f76e0dcf8 soc: arm: st_stm32: stm32u5: add stm32u5a5 soc
Add STM32U5A5 SOC

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-09-29 10:34:33 +02:00
Manuel Argüelles d212e50eaf soc: nxp_s32: enable RTU.PIT timers for S32ZE
Each RTU includes one PIT instance that can be used by any
of the cores.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-29 09:47:35 +02:00
Alberto Escolar Piedras 536aee1e1a native soc: Add option to pass extra images to native simulator build
Add a new kconfig option to be able to pass extra images to the
native simulator build.
So one can, for ex., use one application build to produce one core image,
and at the same time have it produce the final link with the native
simulator runner and the other MCU images.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 08:50:52 +02:00
Alberto Escolar Piedras dd29dffca4 native SOC: Add option to define how many MCUs a SOC has
Add a new Kconfig option to define how many MCUs a SOC has

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 08:50:52 +02:00
Alberto Escolar Piedras c7f85e6ee9 native SOC: Add option to select the primary MCU
Add a new kconfig option to select which is the
preffered embedded MCU.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 08:50:52 +02:00
honglin leng c4f102fd8b boards: arm64: add support for Raspberry Pi 4 Model B
This is an AArch64 board. We also add BCM2711 SoC support

Signed-off-by: honglin leng <a909204013@gmail.com>
2023-09-28 13:40:45 +02:00
Daniel Leung 1c0178ae6e boards: xtensa: rename qemu_xtensa_dc233c to qemu_xtensa_mmu
This renames the board from qemu_xtensa_dc233c to
qemu_xtensa_mmu to better signal that it is for testing with
MMU on QEMU Xtensa. Also turn on testing by default to make
sure future changes will not break Xtensa MMU support.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-27 19:30:15 -05:00
Dat Nguyen Duy 8185faa0cb drivers: dma_mcux_edma: add support dma driver for s32k344
On S32K344, the offset in memory map between each channel
is 0x4000 for most channels, but there is specific case is
between channel 11 and 12 which is 0x1D4000 instead. As a
consequence, 32 channels are divided to two parts: one
starts from channel 0 -> 11. The other is from channel 128
to 145. The channel gap is from 12 -> 127.

For user and data structures in shim driver, the channel's
value comes from 0 --> 31. Above constraint will be counted
when interact with the mcux sdk

Beside that, the DMAMUX register in this platform is very
specific, not in identical with DMAMUX channel, so shim
driver is updated to cover this case

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-27 14:02:09 -05:00
Flavio Ceolin 646a06c9fe random: Fix kconfig symbol name
s/CSPRING_ENABLED/CSPRNG_ENABLED/g

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-09-27 11:55:10 -05:00
Sylvio Alves bdda8ac48e soc: esp32s3: add esp32s3_appcpu for AMP support
Adds esp32s3_appcpu SoC and update default esp32s3 SoC
to support AMP feature.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-09-27 12:07:21 +02:00
Jeff Daly 83de11d9f3 Microchip MEC172X: Rework GPIO definitions to separate package types.
MEC172X has 2 package sizes with additional pins on the -LJ package.
This commit separates the package-specific parts into different files.
In addition, this patch removes unnecessary package-specific enums in
favor of calculated offsets into the desired registers.

Signed-off-by: Jeff Daly <jeffd@silicom-usa.com>
2023-09-26 16:53:29 +02:00
Yong Cong Sin 3300b31de8 boards: ti_k3: prevent header dependencies
These headers are using things like `uint32_t` & devicetree
macros, so they should include the `devicetree.h` & `types.h`.

Otherwise they depend on the parent file to have those headers
included before they are included.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-09-26 12:03:54 +02:00
Yong Cong Sin b49d0addc5 soc: ti_k3: guard the soc header
Add macro guard to the soc header to prevent multiple inclusion

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-09-26 12:03:54 +02:00
Daniel Leung 9f9b4a8afa uart: ns16550: use io-mapped DT property for IO port access
The old CONFIG_UART_NS16550_ACCESS_IOPORT has been used to
indicate whether to access the NS16550 UART via IO port
before device tree is used to describe hardware. Now we have
device tree, and we can specify whether a particular UART
needs to be accessed via IO port using property io-mapped.
Therefore, CONFIG_UART_NS16550_ACCESS_IOPORT is no longer
needed (and thus also CONFIG_UART_NS16550_SIMULT_ACCESS).
Remove these two kconfigs and modify code to use device tree
to figure out how to access the UART hardware.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-26 12:03:04 +02:00
Daniel Leung ba6c9c2136 xtensa: dc233c: enable backtrace support
Adds the necessary bits to enable backtrace support
for Xtensa DC233C core.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-26 08:37:43 +02:00
Daniel Leung b2f7ea0523 soc: xtensa/intel_adsp/ace: fix _end location
The symbol _end is used to indicate the start of heap in
the common libc malloc code. On ACE, heap is in uncached
area. However, _end was in the cached area while end of
heap is in uncached area. This resulted in incorrect
calculation of heap size. So move _end into uncached
area so correct heap size can be calculated.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-25 16:44:22 +02:00
Alberto Escolar Piedras c7c3c82aa0 soc nordic_nrf: Select new compatible kconfig options
Select the newly introduced nrf53 compatible kconfig options.
These are common both for real HW and for simulated HW,
allowing SW to behave appropriately for both.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-25 16:42:45 +02:00
Daniel DeGrasse 9e5188353e soc: arm: nxp_imx: add support for SMARTDMA for RT5xx
Add support for SMARTDMA to RT5xx SOCs. SMARTDMA ram banks will be
powered up, so code can be programmed into this region for the SMARTDMA
engine.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-09-25 09:46:55 +02:00
Roland Lezuo f4c901b82d soc: arm: st_stm32: add config to allow debugger attach in sleep/stop modes
Adds CONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP to allow debugger attaching in
sleep/stop mode of STM32 parts. Mainly useful for debugging. Move DBGMCU
from part-sepcific power.c to common soc_config.c. CONFIG_USE_SEGGER_RTT
depends on this as well.

Signed-off-by: Roland Lezuo <roland.lezuo@embedded-solutions.at>
2023-09-22 15:31:47 +02:00
Aaron Ye 09e7e2db51 soc: arm: Add support for Ambiq Apollo4 Blue Plus.
Added devicetree and Kconfig for Apollo4 Blue Plus SoC.
They are needed for the apollo4p_blue_kxr_evb board.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2023-09-22 08:29:29 -05:00
Declan Snyder 15bc6a2389 soc: lpc55s3x: Enable VREF
Add node for VREF0 peripheral to LPC55S3X SOC DT

Clock VREF peripheral if status = okay in DT

Enable VREF on lpcxpresso55s36

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-09-21 09:26:57 +02:00
Manuel Argüelles 7fca0aa8a6 nxp_s32: enable clock control for S32ZE
Enable clock control driver for NXP S32ZE SoCs and add clock sources
definitions for devicetree.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-20 17:25:44 +01:00
Anas Nashif 759e07bebe intel_adsp: move memory window setup to PRE_KERNEL_1
PRE_KERNEL_1 is more suited for dealing with devices, so move out of
EARLY.
Verified on hardware and things seem to behave the same. Something was
changed since this was first introduced as this was not possible for
some reason.

Fixes #62627

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-20 15:17:14 +02:00
Gerard Marull-Paretas 49df14c08a dts: arm: nordic: fix cryptocell description
The ARM Cryptocell 310/312 IP is wrapped by Nordic specific registers.
It is organized as follows:

- Base address: Nordic wrapper
- Base address + 0x1000: ARM Cryptocell IP registers

Following more standard devicetree conventions, use a single node for
what is exposed as a single peripheral. The node contains 2 register
entries, one for the wrapper and a second one for the 3rd party IP.
Compatibles are used from more specific (nordic,cryptocell) to more
generic (arm,cryptocell-3xx).

Other minor fixes: peripheral is disabled by default (as it should be in
SoC dts files).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-20 13:54:38 +01:00
Alberto Escolar Piedras 0e8f97df49 nrf5x_bsim: Add helper kconfig symbols for simulated nrf5340
Just like for the nrf52_bsim let's add helper kconfig symbols
which can be used to identify we are running in a target that
is compatible with the real HW but is not the real HW.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-20 08:56:49 +02:00
Jonas Otto 2baac8e769 soc: Add support for STM32F072X8
Adds support for the STM32F072X8 SOC, which is a variant of the
existing STM32F072XB with less flash.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
2023-09-19 15:25:09 +01:00
Filip Kokosinski 8131a67d6f soc/arm/silabs_exx32: select missing CONFIG_SOC_GECKO_SERIESx
This commit:
* adds the `CONFIG_SOC_GECKO_SERIES0` Kconfig option for Gecko Series 0
  SoCs
* selects the proper `CONFIG_SOC_GECKO_SERIESx` option where it's currently
  missing

Fixes #62806.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2023-09-19 09:32:55 -04:00
Yong Cong Sin 5b9f82668b riscv: telink_b91: fix compilation
Fix compilation failure due to multilevel interrupt.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-09-18 13:03:45 -04:00
Gerard Marull-Paretas efb8408ba2 soc: arm: nordic_nrf: nrf52: deprecate GPIO_AS_PINRESET
In favor of devicetree property in the UICR node.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-18 13:14:08 +02:00
Yonatan Schachter fb140de04a soc: silabs_exx32: Select SOC_GECKO_SERIES1 for 1x devices
Select SOC_GECKO_SERIES1 for all Silabs devices of the series 1x.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-18 12:55:40 +02:00
Sylvio Alves f5fa4b3bcd soc: espressif: provide VMA to rodata and text by default
Flash segments require VMA to proper work. Executing from LMA
is not possible. Current implementation did not take into account
runtime iterable rom sections that any application could implement.
In the above cenario and as reported in the issue below, ESP32 won't run
when those ROM sections are created in application level.

This change make sure all flash segments are properly mapped
accordingly.

Fixes #61834

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-09-18 10:38:03 +01:00
Tomasz Leman a5d1fd9857 soc: adsp: clk: update clock switch flow
This patch corrects clock selection flow for ACE platforms.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-09-18 10:35:23 +01:00
Tomasz Leman cf6d5f95b6 adsp: clk: ace: select ipll if wovrco is unavailable
Selecting Low Power clock has the same result as selecting High
Performance clock (now IPLL). Therefore, the LP clock will be removed
from the list of available clocks on ACE family platforms.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-09-18 10:35:23 +01:00
Tomasz Leman 2f2689e3d3 intel_adsp: ace15: shim: update wovrco request bit
Updating value of WOVRCO request bit in CLKCTL register according to the
documentation. Previus value was mask used for clock enabling.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-09-18 10:35:23 +01:00
Daniel DeGrasse 23264c4b3a soc: arm: nxp_imx: introduce ROM ramloader feature
The iMX RT bootrom allows the user to load images into RAM regions from
flash by providing a correctly configured boot header. In particular, if
the boot header contains a load address within RAM, the bootroom will
automatically copy the image to the load address before executing it

Introduce CONFIG_NXP_IMX_RT_ROM_RAMLOADER to enable this feature. This
Kconfig will shift the LMA of a image built to run in a RAM region to
reside in the default FlexSPI boot region, which allows the image to be
loaded to the FlexSPI region using west. This is intended to simplify
development of applications executing from RAM on iMX RT based systems.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-09-15 14:37:07 -05:00
Leifu Zhao 61ab3a844c pm: policy: add check for device busy in policy
Add check for device busy when CONFIG_PM_NEED_ALL_DEVICES_IDLE is
set to y because one or more devices may still in busy and causes
problem when system go into low power in Intel ISH platform.

Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
2023-09-15 14:51:50 -04:00
Gerard Marull-Paretas 0762008586 soc: arm: nordic_nrf: deprecate CONFIG_NFCT_PINS_AS_GPIOS
In favor of the new UICR nfct-pins-as-gpios devicetree property.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-15 16:05:28 +02:00
Carlo Caione e4a125b6a4 dt: Make zephyr,memory-attr a capabilities bitmask
This is the final step in making the `zephyr,memory-attr` property
actually useful.

The problem with the current implementation is that `zephyr,memory-attr`
is an enum type, this is making very difficult to use that to actually
describe the memory capabilities. The solution proposed in this PR is to
use the `zephyr,memory-attr` property as an OR-ed bitmask of memory
attributes.

With the change proposed in this PR it is possible in the DeviceTree to
mark the memory regions with a bitmask of attributes by using the
`zephyr,memory-attr` property. This property and the related memory
region can then be retrieved at run-time by leveraging a provided helper
library or the usual DT helpers.

The set of general attributes that can be specified in the property are
defined and explained in
`include/zephyr/dt-bindings/memory-attr/memory-attr.h` (the list can be
extended when needed).

For example, to mark a memory region in the DeviceTree as volatile,
non-cacheable, out-of-order:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_VOLATILE |
			       DT_MEM_NON_CACHEABLE |
			       DT_MEM_OOO )>;
   };

The `zephyr,memory-attr` property can also be used to set
architecture-specific custom attributes that can be interpreted at run
time. This is leveraged, among other things, to create MPU regions out
of DeviceTree defined memory regions on ARM, for example:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-region = "NOCACHE_REGION";
       zephyr,memory-attr = <( DT_ARM_MPU(ATTR_MPU_RAM_NOCACHE) )>;
   };

See `include/zephyr/dt-bindings/memory-attr/memory-attr-mpu.h` to see
how an architecture can define its own special memory attributes (in
this case ARM MPU).

The property can also be used to set custom software-specific
attributes. For example we can think of marking a memory region as
available to be used for memory allocation (not yet implemented):

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_NON_CACHEABLE |
			       DT_MEM_SW_ALLOCATABLE )>;
   };

Or maybe we can leverage the property to specify some alignment
requirements for the region:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_CACHEABLE |
			       DT_MEM_SW_ALIGN(32) )>;
   };

The conventional and recommended way to deal and manage with memory
regions marked with attributes is by using the provided `mem-attr`
helper library by enabling `CONFIG_MEM_ATTR` (or by using the usual DT
helpers).

When this option is enabled the list of memory regions and their
attributes are compiled in a user-accessible array and a set of
functions is made available that can be used to query, probe and act on
regions and attributes, see `include/zephyr/mem_mgmt/mem_attr.h`

Note that the `zephyr,memory-attr` property is only a descriptive
property of the capabilities of the associated memory  region, but it
does not result in any actual setting for the memory to be set. The
user, code or subsystem willing to use this information to do some work
(for example creating an MPU region out of the property) must use either
the provided `mem-attr` library or the usual DeviceTree helpers to
perform the required work / setting.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-09-15 12:46:54 +02:00
Dmytro Firsov c9d2fb7d40 xen: refactor Xen hypervisor Kconfig options
Xen-related Kconfig options were highly dependand on BOARD/SOC xenvm.
It is not correct because Xen support may be used on any board and SoC.

So, Kconfig structure was refactored, now CONFIG_XEN is located in
arch/ directory (same as in Linux kernel) and can be selected for
any Cortex-A arm64 setup (no other platforms are currently supported).

Also remove confusion in Domain 0 naming: Domain-0, initial domain,
Dom0, privileged domain etc. Now all options related to Xen Domain 0
will be controlled by CONFIG_XEN_DOM0.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2023-09-15 11:15:00 +01:00
Mykola Kvach 62fd5ab3e1 drivers: xen: gnttab: do Xen node mapping inside driver
Move memory mapping of Xen node to Grant Table driver system init
function. After moving mapping we don't need anymore records of
xen-xen node into 'mmu_regions' array, so they were deleted from
all SoCs: Rcar Gen3/Gen4 and XenVM.

We need at least 16M of virtual address space to map memory of Xen
node, so the virtual memory sized has been increased to 32 MB, it
should be enough for basic use-cases and mapping of 16M mem region
of Xen node.

Unfortunately, after moving we also need to increase number of XLAT
tables. The previous code was more efficient if we talking about
usage of XLAT tables, because it mapped grant tables using a higher-
order table that allows mapping blocks of 2MB. And after the changes
is maps every 4KB page, so we need more XLAT tables.

Increase number of grant frames, it is needed to sync stage 1 and stage 2
memory mappings, previously we map only one page on stage 2 and further
usage of unmap regions can cause MMU translation errors.

Perform mapping stage 1 before mapping for stage 2 (add to physmap),
because right after stage 1 we can try to access memory and if it is
unmap in stage 2, error will be received during translation.

Note: Xen Grant Table driver doesn't use Zephyr Device Model.

Authored-by: Mykola Kvach <mykola_kvach@epam.com>
Co-authored-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2023-09-15 11:15:00 +01:00
Gerard Marull-Paretas aaeb0a672e toolchain: only include <zephyr/toolchain.h>
It is wrong to use toolchain-specific header files.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-15 09:27:30 +02:00
Flavio Ceolin 8cb9d76553 xtensa: dc233c: Add TLS support
Add TLS support for this target.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-14 17:07:21 -04:00
Gerard Marull-Paretas 691facc20f include: always use <> for Zephyr includes
Double quotes "" should only be used for local headers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-14 13:49:58 +02:00
Marcin Niestroj f15e7c5909 soc: arm: st: set SWO reference frequency based on 'rcc'
Configure SWO reference frequency to be the same as
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC. This should make all ST boards ready to
be used with SWO, without configuring any other devicetree property.

Tested with NUCLEO-L476RG and NUCLEO-H563ZI.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2023-09-13 16:29:56 +02:00
Jordan Yates 1e06ba2328 soc: arm: nordic: handle nRF52832 anomaly 109
Enable workaround for anomaly 109 by default when affected peripherals
are enabled.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-13 12:05:27 +02:00
Paulo Santos 395395b266 soc: arm: efr32bg22: add missing GPIO flag
Add the missing SOC_GECKO_GPIO selection to the EFR32BG22 SoC Series.

Signed-off-by: Paulo Santos <pauloroberto.santos@edge.ufal.br>
2023-09-13 11:49:27 +02:00
Huifeng Zhang 2c22e83dfb include: arch: arm: Remove aarch32 directory
This commit follows the parent commit work.

This commit introduces the following major changes.

  1. Move all directories and files in 'include/zephyr/arch/arm/aarch32'
    to the 'include/zephyr/arch/arm' directory.

  2. Change the path string which is influenced by the changement 1.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-13 10:08:05 +01:00
Huifeng Zhang df41deac1c arch: arm: Remove aarch32 directory
It doesn't make sense to keep the aarch32 directory in the
'arch/arm/core' directory as the aarch64 has been moved out.

This commit introduces the following major changes.

  1. Move all directories and files in 'arch/arm/core/aarch32' to
    'arch/arm/core' and remove the 'arch/arm/core/aarch32' directory.
  2. Move all directories and files in 'arch/include/aarch32' to
    'arch/include' and remove the 'arch/include/aarch32' directory.
  3. Remove the nested including in the 'arch/include/kernel_arch_func.h'
    and 'arch/include/offsets_short_arch.h' header files.
  4. Change the path string which is influenced by the changement 1
    and 2.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-13 10:08:05 +01:00
Anas Nashif fcf50ed6e7 kernel: move timeout_q.h to kernel/include
This is a private kernel header with private kernel APIs, it should not
be exposed in the public zephyr include directory.

Once sample remains to be fixed (metairq_dispatch), which currently uses
private APIs from that header, it should not be the case.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-12 12:55:36 -04:00
Albort Xue 2073dc9cdd boards: arm: lpcxpresso55s36: Added dac support for LPC55S36
Added dac support for the LPC55S36 board, updated lpc55xxx/soc.c to
enable clock and power for dac0.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2023-09-11 19:55:26 +02:00
Mulin Chao eacdadf270 driver: adc: npcx: remove threshold-reg-offset DT property
Remove `threshold-reg-offset` DT property and implement them with static
inline functions in `reg_def.h`

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-09-08 14:43:37 +02:00
Mulin Chao 72ee4f75ef driver: adc: npcx: add multi-device support in npcx adc driver
Add multi-device support in npcx adc driver since there is more than one
adc module in npcx4 series. And each adc's reference voltage might be
different, this CL introduces the `vref-mv` prop. to select its own
reference voltage.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Signed-off-by: Kate Yen <htyen@nuvoton.com>
2023-09-08 14:43:37 +02:00
Piotr Dymacz 98e104fe3d soc: cc13x2_cc26x2: disable CCFG when building MCUboot chain-loaded images
The 'CCFG' (Customer Configuration) occupies 88 bytes in topmost flash
sector (8 KiB) and is by default always included in the final image.

This disables including CCFG part when building images for chain-loading
by the MCUboot bootloader.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-09-07 08:51:21 -05:00
Tim Lin 8a779fc706 ITE: drivers/i2c/target: Introduce I2C target transfer using PIO mode
Introduce I2C target transfer using the PIO mode. Add an option
"target-pio-mode" in the yaml file, determined by the DTS, to dictate
whether I2C target transfer uses the PIO mode.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-09-07 09:43:06 +02:00
Tim Lin 3ae9a358fb ITE: drivers/i2c/target: Disable the timeout setting
Disable the timeout setting when both the clock and data are
in a low state. This allows for I2C host clock stretching
without a timeout limit.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-09-07 09:43:06 +02:00
Richard Wheatley a92008c17d soc: arm: ambiq: apollo4: add simobuck init to apollo4 init
Adds comments and simobuck init function for low power.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2023-09-06 09:33:06 +02:00
Warren Buffer 09577b0a0e soc: Added support for EFR32MG12P433F1024GM68
Added devicetree and Kconfig for EFR32MG12P433F1024GM68, needed for
the BRD4170A radio board by Silicon Labs.

Signed-off-by: Warren Buffer <warren.buffer78@gmail.com>
2023-09-05 16:16:30 +02:00
Gerard Marull-Paretas 35479cccac soc: arm: atmel_sam0: common: bossa: add missing init.h
Because modules uses SYS_INIT, from init.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-05 12:19:04 +02:00
Vinayak Kariappa Chettimada 9ede8cd87e dts: nRF: Add missing headermask binding for NRF_CCM
Add missing headermask binding for NRF_CCM peripheral and
define HAS_HW_NRF_CCM_HEADERMASK Kconfig.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-05 10:04:57 +02:00
Adrian Warecki b26921d776 dai: intel: dmic: New functions for writing fir coefficients
Created set of new functions for configure fir coefficients with support
for packed format. This allowed to make the dai_dmic_set_config_nhlt
function simpler.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki 2452aaad50 dai: intel: dmic: Separate fir configuration code into function
All fir filters have an identical set of registers so their definitions
were combined to simplify the code. From the dai_dmic_set_config_nhlt
function, a duplicate piece of code responsible for configuring fir was
separated into a new function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki d7672af838 dai: intel: dmic: Combine PDM registers definitions
All PDM controllers have the same set of registers. Their definitions have
been merged to simplify the code.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Alberto Escolar Piedras d9c76e6fe1 native SOC: Add option to select CPU we target
Add a new kconfig option to select which embedded
CPU we are targetting.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-04 13:18:01 +02:00
Gerard Marull-Paretas 4747218837 soc: arm: ti_simplelink: cc13x2_cc26x2: compile power.c if PM_DEVICE=y
power.c contains some struct definitions required by the HAL when using
PM_DEVICE.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-04 12:22:55 +02:00
Sreeram Tatapudi 09a07e42c0 drivers: cat1: Updates to support latest version of HAL/PDL
- Refactoring to support latest versions of HAL/PDL

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-09-01 09:52:25 +02:00
Kai Vehmanen 5689916a70 soc: xtensa: intel_adsp: cavs: fix assert on L3_MEM_BASE_ADDR
The assert on L3_MEM_BASE_ADDR is incorrect, we need must convert
to uncached before use.

Fixes: ffd2121c65 ("soc: xtensa: intel_adsp: cavs: fix
  power_down_cavs() signature")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-31 17:43:47 -04:00
Adrian Bonislawski a026370461 drivers: hda: use interrupt for timing L1 exit on host DMA
To properly setup L1 exit timing this patch will use buffer interrupt
for HOST DMA and wait for Host HDA to actually start
First interrupt will clear all others.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-31 09:59:10 -04:00
Adrian Bonislawski b7e181c270 soc: intel_adsp: add HDA buffer interrupt functions
This will add functions to configure HDA buffer interrupts

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-08-31 09:59:10 -04:00
Adrian Bonislawski c6c6c5a5ed soc: intel_adsp: ace shim: add force L1 defines
This will add force L1 defines for svcfg registry

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-08-31 09:59:10 -04:00
Gerard Marull-Paretas c315c9b97c soc: arm: ti_simplelink: cc13x2_cc26x2: add support for sys_poweroff
Implement sys_poweroff() hooks, based on previous SOFT_OFF
implementation.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 14:42:26 +02:00
Almir Okato af3b04238e soc: espressif: adjust memory organization on linker
Adjust the memory organization to avoid overlapping
critical regions from bootloaders (MCUboot and IDF)

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-31 14:08:41 +02:00
Almir Okato e946a13fe1 soc: espressif: fix SOC series name macro on loader.c
Update macro CONFIG_SOC to CONFIG_SOC_SERIES.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-31 14:08:41 +02:00
Rahul Arasikere da55c26593 soc: arm: Add Kconfig option for SOC_STM32F765XX
Adds a new Kconfig menuchoice for the STM32F765xx series.

Signed-off-by: Rahul Arasikere <arasikere.rahul@gmail.com>
2023-08-31 10:21:25 +02:00
Dino Li 003e0be6fb it8xxx2/linker: append h2ram_pool section at the end of used memory
Since __sha256_ram_block section must in the first 4KB,
h2ram_pool section is no longer included first inside the
RAMABLE_REGION.
Append h2ram_pool section at the end of used memory, so gap
due to alignment is still available for newly added variables.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2023-08-31 10:20:17 +02:00
Gerard Marull-Paretas b459064ec1 soc: arm: st_stm32: wl: add support for sys_poweroff
Implement the hook for sys_poweroff based on the SOFT_OFF code. Note
that standby mode was a substate of SOFT_OFF, however, it was not
supported judging from defined DT states. It can be added later using
the STANDBY state.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 10:18:07 +02:00
Gerard Marull-Paretas 574360cba0 soc: arm: st_stm32: wba: remove redundant entry in pm_exit_post_ops
SOFT_OFF is not supported for this SoC, also, SOFT_OFF will never reach
the PM post ops.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 10:18:07 +02:00
Gerard Marull-Paretas d7a0b4fa93 soc: arm: st_stm32: u5: add support for sys_poweroff
Add support for the sys_poweroff hook, re-using code from the SOFT_OFF
state.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 10:18:07 +02:00
Gerard Marull-Paretas b97b17a4f5 soc: arm: st_stm32: wb: add support for sys_poweroff
Implement the sys_poweroff() hook. The hsem locking is not part of the
implementation, it doesn't seem necessary after
https://github.com/zephyrproject-rtos/zephyr/pull/42409 but I may be
wrong. Needs verification.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 10:18:07 +02:00
Gerard Marull-Paretas 643383b060 soc: arm: st_stm32: l4: add support for sys_poweroff
Convert SOFT_OFF handler to sys_poweroff hook.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 10:18:07 +02:00
Gerard Marull-Paretas 11242691cd soc: arm: st_stm32: l0: remove unsupported state
SOFT_OFF state (which translates to standby) doesn't seem to be
supported according to the L0 DT files. Also, by definition soft off
implies context loss, ie boot from scratch, but the implementation
expected a call to the PM exit hook.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-31 10:18:07 +02:00
Gerard Marull-Paretas cd97eae73b soc: xtensa: intel_adsp: common: s/device.h/init.h
soc.c was not using any device.h API, but init.h (SYS_INIT).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 14:43:01 +02:00
Gerard Marull-Paretas 6cdabb4dff soc: xtensa: intel_adsp: common: add missing section_tags.h
Needed by the `__imr` section tag.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 14:43:01 +02:00
Gerard Marull-Paretas c360284c6e soc: xtensa: intel_adsp: add missing init.h
Some files were using SYS_INIT without including init.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 14:43:01 +02:00
Gerard Marull-Paretas 00ff421129 soc: arm: nxp_imx: rt10xx: s/device.h/init.h
File was not using any device.h API, but init.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 11:53:50 +02:00
Gerard Marull-Paretas b3b8a19e02 soc: arm: nuvoton_npcx: common: s/device.h/init.h
File was not using any device.h API, but init.h (SYS_INIT).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 11:53:35 +02:00
Gerard Marull-Paretas 47fba91367 soc: riscv: telink_b91: add missing init.h, devicetree.h
File was including device.h for nothing, it needs init.h and
devicetree.h instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 11:51:57 +02:00
Kai Vehmanen ffd2121c65 soc: xtensa: intel_adsp: cavs: fix power_down_cavs() signature
The second argument 'uint32_t *hpsram_pg_mask' must be a cached
pointer and this needs to be reflected in function prototype.

Fixes sparse warning:
/zep_workspace/zephyr/soc/xtensa/intel_adsp/cavs/power.c:106:63:
warning: incorrect type in argument 2 (different address spaces)

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-30 10:22:45 +02:00
Kai Vehmanen a1d7ffdc37 soc: xtensa: intel_adsp: cavs: fix incorrect cached/uncached cast
Converting between cached and uncached aliases should have correct
sparse annotations. Fix following sparse warning:

/zep_workspace/zephyr/soc/xtensa/intel_adsp/cavs/power.c:97:53: warning:
incorrect type in argument 1 (different address spaces)

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-30 10:22:45 +02:00
Tristen Pierson 1f2180e8ff drivers: adc: adc_sam0: fix c20 and c21 reference not setting
drivers: adc: adc_sam0: fix c20 and c21 reference not setting

On c20 and c21 variants, the adc_sam0 driver is failing to honor the
enable-protected status of the REFCTRL register when writing the channel
config's reference into it. This causes the reference to never be set
when adc_sam0_channel_setup is called since the ADC is not disabled
prior to the write. Fix it by adding the
ADC_SAM0_REFERENCE_ENABLE_PROTECTED definition to the c20 and c21 soc.h
files. This effectively disables the ADC during writes to the REFCTRL
register, thus honoring the enable-protected behavior of this register.
I'm assuming ADC_SAM0_REFERENCE_ENABLE_PROTECTED exists for this type
of situation and therefore this was the approach taken. After making
the change, I was able to verify proper ADC readings by measuring
voltage on an ADC pin and observing correct values. Reverting back prior
to this change, running the same test yields reading 0's.

Fixes: #61975

Signed-off-by: Tristen Pierson <tpierson@bitconcepts.tech>
2023-08-30 10:21:15 +02:00