Commit Graph

906 Commits

Author SHA1 Message Date
Stephane Viau de20f88076 cmsis: Core_A: Update ARM_TIMER_GetFreq() API
The counter-timer Frequency register is common to all types of counters.
There is no need to pass the type of timer in parameter.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Rui Sousa f7703fdf95 cmsis: Core_A: Add __WEAK abstraction
Add compiler abstraction for weak linkage (__WEAK macro)

Signed-off-by: Rui Sousa <rui.sousa@nxp.com>
2023-09-15 06:34:38 -05:00
Rui Sousa bb7d7f9bb0 cmsis: Core_A: Update ARM_TIMER_Start API
The current ARM_TIMER API's Start and EnableIRQ are not working as
expected:
- Start always enables IRQ's
- EnableIRQ always disables the timer

Fix by removing the standalone EnableIRQ API and adding an irq enable
flag to Start API.

Signed-off-by: Rui Sousa <rui.sousa@nxp.com>
2023-09-15 06:34:38 -05:00
Rui Sousa 54ead34bd4 cmsis: Core_A: Add ARM_Timer_GetCount() API
Add API to get timer counter value.

Signed-off-by: Rui Sousa <rui.sousa@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau ff22116e2b cmsis: Core_A: Update compiler support
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Rui Sousa bfa0e78d0f armv8a: mmu: Increase number of translation tables
Increase the number of MMU translation tables. For the audio
application with ivshmem support, the current limit was being reached.

Signed-off-by: Rui Sousa <rui.sousa@nxp.com>
2023-09-15 06:34:38 -05:00
Rui Sousa 8dd629b3c2 armv8a: mmu: Add new map function
Add function to set a new individual MMU map at run-time.

Signed-off-by: Rui Sousa <rui.sousa@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 932783f7a9 armv8a: mmu: Fix memory translation table setup loop
Reported-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Suggested-by: Fabrice Goucem <fabrice.goucem@nxp.com>
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Jiafei Pan d74e852521 CMSIS/Core_A: add __NOP() function
Define __NOP() function for Cortext A CMSIS.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau df3bc32adb armv8a: mmu: Move the MMU configuration to the application
The MMU config is best known by the application iteself, depending on
the SoC, RTOS and use case being executed. Let the MMU intialization API
function take the config as a paramter for a better flexibility.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 7a4ee9bbf0 armv8a: mmu: Make driver more CMSIS-friendly
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau e9530f5bf3 cmsis: Core_A: Move lib_helpers.h out of Include/ directory (FIXME)
TODO: Remove dependency on this file by inserting MSR/MRS instructions
directly in the source code.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau ef137a2300 cmsis: Core_A: Move ARMv8-A MMU driver to CMSIS
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 98416ed3d6 cmsis: Core_A: gcc: Make __MRS() more c-like
We usually pass a pointer to a variable to get value ; let's do this
with the __MRS() macro as well.

Suggested-by: Rui Sousa <rui.sousa@nxp.com>
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 86a441673e cmsis: Core_A: gcc: Add IRQ helper functions
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 138bd8e158 cmsis: Core_A: Add DAIF register definition
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau b5f238fcf0 cmsis: Core_A: Add __ARM_ARCH_8A__ macro definition
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 67b344c60d cmsis: Core_A: gcc: Avoid barrier macros redefinition (fixme)
Zephyr has its own implementation of __ISB() and friends ; let's not
redefine them if already defined.

This _workaround_ consists in defining the macros only if they are not
defined yet.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau c8e053ed51 cmsis: Core_A: gcc: Add __BKPT() macro definiton
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau a54298a00c cmsis: Core_A: gcc: Add required macros for GICv3 driver
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 10d32ace6d cmsis: gic_v3: Add GIC Redistributor type
Use it to access ->WAKER field.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau d4c9b77f96 cmsis: gic_v3: Modify GIC_Enable() API
Ths current parameter (mainCore) is unused ; instead of imposing core 0
as the main code, let the caller decide what core shall initialize the
GIC Distributor.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau f40a723b1f cmsis: gic_v3: Add CPU interface register definition
GNU GCC (AS) is not aware of all Aarch64 symbolic system registers names.
Fetch their definitions from the ARM documentation (instruction encoding
from register descriptions).

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 7302a77f6f cmsis: Core_A: Implement ARMv8-A local timer driver
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 58d1653ad2 cmsis: Core_A: Move GIC v3 support to a separate file
Eventually, gic_v3.h will be included by other SoC, such as other Cortex-A5x.

Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 04fce59236 cmsis: Core_A: Add GCC-specific file
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Stephane Viau 77622bf220 cmsis: Core_A: Match upstream file name and license
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Peng Fan 87c445976b cmsis: Add support for Cortex-A53
Support ca53

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit ee9a1452a2a95cf07b43a0892475675f86f12259)
[Only c-pick core_ca53.h and update commit title]
Signed-off-by: Stephane Viau <stephane.viau@nxp.com>
2023-09-15 06:34:38 -05:00
Jiafei Pan 659ad7c19a CMSIS: add compile helper header file for A-Core
The header file only to resolve aarch64 compatible issue for
CMSIS header files and drivers.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-09-15 06:34:38 -05:00
Jiafei Pan 9cb4c5e151 revert harpoon v2.3 patches for Cortex-A Core
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-09-15 06:34:38 -05:00
Gerard Marull-Paretas 5331fe2ff1 s32: use zephyr/toolchain.h
It is wrong to use toolchain-specific headers.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-09-14 16:34:03 +02:00
Yicheng Li 06c956741a mcux: include MU driver for Zephyr MBOX
A wrapper of the MU driver into the new Zephyr MBOX model is being
added to the main Zephyr repository. Projects that use the MBOX
driver on i.MX boards need the MU driver in the include paths.

Signed-off-by: Yicheng Li <yichengli@google.com>
2023-09-08 13:59:46 -05:00
Dat Nguyen Duy 0ef57e8ee4 s32: soc: s32k344: remove suffix from eMIOS instance count
The shim driver for eMIOS uses eMIOS_INSTANCE_COUNT as
argument of LISTIFY, therefore the integer literal suffix
must be removed in order for the macros to work correctly

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 16:33:44 -05:00
Dat Nguyen Duy dc5fcf710a s32: soc: s32k344: glue with zephyr devicetree
Get value for defined macros based on Zephyr devicetree

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 16:33:44 -05:00
Dat Nguyen Duy df4e20f103 s32: soc: s32k344: add eMIOS Mcl, eMIOS Pwm specific code
Code is auto generated by S32 Design Studio for S32 platform

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 16:33:44 -05:00
Dat Nguyen Duy ffa652c344 s32: drivers: s32k3: mcl: put variable in to read only region
This relocates an array with base addresses for eMIOS
instances that is supposed to read only as a constant
variable

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 16:33:44 -05:00
Dat Nguyen Duy 5c2af05d59 s32: drivers: s32k3: relocate non-cacheable variables
Relocate uninitialized non-cacheable variables of Mcl and
Pwm drivers into .nocache (NOLOAD) section defined by Zephyr

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 16:33:44 -05:00
Dat Nguyen Duy f8de9e2747 s32: drivers: s32k3: add eMIOS Mcl, eMIOS Pwm driver
Mcl eMIOS and PWM eMIOS driver from RTD 3.0.0 P01 for
S32K3 devices

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 16:33:44 -05:00
Daniel DeGrasse b027448102 dts: nxp: nxp_imx: update RT1170 and RT1160 header options
Update RT1170 and RT1160 header options to have correct pin type
information.

Note that due to changes in source data, the following changes have also
been made to the headers:
- the names of SNVS pins have been updated to align with the RM
- XBAR_INOUT mux options now set the associated GPR bit to select the
  XBAR pin as an output, while XBAR_IN options leave the GPR bit clear.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-28 12:26:11 -05:00
Daniel DeGrasse 38c6d2a80f mcux: scripts: update soc header script to handle cfg reg type correctly
Update SOC header script for IMX parts to handle configuration register
type correctly. RT11xx SOCs have multiple types of configuration
registers for pins, and this needs to be encoded in the devicetree for
the MUX options. Fix the header generation script to correctly evaluate
the config type based on which bitfields are in the register, instead of
based on the pin name (as this pattern is not valid for all GPIO_DISP
pins)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-28 12:26:11 -05:00
Benjamin Lemouzy 1f383ebe5f dts: add devicetree pin control definitions for RT1051 SOC
Add devicetree pin control definitions for RT1051 SOC.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2023-08-28 12:23:26 -05:00
Yves Vandervennet 6f11dd49e7 license: change location of the NXP HAL license file
The NXP HAL is licensed under the terms of BSD-3. For clarity, the
license file is moved to the root of the NXP HAL repository

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2023-08-17 12:01:34 -05:00
Albort Xue 73170e8655 mcux: Add support for lpdac
Updated hal_nxp.cmake to support lpdac.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2023-08-16 12:31:15 -05:00
Daniel DeGrasse dacdcd5c16 mcux: add smartdma driver to cmake
Add smartdma driver to MCUX cmake directive, to enable inclusion
of MCUX smartDMA HAL driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-07 13:57:44 -05:00
Manuel Argüelles 4364ed701e modules: rename S32 to NXP_S32
Rename module from `S32` to `NXP_S32` to avoid ambiguity. All other
files and symbols have been already renamed but this was missing to
update.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-07 10:46:40 -05:00
Daniel DeGrasse 32de41804d mcux: set executable bit on board pinctrl script
Set executable bit on board pinctrl script for MCUX. This script
can be run directly on Linux systems, and the execute bit should be set
within file permissions to indicate this.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-31 14:58:04 -05:00
Daniel DeGrasse 5c272eee38 dts: add pin control SOC headers for RT1062xxxxB SOC
Add pin control SOC headers for RT1062 rev B silicon

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-31 14:56:14 -05:00
Manuel Argüelles 674aa3834a s32: s32k344: add clock config for EMAC0
And a new clock configuration group for EMAC0 clocks that skips all
other clocks except for EMAC0 Tx/Rx clocks. EMAC0 TS clock is
sourced from FIRC because is not used currently.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-07-28 08:58:49 -05:00
Manuel Argüelles 67f81b6a86 s32: s32k344: remove suffix from GMAC instance count
The GMAC shim driver uses FEATURE_GMAC_NUM_INSTANCES as argument of
LISTIFY, therefore the integer literal suffix must be removed in order
for the macros to concatenate correctly. This way we can keep the shim
driver generic enough when other SoC is supported and there is no need
to redefine the macro there.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-07-28 08:58:49 -05:00
Manuel Argüelles 027b385225 s32: s32k344: add SoC configuration for GMAC
These files are autogenerated with S32 Design Studio for S32 Platform
using RTD 3.0.0 P01 for S32K3 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-07-28 08:58:49 -05:00