Commit 99bfc0bb authored by Ji Luo's avatar Ji Luo

MA-14273-3 imx8q: Move spl to dram to fix reboot issue

Move spl to dram for Android/Android Auto, the memory
map will be changed to:
  SPL:    0x0000_0000 --------> 0x8000_0000
  ATF:    0x8000_0000 --------> 0x8004_0000
  U-boot: 0x8002_0000 --------> 0x8006_0000

Test: reboot ok on imx8qm/imx8qxp.
Signed-off-by: default avatarJi Luo <ji.luo@nxp.com>
parent 40a65840
flash_b0_spl_container_m4_1_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container.img m4_1_image.bin tee.bin u-boot-spl.bin u-boot-atf-container-android.img: bl31.bin u-boot-hash.bin
./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -flags 0x01200000 -scfw scfw_tcm.bin -p4 -m4 m4_1_image.bin 1 0x88800000 -ap u-boot-spl.bin a53 0x00100000 -out flash.bin @if [ -f "hdmitxfw.bin" ] && [ -f "hdmirxfw.bin" ]; then \
objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmitxfw.bin hdmitxfw-pad.bin; \
objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmirxfw.bin hdmirxfw-pad.bin; \
cat u-boot-hash.bin hdmitxfw-pad.bin hdmirxfw-pad.bin > u-boot-hash.bin.temp; \
mv u-boot-hash.bin.temp u-boot-hash.bin; \
fi
if [ -f "tee.bin" ]; then \
if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \
./$(MKIMG) -soc QM -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -rev B0 -c -ap bl31.bin a53 0x80040000 -ap u-boot-hash.bin a53 0x80060000 -ap tee.bin a53 0xFE000000 -out u-boot-atf-container-android.img; \
else \
./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80040000 -ap u-boot-hash.bin a53 0x80060000 -ap tee.bin a53 0xFE000000 -out u-boot-atf-container-android.img; \
fi; \
else \
./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80040000 -ap u-boot-hash.bin a53 0x80060000 -out u-boot-atf-container-android.img; \
fi
flash_b0_spl_container_m4_1_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container-android.img m4_1_image.bin tee.bin u-boot-spl.bin
./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -flags 0x01200000 -scfw scfw_tcm.bin -p4 -m4 m4_1_image.bin 1 0x88800000 -ap u-boot-spl.bin a53 0x80000000 -out flash.bin
cp flash.bin boot-spl-container.img cp flash.bin boot-spl-container.img
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ echo "append u-boot-atf-container-android.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ dd if=u-boot-atf-container-android.img of=flash.bin bs=1K seek=$$pad_cnt; \
flash_b0_spl_container_m4_1: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container.img m4_1_image.bin u-boot-spl.bin flash_b0_spl_container_m4_1: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container.img m4_1_image.bin u-boot-spl.bin
./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -flags 0x01200000 -scfw scfw_tcm.bin -p4 -m4 m4_1_image.bin 1 0x88800000 -ap u-boot-spl.bin a53 0x00100000 -out flash.bin ./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -flags 0x01200000 -scfw scfw_tcm.bin -p4 -m4 m4_1_image.bin 1 0x88800000 -ap u-boot-spl.bin a53 0x00100000 -out flash.bin
...@@ -14,10 +31,18 @@ flash_b0_spl_container_m4_1: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-bo ...@@ -14,10 +31,18 @@ flash_b0_spl_container_m4_1: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-bo
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 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; \ dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \
flash_b0_spl_container_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container.img tee.bin u-boot-spl.bin flash_b0_spl_container_trusty: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf-container-android.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 ./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x80000000 -out flash.bin
cp flash.bin boot-spl-container.img cp flash.bin boot-spl-container.img
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ echo "append u-boot-atf-container-android.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ dd if=u-boot-atf-container-android.img of=flash.bin bs=1K seek=$$pad_cnt; \
flash_b0_spl_container_android: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-spl.bin u-boot-atf-container-android.img
./$(MKIMG) -soc QM -rev B0 -append mx8qm-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x80000000 -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-android.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container-android.img of=flash.bin bs=1K seek=$$pad_cnt;
...@@ -62,7 +62,7 @@ u-boot-atf-container.img: bl31.bin u-boot-hash.bin ...@@ -62,7 +62,7 @@ u-boot-atf-container.img: bl31.bin u-boot-hash.bin
.PHONY: clean .PHONY: clean
clean: clean:
@rm -f $(DCD_CFG) .imx8_dcd.cfg.cfgtmp.d $(DCD_800_CFG) $(DCD_1200_CFG) .imx8qm_dcd_800.cfg.cfgtmp.d .imx8qm_dcd.cfg.cfgtmp.d .imx8qm_dcd_1200.cfg.cfgtmp.d head.hash u-boot-hash.bin u-boot-atf.itb u-boot-atf-container.img u-boot-atf-hdmi.bin hdmitxfw-pad.bin hdmirxfw-pad.bin @rm -f $(DCD_CFG) .imx8_dcd.cfg.cfgtmp.d $(DCD_800_CFG) $(DCD_1200_CFG) .imx8qm_dcd_800.cfg.cfgtmp.d .imx8qm_dcd.cfg.cfgtmp.d .imx8qm_dcd_1200.cfg.cfgtmp.d head.hash u-boot-hash.bin u-boot-atf.itb u-boot-atf-container.img u-boot-atf-hdmi.bin hdmitxfw-pad.bin hdmirxfw-pad.bin u-boot-atf-container-android.img
@echo "imx8qm clean done" @echo "imx8qm clean done"
flash: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf.bin flash: $(MKIMG) mx8qm-ahab-container.img scfw_tcm.bin u-boot-atf.bin
......
u-boot-atf-container-android.img: bl31.bin u-boot-hash.bin
if [ -f tee.bin ]; then \
if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \
./$(MKIMG) -soc QX -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -rev B0 -c -ap bl31.bin a35 0x80040000 -ap u-boot-hash.bin a35 0x80060000 -ap tee.bin a35 0xFE000000 -out u-boot-atf-container-android.img; \
else \
./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80040000 -ap u-boot-hash.bin a35 0x80060000 -ap tee.bin a35 0xFE000000 -out u-boot-atf-container-android.img; \
fi; \
else \
./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80040000 -ap u-boot-hash.bin a35 0x80060000 -out u-boot-atf-container-android.img; \
fi
flash_b0_all_ddr: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf.bin m4_image.bin flash_b0_all_ddr: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf.bin m4_image.bin
./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -m4 m4_image.bin 0 0x88000000 -out flash.bin ./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -m4 m4_image.bin 0 0x88000000 -out flash.bin
flash_all_spl_container_ddr: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin flash_all_spl_container_ddr: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf-container-android.img m4_image.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 m4_image.bin 0 0x88000000 -out flash.bin ./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x80000000 -m4 m4_image.bin 0 0x88000000 -out flash.bin
cp flash.bin boot-spl-container.img cp flash.bin boot-spl-container.img
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ echo "append u-boot-atf-container-android.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ dd if=u-boot-atf-container-android.img of=flash.bin bs=1K seek=$$pad_cnt; \
flash_all_spl_container_ddr_car: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin flash_all_spl_container_ddr_car: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf-container-android.img m4_image.bin u-boot-spl.bin
./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -flags 0x01200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -p3 -m4 m4_image.bin 0 0x88000000 -out flash.bin ./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -flags 0x01200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x80000000 -p3 -m4 m4_image.bin 0 0x88000000 -out flash.bin
cp flash.bin boot-spl-container.img cp flash.bin boot-spl-container.img
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ echo "append u-boot-atf-container-android.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ dd if=u-boot-atf-container-android.img of=flash.bin bs=1K seek=$$pad_cnt; \
...@@ -52,7 +52,7 @@ Image1: Image ...@@ -52,7 +52,7 @@ Image1: Image
.PHONY: clean nightly .PHONY: clean nightly
clean: clean:
@rm -f $(MKIMG) $(DCD_CFG) .imx8qx_dcd.cfg.cfgtmp.d u-boot-atf-container.img Image0 Image1 @rm -f $(MKIMG) $(DCD_CFG) .imx8qx_dcd.cfg.cfgtmp.d u-boot-atf-container.img Image0 Image1 u-boot-atf-container-android.img
@echo "imx8qx clean done" @echo "imx8qx clean done"
flash: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf.bin flash: $(MKIMG) mx8qx-ahab-container.img scfw_tcm.bin u-boot-atf.bin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment