Commit acab9050 authored by Lukas Posadka's avatar Lukas Posadka

CGT SX8M: Added SX8M targets & pulled in FSPI image fix

  - Added the SX8M SD target
  - Added the FSPI SX8M target
  - FSPI offset fix pulled in from the 2.1.0 branch
parent dd023400
......@@ -1104,6 +1104,11 @@ int main(int argc, char **argv)
}
if (version == ROM_V2) {
/* On V2, flexspi IVT offset is 0, image offset is 0x1000 */
if (ivt_offset == IVT_OFFSET_FLEXSPI)
rom_image_offset = IVT_OFFSET_FLEXSPI;
/* V2 ROM set IVT offset to 0 for all boot devices */
ivt_offset = 0;
......@@ -1593,13 +1598,14 @@ int main(int argc, char **argv)
}
/* The FLEXSPI configuration parameters will add to flash.bin by script, so need add 0x1000 offset to every offset prints */
if (ivt_offset == IVT_OFFSET_FLEXSPI) {
header_image_off += ivt_offset;
dcd_off += ivt_offset;
image_off += ivt_offset;
csf_off += ivt_offset;
sld_header_off += ivt_offset;
sld_csf_off += ivt_offset;
if ((version == ROM_V2 && rom_image_offset == IVT_OFFSET_FLEXSPI) ||
(version == ROM_V1 && ivt_offset == IVT_OFFSET_FLEXSPI)) {
header_image_off += IVT_OFFSET_FLEXSPI;
dcd_off += IVT_OFFSET_FLEXSPI;
image_off += IVT_OFFSET_FLEXSPI;
csf_off += IVT_OFFSET_FLEXSPI;
sld_header_off += IVT_OFFSET_FLEXSPI;
sld_csf_off += IVT_OFFSET_FLEXSPI;
}
fprintf(stderr, "\nLoader IMAGE:\n");
......
......@@ -12,12 +12,18 @@ if [ -z "$ATF_LOAD_ADDR" ]; then
exit 0
fi
if [ "$VERSION" = "v1" ]; then
let ivt_off=0x400
else
let ivt_off=0x0
fi
if [ "$BOOT_DEV" = "flexspi" ]; then
# We dd flash.bin to 0 offset for flexspi
let uboot_sign_off=$((fit_off + 0x3000))
else
# We dd flash.bin to 33KB "0x8400" offset, so need minus 0x8400
let uboot_sign_off=$((fit_off - 0x8400 + 0x3000))
let uboot_sign_off=$((fit_off - 0x8000 - ivt_off + 0x3000))
fi
let uboot_size=$(ls -lct u-boot-nodtb.bin | awk '{print $5}')
......
......@@ -25,7 +25,7 @@ TEE_LOAD_ADDR = 0xbe000000
ATF_LOAD_ADDR = 0x00920000
VAL_BOARD = val
#define the F(Q)SPI header file
QSPI_HEADER = ../scripts/fspi_header
QSPI_HEADER = ../scripts/fspi_header 0
QSPI_PACKER = ../scripts/fspi_packer.sh
VERSION = v1
else ifeq ($(SOC),iMX8MN)
......@@ -95,7 +95,7 @@ u-boot-atf-tee.bin: u-boot.bin bl31.bin tee.bin
.PHONY: clean
clean:
@rm -f $(MKIMG) u-boot-atf.bin u-boot-atf-tee.bin u-boot-spl-ddr.bin u-boot.itb u-boot.its u-boot-ddr3l.itb u-boot-ddr3l.its u-boot-spl-ddr3l.bin u-boot-ddr4.itb u-boot-ddr4.its u-boot-spl-ddr4.bin u-boot-ddr4-evk.itb u-boot-ddr4-evk.its $(OUTIMG)
@rm -f $(MKIMG) u-boot-atf.bin u-boot-atf-tee.bin u-boot-spl-ddr.bin u-boot.itb u-boot.its u-boot-sx8m.itb u-boot-sx8m.its u-boot-ddr3l.itb u-boot-ddr3l.its u-boot-spl-ddr3l.bin u-boot-ddr4.itb u-boot-ddr4.its u-boot-spl-ddr4.bin u-boot-ddr4-evk.itb u-boot-ddr4-evk.its $(OUTIMG)
dtbs = fsl-$(PLAT)-evk.dtb
u-boot.itb: $(dtbs)
......@@ -104,6 +104,13 @@ u-boot.itb: $(dtbs)
./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot.itb
@rm -f u-boot.its
dtbs_sx8m = $(PLAT)-cgtsx8m.dtb
u-boot-sx8m.itb: $(dtbs_sx8m)
./$(PAD_IMAGE) bl31.bin
TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtbs_sx8m) > u-boot-sx8m.its
./mkimage_uboot -E -p 0x3000 -f u-boot-sx8m.its u-boot-sx8m.itb
@rm -f u-boot-sx8m.its
dtbs_ddr3l = fsl-$(PLAT)-ddr3l-$(VAL_BOARD).dtb
u-boot-ddr3l.itb: $(dtbs_ddr3l)
./$(PAD_IMAGE) bl31.bin
......@@ -170,6 +177,13 @@ flash_evk_flexspi: $(MKIMG) u-boot-spl-ddr.bin u-boot.itb
./mkimage_imx8 -version $(VERSION) -dev flexspi -fit -loader u-boot-spl-ddr.bin $(SPL_FSPI_LOAD_ADDR) -second_loader u-boot.itb 0x40200000 0x60000 -out $(OUTIMG)
./$(QSPI_PACKER) $(QSPI_HEADER)
flash_sx8m: $(MKIMG) u-boot-spl-ddr.bin u-boot-sx8m.itb
./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -second_loader u-boot-sx8m.itb 0x40200000 0x60000 -out $(OUTIMG)
flash_sx8m_flexspi: $(MKIMG) u-boot-spl-ddr.bin u-boot-sx8m.itb
./mkimage_imx8 -version $(VERSION) -dev flexspi -fit -loader u-boot-spl-ddr.bin $(SPL_FSPI_LOAD_ADDR) -second_loader u-boot-sx8m.itb 0x40200000 0x60000 -out $(OUTIMG)
./$(QSPI_PACKER) $(QSPI_HEADER)
flash_hdmi_spl_uboot: flash_evk
flash_dp_spl_uboot: flash_dp_evk
......
......@@ -3,7 +3,11 @@
mv flash.bin qspi-flash
awk '{s="00000000"$1;l=length(s);if(!((NR-1)%4))printf "%08x ",(NR-1)*4;for(i=7;i>0;i-=2)printf " %s",substr(s,l-i,2);if(!(NR%4))printf "\n";}' $1 > qspi-tmp
xxd -r qspi-tmp qspi-header
dd if=qspi-header of=qspi-header.off bs=1k seek=1
if [ $# -eq 2 ] && [ $2 -eq 0 ]; then
dd if=qspi-header of=qspi-header.off bs=1k seek=0
else
dd if=qspi-header of=qspi-header.off bs=1k seek=1
fi
dd if=qspi-flash of=qspi-flash.off bs=1k seek=4
dd if=qspi-header.off of=qspi-flash.off conv=notrunc
mv qspi-flash.off flash.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