From 516d1286a6cf376a1fa048ebe78a253360903cc3 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Thu, 3 Nov 2016 21:17:33 -0500 Subject: [PATCH] k64: Move driver instance defconfigs to boards The k64 SoC has multiple instances of many peripherals, but which instances can actually be used depends upon the board design and pinmux configuration. Move all instance-specific default driver configurations from the SoC to the boards (frdm_k64f and hexiwear_k64). Default driver selection remains in the SoC (e.g., enable the KSDK I2C driver when I2C is enabled). This paves the way to support different driver defaults for the frdm_k64f and hexiwear_k64 boards, but it does not yet change any of the default values; it only changes where the default values get set. Change-Id: Id9ed898762eb400ecefeac91ae4dce66da05622d Signed-off-by: Maureen Helm --- .../nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 | 139 +---------------- boards/arm/frdm_k64f/Kconfig.defconfig | 140 ++++++++++++++++++ boards/arm/hexiwear_k64/Kconfig.defconfig | 140 ++++++++++++++++++ 3 files changed, 283 insertions(+), 136 deletions(-) diff --git a/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 b/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 index 2b0de6a6936..a3ab3e2620d 100644 --- a/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 +++ b/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 @@ -22,68 +22,12 @@ config SOC string default mk64f12 -if UART_K20 - -config UART_K20_PORT_0 - def_bool y - -if UART_K20_PORT_0 -config UART_K20_PORT_0_IRQ_PRI - default 3 -config UART_K20_PORT_0_BAUD_RATE - default 115200 -endif - -config UART_K20_PORT_1 - def_bool y - -if UART_K20_PORT_1 -config UART_K20_PORT_1_IRQ_PRI - default 3 -config UART_K20_PORT_1_BAUD_RATE - default 115200 -endif - -config UART_K20_PORT_2 - def_bool y -if UART_K20_PORT_2 -config UART_K20_PORT_2_IRQ_PRI - default 3 -config UART_K20_PORT_2_BAUD_RATE - default 115200 -endif - -config UART_K20_PORT_3 - def_bool y -if UART_K20_PORT_3 -config UART_K20_PORT_3_IRQ_PRI - default 3 -config UART_K20_PORT_3_BAUD_RATE - default 115200 -endif - -config UART_K20_PORT_4 - def_bool y -if UART_K20_PORT_4 -config UART_K20_PORT_4_IRQ_PRI - default 3 -config UART_K20_PORT_4_BAUD_RATE - default 115200 -endif - -endif # UART_K20 - -config BLUETOOTH_UART_ON_DEV_NAME - default "UART_1" if BLUETOOTH_UART - -config PINMUX - def_bool y - if PINMUX config PINMUX_K64 def_bool y -endif + +endif # PINMUX config GPIO def_bool y @@ -93,25 +37,6 @@ if GPIO config GPIO_K64 def_bool y -if GPIO_K64 - -config GPIO_K64_A - def_bool y - -config GPIO_K64_B - def_bool y - -config GPIO_K64_C - def_bool y - -config GPIO_K64_D - def_bool y - -config GPIO_K64_E - def_bool y - -endif # GPIO_K64 - endif # GPIO if I2C @@ -119,32 +44,6 @@ if I2C config I2C_KSDK def_bool y -config I2C_0 - def_bool y - -if I2C_0 - -config I2C_0_DEFAULT_CFG - default 0x12 - -config I2C_0_IRQ_PRI - default 0 - -endif # I2C_0 - -config I2C_1 - def_bool n - -if I2C_1 - -config I2C_1_DEFAULT_CFG - default 0x12 - -config I2C_1_IRQ_PRI - default 0 - -endif # I2C_1 - endif # I2C if PWM @@ -152,14 +51,7 @@ if PWM config PWM_K64_FTM def_bool y -if PWM_K64_FTM - -config PWM_K64_FTM_0 - def_bool y - -endif # PWM_K64_FTM - -endif +endif # PWM config SPI def_bool n @@ -169,28 +61,6 @@ if SPI config SPI_K64 def_bool y -if SPI_K64 - -config SPI_0 - def_bool y - -config SPI_0_IRQ_PRI - default 3 - -config SPI_1 - def_bool n - -config SPI_1_IRQ_PRI - default 3 - -config SPI_2 - def_bool n - -config SPI_2_IRQ_PRI - default 3 - -endif # SPI_K64 - endif # SPI if ETHERNET @@ -198,9 +68,6 @@ if ETHERNET config ETH_KSDK def_bool y -config ETH_KSDK_0 - def_bool y - endif # ETHERNET if RANDOM_GENERATOR diff --git a/boards/arm/frdm_k64f/Kconfig.defconfig b/boards/arm/frdm_k64f/Kconfig.defconfig index 35651d10fd2..4e5a9d5a215 100644 --- a/boards/arm/frdm_k64f/Kconfig.defconfig +++ b/boards/arm/frdm_k64f/Kconfig.defconfig @@ -38,4 +38,144 @@ config MCG_VDIV0 config MCG_FCRDIV default 1 +if UART_K20 + +config UART_K20_PORT_0 + def_bool y +if UART_K20_PORT_0 +config UART_K20_PORT_0_IRQ_PRI + default 3 +config UART_K20_PORT_0_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_1 + def_bool y +if UART_K20_PORT_1 +config UART_K20_PORT_1_IRQ_PRI + default 3 +config UART_K20_PORT_1_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_2 + def_bool y +if UART_K20_PORT_2 +config UART_K20_PORT_2_IRQ_PRI + default 3 +config UART_K20_PORT_2_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_3 + def_bool y +if UART_K20_PORT_3 +config UART_K20_PORT_3_IRQ_PRI + default 3 +config UART_K20_PORT_3_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_4 + def_bool y +if UART_K20_PORT_4 +config UART_K20_PORT_4_IRQ_PRI + default 3 +config UART_K20_PORT_4_BAUD_RATE + default 115200 +endif + +endif # UART_K20 + +config BLUETOOTH_UART_ON_DEV_NAME + default "UART_1" if BLUETOOTH_UART + +config PINMUX + def_bool y + +if GPIO_K64 + +config GPIO_K64_A + def_bool y + +config GPIO_K64_B + def_bool y + +config GPIO_K64_C + def_bool y + +config GPIO_K64_D + def_bool y + +config GPIO_K64_E + def_bool y + +endif # GPIO_K64 + +if I2C + +config I2C_0 + def_bool y + +if I2C_0 + +config I2C_0_DEFAULT_CFG + default 0x12 + +config I2C_0_IRQ_PRI + default 0 + +endif # I2C_0 + +config I2C_1 + def_bool n + +if I2C_1 + +config I2C_1_DEFAULT_CFG + default 0x12 + +config I2C_1_IRQ_PRI + default 0 + +endif # I2C_1 + +endif # I2C + +if PWM_K64_FTM + +config PWM_K64_FTM_0 + def_bool y + +endif # PWM_K64_FTM + +if SPI + +config SPI_0 + def_bool y + +config SPI_0_IRQ_PRI + default 3 + +config SPI_1 + def_bool n + +config SPI_1_IRQ_PRI + default 3 + +config SPI_2 + def_bool n + +config SPI_2_IRQ_PRI + default 3 + +endif # SPI + +if ETHERNET + +config ETH_KSDK_0 + def_bool y + +endif # ETHERNET + endif # BOARD_FRDM_K64F diff --git a/boards/arm/hexiwear_k64/Kconfig.defconfig b/boards/arm/hexiwear_k64/Kconfig.defconfig index acf6b3a86bd..c45ac0fd6a9 100644 --- a/boards/arm/hexiwear_k64/Kconfig.defconfig +++ b/boards/arm/hexiwear_k64/Kconfig.defconfig @@ -38,4 +38,144 @@ config MCG_VDIV0 config MCG_FCRDIV default 1 +if UART_K20 + +config UART_K20_PORT_0 + def_bool y +if UART_K20_PORT_0 +config UART_K20_PORT_0_IRQ_PRI + default 3 +config UART_K20_PORT_0_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_1 + def_bool y +if UART_K20_PORT_1 +config UART_K20_PORT_1_IRQ_PRI + default 3 +config UART_K20_PORT_1_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_2 + def_bool y +if UART_K20_PORT_2 +config UART_K20_PORT_2_IRQ_PRI + default 3 +config UART_K20_PORT_2_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_3 + def_bool y +if UART_K20_PORT_3 +config UART_K20_PORT_3_IRQ_PRI + default 3 +config UART_K20_PORT_3_BAUD_RATE + default 115200 +endif + +config UART_K20_PORT_4 + def_bool y +if UART_K20_PORT_4 +config UART_K20_PORT_4_IRQ_PRI + default 3 +config UART_K20_PORT_4_BAUD_RATE + default 115200 +endif + +endif # UART_K20 + +config BLUETOOTH_UART_ON_DEV_NAME + default "UART_1" if BLUETOOTH_UART + +config PINMUX + def_bool y + +if GPIO_K64 + +config GPIO_K64_A + def_bool y + +config GPIO_K64_B + def_bool y + +config GPIO_K64_C + def_bool y + +config GPIO_K64_D + def_bool y + +config GPIO_K64_E + def_bool y + +endif # GPIO_K64 + +if I2C + +config I2C_0 + def_bool y + +if I2C_0 + +config I2C_0_DEFAULT_CFG + default 0x12 + +config I2C_0_IRQ_PRI + default 0 + +endif # I2C_0 + +config I2C_1 + def_bool n + +if I2C_1 + +config I2C_1_DEFAULT_CFG + default 0x12 + +config I2C_1_IRQ_PRI + default 0 + +endif # I2C_1 + +endif # I2C + +if PWM_K64_FTM + +config PWM_K64_FTM_0 + def_bool y + +endif # PWM_K64_FTM + +if SPI + +config SPI_0 + def_bool y + +config SPI_0_IRQ_PRI + default 3 + +config SPI_1 + def_bool n + +config SPI_1_IRQ_PRI + default 3 + +config SPI_2 + def_bool n + +config SPI_2_IRQ_PRI + default 3 + +endif # SPI + +if ETHERNET + +config ETH_KSDK_0 + def_bool y + +endif # ETHERNET + endif # BOARD_HEXIWEAR_K64