Skip to content

Commit

Permalink
soc: nxp_imx: Add support for device configuration data (DCD)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MaureenHelm authored and galak committed Jan 9, 2019
1 parent 3737947 commit a9389da
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/hal/nxp/mcux/boards/evkbimxrt1050/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
#

zephyr_compile_definitions_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER XIP_BOOT_HEADER_ENABLE=1)
zephyr_compile_definitions_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA XIP_BOOT_HEADER_DCD_ENABLE=1)

zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR evkbimxrt1050_flexspi_nor_config.c)
zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA evkbimxrt1050_sdram_ini_dcd.c)
2 changes: 2 additions & 0 deletions ext/hal/nxp/mcux/boards/evkmimxrt1020/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
#

zephyr_compile_definitions_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER XIP_BOOT_HEADER_ENABLE=1)
zephyr_compile_definitions_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA XIP_BOOT_HEADER_DCD_ENABLE=1)

zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR evkmimxrt1020_flexspi_nor_config.c)
zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA evkmimxrt1020_sdram_ini_dcd.c)
2 changes: 2 additions & 0 deletions ext/hal/nxp/mcux/boards/evkmimxrt1060/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
#

zephyr_compile_definitions_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER XIP_BOOT_HEADER_ENABLE=1)
zephyr_compile_definitions_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA XIP_BOOT_HEADER_DCD_ENABLE=1)

zephyr_sources_ifdef(CONFIG_BOOT_FLEXSPI_NOR evkmimxrt1060_flexspi_nor_config.c)
zephyr_sources_ifdef(CONFIG_DEVICE_CONFIGURATION_DATA evkmimxrt1060_sdram_ini_dcd.c)
3 changes: 3 additions & 0 deletions include/arch/arm/cortex_m/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ SECTIONS
. = CONFIG_IMAGE_VECTOR_TABLE_OFFSET;
KEEP(*(.boot_hdr.ivt))
KEEP(*(.boot_hdr.data))
#ifdef CONFIG_DEVICE_CONFIGURATION_DATA
KEEP(*(.boot_hdr.dcd_data))
#endif
#endif

. = CONFIG_TEXT_SECTION_OFFSET;
Expand Down
1 change: 1 addition & 0 deletions include/linker/section_tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define __imx_boot_conf_section _GENERIC_SECTION(IMX_BOOT_CONF)
#define __imx_boot_data_section _GENERIC_SECTION(IMX_BOOT_DATA)
#define __imx_boot_ivt_section _GENERIC_SECTION(IMX_BOOT_IVT)
#define __imx_boot_dcd_section _GENERIC_SECTION(IMX_BOOT_DCD)
#endif /* CONFIG_ARM */

#if defined(CONFIG_NOCACHE_MEMORY)
Expand Down
1 change: 1 addition & 0 deletions include/linker/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#define IMX_BOOT_CONF .boot_hdr.conf
#define IMX_BOOT_DATA .boot_hdr.data
#define IMX_BOOT_IVT .boot_hdr.ivt
#define IMX_BOOT_DCD .boot_hdr.dcd_data

#ifdef CONFIG_NOCACHE_MEMORY
#define _NOCACHE_SECTION_NAME nocache
Expand Down
6 changes: 6 additions & 0 deletions soc/arm/nxp_imx/rt/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ config IMAGE_VECTOR_TABLE_OFFSET
the application entry point and device configuration data. The boot
ROM reqiures a fixed IVT offset for each type of boot device.

config DEVICE_CONFIGURATION_DATA
bool "Enable device configuration data"
help
Device configuration data (DCD) provides a sequence of commmands to
the boot ROM to initialize components such as an SDRAM.

endif # NXP_IMX_RT_BOOT_HEADER

endif # SOC_SERIES_IMX_RT
4 changes: 4 additions & 0 deletions soc/arm/nxp_imx/rt/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const __imx_boot_ivt_section ivt image_vector_table = {
.hdr = IVT_HEADER,
.entry = CONFIG_FLASH_BASE_ADDRESS + CONFIG_TEXT_SECTION_OFFSET,
.reserved1 = IVT_RSVD,
#ifdef CONFIG_DEVICE_CONFIGURATION_DATA
.dcd = (uint32_t) dcd_data,
#else
.dcd = (uint32_t) NULL,
#endif
.boot_data = (uint32_t) &boot_data,
.self = (uint32_t) &image_vector_table,
.csf = (uint32_t)CSF_ADDRESS,
Expand Down

0 comments on commit a9389da

Please sign in to comment.