Skip to content

Commit a9389da

Browse files
MaureenHelmgalak
authored andcommitted
soc: nxp_imx: Add support for device configuration data (DCD)
Adds support for the device configuration data (DCD), which provides a sequence of commands to the imx rt boot ROM to initialize components such as an SDRAM. It is now possible to use the external SDRAM instead of the internal DTCM on the mimxrt1020_evk, mimxrt1050_evk, and mimxrt1060_evk. Note, however, that the default board configurations still link data into internal DTCM, therefore you must use a device tree overlay to override "zephyr,sram = &sdram0" Signed-off-by: Maureen Helm <[email protected]>
1 parent 3737947 commit a9389da

File tree

8 files changed

+21
-0
lines changed

8 files changed

+21
-0
lines changed

ext/hal/nxp/mcux/boards/evkbimxrt1050/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
#
66

77
zephyr_compile_definitions_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER XIP_BOOT_HEADER_ENABLE=1)
8+
zephyr_compile_definitions_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA XIP_BOOT_HEADER_DCD_ENABLE=1)
89

910
zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR evkbimxrt1050_flexspi_nor_config.c)
11+
zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA evkbimxrt1050_sdram_ini_dcd.c)

ext/hal/nxp/mcux/boards/evkmimxrt1020/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
#
66

77
zephyr_compile_definitions_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER XIP_BOOT_HEADER_ENABLE=1)
8+
zephyr_compile_definitions_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA XIP_BOOT_HEADER_DCD_ENABLE=1)
89

910
zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR evkmimxrt1020_flexspi_nor_config.c)
11+
zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA evkmimxrt1020_sdram_ini_dcd.c)

ext/hal/nxp/mcux/boards/evkmimxrt1060/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
#
66

77
zephyr_compile_definitions_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER XIP_BOOT_HEADER_ENABLE=1)
8+
zephyr_compile_definitions_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA XIP_BOOT_HEADER_DCD_ENABLE=1)
89

910
zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR evkmimxrt1060_flexspi_nor_config.c)
11+
zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA evkmimxrt1060_sdram_ini_dcd.c)

include/arch/arm/cortex_m/scripts/linker.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ SECTIONS
141141
. = CONFIG_IMAGE_VECTOR_TABLE_OFFSET;
142142
KEEP(*(.boot_hdr.ivt))
143143
KEEP(*(.boot_hdr.data))
144+
#ifdef CONFIG_DEVICE_CONFIGURATION_DATA
145+
KEEP(*(.boot_hdr.dcd_data))
146+
#endif
144147
#endif
145148

146149
. = CONFIG_TEXT_SECTION_OFFSET;

include/linker/section_tags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#define __imx_boot_conf_section _GENERIC_SECTION(IMX_BOOT_CONF)
2727
#define __imx_boot_data_section _GENERIC_SECTION(IMX_BOOT_DATA)
2828
#define __imx_boot_ivt_section _GENERIC_SECTION(IMX_BOOT_IVT)
29+
#define __imx_boot_dcd_section _GENERIC_SECTION(IMX_BOOT_DCD)
2930
#endif /* CONFIG_ARM */
3031

3132
#if defined(CONFIG_NOCACHE_MEMORY)

include/linker/sections.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#define IMX_BOOT_CONF .boot_hdr.conf
6262
#define IMX_BOOT_DATA .boot_hdr.data
6363
#define IMX_BOOT_IVT .boot_hdr.ivt
64+
#define IMX_BOOT_DCD .boot_hdr.dcd_data
6465

6566
#ifdef CONFIG_NOCACHE_MEMORY
6667
#define _NOCACHE_SECTION_NAME nocache

soc/arm/nxp_imx/rt/Kconfig.soc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ config IMAGE_VECTOR_TABLE_OFFSET
187187
the application entry point and device configuration data. The boot
188188
ROM reqiures a fixed IVT offset for each type of boot device.
189189

190+
config DEVICE_CONFIGURATION_DATA
191+
bool "Enable device configuration data"
192+
help
193+
Device configuration data (DCD) provides a sequence of commmands to
194+
the boot ROM to initialize components such as an SDRAM.
195+
190196
endif # NXP_IMX_RT_BOOT_HEADER
191197

192198
endif # SOC_SERIES_IMX_RT

soc/arm/nxp_imx/rt/soc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ const __imx_boot_ivt_section ivt image_vector_table = {
6060
.hdr = IVT_HEADER,
6161
.entry = CONFIG_FLASH_BASE_ADDRESS + CONFIG_TEXT_SECTION_OFFSET,
6262
.reserved1 = IVT_RSVD,
63+
#ifdef CONFIG_DEVICE_CONFIGURATION_DATA
64+
.dcd = (uint32_t) dcd_data,
65+
#else
6366
.dcd = (uint32_t) NULL,
67+
#endif
6468
.boot_data = (uint32_t) &boot_data,
6569
.self = (uint32_t) &image_vector_table,
6670
.csf = (uint32_t)CSF_ADDRESS,

0 commit comments

Comments
 (0)