Commit Graph

906 Commits

Author SHA1 Message Date
Manuel Argüelles 2796169ee2 s32: mcux: s32k146: add mcux overlays
Add S32K146 device definitions and overlays in order to reuse
existing MCUX SDK drivers on this SoC.
Drivers enabled: SYSMPU, GPIO, PORT, LPUART.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-29 17:59:04 -06:00
Manuel Argüelles d1e4552c81 s32: soc: s32k146: add SoC configuration
Configuration generated with S32 Design Studio for S32 Platform,
including Real-Time Drivers package for S32K1xx.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-29 17:59:04 -06:00
Manuel Argüelles 4a540f49ce s32: drivers: s32k1: patch relocate nocacheable variables
Relocate uninitialized non-cacheable variables
into .nocache (NOLOAD) section defined by Zephyr.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-29 17:59:04 -06:00
Manuel Argüelles fb9add9533 s32: drivers: s32k1: patch to define __MPU_PRESENT as 0
Device headers are instructing CMSIS to configure the MPU,
but S32k1xx devices have an NXP SYSMPU and not an standard Arm MPU.
Defining `__MPU_PRESENT` to 0 so that SYSMPU driver can be used.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-29 17:59:04 -06:00
Manuel Argüelles df22faaa03 s32: drivers: s32k1: add drivers
Based on S32K1_S32M24_-_R21-11_RTD_2_0_0_D2308.
Components included: device headers, OSIF, Mcu/Clock.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-29 17:59:04 -06:00
Manuel Argüelles 4289b64f6a dts: s32: add pinmux definitions for S32K1xx
S32K1xx uses the same pin control driver as the Kinetis family.
The SoC pinmux headers were generated using gen_soc_headers.py
and NXP Real-Time Drivers for S32K1xx package. The script was
slightly modified locally in order to work with RTD, as follows:

- proc_root = pathlib.Path(temp_dir.name) / 'processors'
- search_pattern = "*/ksdk2_0/*/signal_configuration.xml"
+ proc_root = pathlib.Path(temp_dir.name)
+             / 'tools' / 's32ct' / 'processors'
+ search_pattern = "*/*/*/signal_configuration.xml"

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-29 17:59:04 -06:00
Sumit Batra 5c3e33b987 hal_nxp: s32: Remove 'u' from Lcu,Trgmux inst count
Make LCU_INSTANCE_COUNT and TRGMUX_INSTANCE_COUNT usable by Zephyr

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-11-29 17:31:51 -06:00
Sumit Batra 2f9433a48f hal_nxp: s32k: Pinmux config to connect Trgmux to eMIOS
Add pinmux config to connect source signals
TRGMUX_INT_OUT37 to eMIOS0_CH6_G
TRGMUX_INT_OUT38 to eMIOS0_CH7_G

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-11-28 16:31:34 -06:00
Sumit Batra 04c08a5f54 s32: drivers: s32k3: relocate non-cacheable variables
Relocate uninitialized non-cacheable variables of Lcu and Trgmux Mcl
drivers into .nocache (NOLOAD) section defined by Zephyr

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-11-28 16:31:34 -06:00
Sumit Batra 0291afa1d5 s32k: hal_nxp: Add support for Quadrature Decoder
This commit adds S32DS generated headers to Lcu and Trgmux RTDs
to support Quadrature decoder

Co-authored-by: Mayank Mahajan <mayankmahajan.x@nxp.com>
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-11-28 16:31:34 -06:00
Sumit Batra f5d13246d4 s32k: hal_nxp: Adding LCU and TRGMUX RTDs
Co-authored-by: Mayank Mahajan <mayankmahajan.x@nxp.com>
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-11-28 16:31:34 -06:00
Benjamin Perseghetti 1ed023da7f s32: drivers: s32k3: fix Cmakelist for MDIO.
Fixes the CMakelist to add Eth_mcux if eth or mdio.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-11-26 23:51:33 -05:00
Dat Nguyen Duy b8d1b69bcb mcux: drivers: fsl_i3c: fix compiler warning
"instance" variable is only used if SoC has reset driver
OR the i3c driver is allowed to control clock. Add missing
guards to avoid warnings when compile.

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-11-16 09:36:23 -06:00
Dat Nguyen Duy 518cd07a15 s32: mcux: devices: s32z27: add I3C definitions for MCUX
Add I3C definitions for using I3C MCUX driver

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-11-16 09:36:23 -06:00
Cong Nguyen Huu 69046233b7 s32: readme: update list of patches
Add 2 sub-sections list of patches for S32Z/E and S32K3.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Cong Nguyen Huu 801ea69e9a s32: drivers: s32ze: pit: patch header to use PIT MCUX driver
Rename the PIT struct from TIMER to CHANNEL so that
the MCUX PIT driver can be reused for S32Z.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Cong Nguyen Huu 72b31e9f43 s32: soc: s32z27: integrate with zephyr
Remove 'u' suffix from macros so that they
can be used with LISTIFY in shim drivers.

Set the number of UART LINFlexD instances configured
that bases on the number of devicetree UART nodes enabled.

Set the number of SPI instances configured that bases
on the number of devicetree SPI nodes enabled.
Enable SPI slave support bases on CONFIG_SPI_SLAVE.

Wrap the defined macros of each MRU instance base on
devicetree MRU node so that it is built when node enabled.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Cong Nguyen Huu 65216e94ac s32: drivers: s32ze: remove 'u' suffix from macros
Shim drivers use these macros with LISTIFY.
Remove 'u' suffix from macros so that they
can be used with LISTIFY.
Base on commit 3731aefd

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Cong Nguyen Huu 5b8e6e9a82 s32: drivers: s32ze: relocate non-cacheable variables
Relocate uninitialized non-cacheable variables
into .nocache (NOLOAD) section defined by Zephyr.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Cong Nguyen Huu 9c2c9f8f4a s32: soc: s32z27: update config to RTD 1.0.0
Update tool-generated code to Real-Time Drivers 1.0.0
for configurations:
- Clock/OsIf
- UART
- SIUL2
- SPI
- STM (System Timer Module)
- SWT
- CANEXCEL
- NETC/MRU

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Cong Nguyen Huu 0b13af227b s32: drivers: s32ze: update drivers to RTD 1.0.0
Update headers and baremetal drivers device to NXP S32 RTD 1.0.0
Rename componemt Swt to Wdg

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-15 10:27:54 -06:00
Jiafei Pan 03bd989de4 cmake: unify MCUX_DEVICE with mcux-sdk
In mcux-sdk, MCUX_DEVICE is defined followed by CPU Core for
the platforms with multiple different CPU Cores, but in hal_nxp,
the CPU Core name is removed from MCUX_DEVICE, so let's
unify the macro definition with mcux-sdk, and use
a new macro MCUX_DEVICE_PATH to define device PATH name.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2023-11-14 22:03:07 -06:00
Manuel Argüelles 1bc77937ef s32: mcux: use the SoC name to set the device name
Switch to use `CONFIG_SOC` to define the device name and CPU name
needed to build MCUX drivers and device sources.
The SoC part number for S32 now makes reference to the actual
part number of device as defined in datasheets and should't be
used to define the CPU name.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-14 07:43:48 -06:00
Chekhov Ma 78d1912dbc imx93: add mimx93xxcvxxk-pinctrl.dtsi
Generated *pinctrl.dtsi file for i.MX93 using offline data downloaded
from mcuxpresso.nxp.com. Add copyright notice.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2023-11-09 12:20:52 -06:00
Yangbo Lu 7362019703 devices: MIMX9352: initialize g_clockSourceFreq with default values
Initialize g_clockSourceFreq with default values configured by ROM.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2023-11-09 10:57:46 -06:00
Laurentiu Mihalcea d5e5358e56 mcux: README: Update patch list
Update patch list to contain the QM and QXP changes from
the MCUX-SDK side.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea c3f402cb5d mcux: hal_nxp: Compile SCFW API for QM and QXP's DSP core
This commit adds support for compiling the SCFW API
in Zephyr for i.MX8QM and i.MX8QXP's DSP core.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea 8676fca0d5 devices: MIMX8QX6: Adjust DSP core interrupts
Currently, the core interrupts are CM-specific (e.g: INTID 0
is said to be NMI but, in fact, is tied low on the DSP). As
such, remove the core interrupts altogether.

Also, this commit introduces the MU13 and IRQSTEER interrupt
IDs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea fc3f9171d5 MIMX8QX6: scfw_api: Switch to including generic fsl_device_registers.h
Since the DSP core is now also supported, we need to include
the generic fsl_device_registers.h instead of "MIMX8QX6_cm4.h".
This will assure that the appropriate headers are included
based on the used core.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea 3e4f0a122d devices: MIMX8QX6: Add header files for QXP's DSP core
This commit adds all of the necessary header files for
i.MX8QXP's DSP core.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea 379c94d460 MIMX8QM6: drivers: fsl_clock.c: Report NULL frequency for unsupported core
Currently, if the core is not supported the compilation will
fail because of the "#error" statement in CLOCK_GetCoreSysClkFreq.
To overcome this, instead of causing a compilation error, the
function will report a NULL frequency as if the IPC call failed.
This way, we can avoid having to define macros for each of the
cores just to make CLOCK_GetCoreSysClkFreq() happy.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea 8104659b62 devices: MIMX8QM6_dsp.h: Add missing LPUART IRQ macro
This commit adds the definition for the LPUART_RX_TX_IRQS
macro. For now, this macro resolves to an empty array because
the DSP core is only used with Zephyr on which we do the
IRQ management using the Zephyr support.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea f0a1c6961c devices: MIMX8QM6_dsp.h: Adjust DSP core interrupts
Currently, the core interrupts are CM-specific (e.g: INTID 0
is said to be NMI but, in fact, is tied low on the DSP). As
such, remove the core interrupts altogether.

Also, this commit introduces the MU13 and IRQSTEER interrupt
IDs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Laurentiu Mihalcea 85aa307a0e devices: MIMX8QM6: Add header files for QM's DSP core
This commit adds all of the necessary header files for
i.MX8QM's DSP core.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-07 10:00:30 -06:00
Manuel Argüelles 3731aefd0c s32: remove `u` prefix from instance count 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.

As a prerequisite to refactor all those shim drivers to use the
instance-based DT macros and to obtain the peripheral instance index
at compile time as done in f809614136, remove the `u` prefix from
the HAL instance count macros so that they can be used with `LISTIFY`.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-03 16:09:40 -05:00
Daniel DeGrasse 361ccc5962 mcux: hal_nxp: remove CONFIG_IPM_IMX_REV2
Remove CONFIG_IPM_IMX_REV2, as this Kconfig has been removed from Zephyr
in favor of CONFIG_IPM_IMX (since both Kconfigs handled the same IP
block)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-03 15:54:22 -05:00
Daniel DeGrasse d3770a0434 dts: nxp: add copyright to MK22FX pin control files
Copyright was not included when script was initially run to generate
these files. Add a copyright to all generated files.

Signed-off-by: Daniel DeGrasse <daniel@degrasse.com>
2023-09-29 11:16:38 -05:00
Mahesh Mahadevan ad142f5612 Revert "imx93: add mimx93xxcvxxk-pinctrl.dtsi"
This reverts commit b9c80495e0.
2023-09-29 07:22:59 -05:00
Dat Nguyen Duy 54b8c745aa soc: s32k344: disable un-used eMIOS Icu APIs
Disable un-used eMIOS Icu APIs to avoid build and run
unecessary code

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-28 11:23:03 -05:00
Dat Nguyen Duy 940cb4b396 s32: soc: s32k344: glue emios icu with zephyr devicetree
This glues values for emios icu macro over Zephyr devicetree

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-28 11:23:03 -05:00
Dat Nguyen Duy be880f7392 s32: soc: s32k344: add specific emios icu code for s32k344
This adds specific code for emios icu code which generated
from S32 Design Studio for S32 platform

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-28 11:23:03 -05:00
Dat Nguyen Duy 6c058ce118 s32: driver: s32k3: add emios icu driver
Add driver for eMIOS ICU

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-28 11:23:03 -05:00
Dat Nguyen Duy 1ce1f440ad s32: soc: s32k344: update eMIOS PWM glue code for support PWM capture
If a channel configured to be use in SAIC, means that the PWM
channel will be used for capture mode which is managed by
eMIOS ICU, do not consider it as used by eMIOS PWM driver

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-28 11:23:03 -05:00
Dat Nguyen Duy 4f58cd8976 s32: soc: s32k344: use new dt enum value for PWM mode
For preparing PWM capture support, name of PWM modes
were changed, update to use the new ones

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-28 11:23:03 -05:00
Hou Zhiqiang c257343f4e CMSIS: aarch64: core_common: update the value type of MPIDR_AFFLVL_MASK
Align with Zephyr to avoid redefinition warning.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-09-28 10:33:16 -05:00
Jiafei Pan 6ca692cb9c Revert "CMSIS: AArch64: avoid redefining MPIDR_AFFLVL_MASK"
This reverts commit 8cc344e909.
2023-09-28 10:33:16 -05:00
Daniel DeGrasse b5bd021ab6 mcux: include SYSMPU when building for MK22F12 SOC
Include SYSMPU driver when building for MK22F12 SOC line, as this SOC
has the NXP MPU present.

Signed-off-by: Daniel DeGrasse <daniel@degrasse.com>
2023-09-28 10:27:32 -05:00
Daniel DeGrasse e6cd1b3f1c dts: added devicetree pinctrl files for MK22F12 line of SOCs
Added devictree pinctrl files for legacy MK22F12 line of NXP SOCs.

Signed-off-by: Daniel DeGrasse <daniel@degrasse.com>
2023-09-28 10:27:32 -05:00
Chekhov Ma b9c80495e0 imx93: add mimx93xxcvxxk-pinctrl.dtsi
Generated *pinctrl.dtsi file for i.MX93 using offline data downloaded
from mcuxpresso.nxp.com. Add copyright notice.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2023-09-28 10:05:11 -05:00
Manuel Arguelles b4a3786535 mcux: drivers: pit: fix compiler warning
Add missing guards to avoid compilation warnings when building with SDK
clock control driver disabled.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-27 14:20:23 -05:00