Commit Graph

906 Commits

Author SHA1 Message Date
Manuel Arguelles 79ba797c46 s32ze: patch PIT header to build with MCUX
Rename the PIT struct from TIMER to CHANNEL so that the MCUX PIT driver
can be reused for S32Z.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-27 14:20:23 -05:00
Manuel Argüelles 6018baee13 s32ze: add PIT definitions for MCUX
Add RTU.PIT module features and definitions for S32Z27.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-27 14:20:23 -05:00
Manuel Arguelles 4efff44261 s32ze: support building with MCUX drivers
Introduce necessary glue code and definitions to build MCUX with S32Z27
devices so that we can leverage existing shim drivers for common NXP hw
blocks.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-27 14:20:23 -05:00
Dat Nguyen Duy 6d91c1727d s32: add support DTCM backdoor for DMA transfer
On S32K344 device, there is a backdoor of DTCM that can be
used by the DMA. At application, the source/destination
address and the TCD can be put in to dtcm, then the DMA
driver will access them over backdoor

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-27 08:54:35 -05:00
Dat Nguyen Duy f69b5e5c31 s32: build mcux dma3/dmamux driver
Define memory map and configure DMA/DMAMUX features for S32K344.
Note that for compatible with mcux dma3 driver:

 - Increasing DMA channel from 32 to 148 in which 12 --> 127
   are offset channels. Due to this, the memory map need to
   be redefined

 - Rename some macros, those's value inherited from RTD's
   definition

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-27 08:54:35 -05:00
Dat Nguyen Duy 7da33f60b9 mcux: include dma3 driver
This update is to include the dma3 driver

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-27 08:54:35 -05:00
Declan Snyder 9189572c5a hal_nxp: Include enet driver if using enet
Zephyr ENET driver uses HAL ENET driver.

Also remove duplicate MCUX ENET inclusion.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-09-26 16:27:23 -05:00
Fabio Baltieri 8cc344e909 CMSIS: AArch64: avoid redefining MPIDR_AFFLVL_MASK
There's already a definition of this register in the main repo code
base, add a guard around it so it does not get redefined, fixes a build
warning.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-20 08:59:11 -05:00
Manuel Argüelles 596ea205a5 s32k344: patch Icu/Wkpu config
Patch Icu/Wkpu tool-generated configuration for S32K344 SoCs to
integrate with Zephyr's WKPU interrupt controller shim driver.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-19 11:35:44 -05:00
Manuel Argüelles 35b6203a71 s32k344: add Icu/Wkpu SoC config
Add tool-generated code for Icu/Wkpu driver on S32K344 SoCs.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-19 11:35:44 -05:00
Manuel Argüelles 7e062ab91a s32k3: add Icu/Wkpu driver
Add sources for Icu/Wkpu baremetal driver.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-19 11:35:44 -05:00
Manuel Argüelles 9eda94aaaf s32: enable clock control driver for S32ZE
Enable clock control driver for S32ZE SoCs.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-19 11:24:40 -05:00
Mahesh Mahadevan a87e6a8ba3 cmake: Update hal_nxp to account for driver restructuring
The flexcomm and flexio driver structure has changed to
include sub folder for the individual component drivers.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-09-19 08:13:04 -05:00
Mahesh Mahadevan 927f0a3792 README: Update patch list
Delete patches that have been added to SDK 2.14 release

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-09-19 08:13:04 -05:00
Mahesh Mahadevan 19abd5cc57 mcux-sdk: drivers: Add local changes to the CAAM driver
Move used job descriptors in the CAAM driver from the stack to
noncacheable section.
This change has not been accepted by the SDK team and needs to
be maintained here.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-09-19 08:13:04 -05:00
Mahesh Mahadevan 26270d7cbd mcux-sdk: drivers: Adding zephyrisms to fsl_common.h
This will not get merged into the SDK repo and will have to
be maintained here.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-09-19 08:13:04 -05:00
Mahesh Mahadevan f9f0944bc2 mcux-sdk: Update to SDK 2.14
Update to SDK 2.14

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-09-19 08:13:04 -05:00
Jiafei Pan 8f69c05347 cmake: change to use Core_AArch64 for Cortex-A AARCH64
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-09-15 06:34:38 -05:00
Gerard Marull-Paretas c81bf4ae09 mcux-sdk: do not expose internally used KB define
The KB define is unnecessarily polluting the namespace (clashes with
zephyr/sys/util.h definition) since it is only used once in a source
file. To fix the problem, definition has been moved to the source file.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

Rebased to Core_AArch64.

Signed-off-by: Jiafei Pan <jiafei.pan@nxp.com>
2023-09-15 06:34:38 -05:00
Jiafei Pan 830764171e CMSIS: Core_A: gic_v3: all SPI use non-secure group1
In general, group0 is used by secure el3, so use non-secure group1
for all SPI interrupts.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 77587a376e CMSIS: Core: cmsis_gcc: add likely/unlikely macro
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 2b3516bbff CMSIS: AArch64: core_ca55: include the core_common.h
Includes the AArch64 common header file to avoid duplicate code.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Jiafei Pan c3ae7a36ac CMSIS: add Cortex-A55 Core support
And Core header file for Cortex-A55 Core.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 39db45087c CMSIS: AArch64: gic_v3: move the CPU interface enable to the last step
Refine the CPU interface initialization sequence according to the
GIC CPU interface configration guide.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 25f4d7d84b CMSIS: AArch64: gic_v3: Fix the core wakeup helper
To mark the connected PE as being online, software must:
  - Clear GICR_WAKER.ProcessorSleep to 0.
  - Poll GICR_WAKER.ChildrenAsleep until it reads 0.

It is important that software performs these steps before configuring
the CPU interface, otherwise behavior can be UNPREDICTABLE.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 38d5935884 CMSIS: AArch64: gic_v3: add support for multiple thread processors
In the processors, which integrates the multi-threaded cores, the
definition of the affinity fields in MPIDR_EL1 is different, the
Affinity0 is used to indicate Thread ID instead of Core ID.
However, the current implementation hard-code to use Affinity0 to
identify Core ID and then index the Redistributor, so it does't
work anymore on these platforms.

This patch remove the hard-code indenification of Redistributor
and change to use the core/thread's affinity fields to match the
Redistributor.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 2670f38b99 CMSIS: AArch64: gic_v3: updated the helper GIC_GetTarget()
Return the full Affinity field when Affinity routing is enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang c1ae2ccb53 CMSIS: AArch64: gic_v3: fix the helper GIC_SetTarget()
Change the 'target_core' arguement to 64bit to fully initialize
the 64bit IROUTER register.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 67d8ca095e CMSIS: AArch64: gcc: fix the helper MPIDR_GetCoreID()
The MT bit of MPIDR_EL indicates if Affinity0 is Thread ID,
if MT is set, the Affinity1 is Core ID.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 415f05ad24 CMSIS: AArch64: gcc: fix the helper __get_MPIDR_EL1()
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang cf87ee94d8 CMSIS: AArch64: gic_v3: fix the type of GIC Redistributor TYPER register
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang f619fe1780 CMSIS: AArch64: gic_v3: move MPIDR macros to core_common.h
And add MPIDR_EL1 affinity fields mask definition.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 6eeb3479db CMSIS: AArch64: move the AARCH64 core common code to an new header
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Aziz Sellami 70ea836f13 CMSIS: Core_AArch64: gic_v3: change default priority to comply with RTOS security extension
In some cases, the lower half of available priorities values are reserved by the OS
for critical functions, as part of the legacy security extension feature (for example
in FreeRTOS). By using 2/3 of the max priority of the GIC,  we ensure that we have a
valid default value.

Signed-off-by: Aziz Sellami <aziz.sellami@nxp.com>
2023-09-15 06:34:38 -05:00
Aziz Sellami 7844c5653e CMSIS: Core_AArch64: gic_v3: delete affinity setting in init
In the case of using an hypervisor, we should not setup the affinity
to a specific CPU, as it depends on the CPU used for the guest OS.

Signed-off-by: Aziz Sellami <aziz.sellami@nxp.com>
2023-09-15 06:34:38 -05:00
Aziz Sellami 7ced3c84b3 CMSIS: Core_AArch64: gic_v3: determine default priority value using PPI interrupt
Signed-off-by: Aziz Sellami <aziz.sellami@nxp.com>
2023-09-15 06:34:38 -05:00
Aziz Sellami 7ab5e92ba1 CMSIS: Core_AArch64: gic_v3: remove dead code and cleanup code
Signed-off-by: Aziz Sellami <aziz.sellami@nxp.com>
2023-09-15 06:34:38 -05:00
Aziz Sellami 1b9a186cf2 CMSIS: Core_AArch64: gic_v3: align GIC_GetPriority with GIC_SetPriority
Signed-off-by: Aziz Sellami <aziz.sellami@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 5402bdd9ec CMSIS: Core_AArch64: gic_v3: Add polling RWP for previous writes to the tracked registers
Add polling of RWP bit of Distributor and Redistributor CTRL registers to
make sure the effects of previous register writes to the affected register
fields are visible to all logical components of the GIC architecture.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang f160cc2e2a CMSIS: Core_AArch64: gic_v3: Add SRE version SGI generation API
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 0e1d0fb911 CMSIS: Core_AArch64: gic_v3: Set the SGI&PPI priority through GICR interface
When the ARE has been enabled, it must set the priority of SGI&PPI
through GICR interface.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 0ed0f64a8e CMSIS: Core_AArch64: gic_v3: Add helper for getting Affinity Routing status
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 9a56438245 CMSIS: Core_A: mmu_armv8: add MB() and GB() helper
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 12bca36aad cmsis: Add branch prediction macros
likely/unlikely() branch prediction macros give some hints to the
compiler to favor either side of a jump instruction and may improve
performances in certain conditions.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Rui Sousa ed6c1b3f6b cmsis: Add hypervisor call abstraction
Add hypervisor call abstraction to cmsis layer (supporting
two arguments).

Signed-off-by: Rui Sousa <rui.sousa@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 304915dd9f CMSIS: Core_A: Add cache maintain support for ARMv8-A
Add I-Cache and D-Cache maintain operations for armv8a.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Hou Zhiqiang 57c40befb6 CMSIS: Core_A: Add CLZ instruction helper
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-15 06:34:38 -05:00
Stoica Cosmin-Stefan 47c564c3b7 CMSIS: add REV16 and REV functions
Signed-off-by: Stoica Cosmin-Stefan <cosmin.stoica@nxp.com>
2023-09-15 06:34:38 -05:00
Fabrice Goucem ecd174d54a cmsis: Core_A: Add ARM_TIMER_GetCounterCount() API
This function returns the value of registers cntpct_el0 / cntvct_el0.

Signed-off-by: Fabrice Goucem <fabrice.goucem@nxp.com>
2023-09-15 06:34:38 -05:00
Fabrice Goucem 3439ecb253 cmsis: Core_A: Add __WFI() API
Signed-off-by: Fabrice Goucem <fabrice.goucem@nxp.com>
2023-09-15 06:34:38 -05:00