From d4de5c41e169be65cfc9f39eb12ab66687a1b619 Mon Sep 17 00:00:00 2001 From: "faqiang.zhu" Date: Wed, 16 Jan 2019 12:47:23 +0800 Subject: [PATCH] MA-13940-2 respectively save a copy of SPL and uboot container To enable dual bootloader, this patch will individually save a copy of container contains SPL and a copy of container contains uboot. The container file of u-boot-atf-container.img is also processed based on whether "ROLLBACK_INDEX_IN_CONTAINER" is defined or not. Signed-off-by: faqiang.zhu --- iMX8QM/soc.mak | 10 +++++++--- iMX8QX/soc.mak | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/iMX8QM/soc.mak b/iMX8QM/soc.mak index 5351a67..355851e 100644 --- a/iMX8QM/soc.mak +++ b/iMX8QM/soc.mak @@ -81,7 +81,11 @@ u-boot-atf-container.img: bl31.bin u-boot-hash.bin mv u-boot-hash.bin.temp u-boot-hash.bin; \ fi if [ -f "tee.bin" ]; then \ - ./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80000000 -ap u-boot-hash.bin a53 0x80020000 -ap tee.bin a53 0xFE000000 -out u-boot-atf-container.img; \ + if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ + ./$(MKIMG) -soc QM -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -rev B0 -c -ap bl31.bin a53 0x80000000 -ap u-boot-hash.bin a53 0x80020000 -ap tee.bin a53 0xFE000000 -out u-boot-atf-container.img; \ + else \ + ./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80000000 -ap u-boot-hash.bin a53 0x80020000 -ap tee.bin a53 0xFE000000 -out u-boot-atf-container.img; \ + fi; \ else \ ./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80000000 -ap u-boot-hash.bin a53 0x80020000 -out u-boot-atf-container.img; \ fi @@ -198,19 +202,19 @@ flash_b0_spl_fit_m4_1_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-b flash_b0_spl_container_m4_1_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container.img CM41.bin tee.bin u-boot-spl.bin ./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -scfw scfw_tcm.bin -m4 CM41.bin 1 0x88800000 -ap u-boot-spl.bin a53 0x00100000 -out flash.bin + cp flash.bin boot-spl-container.img @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ - rm -f u-boot-atf-container.img; flash_b0_spl_container_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container.img tee.bin u-boot-spl.bin ./$(MKIMG) -soc QM -rev B0 -dcd skip -append mx8qm-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -out flash.bin + cp flash.bin boot-spl-container.img @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ - rm -f u-boot-atf-container.img; flash_b0_spl_fit: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf.itb u-boot-spl.bin ./$(MKIMG) -soc QM -rev B0 -dcd skip -append mx8qm-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -out flash.bin diff --git a/iMX8QX/soc.mak b/iMX8QX/soc.mak index 586559e..156d2ac 100644 --- a/iMX8QX/soc.mak +++ b/iMX8QX/soc.mak @@ -72,7 +72,11 @@ u-boot-atf.itb: u-boot-hash.bin bl31.bin u-boot-atf-container.img: bl31.bin u-boot-hash.bin if [ -f tee.bin ]; then \ - ./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -ap tee.bin a35 0xFE000000 -out u-boot-atf-container.img; \ + if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ + ./$(MKIMG) -soc QX -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -rev B0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -ap tee.bin a35 0xFE000000 -out u-boot-atf-container.img; \ + else \ + ./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -ap tee.bin a35 0xFE000000 -out u-boot-atf-container.img; \ + fi; \ else \ ./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -out u-boot-atf-container.img; \ fi @@ -178,11 +182,11 @@ flash_all_spl_fit: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf.itb flash_all_spl_container: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf-container.img CM4.bin u-boot-spl.bin ./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -m4 CM4.bin 0 0x88000000 -out flash.bin + cp flash.bin boot-spl-container.img @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ - rm -f u-boot-atf-container.img; flash_spl: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf.bin u-boot-spl.bin ./$(MKIMG) -soc QX -rev B0 -dcd skip -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -out flash.bin -- 2.26.2