Skip to content

Commit 92fe404

Browse files
decsnyjhedberg
authored andcommitted
soc: nxp: rt118x: Move container header in tree
Instead of gluing to the one in the HAL which is not very flexible to configure, define the container header in the zephyr SOC code. This fixes the bug of CONFIG_NXP_FLEXSPI_ROM_RAMLOADER not working. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
1 parent 96d0957 commit 92fe404

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

soc/nxp/imxrt/imxrt118x/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ if((CONFIG_NXP_IMXRT_BOOT_HEADER) AND (CONFIG_BOOT_FLEXSPI_NOR))
1919
set(RT118x_DEVICE_BOOT_HEADER_DIR
2020
"${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk-ng/devices/RT/RT1180/MIMXRT1189")
2121

22-
zephyr_library_sources(${RT118x_DEVICE_BOOT_HEADER_DIR}/xip/fsl_flexspi_nor_boot.c)
2322
zephyr_library_include_directories(${RT118x_DEVICE_BOOT_HEADER_DIR}/xip)
2423
zephyr_library_include_directories(${RT118x_DEVICE_BOOT_HEADER_DIR})
2524
endif()

soc/nxp/imxrt/imxrt118x/soc.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,50 @@
2626

2727
LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
2828

29+
#if defined(CONFIG_NXP_IMXRT_BOOT_HEADER) && defined(CONFIG_CPU_CORTEX_M33)
30+
#include <fsl_flexspi_nor_boot.h>
31+
32+
extern char __start[];
33+
extern char _flash_used[];
34+
extern char __rom_start_address[];
35+
const __imx_boot_container_section container boot_header = {
36+
.hdr = {
37+
CNT_VERSION,
38+
CNT_SIZE,
39+
CNT_TAG_HEADER,
40+
CNT_FLAGS,
41+
CNT_SW_VER,
42+
CNT_FUSE_VER,
43+
CNT_NUM_IMG,
44+
sizeof(cnt_hdr) + CNT_NUM_IMG * sizeof(image_entry),
45+
0
46+
},
47+
.array = {
48+
{
49+
(uint32_t)(-1 * CONFIG_IMAGE_CONTAINER_OFFSET),
50+
(uint32_t)_flash_used,
51+
(uint32_t)__rom_start_address,
52+
0x00000000,
53+
(uint32_t)__start,
54+
0x00000000,
55+
IMG_FLAGS,
56+
0x0,
57+
{0},
58+
{0}
59+
},
60+
},
61+
.sign_block = {
62+
SGNBK_VERSION,
63+
SGNBK_SIZE,
64+
SGNBK_TAG,
65+
0x0,
66+
0x0,
67+
0x0,
68+
0x0
69+
},
70+
};
71+
#endif
72+
2973
#if defined(CONFIG_SECOND_CORE_MCUX) && defined(CONFIG_CPU_CORTEX_M33)
3074
#if !defined(CONFIG_CM7_BOOT_FROM_FLASH)
3175
#include <zephyr_image_info.h>

0 commit comments

Comments
 (0)