Commit Graph

133 Commits

Author SHA1 Message Date
Manuel Argüelles cd046faf8a s32: s32k146: fix RTC clock source
Commit 1be7718c59 wrongly set the RTC
clock source to an external oscillator which is not present in the only
board using this SoC at the moment. Instead use the 32 KHz internal
oscillator which is enabled at PoR and always available.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-04-17 09:11:11 -05:00
Manuel Argüelles b92c645c94 s32: convert to hwmv2
SoC S32Z27 folder is renamed to S32Z270 to align with
changes to `CONFIG_SOC_S32Z270`.
Compatibility with hwmv1 is maintained until support is merged to
main.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-03-01 15:45:06 +01:00
Manuel Argüelles ecb9e4c150 s32: mcux: s32k146: enable RTC driver
Enable fsl_rtc.c driver on S32K146 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-28 11:07:39 -06:00
Manuel Argüelles 1be7718c59 s32: soc: s32k146: set RTC_CLK sourced from RTC_CLKIN
Source the RTC clock from the external 32.768Khz crystal.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-28 11:07:39 -06:00
Manuel Argüelles 3d4be32141 s32: mcux: s32k146: enable watchdog driver
Enable fsl_wdog32 driver on S32K146 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-25 12:18:41 +07:00
Manuel Argüelles 12970d629f s32: mcux: s32k146: add definitions for FlexCAN
Add FlexCAN peripheral definitions to enable FlexCAN driver
on S32K146 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-04 12:40:10 -06:00
Manuel Argüelles 6ccc1ddc1f s32: drivers: s32k1: patch FlexCAN header for compatibility with MCUX
The following patches are applied to the headers in order to make them
compatible with MCUX FlexCAN driver:

- Substitute regex pattern \bFLEXCAN_ with CAN_
- Replace message buffer RAMn array with a struct for 64-byte payloads
  (the only paylod length supported at the moment in MCUX FlexCAN
   driver).
- Replace macros for RAM array bytes with macros for message buffer
  fields CS, ID, WORD0 and WORD1.
- Define MCR_WAKSRC, MCR_SLFWAK, MCR_WAKMSK and ESR1_WAKINT register
  access macros to be able to build with MCUX driver. These fields are
  reserved in S32K1xx and not used.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-04 12:40:10 -06:00
Manuel Argüelles 4605f6715c s32: mcux: s32k146: add definitions for FTM
Add FTM peripheral definitions to enable FTM driver on S32K146 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-26 09:56:16 +07:00
Manuel Argüelles edceb5b166 s32: drivers: s32k1: patch FTM for compatibility with MCUX
In order to reuse existing device header with MCUX SDK FTM driver,
is needed to redefine CONTROLS.CSC/CV to CONTROLS.CnSC/CnV.
The change is applied to all devices to allow future use of it, although
for now only will be used on S32K146 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-26 09:56:16 +07:00
Benjamin Perseghetti 2a294b540c s32k344: devices: Fix lpspi by removing errata.
Removes the S32K3X4-0P55A-1P55A-ERRATA by disabling
FSL_FEATURE_LPSPI_HAS_ERRATA_050456. This allows for
lpspi to work correctly on mr_canhubk3.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-12-08 11:50:35 -06:00
Cong Nguyen Huu cbf2cd1f09 s32: drivers: s32ze: Remove 'static inline' keywords from 'Netc_Eth_Ip_MSIX_Rx' function
Netc shim driver uses 'Netc_Eth_Ip_MSIX_Rx' function.
Need to remove 'static inline' keywords from this function
so that it can be used as an extern function outside of the
file declaration.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-12-08 09:08:09 +07:00
Manuel Argüelles 1b2f3608ab s32: mcux: s32k146: add support for cache driver
Add definitions to use MCUX SDK cache driver for LMEM controller on
S32K146 devices.

Note that `LMEM_PCCCR_ENWRBUF` is not present on S32K1xx devices so it
is defined to have no effect if used in the cache driver.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-07 19:27:23 +07:00
Manuel Argüelles 94f7f1e612 s32: mcux: s32k146: add LPI2C and LPSPI support
Add definitions for LPI2C and LPSPI on S32K146 devices.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-12-02 10:25:28 +07:00
Cong Nguyen Huu b2e85ddda6 s32: soc: s32z27: netc: remove 'u' suffix from macro
Netc shim driver uses the macro
FEATURE_NETC_ETH_NUMBER_OF_CTRLS with LISTIFY.
Remove 'u' suffix from macro so that it
can be used with LISTIFY.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-11-30 13:06:33 +07:00
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
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 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 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
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
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
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
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
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
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