From fd49b1749ed0a3d92a31b1a0f61306d45c47be39 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 29 Feb 2024 18:53:20 +0000 Subject: [PATCH] soc: nxp: convert iMX6 SoloX core to HWMv2 Convert iMX6 SoloX core to HWMv2. This port currently only supports the M4 core (as it did in HWMv1) Signed-off-by: Daniel DeGrasse --- .../imx/imx6sx}/CMakeLists.txt | 4 +- soc/nxp/imx/imx6sx/Kconfig | 18 +++++++++ soc/nxp/imx/imx6sx/Kconfig.defconfig | 18 +++++++++ .../imx/imx6sx}/Kconfig.defconfig.mcimx6x_m4 | 5 +-- .../mcimx6x_m4 => nxp/imx/imx6sx}/Kconfig.soc | 40 +++++++++---------- .../imx/imx6sx}/pinctrl_soc.h | 0 .../mcimx6x_m4 => nxp/imx/imx6sx}/soc.c | 0 .../mcimx6x_m4 => nxp/imx/imx6sx}/soc.h | 0 .../imx/imx6sx}/soc_clk_freq.c | 0 .../imx/imx6sx}/soc_clk_freq.h | 0 soc/nxp/imx/soc.yml | 6 +++ .../mcimx6x_m4/Kconfig.defconfig.series | 21 ---------- .../arm/nxp_imx/mcimx6x_m4/Kconfig.series | 17 -------- 13 files changed, 65 insertions(+), 64 deletions(-) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/CMakeLists.txt (77%) create mode 100644 soc/nxp/imx/imx6sx/Kconfig create mode 100644 soc/nxp/imx/imx6sx/Kconfig.defconfig rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/Kconfig.defconfig.mcimx6x_m4 (67%) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/Kconfig.soc (74%) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/pinctrl_soc.h (100%) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/soc.c (100%) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/soc.h (100%) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/soc_clk_freq.c (100%) rename soc/{soc_legacy/arm/nxp_imx/mcimx6x_m4 => nxp/imx/imx6sx}/soc_clk_freq.h (100%) delete mode 100644 soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.series delete mode 100644 soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.series diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/CMakeLists.txt b/soc/nxp/imx/imx6sx/CMakeLists.txt similarity index 77% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/CMakeLists.txt rename to soc/nxp/imx/imx6sx/CMakeLists.txt index ee28789fe7d..8bebaa89bee 100644 --- a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/CMakeLists.txt +++ b/soc/nxp/imx/imx6sx/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, NXP +# Copyright 2018,2024 NXP # # SPDX-License-Identifier: Apache-2.0 # @@ -9,4 +9,6 @@ zephyr_sources( soc_clk_freq.c ) +zephyr_include_directories(.) + set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") diff --git a/soc/nxp/imx/imx6sx/Kconfig b/soc/nxp/imx/imx6sx/Kconfig new file mode 100644 index 00000000000..901b2c90a64 --- /dev/null +++ b/soc/nxp/imx/imx6sx/Kconfig @@ -0,0 +1,18 @@ +# Copyright 2024 NXP +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_IMX6SX + select ARM + select CPU_CORTEX_M4 + select CPU_CORTEX_M_HAS_DWT + select HAS_IMX_HAL + select CPU_HAS_FPU + select CPU_HAS_ARM_MPU + select CLOCK_CONTROL + +config SOC_MCIMX6X_M4 + select HAS_IMX_HAL + select HAS_IMX_GPIO + select HAS_IMX_EPIT + select HAS_IMX_I2C + select HAS_IMX_IOMUXC diff --git a/soc/nxp/imx/imx6sx/Kconfig.defconfig b/soc/nxp/imx/imx6sx/Kconfig.defconfig new file mode 100644 index 00000000000..e2683c90fa1 --- /dev/null +++ b/soc/nxp/imx/imx6sx/Kconfig.defconfig @@ -0,0 +1,18 @@ +# i.MX 6SoloX core series + +# Copyright 2018,2024 NXP +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_IMX6SX + +config NUM_IRQS + # must be >= the highest interrupt number used + default 128 + +config PINCTRL_IMX + default y if HAS_IMX_IOMUXC + depends on PINCTRL + +rsource "Kconfig.defconfig.*" + +endif # SOC_SERIES_IMX6SX diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.mcimx6x_m4 b/soc/nxp/imx/imx6sx/Kconfig.defconfig.mcimx6x_m4 similarity index 67% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.mcimx6x_m4 rename to soc/nxp/imx/imx6sx/Kconfig.defconfig.mcimx6x_m4 index d8f09a6d8b1..9a925ade2f6 100644 --- a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.mcimx6x_m4 +++ b/soc/nxp/imx/imx6sx/Kconfig.defconfig.mcimx6x_m4 @@ -1,13 +1,10 @@ # i.MX 6SoloX -# Copyright (c) 2018, NXP +# Copyright 2018,2024 NXP # SPDX-License-Identifier: Apache-2.0 if SOC_MCIMX6X_M4 -config SOC - default "mcimx6x" - config FPU default y diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.soc b/soc/nxp/imx/imx6sx/Kconfig.soc similarity index 74% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.soc rename to soc/nxp/imx/imx6sx/Kconfig.soc index 028d4f09212..e6f968bb9e3 100644 --- a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.soc +++ b/soc/nxp/imx/imx6sx/Kconfig.soc @@ -1,23 +1,28 @@ -# i.MX 6SoloX M4 core series +# i.MX 6SoloX core series -# Copyright (c) 2018, NXP +# Copyright 2018,2024 NXP # SPDX-License-Identifier: Apache-2.0 -choice - prompt "i.MX 6SoloX Selection" - depends on SOC_SERIES_IMX_6X_M4 + +config SOC_SERIES_IMX6SX + bool + select SOC_FAMILY_NXP_IMX + +config SOC_MCIMX6X + bool + select SOC_SERIES_IMX6SX config SOC_MCIMX6X_M4 - bool "SOC_MCIMX6X_M4" - select HAS_IMX_HAL - select HAS_IMX_GPIO - select HAS_IMX_EPIT - select HAS_IMX_I2C - select HAS_IMX_IOMUXC + select SOC_MCIMX6X + bool + help + NXP iMX6 SoloX M4 core -endchoice +config SOC_SERIES + default "imx6sx" if SOC_SERIES_IMX6SX -if SOC_SERIES_IMX_6X_M4 +config SOC + default "mcimx6x" if SOC_MCIMX6X config SOC_PART_NUMBER_MCIMX6X1EVK10AB bool @@ -61,8 +66,7 @@ config SOC_PART_NUMBER_MCIMX6X4EVM10AB config SOC_PART_NUMBER_MCIMX6X4EVM10AC bool -config SOC_PART_NUMBER_IMX_6X_M4 - string +config SOC_PART_NUMBER default "MCIMX6X1EVK10AB" if SOC_PART_NUMBER_MCIMX6X1EVK10AB default "MCIMX6X1EVK10AC" if SOC_PART_NUMBER_MCIMX6X1EVK10AC default "MCIMX6X3EVK10AB" if SOC_PART_NUMBER_MCIMX6X3EVK10AB @@ -77,9 +81,3 @@ config SOC_PART_NUMBER_IMX_6X_M4 default "MCIMX6X3EVN10AC" if SOC_PART_NUMBER_MCIMX6X3EVN10AC default "MCIMX6X4EVM10AB" if SOC_PART_NUMBER_MCIMX6X4EVM10AB default "MCIMX6X4EVM10AC" if SOC_PART_NUMBER_MCIMX6X4EVM10AC - help - This string holds the full part number of the SoC. It is a hidden option - that you should not set directly. The part number selection choice defines - the default value for this string. - -endif # SOC_SERIES_IMX_6X_M4 diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/pinctrl_soc.h b/soc/nxp/imx/imx6sx/pinctrl_soc.h similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/pinctrl_soc.h rename to soc/nxp/imx/imx6sx/pinctrl_soc.h diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc.c b/soc/nxp/imx/imx6sx/soc.c similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc.c rename to soc/nxp/imx/imx6sx/soc.c diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc.h b/soc/nxp/imx/imx6sx/soc.h similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc.h rename to soc/nxp/imx/imx6sx/soc.h diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc_clk_freq.c b/soc/nxp/imx/imx6sx/soc_clk_freq.c similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc_clk_freq.c rename to soc/nxp/imx/imx6sx/soc_clk_freq.c diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc_clk_freq.h b/soc/nxp/imx/imx6sx/soc_clk_freq.h similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/soc_clk_freq.h rename to soc/nxp/imx/imx6sx/soc_clk_freq.h diff --git a/soc/nxp/imx/soc.yml b/soc/nxp/imx/soc.yml index f097258c17f..1ceca55fb6c 100644 --- a/soc/nxp/imx/soc.yml +++ b/soc/nxp/imx/soc.yml @@ -44,3 +44,9 @@ family: cpuclusters: - name: a55 - name: m33 + - name: imx6sx + socs: + - name: mcimx6x + cpuclusters: + - name: a9 + - name: m4 diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.series b/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.series deleted file mode 100644 index 3c0f2d74091..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.series +++ /dev/null @@ -1,21 +0,0 @@ -# i.MX 6SoloX M4 core series - -# Copyright (c) 2018, NXP -# SPDX-License-Identifier: Apache-2.0 - -if SOC_SERIES_IMX_6X_M4 - -config SOC_SERIES - default "mcimx6x_m4" - -config NUM_IRQS - # must be >= the highest interrupt number used - default 128 - -config PINCTRL_IMX - default y if HAS_IMX_IOMUXC - depends on PINCTRL - -source "soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.defconfig.mcimx6x_m4" - -endif # SOC_SERIES_IMX_6X_M4 diff --git a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.series b/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.series deleted file mode 100644 index 7279ac8596e..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/mcimx6x_m4/Kconfig.series +++ /dev/null @@ -1,17 +0,0 @@ -# i.MX 6SoloX M4 core series - -# Copyright (c) 2018, NXP -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_IMX_6X_M4 - bool "i.MX 6SoloX M4 Core Series" - select ARM - select CPU_CORTEX_M4 - select CPU_CORTEX_M_HAS_DWT - select HAS_IMX_HAL - select SOC_FAMILY_IMX - select CPU_HAS_FPU - select CPU_HAS_ARM_MPU - select CLOCK_CONTROL - help - Enable support for M4 core of i.MX 6SoloX MCU series