From b2d020bdbf197c4e555af935a150cb271ac04fed Mon Sep 17 00:00:00 2001 From: Parthiban Nallathambi Date: Tue, 11 Feb 2020 22:46:36 +0100 Subject: [PATCH] soc: arm: nxp: kinetis: k6x: add K66F support Add MK66F18 series support with MK66FN2M0VMD18 part. Signed-off-by: Parthiban Nallathambi --- dts/arm/nxp/nxp_k66.dtsi | 13 ++++ .../nxp_kinetis/k6x/Kconfig.defconfig.mk66f18 | 73 +++++++++++++++++++ soc/arm/nxp_kinetis/k6x/Kconfig.soc | 19 +++++ soc/arm/nxp_kinetis/k6x/soc.c | 4 +- soc/arm/nxp_kinetis/k6x/soc.h | 4 + west.yml | 2 +- 6 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 dts/arm/nxp/nxp_k66.dtsi create mode 100644 soc/arm/nxp_kinetis/k6x/Kconfig.defconfig.mk66f18 diff --git a/dts/arm/nxp/nxp_k66.dtsi b/dts/arm/nxp/nxp_k66.dtsi new file mode 100644 index 00000000000..be249be788f --- /dev/null +++ b/dts/arm/nxp/nxp_k66.dtsi @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2020 DENX Software Engineering GmbH + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +&flash0 { + reg = <0x00000000 DT_SIZE_M(2)>; +}; + diff --git a/soc/arm/nxp_kinetis/k6x/Kconfig.defconfig.mk66f18 b/soc/arm/nxp_kinetis/k6x/Kconfig.defconfig.mk66f18 new file mode 100644 index 00000000000..5c12a7b8ea8 --- /dev/null +++ b/soc/arm/nxp_kinetis/k6x/Kconfig.defconfig.mk66f18 @@ -0,0 +1,73 @@ +# FSL SEGGER K66F platform configuration options + +# Copyright (c) 2020 DENX Software Engineering GmbH +# SPDX-License-Identifier: Apache-2.0 + +if SOC_MK66F18 + +config SOC + default "mk66f18" + +if CLOCK_CONTROL + +config CLOCK_CONTROL_MCUX_SIM + default y + +config CLOCK_CONTROL_MCUX_MCG + default y + +endif # CLOCK_CONTROL + +if PINMUX + +config PINMUX_MCUX + default y + +endif # PINMUX + +config GPIO + default y + +if GPIO + +config GPIO_MCUX + default y + +endif # GPIO + +if SPI + +config SPI_MCUX_DSPI + default y + +endif # SPI + +if ENTROPY_GENERATOR + +config ENTROPY_MCUX_RNGA + default y + +endif # ENTROPY_GENERATOR + +if FLASH + +config SOC_FLASH_MCUX + default y + +endif # FLASH + +if WATCHDOG + +config WDT_MCUX_WDOG + default y + +endif # WATCHDOG + +if COUNTER + +config COUNTER_MCUX_RTC + default y + +endif # COUNTER + +endif # SOC_MK66F18 diff --git a/soc/arm/nxp_kinetis/k6x/Kconfig.soc b/soc/arm/nxp_kinetis/k6x/Kconfig.soc index 331aa945dd9..de34000581d 100644 --- a/soc/arm/nxp_kinetis/k6x/Kconfig.soc +++ b/soc/arm/nxp_kinetis/k6x/Kconfig.soc @@ -22,6 +22,21 @@ config SOC_MK64F12 select CPU_HAS_FPU select HAS_MCUX_RTC +config SOC_MK66F18 + bool "SOC_MK66F18" + select HAS_MCUX + select HAS_MCUX_ADC16 + select HAS_MCUX_ENET + select HAS_MCUX_FLEXCAN + select HAS_MCUX_FTFX + select HAS_MCUX_FTM + select HAS_MCUX_RNGA + select HAS_MCUX_SIM + select HAS_OSC + select HAS_MCG + select CPU_HAS_FPU + select HAS_MCUX_RTC + endchoice if SOC_SERIES_KINETIS_K6X @@ -53,6 +68,9 @@ config SOC_PART_NUMBER_MK64FX512VLQ12 config SOC_PART_NUMBER_MK64FX512VMD12 bool +config SOC_PART_NUMBER_MK66FN2M0VMD18 + bool + config SOC_PART_NUMBER_KINETIS_K6X string default "MK64FN1M0CAJ12" if SOC_PART_NUMBER_MK64FN1M0CAJ12 @@ -64,6 +82,7 @@ config SOC_PART_NUMBER_KINETIS_K6X default "MK64FX512VLL12" if SOC_PART_NUMBER_MK64FX512VLL12 default "MK64FX512VLQ12" if SOC_PART_NUMBER_MK64FX512VLQ12 default "MK64FX512VMD12" if SOC_PART_NUMBER_MK64FX512VMD12 + default "MK66FN2M0VMD18" if SOC_PART_NUMBER_MK66FN2M0VMD18 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 diff --git a/soc/arm/nxp_kinetis/k6x/soc.c b/soc/arm/nxp_kinetis/k6x/soc.c index a5ecf8ce943..b10eee2851d 100644 --- a/soc/arm/nxp_kinetis/k6x/soc.c +++ b/soc/arm/nxp_kinetis/k6x/soc.c @@ -120,7 +120,7 @@ static ALWAYS_INLINE void clock_init(void) * @return 0 */ -static int fsl_frdm_k64f_init(struct device *arg) +static int k6x_init(struct device *arg) { ARG_UNUSED(arg); @@ -167,4 +167,4 @@ static int fsl_frdm_k64f_init(struct device *arg) return 0; } -SYS_INIT(fsl_frdm_k64f_init, PRE_KERNEL_1, 0); +SYS_INIT(k6x_init, PRE_KERNEL_1, 0); diff --git a/soc/arm/nxp_kinetis/k6x/soc.h b/soc/arm/nxp_kinetis/k6x/soc.h index 30441824bd6..5f7e7179be4 100644 --- a/soc/arm/nxp_kinetis/k6x/soc.h +++ b/soc/arm/nxp_kinetis/k6x/soc.h @@ -19,7 +19,11 @@ /* default system clock */ +#if defined(CONFIG_SOC_MK64F12) #define SYSCLK_DEFAULT_IOSC_HZ MHZ(120) +#elif defined(CONFIG_SOC_MK66F18) +#define SYSCLK_DEFAULT_IOSC_HZ MHZ(180) +#endif #define BUSCLK_DEFAULT_IOSC_HZ (SYSCLK_DEFAULT_IOSC_HZ / \ CONFIG_K6X_BUS_CLOCK_DIVIDER) diff --git a/west.yml b/west.yml index e0ecc70054d..119a5d820be 100644 --- a/west.yml +++ b/west.yml @@ -86,7 +86,7 @@ manifest: revision: a1fcd0c5949095194b26e6fb45768073bb3fd9de path: tools/net-tools - name: hal_nxp - revision: 3e3f20e7de7606d735cdeefe21d5f2a51bf06095 + revision: 6d06195b8b21ce184ba6ced5b12836de91b507ee path: modules/hal/nxp - name: open-amp revision: 9b591b289e1f37339bd038b5a1f0e6c8ad39c63a