Commit graph

3414 commits

Author SHA1 Message Date
Daniel DeGrasse 6bcdcc3795 dts: nxp_imx: Add zephyr,memory-region attribute to memory regions
Add zephyr,memory-region compatible and attribute to SOC memory regions,
so that sections will be generated and MPU attributes can be applied.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-05 19:54:37 +01:00
Daniel DeGrasse 66f35b286c soc: nxp_imx: Add code to wait for second core boot in RT11xx
Use the messaging unit to ensure that the RT11xx dual core mode will
wait for the second core to boot successfully during early init

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-05 19:54:37 +01:00
Daniel DeGrasse 5992ae2a3d soc: rt11xx: Enabled multicore support with second image
RT11xx features CM4 core, which must be booted from CM7 core. Add
support for loading an image for the CM4 to RAM, and booting the CM4 core
from this image. Each image is built independently using sysbuild, and the
M4 image build produces built collateral with load address information the
M7 image can use to load it to RAM

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-05 19:54:37 +01:00
Daniel DeGrasse 755af99707 soc: rt1xxx: allow linking code to OCRAM region
Allow linking code into OCRAM region when building for RT1xxx SOCs. This
can be used on the RT11xx dual core SOCs as a shared memory region, when
the M7 core needs to load code into a region accessible to the M4 core.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-05 19:54:37 +01:00
Glauber Maroto Ferreira 2cbc3f4f99 pm: esp32c3: system power management
Adds initial system power management support.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira aba71499a9 soc: esp32c3: set RTC registers to known state
Low-power management is part of the RTC peripherals' domain
on ESP32C3. This dependency implies the need to bring some RTC
registers to a known state, during system initialization, to
achieve proper low-power handling.

The RTC slow memory region is also delimited and used during
power domain options selection.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira 063d94c0ec pm: esp32s2: system power management
Adds initial system power management support.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira 204bf27824 soc: esp32s2: set RTC registers to known state
Low-power management is part of the RTC peripherals' domain
on ESP32S2. This dependency implies the need to bring some RTC
registers to a known state, during system initialization, to
achieve proper low-power handling.

The RTC slow memory region is also delimited and used during
power domain options selection.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira bf65685a83 pm: esp32: system power management
- Adds initial system power management support.
- Adds option to add extra delay when waking from
deep sleep.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira a92bbb2d19 soc: esp32: set RTC registers to known state
Low-power management is part of the RTC peripherals' domain
on ESP32. This dependency implies the need to bring some RTC
registers to a known state, during system initialization, to
achieve proper low-power handling.

The RTC slow memory region is also delimited and used during
power domain options selection.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira f0b4eb5557 soc: esp32x: replace STATUS by int
Replace 'STATUS' by 'int' in extern function
signatures.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Johann Fischer 0f6e2ba7cd soc: expand ifdef by adding new Kconfig option UDC_KINETIS
Expand ifdef by adding new Kconfig option UDC_KINETIS as
preparation for USBFSOTG UDC driver.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-02 12:55:18 +01:00
Tim Lin ad2dc064a7 ITE: soc: it81xx2: Add new variant of it81xx2cx related configuration
Add new variant configuration of it81202cx and it81302cx.
This cx variant of it81xx2 changes are as follows:
1. SRAM size will increase from 60k to 128k.
2. Configurable ILM size is still 60k.
3. Support M extension of RISC-V.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-12-02 11:29:00 +01:00
Carlo Caione cc427b4bb0 cache: Fix libraries and drivers
Fix the usage to be compliant to the new cache API.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-12-01 13:40:56 -05:00
Carlo Caione 189cd1f4a2 cache: Rework cache API
The cache operations must be quick, optimized and possibly inlined. The
current API is clunky, functions are not inlined and passing parameters
around that are basically always known at compile time.

In this patch we rework the cache functions to allow us to get rid of
useless parameters and make inlining easier.

In particular this changeset is doing three things:

1. `CONFIG_HAS_ARCH_CACHE` is now `CONFIG_ARCH_CACHE` and
   `CONFIG_HAS_EXTERNAL_CACHE` is now `CONFIG_EXTERNAL_CACHE`

2. The cache API has been reworked.

3. Comments are added.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-12-01 13:40:56 -05:00
Tomasz Leman 8e9a01d96a intel_adsp: ace: power header update
This patch is replacing hardcoded register address with one taken from
device tree.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-11-30 17:46:17 -05:00
Sylvio Alves 2bfc4451cf linker: esp32: fix IRAM length for mcuboot
When MCUBoot is enabled, IRAM region needs to be set
to a smaller value to avoid overlapping. This shall be re-worked
when MCUboot build for ESP32 is performed in Zephyr environment.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-11-30 13:40:10 +01:00
Manuel Arguelles 10c9e40566 soc: nxp: s32ze: add option to select RTU index
Add a hidden Kconfig option to select the index of the target RTU
(Real-Time Unit) subsystem. This index can be used by peripheral
drivers, for example, to know the peripheral instance index since the
HAL is index-based.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-11-30 11:29:39 +01:00
Jay Vasanth 38ad230aec drivers: pinctrl: Microchip XEC PINCTRL add invert pin
Microchip XEC GPIO pins support inverting the output of
alternate pin functions. This feature may be useful for
those peripherals that do not implement output inversion
in the peripheral. GPIO control register pad input and
parallel input register values are not affected by the
function output invert feature. GPIO interrupt detection
of an output is inverted if the invert polarity is enabled.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-11-30 11:29:22 +01:00
Emilio Benavente 1e540f965f soc: lpcxpresso55S36 added PowerInit in clock_init.
Added a missing SDK function POWER_PowerInit
to the clock_init function of the soc in lpc55S36.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2022-11-30 11:29:12 +01:00
Ettore Chimenti 21a6bb3d2d dts: arm: st: add STM32F302xC device tree
Add ST Micro STM32F302xC family of microcontrollers.

Signed-off-by: Ettore Chimenti <ek5.chimenti@gmail.com>
2022-11-29 09:15:12 +00:00
Wei-Tai Lee b055e3ca23 soc: riscv: andes_v5: Fix system initialization for L2C
- Put L2C init level in pre_kernel_2 to wait for syscon driver
- Check if SMU exists when preprocessing

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-11-29 09:50:05 +01:00
Arsen Eloglian 3659c2db4b intel_common: clean up & rename cavs_* to adsp_*
ADSP common definitions has been fixed
and changed from CAVS_* to  ADSP_*

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-11-28 17:45:20 -05:00
Evgeniy Paltsev d2488d2160 ARC: control shared (common) interrupts via IDU
Control shared interrupts enabling/disabling via IDU.
With that we can easily enable and disable them for all cores
in one place.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-11-28 17:44:54 +01:00
Maciej Zagrabski 1cf65ac47a soc: stm32u5: Replace IMGTOOL_ARGS with ROM_START_OFFSET
EXTRA_IMGTOOL_ARGS is used to set additional options by the user.
Any user change will overwrite this option, which
is unintuitive.
Also option ROM_START_OFFSET will be overwritten which is also unintuitive.

Replace hardcoded config option MCUBOOT_EXTRA_IMGTOOL_ARGS
with proper config ROM_START_OFFSET.

Signed-off-by: Maciej Zagrabski <mzi@trackunit.com>
2022-11-28 15:38:45 +00:00
Marc Herbert 57ea358afc intel_adsp: strip rimage main.mod when CONFIG_BUILD_OUTPUT_STRIPPED
Be consistency with zephyr.strip

This will help with reproducibility issues like the one in
https://github.com/thesofproject/sof-bin/pull/106

Use the `strip_command` introduced by commit c060b075a6 ("cmake:
toolchain: bintools abstraction")

boot.mod is already deterministic because it has no debug symbols; no
need to strip it.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-11-28 10:00:50 -05:00
Marcin Szkudlinski eb280f80e6 mtl: drv: avoid compilation warnings in ace/power.c
SOF compilation is sensitive to compilation warnings
Some simple and neutral changes to avoid them

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-26 05:46:08 -05:00
Marcin Szkudlinski 0f067896a6 mtl: drv: move ACE specific procedures to ace directory
IMR save and restore context is a flow implemented for ACE
move boot specific procedures to ace subdir

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-26 05:46:08 -05:00
Przemyslaw Blaszkowski 67791ddd70 soc: xtensa: ipc: unmask intc for core 0 only
In ACE architecture, only core 0 should receive IPC interrupts from host.
Unmasking secodnary core IPC interrupts was causing race condition in
ipc irq handler after enabling secondary core.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2022-11-25 06:37:03 -05:00
Fabio Baltieri b1d1f442cc xtensa: linker: add missing snippets-sections to ace-link.ld
The linker script for intel_adsp ace was missing the
snippets-sections.ld include, causing it to ignore any custom section
defined in with cmake zephyr_linker_sources().

Adding it in the same location as it's done in xtensa-cavs-linker.ld.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-11-24 16:37:49 +01:00
Arsen Eloglian 54c76ea7c1 soc: intel_adsp: adsp_shim: DfPMCCH definition
Add DfPMCCH block definition for mtl ACE platform

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-11-22 20:03:06 -05:00
Manuel Arguelles 53e1ea58e0 soc: nxp_s32: update baremetal drivers version
HAL for NXP S32 is updated to a newer version, hence some headers and
macro definitions must be updated accordingly.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-11-21 09:18:13 -06:00
Daniel DeGrasse 54ea741a65 soc: arm: nxp: use zephyr,chosen flash node for RT5xx flash base address
Update rt5xx base address calculation to use the zephyr,chosen flash node
to determine flash base address. Note that due to the external flash
controller, the flexSPI base address must be used when the flash device
is on the flexSPI bus.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-21 13:03:26 +01:00
Daniel DeGrasse b455492b1b soc: arm: nxp: use zephyr,chosen flash node for RT6xx flash base address
Update rt6xx base address calculation to use the zephyr,chosen flash node
to determine flash base address. Note that due to the external flash
controller, the flexSPI base address must be used when the flash device
is on the flexSPI bus.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-21 13:03:26 +01:00
Carles Cufi 4796ffee7a drivers: mm: Move mm_drv_intel_adsp_mtl_tlb to zephyr/
This file was mistakenly placed in include/ instead of include/zephyr.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-11-21 20:43:50 +09:00
Marcin Szkudlinski c01a8c8807 mtl: soc: store power gating state in D3 state
Power gating register must be stored when CPU is in
power off state

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-18 13:00:04 -05:00
Marcin Szkudlinski 1631d2dc2d mtl: soc: add context save and restore flow
Context save is saving whole memory to persistent
memory area, than turning off memory and CPU
Context restore is a modified boot flow, where
the previously saved context is restored

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-18 13:00:04 -05:00
Marcin Szkudlinski c929bbcc58 mtl: dts: add L3 memory definitions macros
Add helper macros for l3 memory definitions from
the Device Tree

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-18 13:00:04 -05:00
Emilio Benavente 1374415a2c soc: Updated clock_init in rt6xx
Updated the clock_init function to the latest sdk
and added a safe initialization for the flash setup

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2022-11-17 13:59:39 -06:00
Emilio Benavente a3e3cbc3f9 soc: Setup up Kconfigs for safe flash code to load in SRAM
Added a selecion on rt6xx that allows the loading of
the safe flash clock initialization to be inside SRAM
if the user code is being executed from flash.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2022-11-17 13:59:39 -06:00
Emilio Benavente 9a2fa8d9c0 soc: Add safe flash clock support for MXRT685
Added Safe flash clock setup files for rt6xx

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2022-11-17 13:59:39 -06:00
Daniel DeGrasse 1ed776a218 soc: arm: imx_rt10xx: call CMSIS SystemInit at early boot
Call CMSIS SystemInit at early platform boot, to ensure that registers
are configured correctly on RT10xx series.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-17 11:53:42 -06:00
Tomasz Leman f246d9540c intel_adsp: ace: power: ipc procedure update
This patch updates ipc response procedure in power down function. New
flow is only limited to the writs into two registers. We need to clear
the IPCxIDD register in case if its contains any leftovers from a
previous responce. And then write a response to the IPCxIDR.

To prepare response we need to copy incoming request and then mark it as
replay. New message with IPC Busy bit set is then send to host.

The reason for this is a change in the behavior of the IPC driver
compared to how it worked when this function was originaly implemented.
The biggest difference are enabled interrupts in register IPCxCTL.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-11-17 11:19:50 +01:00
Henri Xavier 5de23dab59 boards/arm64: Add QEMU Virt KVM support
Zephyr already has an AArch64 QEMU Virt TCG board.
We add a KVM version of it.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
2022-11-17 11:16:08 +01:00
Flavio Ceolin e3aac24821 xtensa: linker: Use zephyr's convention for rodata
Zephyr maps start/end of rodata section with variables
using __rodata_region namespace. The exception was Xtensa.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-11-17 15:44:48 +09:00
Nikolay Agishev 6e215ce6af boards: nsim_hs: Add separate config for XIP memory organization
Add XIP support with MWDT toolchain. To have it proper tested
add separate nsim platforms for XIP (flash + sram) and
non-XIP (sram) memory organization in addition to existing
nsim_hs platfor with CCMs (ICCM + DCCM) memory organization.

This PR also enables MPU for all nsim hs3x based platforms
(like we previously enabled it for qemu_arc_hs) to have proper
memory regions permissions.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2022-11-16 11:18:51 +01:00
Johan Hedberg 1d3e1c7778 soc: x86: Used fixed BDF values for early serial
Since DTS doesn't contain the BDF anymore (it's looked up at runtime),
hardcode the BDF value for the use of early serial.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2022-11-16 11:18:43 +01:00
Daniel DeGrasse e274fbe3f9 soc: lpc54114: update multi core support for LMA address offset
Update lpc54114 support to use LMA address offset instead of linking
secondary core image into primary core memory. This will allow support
with sysbuild to be enabled. Additionally, use partitions to select where
the secondary core image will be located in flash

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Daniel DeGrasse fadd86d3e2 boards: lpcxpresso55s69: use LMA adjustment for second core
Use LMA adjustment building dual core image with LPC55s69. The load
address adjustment allows the second core image to be flashed onto the chip
by the debugger, into the secure region of the LPC flash.

Additionally, remove the build dependency that was enforced by the SOC.
This requirement to build the secondary core image first can be enforced
by the project itself, instead of the core.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Kumar Gala fb351a63e8 soc: xtensa: intel_adsp: ace: Rework setting soc_num_cpus
Move setting soc_num_cpus into its own SYS_INIT function such
that we can ensure it happens as one of the first things.  We
need soc_num_cpus set before soc_mp_init is called but also before
interrupt controller init functions might be called.

Also, by having it in its own function, it ensures that
soc_num_cpus gets set regardless of how CONFIG_MP_MAX_NUM_CPUS
is set.  Since if CONFIG_MP_MAX_NUM_CPUS=1, we do not call
soc_mp_init().

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-11-15 07:02:37 -05:00
Marcin Szkudlinski 6f3e0babb3 intel_adsp: include toolchain.h in adsp_memory.h
\MTL SOF is not compiling when
8d0eb6ce10
(devicetree: remove deprecated DT_CHOSEN_*_LABEL macros)
is applied
Fix - zephyr/toolchain used to be included by
devicetree/zephyr.h. The file has been removed by 8d0eb6ce10
Include is needed for ALWAYS_INLINE macro

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-14 14:27:01 -05:00
Jay Vasanth 4ce502777b soc: arm: mec1501: add debug interface configuration
Move regs configuration from previous pinmux.c to soc layer.
This involves the debug interface, configuring the GPIO bank power
and the test clock out pin.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-11-10 22:39:43 -05:00
Daniel DeGrasse b53eaf1f24 soc: nxp_imx: include fsl_flexspi_nor_boot when boot header is present
Only include fsl_flexspi_nor_boot when a boot header is present,
as this is the only case where the boot header data will be required.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-10 09:11:08 -06:00
Tim Lin fa751b8472 ITE: soc: chip_chipregs: Add SPISC register structure
Use spisc_it8xxx2_regs instead of IT83XX_SPI_*** registers declaration
to fix in cros_shi_it8xxx2.c

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Tim Lin 0789442132 ITE: soc: chip_chipregs: Access registers using structure method
Access registers using structure method.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Tim Lin b3f46ccaec ITE: cleanup: soc: chip_chipregs: Rename the structure name of register
Rename the structure of flash_it8xxx2_regs to smfi_it8xxx2_regs.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Tim Lin 2937beb085 ITE: cleanup: soc: chip_chipregs: Remove unused registers
Remove unused registers.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
William MARTIN 9aaeeb25d1 soc: arm: st_stm32: stm32f0: Add support for stm32f030x6
This commit adds the soc config for the STM32F030X6.

Signed-off-by: William MARTIN <william.martin@power-lan.com>
2022-11-09 10:43:41 +01:00
Hubert Miś dc9d479dea ipc: add a multi-endpoint feature to icmsg
The icmsg backend for ipc_service has a limitation of supporting only
on endpoint. This limitation is acceptable for many IPC instances.
However, some require to use multiple endpoints sharing a single
instance. To preserve the simple and the most efficient single-instance
backend, a separated backend is introduced implementing a wrapper
around icmsg core which adds multiple endpoints support.

There are two multi-endpoint ipc_service icmsg backends: one in the
initiator role, and the other one in the follower role. In a IPC
configuration one end of communication must be in the follower role
while the other one is in the initiator. The initiator initiates
an endpoint discovery handshake to establish enpoint identifiers for
requested endpoint names. The follower responds to requests sent by
the initiator.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2022-11-09 10:41:43 +01:00
Kevin Townsend 9566e9704b boards: arm: mps2_an521: Resize _remote and _ns
The `mps2_an521_remote` and `mps2_an521_ns` targets have the same
memory layout for code and ram, meaning that you can't use TF-M
(`mps2_an521_ns`) and the second core (`mps2_an521_remote`) at the
same time.

This commit updates the memory map of the `_ns` build targets as
follows:

- Reduces the code memory region from 1 MB to 512 KB, maintaining the
  existing base memory address of `0x0010 0000`
- Maintains the existing 512 KB ram memory at `0x2810 0000`

It updates the `_remote` target as follows:

- Reserves 468 KB code memory at address `0x0038 B000`
- Reserves 512 KB ram memory at address `0x2818 0000`

This ensures that the code region for the `_remote` target doesn't
overlap with the code region used by the single flash image layout
defined upstream in TF-M, which the `_ns` target is based upon.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-11-08 10:57:35 -05:00
Adrian Bonislawski 728506df6f soc: intel_adsp/ace: wait for lpsram power up
Wait for lpsram power up before bbzero

Fixes commit 195db14

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-11-08 10:48:30 +01:00
Adrian Bonislawski 7e0c1a81cb soc: intel_adsp/ace: remove z_delay from hpsram init
No delay needed here, at init time fw can boot as soon as possible

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-11-08 10:48:30 +01:00
Tomislav Milkovic c79ac5152b soc: arm: st_stm32: stm32l4: add support for L486 and L4A6
Add support for STM32L486 and STM32L4A6 families

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-11-08 10:46:16 +01:00
Kumar Gala e3e24b266d soc: xtensa: intel_adsp: ace: Fix build when CONFIG_MP_NUM_CPUS=1
When CONFIG_MP_MAX_NUM_CPUS=1, which it does for some tests, we will
get compiler warnings with soc_adsp_halt_cpu(), so only build it
when CONFIG_MP_MAX_NUM_CPUS > 1.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-11-07 21:12:54 -05:00
Kamil Serwus cad62fae61 soc: atmel: add base support for C2x SOC
Adds Atmel SAMC20 and SAMC21 soc. C series is based on Cortex-M0+.
C21 contains CAN interface.

The init routines are same for SAMC20 and SAMC21. They use one
clock OSC48M without configuration.

The code is inspirated from atmel_sam0/samd21.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>
2022-11-04 16:03:01 +01:00
Kamil Serwus 9f5edfbc55 soc: arm: atmel: Add revisions to soc
Some SAM0 contains revisions with separated includes for example
SAMC21 and SAMC21N.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>

Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-11-04 16:03:01 +01:00
Kumar Gala a574957c74 soc: xtensa: intel_adsp: ace: set number of cpus at boot
We look at the Intra DSP communications capability register (DFIDCCP)
to determine the number of cores.  There might be a better way to
determine the number of cores, but this works for now.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-11-03 16:43:53 -04:00
Kumar Gala 6bdd91e9b1 soc: Add ability for SOC to specify runtime CPU detection
Add Kconfig SOC_HAS_RUNTIME_NUM_CPUS symbol that an SoC can
set to specify that it supports determining the number of CPUs
at runtime.

On xtensa add support for SOC_HAS_RUNTIME_NUM_CPUS and expose
soc_num_cpus that the SoC code should set early in boot as the
means to expose the number of cpus.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-11-03 16:43:53 -04:00
Ederson de Souza e98a748ad2 soc/xtensa/intel_adsp/cavs: Support for code relocation
Basically:
  - Name RAMABLE_REGION as "RAM";
  - Insert the relocation hooks for gen_relocate_app.py.

Also, to help with "rimage" peculiarities, `fix_elf_addrs.py` changed to
not copy empty sections to output, as this would prevent someone trying
to move all of some section (such as BSS) to a different location and
reuse the platform linker script - which would generate an empty section
anyway.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-03 10:25:07 +01:00
Ederson de Souza 06990e69d6 soc/xtensa/intel_adsp/cavs: Expose linker script on include
This way, applications can reuse it by simply including it in their
custom linker scripts.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-03 10:25:07 +01:00
Ederson de Souza 8ac6f74a7d arch/xtensa: Enable code relocation
Besides adding ARCH_HAS_CODE_DATA_RELOCATION, this patch also adds
support for the "sample_controller" SoC (used by qemu_xtensa) as
demonstration.

As Xtensa lacks a common linker script at the arch level, enabling it
for each platform will be a piecemeal effort. This patch adds it to the
`soc/xtensa/sample_controller` SoC. Basically, default RAMABLE_REGION is
set to be called "RAM", and hooks are inserted so that
gen_relocate_app.py can add the relevant linker bits.

Also, `tests/application_developent/code_relocation` was tweaked to
support the qemu_xtensa platform. Basically, add the relevant linker
script and ensure that relevant memory regions have their program header
(PHDR) associated.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-03 10:25:07 +01:00
Ederson de Souza fb26f18ae1 soc/xtensa/sample_controller: Expose linker script on include
This way, applications can reuse it by simply including it in their
custom linker scripts.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-03 10:25:07 +01:00
Ederson de Souza d7f46136e0 soc/xtensa: Use standard __data_start/__data_end markers
Xtensa is the odd one out by using _data_start/_data_end instead. Using
the Zephyr standard helps avoid ifdefs for common code, like tests.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-03 10:25:07 +01:00
Marcin Niestroj adfc705b51 ARM: nxp_imx: rt10xx: migrate ARM, AHB and IPG dividers to DT
Those dividers were configured in Kconfig so far. Add 'arm-podf',
'ahb-podf' and 'ipg-podf' "fixed-factor-clock" compatible DT child nodes
under 'ccm' (Clock Control Module) and use configured 'clock-div' values
instead of Kconfig equivalents.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-11-02 17:17:27 -05:00
Jaska Uimonen 1f6d6deaef sparse: fix sparse warnings found in sof compilation
Add proper sparse_force cast to assigments into sparse_cache pointers.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-11-02 14:34:20 -04:00
Kai Vehmanen af5fb91a6c soc: intel_adsp: ipc: Do not send message until previous one is acked
Fix a bug where an IPC message is sent while the peer/host ack for
the previous message has not yet been processed. There is existing
logic to check 'idr' INTEL_ADSP_IPC_BUSY bit, but this leaves
the following race:

 - DSP: msg A sent by DSP to host
 - HOST: IRQ, msg A acked, host sets DONE bit -> ADSP_IPC_BUSY cleared
 - DSP: msg B sent by DSP to host, IPC_BUSY is clear so proceeding to send
	-> e.g. 'devdata->sem' is reset --> BUG!
 - DSP: IRQ, msg A done
	-> e.g. call to 'sem_give(&devdata->sem)' which is wrong as
	   the semaphore was just reset in previous step for msg B

Add additional state to track handling of the acks. This allows
to postpone sending message B (in above example), until message A
is fully processed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-11-02 14:33:20 -04:00
Erwan Gouriou 46a09b308e soc: stm32wb: Set BT_USER_PHY_UPDATE as supported
STM32WB Controller supports application to initiate the "PHY Update
Procedure" (BT_USER_PHY_UPDATE) while it doesn't support it to be
automatically triggered on connection establishment (BT_AUTO_PHY_UPDATE).

Default BT_USER_PHY_UPDATE to true, which automatically defaults
BT_AUTO_PHY_UPDATE to false.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-11-02 11:11:10 +02:00
Kumar Gala 0a7c25e649 drivers: timer: intel_adsp: Update driver to use dts Kconfig symbol
Update Intel ADSP timer driver to use DT_HAS_<compat>_ENABLED Kconfig
symbol to expose the driver and enable it by default based on
devicetree.

We remove setting 'default y' for the timer driver in
Kconfig.defconfig.series as that is now handled in the driver Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-11-01 09:03:17 +00:00
Kumar Gala 117039ca2b IPM: remove defconfig/proj setting of IPM drivers
Now that IPM drivers are enabled based on devicetree we can
remove any cases of them getting enabled by Kconfig, *defconfig*,
and *.conf files.

We need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-31 16:45:56 -05:00
Jay Vasanth d0fe965b9f drivers: espi_saf: Add Microchip MEC172x eSPI SAF version 2 driver
Microchip MEC172x has a modified eSPI SAF hardware implementation.
Hardware changes include multiple clock dividers for each SPI
flash device and data transfer using QMSPI local DMA.
espi reset interrupt is made a higer priority in MEC172x devicetree
because espi reset event resets all espi hardware and we don't
to want to service any other espi interrupt blocks when espi reset
occurs.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-10-28 14:29:46 -05:00
Jay Vasanth d32d1eb966 soc: microchip_mec: Prepare for MEC172x SAF version 2
Microchip MEC172x eSPI SAF has significant hardware changes
requiring a new SAF configuration structure. In preparation
for the MEC172x we move the current SAF header out of common
to the MEC1501 subfolder, remove an unused and empty common
header and remove includes of the moved headers from MEC172x.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-10-28 14:29:46 -05:00
Jay Vasanth 0976343513 drivers: SPI: MEC172x QMSPI clock fix
Microchip MEC172x QMSPI expanded its clock divider register
field from 8 to 16 bits. QMSPI source clock is on the fast
peripheral domain therefore get the frequency from the clock
control driver.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-10-28 14:29:46 -05:00
Kumar Gala f8fba49a41 soc: xtensa: intel_adsp: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus() and build checks
to use CONFIG_MP_MAX_NUM_CPUS.  This is to allow runtime
determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-26 12:00:53 +02:00
Kumar Gala 0ce0f43b36 soc: xtensa: esp32: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus().  This is to allow
runtime determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-26 12:00:45 +02:00
Kumar Gala 9387d8689b soc: xtensa: esp32: Add CONFIG_SMP protection
Add #ifdef CONFIG_SMP around code that only needs to exist when
SMP is enabled.

Also include ksched.h to get decleration of z_sched_ipi.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-26 12:00:45 +02:00
Kamil Serwus c707f1ed28 drivers: adc: sam0: fix compliation for feature SAMs for C21.
C21 doesn't have ADC_REFCTRL_REFSEL_AREFB and have different APBs.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>
2022-10-25 15:48:13 -07:00
Andrei Emeltchenko 42b6af2ee8 soc: raptor_lake: Cleanup CMakeLists
Cleanup CMakeLists fixing error message:
...
No SOURCES given to Zephyr library: soc__x86__raptor_lake
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-10-25 09:50:15 -05:00
Yinfang Wang b2fe7045d1 soc: x86: Add Raptor Lake SoC definition
Add a basic definition for the Raptor Lake SoC.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-10-25 09:51:37 +03:00
Peter Marheine ab2515ad26 it8xxx2: support relocating ISR code to RAM
IT8xxx2 uses a relatively slow SPI flash for ROM with a small 4k
I-cache. As a result in large or busy applications, instruction fetch
can be very costly due to I-cache misses. Since exception handling code
is some of the hottest code in most applications, add an option (enabled
by default) causing that code to execute out of RAM in order to improve
performance.

This is very similar to exception section placement on XIP niosii
platforms (which has similar motivation), but can still be disabled by
configuration.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2022-10-21 20:31:47 +02:00
Peter Marheine d37f496ee7 it8xxx2: allow placing arithmetic functions in ILM
These functions are small and may be very hot depending on the workload,
so are usually a good choice to execute from RAM.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2022-10-21 20:31:47 +02:00
Peter Marheine d4549ed808 it8xxx2: generalize ILM support
Executing code out of RAM on IT8xxx2 requires that the relevant
addresses be mapped onto the CPU's instruction memory bus, referred to
by ITE documentation as Instruction Local Memory (ILM). ILM mappings
configure blocks of RAM to be used for accesses to chosen addresses when
performing instruction fetch, instead of the memory that would normally
be accessed at that address.

ILM must be used for some chip features (particularly Flash
self-programming, to execute from RAM while writing to Flash), and has
historically been configured in the Flash driver. The RAM for that was
hard-coded as a single 4k block in the linker script.  Configuring ILM
in the flash driver is confusing because it is used by other SoC code as
well, currently in code that cannot depend on the Flash being functional
or in hand-selected functions that seem performance-critical.

This change moves ILM configuration to a new driver and dynamically
allocates RAM to ILM in the linker script, allowing software use of the
entire 64k RAM depending on configuration.  This makes ILM configuration
more discoverable and makes it much easier to correctly support the
CODE_DATA_RELOCATION feature on this SoC.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2022-10-21 20:31:47 +02:00
Peter Marheine 1b931af0ff it8xxx2: fix build with CONFIG_SOC_IT8XXX2_PLL_FLASH_48M=n
The chip I2C driver uses chip_get_pll_freq(), so that function needs to
be built even when the PLL configuration is not changed at boot.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2022-10-21 20:31:47 +02:00
Kumar Gala a1195ae39b smp: Move for loops to use arch_num_cpus instead of CONFIG_MP_NUM_CPUS
Change for loops of the form:

for (i = 0; i < CONFIG_MP_NUM_CPUS; i++)
   ...

to

unsigned int num_cpus = arch_num_cpus();
for (i = 0; i < num_cpus; i++)
   ...

We do the call outside of the for loop so that it only happens once,
rather than on every iteration.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-21 13:14:58 +02:00
Lauren Murphy 938b9533c7 intel: adsp: cavs: fix NO_OPTIMIZATION boot failure
Fixes boot failure on CAVS platforms with
CONFIG_NO_OPTIMIZATIONS=y by moving z_soc_mp_asm_entry
into .text linker section to ensure it is copied to
SRAM.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-10-20 18:53:04 -04:00
Andrey Borisovich 56e1c5061d soc: ace: add external IPC completion to ipc done handler
Sometimes IPC message acknowledgement should be done by external
code to provide sufficient timing (example assemble code related
to powering down). Added bool return type to ipc message done handler
that if callback function returns true, IPC API skips writing
IPC message completion bits.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-10-20 18:52:42 -04:00
Anas Nashif ad05e79598 intel_adsp: mem_window: fix definition of memory windows
Fix wrong calculation of memory window sizes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-10-20 18:52:13 -04:00
Tomasz Leman ed5abc9f71 ace: power: fix d0i3 restore
The restore vector after power gating was configuring the MEMCTL register
incorrectly. This caused an FW crash during the cache prefetch.

Additionally, since lp sram cache issue was fixed, xtensa hal function
can be replace with zephyr equivalent.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-10-20 18:00:26 -04:00
Jun Lin 82a887c98d driver: eSPI: npcx: support multiple bytes mode for Port80
eSPI PUT_IOWR_SHORT protocol can send 1/2/4 bytes of data in a single
transaction. This allows the host to send max 32-bits Port80 code
at one time. This CL sets bits OFS0_SEL~OFS3_SEL in the DPAR1 register
to let the EC hardware put the full Port80 code to DP80BUF FIFO.
It also groups the N-byte code into a single 32-bits variable when
necessary by analyzing the offset field in the DP80BUF register.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-10-20 15:41:22 +02:00
Michal Sieron 6423e7db38 soc: arm: eos_s3: Use frequency from Kconfig to configure main clock
Allows applications to use other frequencies than 60 MHz.
For example 48 MHz for USB communication with usbserial driver.

Signed-off-by: Michal Sieron <msieron@antmicro.com>
2022-10-20 15:41:09 +02:00
Kumar Gala fc95ec98dd smp: Convert #if to use CONFIG_MP_MAX_NUM_CPUS
Convert CONFIG_MP_NUM_CPUS to CONFIG_MP_MAX_NUM_CPUS as we work on
phasing out CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00