From 7dcffb6ccd934b65096a90402d7da4f8ecfbcc1b Mon Sep 17 00:00:00 2001 From: Parthiban Nallathambi Date: Wed, 26 Feb 2020 12:17:38 +0100 Subject: [PATCH] soc: arm: nxp: kinetis: k6x: move clock defines Rename the clock defines from k64 to K6X. This allows inclusion of K66 series MCU's support without much re-defines. Clock divider defaults to K64 series. Signed-off-by: Parthiban Nallathambi --- soc/arm/nxp_kinetis/k6x/Kconfig.soc | 24 ++++++++++++------------ soc/arm/nxp_kinetis/k6x/soc.c | 8 ++++---- soc/arm/nxp_kinetis/k6x/soc.h | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/soc/arm/nxp_kinetis/k6x/Kconfig.soc b/soc/arm/nxp_kinetis/k6x/Kconfig.soc index 3dad7f2dc57..331aa945dd9 100644 --- a/soc/arm/nxp_kinetis/k6x/Kconfig.soc +++ b/soc/arm/nxp_kinetis/k6x/Kconfig.soc @@ -69,32 +69,32 @@ config SOC_PART_NUMBER_KINETIS_K6X that you should not set directly. The part number selection choice defines the default value for this string. -config K64_CORE_CLOCK_DIVIDER - int "Freescale K64 core clock divider" +config K6X_CORE_CLOCK_DIVIDER + int "Freescale K6X core clock divider" default 1 help - This option specifies the divide value for the K64 processor core clock + This option specifies the divide value for the K6X processor core clock from the system clock. -config K64_BUS_CLOCK_DIVIDER - int "Freescale K64 bus clock divider" +config K6X_BUS_CLOCK_DIVIDER + int "Freescale K6X bus clock divider" default 2 help - This option specifies the divide value for the K64 bus clock from the + This option specifies the divide value for the K6X bus clock from the system clock. -config K64_FLEXBUS_CLOCK_DIVIDER - int "Freescale K64 FlexBus clock divider" +config K6X_FLEXBUS_CLOCK_DIVIDER + int "Freescale K6X FlexBus clock divider" default 3 help - This option specifies the divide value for the K64 FlexBus clock from the + This option specifies the divide value for the K6X FlexBus clock from the system clock. -config K64_FLASH_CLOCK_DIVIDER - int "Freescale K64 flash clock divider" +config K6X_FLASH_CLOCK_DIVIDER + int "Freescale K6X flash clock divider" default 5 help - This option specifies the divide value for the K64 flash clock from the + This option specifies the divide value for the K6X flash clock from the system clock. endif # SOC_SERIES_KINETIS_K6X diff --git a/soc/arm/nxp_kinetis/k6x/soc.c b/soc/arm/nxp_kinetis/k6x/soc.c index 25d08f68819..a5ecf8ce943 100644 --- a/soc/arm/nxp_kinetis/k6x/soc.c +++ b/soc/arm/nxp_kinetis/k6x/soc.c @@ -65,10 +65,10 @@ static const mcg_pll_config_t pll0Config = { static const sim_clock_config_t simConfig = { .pllFllSel = PLLFLLSEL_MCGPLLCLK, /* PLLFLLSEL select PLL. */ .er32kSrc = ER32KSEL_RTC, /* ERCLK32K selection, use RTC. */ - .clkdiv1 = SIM_CLKDIV1_OUTDIV1(CONFIG_K64_CORE_CLOCK_DIVIDER - 1) | - SIM_CLKDIV1_OUTDIV2(CONFIG_K64_BUS_CLOCK_DIVIDER - 1) | - SIM_CLKDIV1_OUTDIV3(CONFIG_K64_FLEXBUS_CLOCK_DIVIDER - 1) | - SIM_CLKDIV1_OUTDIV4(CONFIG_K64_FLASH_CLOCK_DIVIDER - 1), + .clkdiv1 = SIM_CLKDIV1_OUTDIV1(CONFIG_K6X_CORE_CLOCK_DIVIDER - 1) | + SIM_CLKDIV1_OUTDIV2(CONFIG_K6X_BUS_CLOCK_DIVIDER - 1) | + SIM_CLKDIV1_OUTDIV3(CONFIG_K6X_FLEXBUS_CLOCK_DIVIDER - 1) | + SIM_CLKDIV1_OUTDIV4(CONFIG_K6X_FLASH_CLOCK_DIVIDER - 1), }; /** diff --git a/soc/arm/nxp_kinetis/k6x/soc.h b/soc/arm/nxp_kinetis/k6x/soc.h index 7d93f034c39..30441824bd6 100644 --- a/soc/arm/nxp_kinetis/k6x/soc.h +++ b/soc/arm/nxp_kinetis/k6x/soc.h @@ -21,7 +21,7 @@ #define SYSCLK_DEFAULT_IOSC_HZ MHZ(120) #define BUSCLK_DEFAULT_IOSC_HZ (SYSCLK_DEFAULT_IOSC_HZ / \ - CONFIG_K64_BUS_CLOCK_DIVIDER) + CONFIG_K6X_BUS_CLOCK_DIVIDER) /* address bases */