Commit 700315c9ac4d44740884ed6a02a5dc56bec92868
Committed by
Stefano Babic
1 parent
dd7d0911e0
Exists in
smarc_8mq_lf_v2020.04
and in
9 other branches
imx: add container target
To support SPL loading container file, add a new Makefile target, and introduce a new Kconfig file to source the cfg file which will be parsed by mkimage. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Showing 3 changed files with 27 additions and 2 deletions Side-by-side Diff
Makefile
... | ... | @@ -1365,8 +1365,16 @@ |
1365 | 1365 | $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ |
1366 | 1366 | |
1367 | 1367 | ifeq ($(CONFIG_ARCH_IMX8M)$(CONFIG_ARCH_IMX8), y) |
1368 | +ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y) | |
1369 | +u-boot.cnt: u-boot.bin FORCE | |
1370 | + $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ | |
1371 | + | |
1372 | +flash.bin: spl/u-boot-spl.bin u-boot.cnt FORCE | |
1373 | + $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ | |
1374 | +else | |
1368 | 1375 | flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE |
1369 | 1376 | $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@ |
1377 | +endif | |
1370 | 1378 | endif |
1371 | 1379 | |
1372 | 1380 | u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE |
arch/arm/mach-imx/Makefile
... | ... | @@ -90,6 +90,11 @@ |
90 | 90 | $(Q)mkdir -p $(dir $@) |
91 | 91 | $(call if_changed_dep,cpp_cfg) |
92 | 92 | |
93 | +IMX_CONTAINER_CFG = $(CONFIG_IMX_CONTAINER_CFG:"%"=%) | |
94 | +container.cfg: $(IMX_CONTAINER_CFG) FORCE | |
95 | + $(Q)mkdir -p $(dir $@) | |
96 | + $(call if_changed_dep,cpp_cfg) | |
97 | + | |
93 | 98 | ifeq ($(CONFIG_ARCH_IMX8), y) |
94 | 99 | CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh |
95 | 100 | IMAGE_TYPE := imx8image |
96 | 101 | |
... | ... | @@ -158,10 +163,15 @@ |
158 | 163 | MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e 0x100000 |
159 | 164 | flash.bin: MKIMAGEOUTPUT = flash.log |
160 | 165 | |
161 | -flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE | |
162 | -ifeq ($(SPL_DEPFILE_EXISTS),0) | |
166 | +MKIMAGEFLAGS_u-boot.cnt = -n container.cfg -T $(IMAGE_TYPE) -e 0x100000 | |
167 | +u-boot.cnt: MKIMAGEOUTPUT = u-boot.cnt.log | |
168 | + | |
169 | +ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y) | |
170 | +u-boot.cnt: u-boot.bin container.cfg FORCE | |
163 | 171 | $(call if_changed,mkimage) |
164 | 172 | endif |
173 | +flash.bin: spl/u-boot-spl.bin FORCE | |
174 | + $(call if_changed,mkimage) | |
165 | 175 | endif |
166 | 176 | |
167 | 177 | else |
arch/arm/mach-imx/imx8/Kconfig
... | ... | @@ -29,6 +29,13 @@ |
29 | 29 | help |
30 | 30 | This is to let SPL could load i.MX8 Container image |
31 | 31 | |
32 | +config IMX_CONTAINER_CFG | |
33 | + string "i.MX Container config file" | |
34 | + depends on SPL | |
35 | + help | |
36 | + This is to specific the cfg file for generating container | |
37 | + image which will be loaded by SPL. | |
38 | + | |
32 | 39 | choice |
33 | 40 | prompt "i.MX8 board select" |
34 | 41 | optional |