From ee63a78e3f48a324ead870db64d761cc7f460f8d Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 14 Dec 2018 12:01:17 -0600 Subject: [PATCH] boards: mimxrt{1020,1050,1060,1064}_evk remove CONFIG_ from dts files The dts files on these boards had some CONFIG_ defines related to which memory should be used to hold code. We move this choice out of DTS and back into Kconfig. As such, we removed the default setting of 'zephyr,flash' and just map CONFIG_CODE_ITCM to: DT_NXP_IMX_RT_ITCM_0_SIZE DT_NXP_IMX_RT_ITCM_0_BASE_ADDRESS CONFIG_CODE_{QSPI,HYPERFLASH} to: DT_NXP_IMX_FLEXSPI_402A8000_SIZE_1 DT_NXP_IMX_FLEXSPI_402A8000_BASE_ADDDRESS_1 for the mimxrt1050_evk, we remove the default setting of 'zephyr,sram' and just map: CONFIG_DATA_DTCM to: DT_NXP_IMX_DTCM_0_SIZE DT_NXP_IMX_DTCM_0_BASE_ADDRESS CONFIG_DATA_SDRAM to: DT_MMIO_SRAM_80000000_SIZE DT_MMIO_SRAM_80000000_BASE_ADDRESS Signed-off-by: Kumar Gala --- boards/arm/mimxrt1020_evk/Kconfig.defconfig | 20 ++++++++++ boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts | 5 --- boards/arm/mimxrt1050_evk/Kconfig.defconfig | 38 +++++++++++++++++++ boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts | 10 ----- .../mimxrt1050_evk/mimxrt1050_evk_qspi.dts | 10 ----- boards/arm/mimxrt1060_evk/Kconfig.defconfig | 20 ++++++++++ boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts | 5 --- .../mimxrt1060_evk_hyperflash.dts | 10 ----- boards/arm/mimxrt1064_evk/Kconfig.defconfig | 20 ++++++++++ boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts | 5 --- 10 files changed, 98 insertions(+), 45 deletions(-) diff --git a/boards/arm/mimxrt1020_evk/Kconfig.defconfig b/boards/arm/mimxrt1020_evk/Kconfig.defconfig index 29c0a4cd9eafce..f8f978802190f0 100644 --- a/boards/arm/mimxrt1020_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1020_evk/Kconfig.defconfig @@ -50,4 +50,24 @@ config ETH_MCUX_0 endif # NETWORKING +if CODE_ITCM + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_ITCM_0_SIZE,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_ITCM_0_BASE_ADDRESS) + +endif # CODE_ITCM + +if CODE_QSPI + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_FLEXSPI_402A8000_SIZE_1,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_FLEXSPI_402A8000_BASE_ADDRESS_1) + +endif + endif # BOARD_MIMXRT1020_EVK diff --git a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts index 3be395bb3c5ddb..cf7018b8173da4 100644 --- a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts +++ b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts @@ -27,11 +27,6 @@ }; chosen { -#if defined(CONFIG_CODE_ITCM) - zephyr,flash = &itcm0; -#elif defined(CONFIG_CODE_QSPI) - zephyr,flash = &is25wp064; -#endif zephyr,sram = &dtcm0; zephyr,console = &uart1; zephyr,shell-uart = &uart1; diff --git a/boards/arm/mimxrt1050_evk/Kconfig.defconfig b/boards/arm/mimxrt1050_evk/Kconfig.defconfig index 531ff6f2963edc..9e63c308a30fc6 100644 --- a/boards/arm/mimxrt1050_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1050_evk/Kconfig.defconfig @@ -53,6 +53,44 @@ config UART_MCUX_LPUART_3 endif # UART_MCUX_LPUART +if CODE_ITCM + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_ITCM_0_SIZE,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_ITCM_0_BASE_ADDRESS) + +endif # CODE_ITCM + +if CODE_HYPERFLASH || CODE_QSPI + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_FLEXSPI_402A8000_SIZE_1,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_FLEXSPI_402A8000_BASE_ADDRESS_1) + +endif + +if DATA_DTCM + +config SRAM_SIZE + default $(dt_int_val,DT_NXP_IMX_DTCM_0_SIZE,K) + +config SRAM_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_DTCM_0_BASE_ADDRESS) +endif + +if DATA_SDRAM + +config SRAM_SIZE + default $(dt_int_val,DT_MMIO_SRAM_80000000_SIZE,K) + +config SRAM_BASE_ADDRESS + default $(dt_hex_val,DT_MMIO_SRAM_80000000_BASE_ADDRESS) +endif + if NETWORKING config NET_L2_ETHERNET diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts index 07f7a342090cb8..0269471c5927d6 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts @@ -28,16 +28,6 @@ }; chosen { -#if defined(CONFIG_CODE_ITCM) - zephyr,flash = &itcm0; -#elif defined(CONFIG_CODE_HYPERFLASH) - zephyr,flash = &hyperflash0; -#endif -#if defined(CONFIG_DATA_SDRAM) - zephyr,sram = &sdram0; -#else - zephyr,sram = &dtcm0; -#endif zephyr,console = &uart1; zephyr,shell-uart = &uart1; }; diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts index c3272de62d20c0..2fc669c5abdea4 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts @@ -6,16 +6,6 @@ #include "mimxrt1050_evk.dts" -/ { - chosen { -#if defined(CONFIG_CODE_ITCM) - zephyr,flash = &itcm0; -#elif defined(CONFIG_CODE_QSPI) - zephyr,flash = &is25wp064; -#endif - }; -}; - /delete-node/ &hyperflash0; &flexspi0 { diff --git a/boards/arm/mimxrt1060_evk/Kconfig.defconfig b/boards/arm/mimxrt1060_evk/Kconfig.defconfig index e334f3c9331b3c..7a74fffd00205d 100644 --- a/boards/arm/mimxrt1060_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1060_evk/Kconfig.defconfig @@ -31,4 +31,24 @@ config UART_MCUX_LPUART_3 endif # UART_MCUX_LPUART +if CODE_ITCM + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_ITCM_0_SIZE,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_ITCM_0_BASE_ADDRESS) + +endif # CODE_ITCM + +if CODE_HYPERFLASH || CODE_QSPI + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_FLEXSPI_402A8000_SIZE_1,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_FLEXSPI_402A8000_BASE_ADDRESS_1) + +endif + endif # BOARD_MIMXRT1060_EVK || BOARD_MIMXRT1060_EVK_HYPERFLASH diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts index 5e869c027d37e9..9b74f470c070ba 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts @@ -24,11 +24,6 @@ }; chosen { -#if defined(CONFIG_CODE_ITCM) - zephyr,flash = &itcm0; -#elif defined(CONFIG_CODE_QSPI) - zephyr,flash = &is25wp064; -#endif zephyr,sram = &dtcm0; zephyr,console = &uart1; zephyr,shell-uart = &uart1; diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts index c06a5d60db54d6..1d31d3fa2d2ca7 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts @@ -6,16 +6,6 @@ #include "mimxrt1060_evk.dts" -/ { - chosen { -#if defined(CONFIG_CODE_ITCM) - zephyr,flash = &itcm0; -#elif defined(CONFIG_CODE_HYPERFLASH) - zephyr,flash = &hyperflash0; -#endif - }; -}; - /delete-node/ &is25wp064; &flexspi0 { reg = <0x402a8000 0x4000>, <0x60000000 0x4000000>; diff --git a/boards/arm/mimxrt1064_evk/Kconfig.defconfig b/boards/arm/mimxrt1064_evk/Kconfig.defconfig index 93a8ce01f76a0e..9b2ebd892b3078 100644 --- a/boards/arm/mimxrt1064_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1064_evk/Kconfig.defconfig @@ -10,6 +10,26 @@ if BOARD_MIMXRT1064_EVK config BOARD default "mimxrt1064_evk" +if CODE_ITCM + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_ITCM_0_SIZE,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_ITCM_0_BASE_ADDRESS) + +endif # CODE_ITCM + +if CODE_INTERNAL_QSPI + +config FLASH_SIZE + default $(dt_int_val,DT_NXP_IMX_FLEXSPI_402A8000_SIZE_1,K) + +config FLASH_BASE_ADDRESS + default $(dt_hex_val,DT_NXP_IMX_FLEXSPI_402A8000_BASE_ADDRESS_1) + +endif + if GPIO_MCUX_IGPIO config GPIO_MCUX_IGPIO_1 diff --git a/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts b/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts index e054a445774f97..6351f4efdf24f6 100644 --- a/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts +++ b/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts @@ -24,11 +24,6 @@ }; chosen { -#if defined(CONFIG_CODE_ITCM) - zephyr,flash = &itcm0; -#elif defined(CONFIG_CODE_INTERNAL_QSPI) - zephyr,flash = &w25q32jvwj0; -#endif zephyr,sram = &dtcm0; zephyr,console = &uart1; zephyr,shell-uart = &uart1;