diff --git a/drivers/clock_control/clock_control_mcux_syscon.c b/drivers/clock_control/clock_control_mcux_syscon.c index a0a7db57d28..5386b41ed04 100644 --- a/drivers/clock_control/clock_control_mcux_syscon.c +++ b/drivers/clock_control/clock_control_mcux_syscon.c @@ -27,7 +27,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev, if ((uint32_t)sub_system == MCUX_MRT_CLK) { #if defined(CONFIG_SOC_FAMILY_LPC) CLOCK_EnableClock(kCLOCK_Mrt); -#elif defined(CONFIG_SOC_FAMILY_IMX) +#elif defined(CONFIG_SOC_FAMILY_NXP_IMXRT) CLOCK_EnableClock(kCLOCK_Mrt0); #endif } diff --git a/drivers/gpio/gpio_mcux_igpio.c b/drivers/gpio/gpio_mcux_igpio.c index f8f26e38d4e..91ed22b4422 100644 --- a/drivers/gpio/gpio_mcux_igpio.c +++ b/drivers/gpio/gpio_mcux_igpio.c @@ -152,7 +152,7 @@ static int mcux_igpio_configure(const struct device *dev, } -#elif defined(CONFIG_SOC_SERIES_IMX8MQ_M4) +#elif defined(CONFIG_SOC_MIMX8MQ6_M4) if ((flags & GPIO_SINGLE_ENDED) != 0) { /* Set ODE bit */ reg |= (0x1 << MCUX_IMX_DRIVE_OPEN_DRAIN_SHIFT); diff --git a/modules/Kconfig.imx b/modules/Kconfig.imx index 231c658f821..80e4b3434a5 100644 --- a/modules/Kconfig.imx +++ b/modules/Kconfig.imx @@ -6,7 +6,7 @@ config HAS_IMX_HAL bool select HAS_CMSIS_CORE - depends on SOC_FAMILY_NXP_IMX || SOC_FAMILY_IMX + depends on SOC_FAMILY_NXP_IMX if HAS_IMX_HAL diff --git a/modules/Kconfig.mcux b/modules/Kconfig.mcux index 5d842716e41..21658c1ebd0 100644 --- a/modules/Kconfig.mcux +++ b/modules/Kconfig.mcux @@ -6,7 +6,7 @@ config HAS_MCUX bool depends on SOC_FAMILY_KINETIS || SOC_FAMILY_NXP_IMX || SOC_FAMILY_LPC || \ - SOC_FAMILY_NXP_S32 || SOC_FAMILY_IMX || SOC_FAMILY_NXP_IMXRT + SOC_FAMILY_NXP_S32 || SOC_FAMILY_NXP_IMXRT if HAS_MCUX config MCUX_CORE_SUFFIX diff --git a/soc/nxp/imx/imx8m/CMakeLists.txt b/soc/nxp/imx/imx8m/CMakeLists.txt index 6a9ca932220..8f319c6827a 100644 --- a/soc/nxp/imx/imx8m/CMakeLists.txt +++ b/soc/nxp/imx/imx8m/CMakeLists.txt @@ -43,6 +43,10 @@ if(CONFIG_SOC_MIMX8MM6_M4) add_subdirectory(m4_mini) endif() +if(CONFIG_SOC_MIMX8MQ6_M4) + add_subdirectory(m4_quad) +endif() + if(CONFIG_SOC_MIMX8MP_M7) add_subdirectory(m7) endif() diff --git a/soc/nxp/imx/imx8m/Kconfig b/soc/nxp/imx/imx8m/Kconfig index 7ebb3f699a9..ed796a8c2da 100644 --- a/soc/nxp/imx/imx8m/Kconfig +++ b/soc/nxp/imx/imx8m/Kconfig @@ -65,6 +65,16 @@ config SOC_MIMX8MP_M7 select HAS_MCUX_IGPIO select HAS_MCUX_IOMUXC +config SOC_MIMX8MQ6_M4 + select ARM + select CPU_CORTEX_M4 + select CPU_HAS_FPU + select CPU_HAS_ARM_MPU + select HAS_MCUX + select HAS_MCUX_CCM + select HAS_MCUX_RDC + select HAS_MCUX_IOMUXC + config MCUX_CORE_SUFFIX default "_ca53" if SOC_MIMX8MM6_A53 || SOC_MIMX8MN6_A53 || SOC_MIMX8ML8_A53 default "_dsp" if SOC_MIMX8MP_ADSP diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.mimx8mq6_m4 b/soc/nxp/imx/imx8m/Kconfig.defconfig.mimx8mq.m4 similarity index 56% rename from soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.mimx8mq6_m4 rename to soc/nxp/imx/imx8m/Kconfig.defconfig.mimx8mq.m4 index be244e4b61c..0f9e144bfde 100644 --- a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.mimx8mq6_m4 +++ b/soc/nxp/imx/imx8m/Kconfig.defconfig.mimx8mq.m4 @@ -1,13 +1,10 @@ -# MIMX8MQ6 SoC defconfig +# MIMX8MQ6 M4 SoC defconfig # Copyright (c) 2021, Kwon Tae-young +# Copyright 2024 NXP # SPDX-License-Identifier: Apache-2.0 -if SOC_MIMX8MQ6 - -config SOC - string - default "mimx8mq6" +if SOC_MIMX8MQ6_M4 config SYS_CLOCK_HW_CYCLES_PER_SEC int @@ -17,4 +14,9 @@ config PINCTRL_IMX default y if HAS_MCUX_IOMUXC depends on PINCTRL -endif # SOC_MIMX8MQ6 +config NUM_IRQS + int + # must be >= the highest interrupt number used + default 127 + +endif # SOC_MIMX8MQ6_M4 diff --git a/soc/nxp/imx/imx8m/Kconfig.soc b/soc/nxp/imx/imx8m/Kconfig.soc index d0e848e1982..79471279a75 100644 --- a/soc/nxp/imx/imx8m/Kconfig.soc +++ b/soc/nxp/imx/imx8m/Kconfig.soc @@ -50,6 +50,16 @@ config SOC_MIMX8MP_M7 help Enable support for NXP i.MX 8MPLUS M7 MCU +config SOC_MIMX8MQ6 + bool + select SOC_SERIES_IMX8M + +config SOC_MIMX8MQ6_M4 + bool + select SOC_MIMX8MQ6 + help + Enable support for NXP i.MX 8M Quad M4 MCU + config SOC_TOOLCHAIN_NAME string default "nxp_imx8m_adsp" if SOC_MIMX8MP_ADSP @@ -68,6 +78,7 @@ config SOC default "mimx8mm6" if SOC_MIMX8MM6 default "mimx8mn6" if SOC_MIMX8MN6 default "mimx8ml8" if SOC_MIMX8MP + default "mimx8mq6" if SOC_MIMX8MQ6 config SOC_PART_NUMBER_MIMX8ML8DVNLZ bool @@ -90,6 +101,9 @@ config SOC_PART_NUMBER_MIMX8MN6CVTIZ config SOC_PART_NUMBER_MIMX8MN6CUCIZ bool +config SOC_PART_NUMBER_MIMX8MQ6DVAJZ + bool + config SOC_PART_NUMBER default "MIMX8ML8DVNLZ" if SOC_PART_NUMBER_MIMX8ML8DVNLZ default "MIMX8MM6DVTLZ" if SOC_PART_NUMBER_MIMX8MM6DVTLZ @@ -98,3 +112,4 @@ config SOC_PART_NUMBER default "MIMX8MN6DUCJZ" if SOC_PART_NUMBER_MIMX8MN6DUCJZ default "MIMX8MN6CVTIZ" if SOC_PART_NUMBER_MIMX8MN6CVTIZ default "MIMX8MN6CUCIZ" if SOC_PART_NUMBER_MIMX8MN6CUCIZ + default "MIMX8MQ6DVAJZ" if SOC_PART_NUMBER_MIMX8MQ6DVAJZ diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/CMakeLists.txt b/soc/nxp/imx/imx8m/m4_quad/CMakeLists.txt similarity index 82% rename from soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/CMakeLists.txt rename to soc/nxp/imx/imx8m/m4_quad/CMakeLists.txt index 9555fd57a89..2d5bd4a9f30 100644 --- a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/CMakeLists.txt +++ b/soc/nxp/imx/imx8m/m4_quad/CMakeLists.txt @@ -1,5 +1,6 @@ # # Copyright (c) 2021, Kwon Tae-young +# Copyright 2024 NXP # # SPDX-License-Identifier: Apache-2.0 # @@ -7,5 +8,6 @@ zephyr_sources( soc.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/soc_legacy/arm/nxp_imx/mimx8mq6_m4/pinctrl_soc.h b/soc/nxp/imx/imx8m/m4_quad/pinctrl_soc.h similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/pinctrl_soc.h rename to soc/nxp/imx/imx8m/m4_quad/pinctrl_soc.h diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/soc.c b/soc/nxp/imx/imx8m/m4_quad/soc.c similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/soc.c rename to soc/nxp/imx/imx8m/m4_quad/soc.c diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/soc.h b/soc/nxp/imx/imx8m/m4_quad/soc.h similarity index 100% rename from soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/soc.h rename to soc/nxp/imx/imx8m/m4_quad/soc.h diff --git a/soc/nxp/imx/soc.yml b/soc/nxp/imx/soc.yml index 348e06a2e37..c1a4c16b37b 100644 --- a/soc/nxp/imx/soc.yml +++ b/soc/nxp/imx/soc.yml @@ -38,6 +38,10 @@ family: cpuclusters: - name: a53 - name: m7 + - name: mimx8mq6 + cpuclusters: + - name: a53 + - name: m4 - name: imx9 socs: - name: mimx9352 diff --git a/soc/soc_legacy/arm/nxp_imx/CMakeLists.txt b/soc/soc_legacy/arm/nxp_imx/CMakeLists.txt deleted file mode 100644 index 00c429b533c..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2017, NXP -# -# SPDX-License-Identifier: Apache-2.0 -# - -add_subdirectory(${SOC_SERIES}) diff --git a/soc/soc_legacy/arm/nxp_imx/Kconfig b/soc/soc_legacy/arm/nxp_imx/Kconfig deleted file mode 100644 index c78c5392795..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/Kconfig +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017-2021, NXP -# SPDX-License-Identifier: Apache-2.0 - -config SOC_FAMILY_IMX - bool - select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE - -if SOC_FAMILY_IMX - -config SOC_FAMILY - string - default "nxp_imx" - - -# Used for default value in FLASH_MCUX_FLEXSPI_XIP -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi -# Macros to shorten Kconfig definitions -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - - -source "soc/soc_legacy/arm/nxp_imx/*/Kconfig.soc" - -config SOC_PART_NUMBER - default SOC_PART_NUMBER_IMX_RT5XX if SOC_SERIES_IMX_RT5XX - default SOC_PART_NUMBER_IMX_RT6XX if SOC_SERIES_IMX_RT6XX - default SOC_PART_NUMBER_IMX_RT if SOC_SERIES_IMX_RT - default SOC_PART_NUMBER_IMX_6X_M4 if SOC_SERIES_IMX_6X_M4 - default SOC_PART_NUMBER_IMX7_M4 if SOC_SERIES_IMX7_M4 - default SOC_PART_NUMBER_IMX8MM_M4 if SOC_SERIES_IMX8MM_M4 - default SOC_PART_NUMBER_IMX8ML_M7 if SOC_SERIES_IMX8ML_M7 - default SOC_PART_NUMBER_IMX8MQ_M4 if SOC_SERIES_IMX8MQ_M4 - -config FLASH_MCUX_FLEXSPI_XIP - bool "MCUX FlexSPI flash access with xip" - default $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) - depends on (CODE_FLEXSPI || CODE_FLEXSPI2 || SOC_SERIES_IMX_RT6XX || SOC_SERIES_IMX_RT5XX) - select XIP - help - Allows for the soc to safely initialize the clocks for the - FlexSpi when planning to execute code in FlexSpi Memory. - - -endif # SOC_FAMILY_IMX diff --git a/soc/soc_legacy/arm/nxp_imx/Kconfig.defconfig b/soc/soc_legacy/arm/nxp_imx/Kconfig.defconfig deleted file mode 100644 index 6f1707db03d..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/Kconfig.defconfig +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2017, NXP -# SPDX-License-Identifier: Apache-2.0 - -config SERIAL_INIT_PRIORITY - default 55 - depends on SERIAL - -source "soc/soc_legacy/arm/nxp_imx/*/Kconfig.defconfig.series" diff --git a/soc/soc_legacy/arm/nxp_imx/Kconfig.soc b/soc/soc_legacy/arm/nxp_imx/Kconfig.soc deleted file mode 100644 index 5e869fb87b2..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/Kconfig.soc +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2017, NXP -# SPDX-License-Identifier: Apache-2.0 - -source "soc/soc_legacy/arm/nxp_imx/*/Kconfig.series" diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.series b/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.series deleted file mode 100644 index 7d9efd34117..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.series +++ /dev/null @@ -1,18 +0,0 @@ -# i.MX8MQ M4 SoC series defconfig - -# Copyright (c) 2021, Kwon Tae-young -# SPDX-License-Identifier: Apache-2.0 - -if SOC_SERIES_IMX8MQ_M4 - -config SOC_SERIES - default "mimx8mq6_m4" - -config NUM_IRQS - int - # must be >= the highest interrupt number used - default 127 - -source "soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.mimx8mq6_m4" - -endif # SOC_SERIES_IMX8MQ_M4 diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.series b/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.series deleted file mode 100644 index 3933037c3a0..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.series +++ /dev/null @@ -1,14 +0,0 @@ -# i.MX8MQ M4 core series - -# Copyright (c) 2021, Kwon Tae-young -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_IMX8MQ_M4 - bool "i.MX8MQ M4 Core Series" - select ARM - select CPU_CORTEX_M4 - select SOC_FAMILY_IMX - select CPU_HAS_FPU - select CPU_HAS_ARM_MPU - help - Enable support for i.MX8MQ M4 MCU series diff --git a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.soc b/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.soc deleted file mode 100644 index 0165a4d2a19..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.soc +++ /dev/null @@ -1,32 +0,0 @@ -# i.MX8MQ M4 SoC series - -# Copyright (c) 2021, Kwon Tae-young -# SPDX-License-Identifier: Apache-2.0 - -choice -prompt "i.MX8MQ M4 Selection" - depends on SOC_SERIES_IMX8MQ_M4 - -config SOC_MIMX8MQ6 - bool "SOC_MIMX8MQ6" - select HAS_MCUX - select HAS_MCUX_CCM - select HAS_MCUX_RDC - select HAS_MCUX_IOMUXC - -endchoice - -if SOC_SERIES_IMX8MQ_M4 - -config SOC_PART_NUMBER_MIMX8MQ6DVAJZ - bool - -config SOC_PART_NUMBER_IMX8MQ_M4 - string - default "MIMX8MQ6DVAJZ" if SOC_PART_NUMBER_MIMX8MQ6DVAJZ - 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_IMX8MQ_M4 diff --git a/soc/soc_legacy/arm/nxp_imx/rt/flexspi_rt11xx.c b/soc/soc_legacy/arm/nxp_imx/rt/flexspi_rt11xx.c deleted file mode 100644 index cfbcaaea5ac..00000000000 --- a/soc/soc_legacy/arm/nxp_imx/rt/flexspi_rt11xx.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2023, NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include - -uint32_t flexspi_clock_set_freq(uint32_t clock_name, uint32_t rate) -{ - clock_name_t root; - uint32_t root_rate; - FLEXSPI_Type *flexspi; - clock_root_t flexspi_clk; - clock_ip_name_t clk_gate; - uint32_t divider; - - switch (clock_name) { - case IMX_CCM_FLEXSPI_CLK: - flexspi_clk = kCLOCK_Root_Flexspi1; - flexspi = (FLEXSPI_Type *)DT_REG_ADDR(DT_NODELABEL(flexspi)); - clk_gate = kCLOCK_Flexspi1; - break; - case IMX_CCM_FLEXSPI2_CLK: - flexspi_clk = kCLOCK_Root_Flexspi2; - flexspi = (FLEXSPI_Type *)DT_REG_ADDR(DT_NODELABEL(flexspi2)); - clk_gate = kCLOCK_Flexspi2; - break; - default: - return -ENOTSUP; - } - root = CLOCK_GetRootClockSource(flexspi_clk, - CLOCK_GetRootClockMux(flexspi_clk)); - /* Get clock root frequency */ - root_rate = CLOCK_GetFreq(root); - /* Select a divider based on root clock frequency. We round the - * divider up, so that the resulting clock frequency is lower than - * requested when we can't output the exact requested frequency - */ - divider = ((root_rate + (rate - 1)) / rate); - /* Cap divider to max value */ - divider = MIN(divider, CCM_CLOCK_ROOT_CONTROL_DIV_MASK); - - while (FLEXSPI_GetBusIdleStatus(flexspi) == false) { - /* Spin */ - } - FLEXSPI_Enable(flexspi, false); - - CLOCK_DisableClock(clk_gate); - - CLOCK_SetRootClockDiv(flexspi_clk, divider); - - CLOCK_EnableClock(clk_gate); - - FLEXSPI_Enable(flexspi, true); - - FLEXSPI_SoftwareReset(flexspi); - - return 0; -}