├── scripts ├── more_headers │ ├── README │ └── micron_nor_mt35x_octal_ddr_200mhz ├── sit_template ├── gen_sit.sh ├── split_kernel.sh ├── fspi_packer.sh ├── split_spl.sh ├── pad_image.sh ├── dtb_check.sh ├── fspi_fcb_gen.sh ├── autobuild_common.mak ├── fspi_header ├── fspi_header_atxp └── qspi_header ├── iMX8M ├── signature.dts ├── README ├── print_fit_hab.sh ├── mkimage_fit_atf.sh └── soc.mak ├── iMX91 ├── signature.dts ├── scripts │ └── autobuild.mak └── soc.mak ├── iMX93 ├── signature.dts ├── scripts │ └── autobuild.mak └── soc.mak ├── iMX95 ├── signature.dts └── scripts │ ├── fspi_header_133 │ ├── fspi_header_200 │ └── autobuild.mak ├── iMX8QM ├── scripts │ ├── alias.mak │ ├── test.mak │ ├── misc.mak │ ├── m4.mak │ ├── android.mak │ └── autobuild.mak ├── mkimage_fit_atf.sh ├── expand_c_define.sh └── soc.mak ├── SCR-imx-mkimage.txt ├── iMX8QX ├── scripts │ ├── alias.mak │ ├── m4.mak │ ├── android.mak │ ├── misc.mak │ ├── test.mak │ └── autobuild.mak ├── mkimage_fit_atf.sh └── soc.mak ├── iMX8DXL ├── scripts │ ├── m4.mak │ ├── android.mak │ ├── misc.mak │ ├── test.mak │ └── autobuild.mak └── soc.mak ├── Readme.imx95 ├── SBOM.spdx.json ├── iMX94 └── scripts │ ├── fspi_header_133 │ ├── fspi_header_200 │ └── autobuild.mak ├── Makefile ├── iMX8ULP ├── README └── soc.mak ├── README └── src └── mkimage_common.h /scripts/more_headers/README: -------------------------------------------------------------------------------- 1 | Chips from different vendors may require different header files. The list of 2 | header files in this folder can be used as a reference. 3 | -------------------------------------------------------------------------------- /iMX8M/signature.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | /dts-v1/; 7 | /plugin/; 8 | / { 9 | fragment@0 { 10 | target-path = "/"; 11 | __overlay__ { 12 | signature { 13 | capsule-key = /incbin/("CRT.esl"); 14 | }; 15 | }; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /iMX91/signature.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | /dts-v1/; 7 | /plugin/; 8 | / { 9 | fragment@0 { 10 | target-path = "/"; 11 | __overlay__ { 12 | signature { 13 | capsule-key = /incbin/("CRT.esl"); 14 | }; 15 | }; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /iMX93/signature.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | /dts-v1/; 7 | /plugin/; 8 | / { 9 | fragment@0 { 10 | target-path = "/"; 11 | __overlay__ { 12 | signature { 13 | capsule-key = /incbin/("CRT.esl"); 14 | }; 15 | }; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /iMX95/signature.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright 2022 NXP 4 | */ 5 | 6 | /dts-v1/; 7 | /plugin/; 8 | / { 9 | fragment@0 { 10 | target-path = "/"; 11 | __overlay__ { 12 | signature { 13 | capsule-key = /incbin/("CRT.esl"); 14 | }; 15 | }; 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /scripts/sit_template: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | use strict; 3 | 4 | open(my $out, '>:raw', 'sit.bin') or die "Unable to open: $!"; 5 | print $out pack("V", 0x0); # chipnum 6 | print $out pack("V", 0x0); # driver type 7 | print $out pack("V", 0x00112233); # tag 8 | print $out pack("V", %sectornum%); # firstSectorNumber 9 | print $out pack("V", 0x0); # Sector count, not used 10 | close($out); 11 | -------------------------------------------------------------------------------- /scripts/gen_sit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -lt 1 ]; then 4 | echo "Must set the sector offset of secondary image" 5 | exit -1 6 | fi 7 | 8 | sector_num=`printf "0x%X" $1` 9 | 10 | sed -e s/%sectornum%/${sector_num}/g scripts/sit_template > sit_gen 11 | chmod +x sit_gen 12 | 13 | ./sit_gen 14 | objcopy -I binary -O binary --pad-to 512 sit.bin 15 | 16 | rm sit_gen 17 | echo "Generated sit.bin" 18 | -------------------------------------------------------------------------------- /iMX8QM/scripts/alias.mak: -------------------------------------------------------------------------------- 1 | flash_b0: flash 2 | 3 | flash_b0_flexspi: flash_flexspi 4 | 5 | flash_b0_spl_container: flash_spl 6 | 7 | flash_b0_spl_flexspi_container: flash_spl_flexspi 8 | 9 | flash_b0_scfw: flash_scfw 10 | 11 | flash_b0_linux: flash_kernel 12 | 13 | flash_b0_ca72: flash_ca72 14 | 15 | flash_b0_cm40flexspi: flash_cm4_xip 16 | 17 | flash_b0_cm4sflexspi: flash_cm4s_xip 18 | 19 | flash_b0_cm4_0: flash_cm4 20 | 21 | flash_b0_cm4_1: flash_cm41 22 | 23 | flash_b0_m4s_tcm: flash_cm4s -------------------------------------------------------------------------------- /SCR-imx-mkimage.txt: -------------------------------------------------------------------------------- 1 | Package: imx-mkimage.git 2 | Version: 3 | Outgoing License: GPL-2.0 4 | License File: LICENSE 5 | Type of Content: source 6 | Description and comments: Make Image BootLoader 7 | Release Location: https://github.com/nxp-imx/imx-mkimage -b lf-6.1.1-1.0.0 8 | Origin: NXP (GPL-2.0) 9 | Das U-Boot - Universal Bootloader (GPL-2.0) - http://www.denx.de/wiki/U-Boot/WebHome 10 | -------------------------------------------------------------------------------- /iMX8QX/scripts/alias.mak: -------------------------------------------------------------------------------- 1 | flash_b0: flash 2 | 3 | flash_spl_container: flash_spl 4 | 5 | flash_spl_flexspi_container: flash_spl_flexspi 6 | 7 | flash_spl_nand_container: flash_spl_nand 8 | 9 | flash_all_spl_container: flash_linux_m4 10 | 11 | flash_b0_all flash_all flash_uboot_cm4 flash_b0_uboot_cm4: flash_regression_linux_m4 12 | 13 | flash_uboot_cm4ddr flash_b0_uboot_cm4ddr: flash_regression_linux_m4_ddr 14 | 15 | flash_b0_scfw: flash_scfw 16 | 17 | flash_b0_linux: flash_kernel 18 | 19 | flash_b0_cm4: flash_cm4 20 | 21 | flash_b0_cm4ddr: flash_cm4_ddr 22 | 23 | flash_b0_cm4flexspi: flash_cm4_xip 24 | 25 | -------------------------------------------------------------------------------- /iMX8QX/scripts/m4.mak: -------------------------------------------------------------------------------- 1 | flash_m4: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin 2 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 3 | 4 | flash_m4_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin 5 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x88000000 -out flash.bin 6 | 7 | flash_m4_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin $(QSPI_HEADER) 8 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -fileoff 0x80000 -p1 -m4 m4_image.bin 0 0x08081000 -out flash.bin 9 | ./$(QSPI_PACKER) $(QSPI_HEADER) -------------------------------------------------------------------------------- /scripts/split_kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f $1 ]; then 4 | echo "Kernel Image file" $1 "NOT found" 5 | exit 1; 6 | fi 7 | 8 | let size=$(wc -c $1 | awk '{print $1}') 9 | let split_address=$2 10 | let split_size=$3 11 | let split_number=$(((size + split_size -1) / split_size)) 12 | command="" 13 | 14 | for ((i = 0; i < ${split_number}; i++)); do 15 | rm -f $1_split_$i 16 | 17 | dd if=$1 of=$1_split_$i bs=${split_size} skip=$i count=1 conv=fsync 18 | 19 | addr=`printf "0x%X" ${split_address}` 20 | command="$command -ap $1_split_$i a35 $addr" 21 | 22 | split_address=$((split_address + split_size)) 23 | done 24 | 25 | rm -f $1_cmd 26 | echo $command > $1_cmd -------------------------------------------------------------------------------- /scripts/fspi_packer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mv flash.bin qspi-flash 4 | 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 5 | xxd -r qspi-tmp qspi-header 6 | if [ $# -eq 2 ] && [ $2 -eq 0 ]; then 7 | dd if=qspi-header of=qspi-header.off bs=1k seek=0 8 | else 9 | dd if=qspi-header of=qspi-header.off bs=1k seek=1 10 | fi 11 | dd if=qspi-flash of=qspi-flash.off bs=1k seek=4 12 | dd if=qspi-header.off of=qspi-flash.off conv=notrunc 13 | mv qspi-flash.off flash.bin 14 | cp qspi-header.off imx-fspi-header.bin 15 | rm qspi-tmp qspi-header* qspi-flash* 16 | echo "F(Q)SPI IMAGE PACKED" 17 | 18 | -------------------------------------------------------------------------------- /iMX8QM/scripts/test.mak: -------------------------------------------------------------------------------- 1 | flash_b0_ca72_ddrstress: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin mx8qmb0_ddr_stress_test.bin 2 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00800000 -scfw scfw_tcm.bin -ap mx8qmb0_ddr_stress_test.bin a72 0x00100000 -out flash.bin 3 | 4 | flash_ddrstress flash_b0_ca53_ddrstress: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin mx8qmb0_ddr_stress_test.bin 5 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00800000 -scfw scfw_tcm.bin -ap mx8qmb0_ddr_stress_test.bin a53 0x00100000 -out flash.bin 6 | 7 | flash_scfw_test flash_b0_scfw_test: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin scfw_tests.bin 8 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin --data scfw_tests.bin a53 0x100000 -out flash.bin 9 | -------------------------------------------------------------------------------- /scripts/split_spl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ${V2X} != YES ]; then 4 | echo "-ap u-boot-spl.bin a35 0x00100000" > $1_cmd 5 | exit 0 6 | fi 7 | 8 | if [ ! -f $1 ]; then 9 | echo "SPL file" $1 "NOT found" 10 | exit 1; 11 | fi 12 | let size=$(wc -c $1 | awk '{print $1}') 13 | let split_address=$2 14 | let split_size=$((split_address - 0x100000)) 15 | 16 | if [ ${size} -gt ${split_size} ]; then 17 | let residual_size=$((size - split_size)) 18 | 19 | rm -f $1_split_a $1_split_b 20 | 21 | dd if=$1 of=$1_split_a bs=1 count=${split_size} conv=fsync 22 | dd if=$1 of=$1_split_b bs=1 skip=${split_size} count=${residual_size} conv=fsync 23 | 24 | echo "-ap u-boot-spl.bin_split_a a35 0x00100000 -data u-boot-spl.bin_split_b a35" $2 > $1_cmd 25 | else 26 | echo "-ap u-boot-spl.bin a35 0x00100000" > $1_cmd 27 | fi 28 | -------------------------------------------------------------------------------- /scripts/pad_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | 4 | # Compute the sum of all files passed in the command line and pad the last one, 5 | # so that the sum of all files size is aligned on 16 bytes. 6 | 7 | _total_size=0 8 | 9 | while [[ $# -gt 0 ]]; do 10 | if [[ ! -f $1 ]]; then 11 | echo "ERROR: $0: Could not find file $1. Exiting." 12 | exit 0 13 | fi 14 | 15 | _file=$1 16 | _current_file_size="$(wc -c $1 | awk '{print $1}')" 17 | _total_size=$((_total_size + _current_file_size)) 18 | shift 19 | done 20 | 21 | _padded_size="$(((_total_size + 15) & ~15))" 22 | if [[ "${_total_size}" != "${_padded_size}" ]]; then 23 | _last_file_padded_size=$((_padded_size - (_total_size - _current_file_size))) 24 | echo "Padding $_file to ${_last_file_padded_size} bytes" 25 | objcopy -I binary -O binary --pad-to "${_last_file_padded_size}" "${_file}" 26 | fi 27 | -------------------------------------------------------------------------------- /scripts/dtb_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | let dtba=0 4 | if [ -f $1 ]; then 5 | let dtba=1 6 | fi 7 | 8 | if [ -f fsl-$1 ]; then 9 | let dtba=$((dtba + 2)) 10 | fi 11 | 12 | if [ $3 ]&&[ -f $3 ]; then 13 | let dtba=4 14 | fi 15 | 16 | if [ $((dtba)) == 3 ]; then 17 | echo " Two u-boot DTB files exist: fsl-"$1 "and" $1 18 | echo " Please delete unused one!" 19 | echo " u-boot imx_v2020.04: "$1 20 | echo " u-boot imx_v2019.04: fsl-"$1 21 | exit -1 22 | elif [ $((dtba)) == 0 ]; then 23 | echo " Can't find u-boot DTB file, please copy from u-boot" 24 | exit -2 25 | elif [ $((dtba)) == 1 ]; then 26 | echo "Use u-boot DTB: "$1 27 | cp -f $1 $2 28 | elif [ $((dtba)) == 2 ]; then 29 | echo "Use u-boot DTB: fsl-"$1 30 | cp -f fsl-$1 $2 31 | elif [ $((dtba)) == 4 ]; then 32 | echo "Use u-boot DTB: "$3 33 | cp -f $3 $2 34 | fi 35 | -------------------------------------------------------------------------------- /iMX8DXL/scripts/m4.mak: -------------------------------------------------------------------------------- 1 | flash_m4: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin m4_image.bin 2 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_OCRAM) -out flash.bin 3 | 4 | flash_m4_ddr: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin m4_image.bin 5 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x88000000 $(V2X_DUMMY_DDR) -out flash.bin 6 | 7 | flash_m4_xip: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin m4_image.bin $(QSPI_HEADER) 8 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -dev flexspi -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -fileoff 0x80000 -p1 -m4 m4_image.bin 0 0x08081000 $(V2X_DUMMY_OCRAM) -out flash.bin 9 | ./$(QSPI_PACKER) $(QSPI_HEADER) 10 | 11 | flash_m4_flexspi: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin m4_image.bin 12 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -dev flexspi -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_OCRAM) -out flash.bin 13 | ./$(QSPI_PACKER) $(QSPI_HEADER) 14 | -------------------------------------------------------------------------------- /scripts/fspi_fcb_gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cnt=0 4 | fcb_sz=0 5 | crc_sz=0 6 | 7 | fspi_calc_crc() { 8 | local crc_tmp=0 9 | while read -r line; do 10 | data=$(echo "$line" | cut -c 1-8) 11 | crc_tmp=$((0x$data ^ $crc_tmp)) 12 | done < $1 13 | echo "`printf "%x" $crc_tmp`" 14 | } 15 | 16 | for fcbfile in $* 17 | do 18 | 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";}' $fcbfile > qspi-tmp 19 | xxd -r qspi-tmp qspi-header 20 | fcb_sz=$(expr $(wc -l $fcbfile | awk '{print $1}') \* 4) 21 | crc_sz=$(expr $fcb_sz - 4) 22 | dd if=qspi-header of=qspi-header-crc bs=1 count=$crc_sz 23 | crc_value=$(fspi_calc_crc $fcbfile) 24 | echo $crc_value | xxd -r -ps >> qspi-header-crc 25 | dd if=qspi-header-crc of=fcb.bin bs=$fcb_sz seek=$cnt 26 | cnt=$((cnt+1)) 27 | rm -f qspi-tmp qspi-header qspi-header-crc 28 | done 29 | 30 | while [ $cnt -lt 4 ] 31 | do 32 | dd if=/dev/zero of=fcb.bin bs=$fcb_sz seek=$cnt count=1 33 | cnt=$((cnt+1)) 34 | done 35 | echo "fcb.bin is generated" 36 | -------------------------------------------------------------------------------- /iMX8M/README: -------------------------------------------------------------------------------- 1 | Build Guide 2 | 3 | imx-mkimage is used to combine input images and generate final boot image with appropriate IVT set. 4 | Before building the boot image, need to prepare the input images first: 5 | 6 | 1. DDR PHY firmware images (Mandatory, used for all targets) 7 | Files: lpddr4_pmu_train_imem.bin and lpddr4_pmu_train_dmem.bin 8 | Git: ssh://git@sw-stash.freescale.net/imx/linux-firmware-imx.git 9 | Directory: firmware/ddr/synopsys 10 | 11 | 2. u-boot and SPL images (Mandatory, used for all targets) 12 | Files: u-boot.bin and u-boot-spl.bin 13 | Git: ssh://git@sw-stash.freescale.net/imx/uboot-imx.git 14 | Directory: ./u-boot.bin and spl/u-boot-spl.bin 15 | Build command: make imx8mq_evk_defconfig; make 16 | 17 | 3. ATF image (Mandatory, used for all targets) 18 | File: bl31.bin 19 | Git: ssh://git@sw-stash.freescale.net/imx/arm-trusted-firmware.git 20 | Directory: build/imx8mq/release 21 | Build command: make PLAT=imx8mq 22 | 23 | 4. HDMI firmware image (flash_hdmi_spl_uboot and flash_hdmi_spl_uboot_tee) 24 | File: hdmi_imx8m.bin 25 | Git: ssh://git@sw-stash.freescale.net/imx/linux-firmware-imx.git 26 | Directory: firmware/hdmi/cadence 27 | 28 | 5. Optee image (flash_hdmi_spl_uboot_tee and flash_spl_uboot_tee) 29 | File: tee.bin 30 | Git: ssh://git@sw-stash.freescale.net/imx/imx-optee-os.git 31 | -------------------------------------------------------------------------------- /iMX8QX/scripts/android.mak: -------------------------------------------------------------------------------- 1 | flash_b0_all_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin 2 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -m4 m4_image.bin 0 0x88000000 -out flash.bin 3 | 4 | flash_all_spl_container_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 5 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -m4 m4_image.bin 0 0x88000000 -out flash.bin 6 | cp flash.bin boot-spl-container.img 7 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 8 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 9 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 10 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 11 | 12 | flash_all_spl_container_ddr_car: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 13 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_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 14 | cp flash.bin boot-spl-container.img 15 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 16 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 17 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 18 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 19 | -------------------------------------------------------------------------------- /iMX8DXL/scripts/android.mak: -------------------------------------------------------------------------------- 1 | flash_b0_all_ddr: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin m4_image.bin 2 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -m4 m4_image.bin 0 0x88000000 $(V2X_DUMMY_DDR) -out flash.bin 3 | 4 | flash_all_spl_container_ddr: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 5 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -m4 m4_image.bin 0 0x88000000 $(V2X_DUMMY_DDR) -out flash.bin 6 | cp flash.bin boot-spl-container.img 7 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 8 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 9 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 10 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 11 | 12 | flash_all_spl_container_ddr_car: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 13 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -flags 0x01200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -p3 -m4 m4_image.bin 0 0x88000000 $(V2X_DUMMY_DDR) -out flash.bin 14 | cp flash.bin boot-spl-container.img 15 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 16 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 17 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 18 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 19 | -------------------------------------------------------------------------------- /scripts/autobuild_common.mak: -------------------------------------------------------------------------------- 1 | # For pulling archives internally. Example usage: 2 | # $ export SERVER=https://us-nxrm.sw.nxp.com 3 | # $ make SOC=iMX8QM nightly_mek 4 | 5 | WGET = /usr/bin/wget 6 | N ?= latest 7 | ROOTDIR ?= repository/IMX_Linux_Internal_Daily_Build 8 | BUILD ?= Linux_IMX_Trunk 9 | DIR = $(ROOTDIR)/$(BUILD)/$(N)/common_bsp 10 | ARCHIVE_PATH ?= ~ 11 | ARCHIVE_NAME ?= $(shell cat nightly.txt).tar 12 | USE_COMMON_LOCATION ?= true 13 | 14 | ifeq (,$(findstring nxrm,$(SERVER))) 15 | ROOTDIR := internal-only 16 | RWGET = /usr/bin/wget -qr -nd -l1 -np 17 | else 18 | ifneq ($(shell test -e ~/.netrc && echo -n yes),yes) 19 | $(warning No ~/.netrc found!) 20 | endif 21 | ifeq ($(N),latest) 22 | override N := $(shell $(WGET) -q --output-document - $(SERVER)/$(ROOTDIR)/$(BUILD)/latest) 23 | endif 24 | 25 | ifeq ($(USE_COMMON_LOCATION),true) 26 | COMMON_BUILD_VERSION := $(shell $(WGET) -q --output-document - $(SERVER)/$(ROOTDIR)/$(BUILD)/$(N)/common_build_version.txt || echo -n 0) 27 | ifneq ($(COMMON_BUILD_VERSION),0) 28 | COMMON_LOCATION := $(shell $(WGET) -q --output-document - $(SERVER)/$(ROOTDIR)/$(BUILD)/$(N)/common_location.txt) 29 | DIR = $(COMMON_LOCATION)/../common_bsp 30 | else 31 | COMMON_BUILD_VERSION := $(shell $(WGET) -q --output-document - $(SERVER)/$(ROOTDIR)/$(BUILD)/$(N)/boottools_build_version.txt || echo -n 0) 32 | ifneq ($(COMMON_BUILD_VERSION),0) 33 | COMMON_LOCATION := $(shell $(WGET) -q --output-document - $(SERVER)/$(ROOTDIR)/$(BUILD)/$(N)/boottools_location.txt) 34 | DIR = $(COMMON_LOCATION)/../common_bsp 35 | endif 36 | endif 37 | endif 38 | 39 | RWGET = echo Skipping 40 | endif 41 | -------------------------------------------------------------------------------- /iMX8QX/scripts/misc.mak: -------------------------------------------------------------------------------- 1 | flash_secofw flash_b0_secofw: $(MKIMG) ahabfw.bin 2 | ./$(MKIMG) -soc QX -rev B0 -c -seco ahabfw.bin -out flash.bin 3 | 4 | flash_msg_block_field_return: 5 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -msg_blk test_block.bin field 0x00100000 -out flash.bin 6 | 7 | flash_flexspi_msg_block_field_return: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin $(QSPI_HEADER) 8 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -msg_blk test_block.bin field 0x00100000 -out flash.bin 9 | ./$(QSPI_PACKER) $(QSPI_HEADER) 10 | 11 | flash_nand_fw: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 12 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 13 | 14 | flash_mfg flash_b0_mfg: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin Image fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot board.dtb Image0 Image1 15 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -data board.dtb a35 0x83000000 -data fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot a35 0x83100000 -data Image0 a35 0x80280000 -data Image1 a35 0x80c80000 -out flash_mfg.bin 16 | 17 | flash_nand_mfg flash_nand_b0_mfg: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin Image fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot board-nand.dtb Image0 Image1 18 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -data board-nand.dtb a35 0x83000000 -data fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot a35 0x83100000 -data Image0 a35 0x80280000 -data Image1 a35 0x80c80000 -out flash_mfg.bin 19 | -------------------------------------------------------------------------------- /iMX8QM/scripts/misc.mak: -------------------------------------------------------------------------------- 1 | flash_secofw flash_b0_secofw: $(MKIMG) ahabfw.bin 2 | ./$(MKIMG) -soc QX -rev B0 -c -seco ahabfw.bin -out flash.bin 3 | 4 | flash_msg_block_field_return: 5 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -msg_blk signed_message.bin field 0x00100000 -out flash.bin 6 | 7 | flash_flexspi_msg_block_field_return: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin $(QSPI_HEADER) 8 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -msg_blk signed_message.bin field 0x00100000 -out flash.bin 9 | ./$(QSPI_PACKER) $(QSPI_HEADER) 10 | 11 | flash_nand_fw: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 12 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 13 | 14 | flash_mfg flash_b0_mfg: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin Image fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot board.dtb Image0 Image1 15 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -data board.dtb a53 0x83000000 -data fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot a53 0x83100000 -data Image0 a53 0x80280000 -data Image1 a53 0x80c80000 -out flash_mfg.bin 16 | 17 | flash_nand_mfg flash_nand_b0_mfg: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin Image fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot board-nand.dtb Image0 Image1 18 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -data board-nand.dtb a53 0x83000000 -data fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot a53 0x83100000 -data Image0 a53 0x80280000 -data Image1 a53 0x80c80000 -out flash_mfg.bin 19 | -------------------------------------------------------------------------------- /iMX91/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | ifeq ($(V),1) 4 | AT := 5 | else 6 | AT := @ 7 | endif 8 | 9 | # Aliases 10 | nightly : nightly_evk 11 | nightly_mek: nightly_evk 12 | nightly_evk: nightly_mx91evk 13 | 14 | # MX91 EVK 15 | nightly_mx91evk: BOARD = imx91evk 16 | nightly_mx91evk: DTB = imx91-11x11-evk 17 | nightly_mx91evk: CPU = imx91 18 | nightly_mx91evk: DDR = lpddr4 19 | nightly_mx91evk: DDR_FW_VER = v202201 20 | nightly_mx91evk: core_files 21 | 22 | core_files: 23 | $(AT)rm -rf boot 24 | $(AT)echo "Pulling nightly for EVK board from $(SERVER)/$(DIR)" 25 | $(AT)echo $(BUILD)-$(N)-iMX91-evk > nightly.txt 26 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(AHAB_IMG) -O $(AHAB_IMG) 27 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/bl31-$(CPU).bin -O bl31.bin 28 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-$(BOARD).bin-sd -O u-boot.bin 29 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-spl.bin-$(BOARD)-sd -O u-boot-spl.bin 30 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem_1d_$(DDR_FW_VER).bin -O $(DDR)_dmem_1d_$(DDR_FW_VER).bin 31 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem_2d_$(DDR_FW_VER).bin -O $(DDR)_dmem_2d_$(DDR_FW_VER).bin 32 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem_1d_$(DDR_FW_VER).bin -O $(DDR)_imem_1d_$(DDR_FW_VER).bin 33 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem_2d_$(DDR_FW_VER).bin -O $(DDR)_imem_2d_$(DDR_FW_VER).bin 34 | $(AT)$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "$(DTB)*.dtb" 35 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/Image-$(BOARD).bin -O Image 36 | $(AT)mv -f Image boot 37 | -------------------------------------------------------------------------------- /iMX93/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | ifeq ($(V),1) 4 | AT := 5 | else 6 | AT := @ 7 | endif 8 | 9 | # Aliases 10 | nightly : nightly_evk 11 | nightly_mek: nightly_evk 12 | nightly_evk: nightly_mx93evk 13 | 14 | # MX93 EVK 15 | nightly_mx93evk: BOARD = imx93evk 16 | nightly_mx93evk: DTB = imx93-11x11-evk 17 | nightly_mx93evk: CPU = imx93 18 | nightly_mx93evk: DDR = lpddr4 19 | nightly_mx93evk: DDR_FW_VER = v202201 20 | nightly_mx93evk: core_files 21 | 22 | core_files: 23 | $(AT)rm -rf boot 24 | $(AT)echo "Pulling nightly for EVK board from $(SERVER)/$(DIR)" 25 | $(AT)echo $(BUILD)-$(N)-iMX93-evk > nightly.txt 26 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(AHAB_IMG) -O $(AHAB_IMG) 27 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/bl31-$(CPU).bin -O bl31.bin 28 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-$(BOARD).bin-sd -O u-boot.bin 29 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-spl.bin-$(BOARD)-sd -O u-boot-spl.bin 30 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem_1d_$(DDR_FW_VER).bin -O $(DDR)_dmem_1d_$(DDR_FW_VER).bin 31 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem_2d_$(DDR_FW_VER).bin -O $(DDR)_dmem_2d_$(DDR_FW_VER).bin 32 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem_1d_$(DDR_FW_VER).bin -O $(DDR)_imem_1d_$(DDR_FW_VER).bin 33 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem_2d_$(DDR_FW_VER).bin -O $(DDR)_imem_2d_$(DDR_FW_VER).bin 34 | $(AT)$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "$(DTB)*.dtb" 35 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/Image-$(BOARD).bin -O Image 36 | $(AT)mv -f Image boot 37 | -------------------------------------------------------------------------------- /iMX8DXL/scripts/misc.mak: -------------------------------------------------------------------------------- 1 | flash_secofw flash_b0_secofw: $(MKIMG) ahabfw.bin 2 | ./$(MKIMG) -soc DXL -rev A0 -c -seco ahabfw.bin -out flash.bin 3 | 4 | flash_msg_block_field_return: 5 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -msg_blk test_block.bin field 0x00100000 $(V2X_DUMMY_OCRAM) -out flash.bin 6 | 7 | flash_flexspi_msg_block_field_return: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin $(QSPI_HEADER) 8 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -dev flexspi -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -msg_blk test_block.bin field 0x00100000 $(V2X_DUMMY_OCRAM) -out flash.bin 9 | ./$(QSPI_PACKER) $(QSPI_HEADER) 10 | 11 | flash_nand_fw: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin 12 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 $(V2X_DUMMY_DDR) -out flash.bin 13 | 14 | flash_mfg flash_b0_mfg: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin Image fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot board.dtb Image0 Image1 15 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -data board.dtb a35 0x83000000 -data fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot a35 0x83100000 -data Image0 a35 0x80280000 -data Image1 a35 0x80c80000 -dummy 0x87fc0000 -out flash_mfg.bin 16 | 17 | flash_nand_mfg flash_nand_b0_mfg: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin Image fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot board-nand.dtb Image0 Image1 18 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -data board-nand.dtb a35 0x83000000 -data fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot a35 0x83100000 -data Image0 a35 0x80280000 -data Image1 a35 0x80c80000 -dummy 0x87fc0000 -out flash_mfg.bin 19 | -------------------------------------------------------------------------------- /iMX8QX/scripts/test.mak: -------------------------------------------------------------------------------- 1 | flash_ddrstress flash_b0_ddrstress: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin mx8qxb0_ddr_stress_test.bin 2 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -flags 0x00800000 -scfw scfw_tcm.bin -ap mx8qxb0_ddr_stress_test.bin a35 0x00100000 -out flash.bin 3 | 4 | flash_test_build_nand_4K flash_b0_test_build_nand_4K: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot.bin m4_image.bin 5 | ./$(MKIMG) -soc QX -rev B0 -dev nand 4K -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 6 | 7 | flash_test_build_nand_8K flash_b0_test_build_nand_8K: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot.bin m4_image.bin 8 | ./$(MKIMG) -soc QX -rev B0 -dev nand 8K -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 9 | 10 | flash_test_build_nand_16K flash_b0_test_build_nand_16K: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot.bin m4_image.bin 11 | ./$(MKIMG) -soc QX -rev B0 -dev nand 16K -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 12 | 13 | flash_test_build flash_b0_test_build: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot.bin m4_image.bin 14 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 15 | 16 | flash_test_build_mfg flash_b0_test_build_mfg: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin dummy_ddr.bin u-boot.bin CM4.bin kernel.bin initramfs.bin board.dtb 17 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 CM4.bin 0 0x34FE0000 -data kernel.bin a35 0x80280000 -data initramfs.bin a35 0x83100000 -data board.dtb a35 0x83000000 -out flash.bin 18 | 19 | flash_scfw_test flash_b0_scfw_test: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin scfw_tests.bin 20 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin --data scfw_tests.bin a35 0x100000 -out flash.bin 21 | -------------------------------------------------------------------------------- /Readme.imx95: -------------------------------------------------------------------------------- 1 | 1. i.MX95 uses dedicated SOC type, so must set "SOC=iMX95" 2 | 3 | 2. By default, OEI image is not used. To use OEI image, only need to add "OEI=YES" in command. The "OEI=YES" is pertained to all targets to enable OEI. 4 | The default name of OEI images are: oei.bin.ca55 (singleboot) and oei.bin.cm33 (lpboot) 5 | For example, 6 | a) Non-OEI image for singleboot: 7 | make SOC=iMX95 flash_singleboot 8 | 9 | b) OEI image for singleboot: 10 | make SOC=iMX95 OEI=YES flash_singleboot 11 | 12 | 3. To run System manager, could use below targets. If need to use M33 OEI image, add "OEI=YES" 13 | a) System manager only 14 | make SOC=iMX95 flash_lpboot_sm 15 | make SOC=iMX95 flash_lpboot_sm_no_ahabfw 16 | 17 | b) System manager with M7 in TCM or DDR 18 | make SOC=iMX95 flash_lpboot_sm_m7 19 | make SOC=iMX95 flash_lpboot_sm_m7_no_ahabfw 20 | make SOC=iMX95 flash_lpboot_sm_m7_ddr 21 | make SOC=iMX95 flash_lpboot_sm_m7_ddr_no_ahabfw 22 | 23 | c) System manager with A55 from sd/emmc or flexspi nor 24 | make SOC=iMX95 flash_lpboot_sm_a55 25 | make SOC=iMX95 flash_lpboot_sm_a55_no_ahabfw 26 | make SOC=iMX95 flash_lpboot_sm_a55_flexspi 27 | 28 | d) System manager with A55 + M7 (TCM) 29 | make SOC=iMX95 flash_lpboot_sm_all 30 | make SOC=iMX95 flash_lpboot_sm_all_no_ahabfw 31 | 32 | Note: For iMX95 "UBOOT_LOAD_ADDR is set to 0x90200000", please ensure your u-boot is latest and uses this address. 33 | Otherwise set the UBOOT_LOAD_ADDR to your address. 34 | 35 | MSEL=m can be used to specify a mode select value to pass to the SM. Can be used to select at run-time between 36 | boot configurations (which cores to boot, etc.). 37 | 38 | 4. The DDR Firmware used by default is LPDDR5 (for both OEI or Non-OEI), to generate image with LPDDR4x or LPDDR4, 39 | set the "LPDDR_TYPE=lpddr4" 40 | 41 | 5. Options "GDET", "VDET", "AGDET", "FDET" are used for container flag values. For example: 42 | set "GDET=2" will set the flag bits 20-21 to 0b10: GDET is enabled only when ELE receives a command 43 | set "VDET=1" will set the flag bits 22-23 to 0b01: AGDET is always disabled 44 | -------------------------------------------------------------------------------- /iMX8DXL/scripts/test.mak: -------------------------------------------------------------------------------- 1 | flash_ddrstress flash_a0_ddrstress: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin mx8dxl_ddr_stress_test.bin 2 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -flags 0x00800000 -scfw scfw_tcm.bin -ap mx8dxl_ddr_stress_test.bin a35 0x00100000 $(V2X_DUMMY_DDR) -out flash.bin 3 | 4 | flash_test_build_nand_4K flash_a0_test_build_nand_4K: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot.bin m4_image.bin 5 | ./$(MKIMG) -soc DXL -rev A0 -dev nand 4K -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_DDR) -out flash.bin 6 | 7 | flash_test_build_nand_8K flash_a0_test_build_nand_8K: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot.bin m4_image.bin 8 | ./$(MKIMG) -soc DXL -rev A0 -dev nand 8K -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_DDR) -out flash.bin 9 | 10 | flash_test_build_nand_16K flash_a0_test_build_nand_16K: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot.bin m4_image.bin 11 | ./$(MKIMG) -soc DXL -rev A0 -dev nand 16K -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_DDR) -out flash.bin 12 | 13 | flash_test_build flash_a0_test_build: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot.bin m4_image.bin 14 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_DDR) -out flash.bin 15 | 16 | flash_test_build_mfg flash_a0_test_build_mfg: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin dummy_ddr.bin u-boot.bin CM4.bin kernel.bin initramfs.bin board.dtb 17 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot.bin a35 0x80000000 -m4 CM4.bin 0 0x34FE0000 -data kernel.bin a35 0x80280000 -data initramfs.bin a35 0x83100000 -data board.dtb a35 0x83000000 $(V2X_DUMMY_DDR) -out flash.bin 18 | 19 | flash_scfw_test flash_a0_scfw_test: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin scfw_tests.bin 20 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin --data scfw_tests.bin a35 0x100000 $(V2X_DUMMY_OCRAM) -out flash.bin 21 | 22 | -------------------------------------------------------------------------------- /scripts/fspi_header: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00000156 /* Version */ 3 | 00000000 4 | 00030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 00000000 6 | 00000000 7 | 00000000 8 | 00000000 9 | 00000000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 00000000 18 | 01010200 /* Serial Nor, Single/Dual/Quad/Octal, SerialClkFreq 1 - 20MHz, 2- 50MHz... */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | 0b041808 /* LUT Table */ 34 | 08300424 35 | 00000000 36 | 00000000 37 | 00000000 38 | 00000000 39 | 00000000 40 | 00000000 41 | 00000000 42 | 00000000 43 | 00000000 44 | 00000000 45 | 00000000 46 | 00000000 47 | 00000000 48 | 00000000 49 | 00000000 50 | 00000000 51 | 00000000 52 | 00000000 53 | 00000000 54 | 00000000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 00000000 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 00000000 79 | 00000000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 00000000 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00010000 /* Page Size, not used in ROM */ 114 | 00000100 /* Sector Size, not used in ROM */ 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 126 | 00000000 127 | 00000000 128 | 00000000 129 | -------------------------------------------------------------------------------- /scripts/fspi_header_atxp: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00000156 /* Version */ 3 | 00000000 4 | 00030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 00000000 6 | 00000000 7 | 00000000 8 | 01000000 9 | 01040000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 00000000 18 | 01010000 /* Serial Nor, Single/Dual/Quad/Octal, SerialClkFreq 0 - 24MHz, 1- 48MHz... */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | 0b042008 /* LUT Table */ 34 | 08300424 35 | 00000000 36 | 00000000 37 | 05040124 38 | 00000000 39 | 00000000 40 | 00000000 41 | 00000000 42 | 00000000 43 | 00000000 44 | 00000000 45 | 06040000 46 | 00000000 47 | 00000000 48 | 00000000 49 | b7040000 50 | 00000000 51 | 00000000 52 | 00000000 53 | 00000000 54 | 00000000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 00000000 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 00000000 79 | 00000000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 00000000 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00010000 /* Page Size, not used in ROM */ 114 | 00000100 /* Sector Size, not used in ROM */ 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 126 | 00000000 127 | 00000000 128 | 00000000 129 | -------------------------------------------------------------------------------- /iMX8QM/scripts/m4.mak: -------------------------------------------------------------------------------- 1 | flash_m4: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin 2 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 3 | 4 | flash_m41: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_1_image.bin 5 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 6 | 7 | flash_m4s: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin m4_1_image.bin 8 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x34FE0000 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 9 | 10 | flash_m4_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin 11 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x88000000 -out flash.bin 12 | 13 | flash_m41_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_1_image.bin 14 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_1_image.bin 1 0x88800000 -out flash.bin 15 | 16 | flash_m4s_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin m4_1_image.bin 17 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -p1 -m4 m4_image.bin 0 0x88000000 -m4 m4_1_image.bin 1 0x88800000 -out flash.bin 18 | 19 | flash_m4_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin $(QSPI_HEADER) 20 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -fileoff 0x80000 -p1 -m4 m4_image.bin 0 0x08081000 -out flash.bin 21 | ./$(QSPI_PACKER) $(QSPI_HEADER) 22 | 23 | flash_m41_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_1_image.bin $(QSPI_HEADER) 24 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -fileoff 0x180000 -p1 -m4 m4_1_image.bin 1 0x08181000 -out flash.bin 25 | ./$(QSPI_PACKER) $(QSPI_HEADER) 26 | 27 | flash_m4s_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin m4_image.bin m4_1_image.bin $(QSPI_HEADER) 28 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -fileoff 0x80000 -p1 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 -m4 m4_1_image.bin 1 0x08181000 -out flash.bin 29 | ./$(QSPI_PACKER) $(QSPI_HEADER) -------------------------------------------------------------------------------- /SBOM.spdx.json: -------------------------------------------------------------------------------- 1 | { 2 | "SPDXID": "SPDXRef-DOCUMENT", 3 | "spdxVersion": "SPDX-2.3", 4 | "creationInfo": { 5 | "created": "2025-11-12T06:56:23Z", 6 | "creators": [ 7 | "Organization: NXP" 8 | ], 9 | "licenseListVersion": "3.20" 10 | }, 11 | "name": "imx-mkimage-LF_6.12.49_2.2.0", 12 | "dataLicense": "CC0-1.0", 13 | "documentNamespace": "https://nxp.com/spdx/16f44513-f30d-4985-9174-669ce653b9d8", 14 | "packages": [ 15 | { 16 | "SPDXID": "SPDXRef-package-16f44513-f30d-4985-9174-669ce653b9d8", 17 | "name": "imx-mkimage", 18 | "versionInfo": "LF_6.12.49_2.2.0", 19 | "licenseConcluded": "(GPL-2.0-only)", 20 | "licenseDeclared": "(GPL-2.0-only)", 21 | "downloadLocation": "https://github.com/nxp-imx/imx-mkimage -b lf-6.12.49-2.2.0", 22 | "originator": "Organization: NXP", 23 | "supplier": "NOASSERTION", 24 | "externalRefs": [], 25 | "filesAnalyzed": false 26 | }, 27 | { 28 | "SPDXID": "SPDXRef-package-c563a3b4-eef4-41ba-b43d-fc73391411f4", 29 | "name": "U-Boot", 30 | "versionInfo": "2025.04", 31 | "licenseConcluded": "GPL-2.0-or-later", 32 | "licenseDeclared": "(LGPL-2.0-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND NOASSERTION)", 33 | "homepage": "https://source.denx.de/u-boot/u-boot", 34 | "downloadLocation": "NOASSERTION", 35 | "originator": "Organization: U-Boot", 36 | "supplier": "NOASSERTION", 37 | "externalRefs": [ 38 | { 39 | "referenceCategory": "SECURITY", 40 | "referenceLocator": "cpe:2.3:a:u_boot:u_boot:2025.04:*:*:*:*:*:*:*", 41 | "referenceType": "cpe23Type" 42 | }, 43 | { 44 | "referenceCategory": "SECURITY", 45 | "referenceLocator": "cpe:2.3:a:denx:u-boot:2025.04:*:*:*:*:*:*:*", 46 | "referenceType": "cpe23Type" 47 | } 48 | ], 49 | "filesAnalyzed": false 50 | } 51 | ], 52 | "relationships": [ 53 | { 54 | "spdxElementId": "SPDXRef-DOCUMENT", 55 | "relationshipType": "DESCRIBES", 56 | "relatedSpdxElement": "SPDXRef-package-16f44513-f30d-4985-9174-669ce653b9d8" 57 | }, 58 | { 59 | "spdxElementId": "SPDXRef-package-16f44513-f30d-4985-9174-669ce653b9d8", 60 | "relationshipType": "DYNAMIC_LINK", 61 | "relatedSpdxElement": "SPDXRef-package-c563a3b4-eef4-41ba-b43d-fc73391411f4" 62 | } 63 | ] 64 | } -------------------------------------------------------------------------------- /iMX94/scripts/fspi_header_133: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00000156 /* Version */ 3 | 00000000 4 | 03030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 01000000 /* device mode cfg enable 01000000 */ 6 | 01040000 /* cfg use seq cnt 1 idx 4*/ 7 | e7000000 /* mt35x Volatile Configuration Register 0, octal ddr mode, 0xe7 */ 8 | 00000000 9 | 00000000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 50000000 /* DDR mode enable use 30M for config 50000000 */ 18 | 01080600 /* Nor, Octal pad, 133MHZ 01080600 */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | fd87fd87 /* idx0 */ 34 | 208b20b3 35 | 04a70000 36 | 00000000 37 | 05870587 /* idx1 read status */ 38 | 20b300a7 39 | 00000000 40 | 00000000 41 | 00000000 /* idx 2 */ 42 | 00000000 43 | 00000000 44 | 00000000 45 | 06040000 /* idx 3 write enable */ 46 | 00000000 47 | 00000000 48 | 00000000 49 | 81041808 /* idx4 use 81h write volatile reg of mt35x */ 50 | 01200000 51 | 00000000 52 | 00000000 53 | 00000000 54 | 00000000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 00000000 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 00000000 79 | 00000000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 00000000 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00010000 /* Page Size, not used in ROM */ 114 | 00000100 /* Sector Size, not used in ROM */ 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 126 | 00000000 127 | 00000000 128 | 00000000 129 | -------------------------------------------------------------------------------- /iMX95/scripts/fspi_header_133: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00000156 /* Version */ 3 | 00000000 4 | 03030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 01000000 /* device mode cfg enable 01000000 */ 6 | 01040000 /* cfg use seq cnt 1 idx 4*/ 7 | e7000000 /* mt35x Volatile Configuration Register 0, octal ddr mode, 0xe7 */ 8 | 00000000 9 | 00000000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 50000000 /* DDR mode enable use 30M for config 50000000 */ 18 | 01080600 /* Nor, Octal pad, 133MHZ 01080600 */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | fd87fd87 /* idx0 */ 34 | 208b20b3 35 | 04a70000 36 | 00000000 37 | 05870587 /* idx1 read status */ 38 | 20b300a7 39 | 00000000 40 | 00000000 41 | 00000000 /* idx 2 */ 42 | 00000000 43 | 00000000 44 | 00000000 45 | 06040000 /* idx 3 write enable */ 46 | 00000000 47 | 00000000 48 | 00000000 49 | 81041808 /* idx4 use 81h write volatile reg of mt35x */ 50 | 01200000 51 | 00000000 52 | 00000000 53 | 00000000 54 | 00000000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 00000000 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 00000000 79 | 00000000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 00000000 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00010000 /* Page Size, not used in ROM */ 114 | 00000100 /* Sector Size, not used in ROM */ 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 126 | 00000000 127 | 00000000 128 | 00000000 129 | -------------------------------------------------------------------------------- /iMX95/scripts/fspi_header_200: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00000156 /* Version */ 3 | 00000000 4 | 03030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 01000000 /* device mode cfg enable 01000000 */ 6 | 01040000 /* cfg use seq cnt 1 idx 4*/ 7 | e7000000 /* mt35x Volatile Configuration Register 0, octal ddr mode, 0xe7 */ 8 | 00000000 9 | 00000000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 50000000 /* DDR mode enable use 30M for config 50000000 */ 18 | 01080800 /* Nor, Octal pad, 200MHZ 01080800 */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | fd87fd87 /* idx0 */ 34 | 208b20b3 35 | 04a70000 36 | 00000000 37 | 05870587 /* idx1 read status */ 38 | 20b300a7 39 | 00000000 40 | 00000000 41 | 00000000 /* idx 2 */ 42 | 00000000 43 | 00000000 44 | 00000000 45 | 06040000 /* idx 3 write enable */ 46 | 00000000 47 | 00000000 48 | 00000000 49 | 81041808 /* idx4 use 81h write volatile reg of mt35x */ 50 | 01200000 51 | 00000000 52 | 00000000 53 | 00000000 54 | 00000000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 00000000 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 00000000 79 | 00000000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 00000000 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00010000 /* Page Size, not used in ROM */ 114 | 00000100 /* Sector Size, not used in ROM */ 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 126 | 00000000 127 | 00000000 128 | 00000000 129 | -------------------------------------------------------------------------------- /scripts/more_headers/micron_nor_mt35x_octal_ddr_200mhz: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00000156 /* Version */ 3 | 00000000 4 | 03030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 01000000 /* device mode cfg enable 01000000 */ 6 | 01040000 /* cfg use seq cnt 1 idx 4*/ 7 | e7000000 /* mt35x Volatile Configuration Register 0, octal ddr mode, 0xe7 */ 8 | 00000000 9 | 00000000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 50000000 /* DDR mode enable use 30M for config 50000000 */ 18 | 01080700 /* Nor, Octal pad, 200MHZ 01080700 */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 00000000 32 | 00000000 33 | fd07208b /* idx0 */ 34 | 10b304a7 35 | 00000000 36 | 00000000 37 | 050710b3 /* idx1 read status */ 38 | 04a70000 39 | 00000000 40 | 00000000 41 | 00000000 /* idx 2 */ 42 | 00000000 43 | 00000000 44 | 00000000 45 | 06040000 /* idx 3 write enable */ 46 | 00000000 47 | 00000000 48 | 00000000 49 | 81040004 /* idx4 use 81h write volatile reg of mt35x */ 50 | 00040004 51 | 01200000 52 | 00000000 53 | 00000000 54 | 00000000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 00000000 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 00000000 79 | 00000000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 00000000 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00010000 /* Page Size, not used in ROM */ 114 | 00000100 /* Sector Size, not used in ROM */ 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 126 | 00000000 127 | 00000000 128 | 00000000 129 | -------------------------------------------------------------------------------- /iMX8QM/mkimage_fit_atf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # script to generate FIT image source for i.MX8MQ boards with 4 | # ARM Trusted Firmware and multiple device trees (given on the command line) 5 | # 6 | 7 | [ -z "$BL31" ] && BL31="bl31.bin" 8 | # keep backward compatibility 9 | [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000" 10 | 11 | if [ ! -f $BL31 ]; then 12 | echo "ERROR: BL31 file $BL31 NOT found" >&2 13 | exit 0 14 | else 15 | echo "bl31.bin size: " >&2 16 | ls -lct bl31.bin | awk '{print $5}' >&2 17 | fi 18 | 19 | BL32="tee.bin" 20 | 21 | if [ ! -f $BL32 ]; then 22 | BL32=/dev/null 23 | else 24 | echo "Building with TEE support, make sure your bl31 is compiled with spd. If you do not want tee, please delete tee.bin" >&2 25 | echo "tee.bin size: " >&2 26 | ls -lct tee.bin | awk '{print $5}' >&2 27 | fi 28 | 29 | BL33="u-boot-hash.bin" 30 | 31 | if [ ! -f $BL33 ]; then 32 | echo "ERROR: $BL33 file NOT found" >&2 33 | exit 0 34 | else 35 | echo "$BL33 size: " >&2 36 | ls -lct u-boot-hash.bin | awk '{print $5}' >&2 37 | fi 38 | 39 | cat << __HEADER_EOF 40 | /dts-v1/; 41 | 42 | / { 43 | description = "Configuration to load ATF before U-Boot"; 44 | 45 | images { 46 | uboot@1 { 47 | description = "U-Boot (64-bit)"; 48 | data = /incbin/("$BL33"); 49 | type = "standalone"; 50 | arch = "arm64"; 51 | compression = "none"; 52 | load = <0x80020000>; 53 | }; 54 | atf@1 { 55 | description = "ARM Trusted Firmware"; 56 | data = /incbin/("$BL31"); 57 | type = "firmware"; 58 | arch = "arm64"; 59 | compression = "none"; 60 | load = <0x80000000>; 61 | entry = <0x80000000>; 62 | }; 63 | __HEADER_EOF 64 | 65 | if [ -f $BL32 ]; then 66 | cat << __HEADER_EOF 67 | tee@1 { 68 | description = "TEE firmware"; 69 | data = /incbin/("$BL32"); 70 | type = "firmware"; 71 | arch = "arm64"; 72 | compression = "none"; 73 | load = <$TEE_LOAD_ADDR>; 74 | entry = <$TEE_LOAD_ADDR>; 75 | }; 76 | __HEADER_EOF 77 | fi 78 | 79 | cat << __CONF_HEADER_EOF 80 | }; 81 | configurations { 82 | default = "config@1"; 83 | 84 | __CONF_HEADER_EOF 85 | 86 | if [ -f $BL32 ]; then 87 | cat << __CONF_SECTION1_EOF 88 | config@1 { 89 | description = "fsl-imx8qm-mek"; 90 | firmware = "uboot@1"; 91 | loadables = "atf@1", "tee@1"; 92 | }; 93 | __CONF_SECTION1_EOF 94 | else 95 | cat << __CONF_SECTION1_EOF 96 | config@1 { 97 | description = "fsl-imx8qm-mek"; 98 | firmware = "uboot@1"; 99 | loadables = "atf@1"; 100 | }; 101 | __CONF_SECTION1_EOF 102 | fi 103 | cat << __ITS_EOF 104 | }; 105 | }; 106 | __ITS_EOF 107 | -------------------------------------------------------------------------------- /iMX8QX/mkimage_fit_atf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # script to generate FIT image source for i.MX8MQ boards with 4 | # ARM Trusted Firmware and multiple device trees (given on the command line) 5 | # 6 | 7 | [ -z "$BL31" ] && BL31="bl31.bin" 8 | # keep backward compatibility 9 | [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000" 10 | 11 | if [ ! -f $BL31 ]; then 12 | echo "ERROR: BL31 file $BL31 NOT found" >&2 13 | exit 0 14 | else 15 | echo "bl31.bin size: " >&2 16 | ls -lct bl31.bin | awk '{print $5}' >&2 17 | fi 18 | 19 | BL32="tee.bin" 20 | 21 | if [ ! -f $BL32 ]; then 22 | BL32=/dev/null 23 | else 24 | echo "Building with TEE support, make sure your bl31 is compiled with spd. If you do not want tee, please delete tee.bin" >&2 25 | echo "tee.bin size: " >&2 26 | ls -lct tee.bin | awk '{print $5}' >&2 27 | fi 28 | 29 | BL33="u-boot-hash.bin" 30 | 31 | if [ ! -f $BL33 ]; then 32 | echo "ERROR: $BL33 file NOT found" >&2 33 | exit 0 34 | else 35 | echo "$BL33 size: " >&2 36 | ls -lct u-boot-hash.bin | awk '{print $5}' >&2 37 | fi 38 | 39 | cat << __HEADER_EOF 40 | /dts-v1/; 41 | 42 | / { 43 | description = "Configuration to load ATF before U-Boot"; 44 | 45 | images { 46 | uboot@1 { 47 | description = "U-Boot (64-bit)"; 48 | data = /incbin/("$BL33"); 49 | type = "standalone"; 50 | arch = "arm64"; 51 | compression = "none"; 52 | load = <0x80020000>; 53 | }; 54 | atf@1 { 55 | description = "ARM Trusted Firmware"; 56 | data = /incbin/("$BL31"); 57 | type = "firmware"; 58 | arch = "arm64"; 59 | compression = "none"; 60 | load = <0x80000000>; 61 | entry = <0x80000000>; 62 | }; 63 | __HEADER_EOF 64 | 65 | if [ -f $BL32 ]; then 66 | cat << __HEADER_EOF 67 | tee@1 { 68 | description = "TEE firmware"; 69 | data = /incbin/("$BL32"); 70 | type = "firmware"; 71 | arch = "arm64"; 72 | compression = "none"; 73 | load = <$TEE_LOAD_ADDR>; 74 | entry = <$TEE_LOAD_ADDR>; 75 | }; 76 | __HEADER_EOF 77 | fi 78 | 79 | cat << __CONF_HEADER_EOF 80 | }; 81 | configurations { 82 | default = "config@1"; 83 | 84 | __CONF_HEADER_EOF 85 | 86 | if [ -f $BL32 ]; then 87 | cat << __CONF_SECTION1_EOF 88 | config@1 { 89 | description = "fsl-imx8qxp-mek"; 90 | firmware = "uboot@1"; 91 | loadables = "atf@1", "tee@1"; 92 | }; 93 | __CONF_SECTION1_EOF 94 | else 95 | cat << __CONF_SECTION1_EOF 96 | config@1 { 97 | description = "fsl-imx8qxp-mek"; 98 | firmware = "uboot@1"; 99 | loadables = "atf@1"; 100 | }; 101 | __CONF_SECTION1_EOF 102 | fi 103 | 104 | cat << __ITS_EOF 105 | }; 106 | }; 107 | __ITS_EOF 108 | -------------------------------------------------------------------------------- /iMX8QM/expand_c_define.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #################################################################### 4 | # 5 | # Copyright 2017 NXP 6 | # 7 | #################################################################### 8 | 9 | # usage: 10 | # cat ../../imx-sc-firmware/firmware/platform/board/mx8qm_val/ddrc/ddrc_mem_map.h | ./expand_c_define.sh > ddrc_mem_map.h 11 | # cat ../../imx-sc-firmware/firmware/platform/board/mx8qm_val/ddrc/ddr_phy_mem_map.h | ./expand_c_define.sh > ddr_phy_mem_map.h 12 | 13 | # This script parses a register mapping file from imx-sc-firmware (C header 14 | # file with register base addresse and register offset definitions). 15 | # 16 | # This script evaluates an arithmetic expression to get the register 17 | # addresses for iMX8QM. 18 | # Its creates new C #define for each instance of the DDR (#0, #1). 19 | # 20 | # This script parses a C header file like: 21 | # '#define DDRC_MSTR(X) REG32(DDRC_BASE_ADDR(X) + 0x00)' 22 | # and converts it to (last arithmetic expression is evaluated) 23 | # '#define DDRC_MSTR_0 0x5c000000' 24 | # '#define DDRC_MSTR_1 0x5c100000' 25 | 26 | # search for the register map BASE_ADDR definition 27 | # Search for a line like: 28 | # #define DDR_PHY_BASE_ADDR(X) 0x5c000000 + ((X * 0x100000) + 0x10000) 29 | base_found=0 30 | while IFS= read -r line 31 | do 32 | echo "$line" 33 | base_addr_name=$(echo "$line" | sed -n -e "s/^#define *\([^ ]*_BASE_ADDR(X)\) *\(.*\)/\1/p") 34 | #base_addr_expr="$(echo $line | sed -n -e 's/^#define *\([^ ]*_BASE_ADDR(X)\) *\(.*\)/\2/p')" 35 | base_addr_expr=$(echo "$line" | sed -n -e 's/^#define *\([^ ]*_BASE_ADDR(X)\) *\(.*\)$/\2/p') 36 | #echo "$base_addr_expr" 37 | if [ "${base_addr_name}X" != "X" ] 38 | then 39 | base_found=1 40 | break 41 | fi 42 | done 43 | 44 | # find register definitions and evaluate register addresses 45 | # For example the following line: 46 | # #define DDRC_MSTR(X) REG32(DDRC_BASE_ADDR(X) + 0x00) 47 | # is expanded to: 48 | # #define DDRC_MSTR_0 0x5c000000 49 | # #define DDRC_MSTR_1 0x5c100000 50 | 51 | while IFS= read -r line 52 | do 53 | echo "$line" 54 | # substitute BASE_ADDR(X) with the macro value 55 | line=$(echo "$line" | sed -n -e "s/${base_addr_name}/${base_addr_expr}/p") 56 | # extract register name and arithmetic expression 57 | reg_name=$(echo "$line" | sed -n -e "s/^#define *\([^(]*\)(X)[[:space:]]*REG32(\(.*\))$/\1/p") 58 | reg_value=$(echo "$line" | sed -n -e "s/^#define *\([^(]*\)(X)[[:space:]]*REG32(\(.*\))$/\2/p") 59 | #echo "$reg_name" "$reg_value" 60 | if [ "${reg_name}X" != "X" ] 61 | then 62 | # enumerate X from 0 to the number of DDR 63 | for instance in 0 1 64 | do 65 | tmp=$(echo "$reg_value" | sed -n -e "s/(X/(${instance}/p") 66 | printf "#define %-23s 0x%x\n" "${reg_name}_${instance}" $(($tmp)) 67 | done 68 | fi 69 | done 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /iMX8DXL/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | ifeq ($(V),1) 4 | AT := 5 | else 6 | AT := @ 7 | endif 8 | 9 | # Aliases 10 | nightly : nightly_evk 11 | nightly_mek: nightly_evk 12 | nightly_evk: nightly_a1evk 13 | nightly_ddr3_evk: nightly_ddr3_a1evk 14 | 15 | # LPDDR4 EVK - A1 16 | nightly_a1evk: override REV = a1 17 | nightly_a1evk: override BRD = lpddr4-evk 18 | nightly_a1evk: override SBRD = evk 19 | nightly_a1evk: core_files 20 | 21 | # DDR3L EVK - A1 22 | nightly_ddr3_a1evk: override REV = a1 23 | nightly_ddr3_a1evk: override BRD = ddr3l-evk 24 | nightly_ddr3_a1evk: override SBRD = ddr3-evk 25 | nightly_ddr3_a1evk: core_files 26 | 27 | # LPDDR4 EVK - B0 28 | nightly_b0evk: override REV = b0 29 | nightly_b0evk: override BRD = lpddr4-evk 30 | nightly_b0evk: override SBRD = evk 31 | nightly_b0evk: core_files ocram_files 32 | 33 | # DDR3L EVK - B0 34 | nightly_ddr3_b0evk: override REV = b0 35 | nightly_ddr3_b0evk: override BRD = ddr3l-evk 36 | nightly_ddr3_b0evk: override SBRD = ddr3-evk 37 | nightly_ddr3_b0evk: core_files ocram_files 38 | 39 | core_files: 40 | $(AT)rm -rf boot 41 | $(AT)echo "Pulling nightly for MEK board from $(SERVER)/$(DIR)" 42 | $(AT)echo $(BUILD)-$(N)-iMX8DXL-$(LC_REVISION)-evk > nightly.txt 43 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/$(SECO_FW_NAME) -O $(SECO_FW_NAME) 44 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/mx8dxl-$(SBRD)-scfw-tcm.bin -O scfw_tcm.bin 45 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/bl31-imx8dxl.bin -O bl31.bin 46 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/u-boot-imx8dxl$(LC_REVISION)-$(BRD).bin-sd -O u-boot.bin 47 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/u-boot-imx8dxl$(LC_REVISION)-$(BRD).bin-fspi -O u-boot-fspi.bin 48 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/m4_image.bin -O m4_image.bin 49 | $(AT)$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8dxl-evk*.dtb" 50 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 51 | $(AT)mv -f Image boot 52 | 53 | 54 | ocram_files: 55 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/bl31-imx8dxl.bin-optee -O bl31-optee.bin 56 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/u-boot-spl.bin-imx8dxl$(LC_REVISION)-$(BRD)-sd -O u-boot-spl.bin 57 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/u-boot-spl.bin-imx8dxl$(LC_REVISION)-$(BRD)-fspi -O u-boot-spl-fspi.bin 58 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxl$(LC_REVISION)-$(BRD)/tee.bin -O tee.bin 59 | 60 | archive : 61 | git ls-files --others --exclude-standard -z | xargs -0 tar rvf $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 62 | bzip2 $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 63 | -------------------------------------------------------------------------------- /iMX8M/print_fit_hab.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | let fit_off=$1 4 | 5 | # keep backward compatibility 6 | [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000" 7 | 8 | [ -z "$BL31" ] && BL31="bl31.bin" 9 | 10 | if [ -z "$BL32" ]; then 11 | BL32="tee.bin" 12 | [ -f "tee.bin.lz4" ] && BL32="tee.bin.lz4" 13 | fi 14 | 15 | [ -z "$BL33" ] && BL33="u-boot-nodtb.bin" 16 | 17 | if [ -z "$ATF_LOAD_ADDR" ]; then 18 | echo "ERROR: BL31 load address is not set" >&2 19 | exit 0 20 | fi 21 | 22 | if [ "$VERSION" = "v1" ]; then 23 | let ivt_off=0x400 24 | else 25 | let ivt_off=0x0 26 | fi 27 | 28 | if [ "$BOOT_DEV" = "flexspi" ] || [ ${fit_off} == 0 ]; then 29 | # We dd flash.bin to 0 offset for flexspi 30 | let uboot_sign_off=$((fit_off + $FIT_DATA_POS)) 31 | else 32 | # We dd flash.bin to 33KB "0x8400" offset, so need minus 0x8400 33 | let uboot_sign_off=$((fit_off - 0x8000 - ivt_off + $FIT_DATA_POS)) 34 | fi 35 | 36 | let uboot_size=$(stat --printf="%s" $BL33) 37 | let uboot_load_addr=0x40200000 38 | 39 | let last_sign_off=$(((uboot_sign_off + uboot_size + 3) & ~3)) 40 | let last_load_addr=$((uboot_load_addr + uboot_size)) 41 | 42 | uboot_size=`printf "0x%X" ${uboot_size}` 43 | uboot_sign_off=`printf "0x%X" ${uboot_sign_off}` 44 | uboot_load_addr=`printf "0x%X" ${uboot_load_addr}` 45 | 46 | echo ${uboot_load_addr} ${uboot_sign_off} ${uboot_size} 47 | 48 | cnt=0 49 | for dtname in $* 50 | do 51 | if [ ${cnt} != 0 ] 52 | then 53 | let fdt${cnt}_size=$(stat --printf="%s" $dtname) 54 | 55 | let fdt${cnt}_sign_off=$((last_sign_off)) 56 | let fdt${cnt}_load_addr=$((last_load_addr)) 57 | let last_size=$((fdt${cnt}_size)) 58 | 59 | fdt_size=`printf "0x%X" ${last_size}` 60 | fdt_sign_off=`printf "0x%X" ${last_sign_off}` 61 | fdt_load_addr=`printf "0x%X" ${last_load_addr}` 62 | 63 | let last_sign_off=$(((last_sign_off + fdt${cnt}_size + 3) & ~3)) 64 | let last_load_addr=$((last_load_addr + fdt${cnt}_size)) 65 | 66 | echo ${fdt_load_addr} ${fdt_sign_off} ${fdt_size} 67 | fi 68 | 69 | cnt=$((cnt+1)) 70 | done 71 | 72 | let atf_sign_off=$((last_sign_off)) 73 | let atf_load_addr=$ATF_LOAD_ADDR 74 | let atf_size=$(stat --printf="%s" $BL31) 75 | 76 | if [ ! -f $BL32 ]; then 77 | let tee_size=0x0 78 | let tee_sign_off=$((atf_sign_off + atf_size)) 79 | else 80 | let tee_size=$(stat --printf="%s" $BL32) 81 | 82 | let tee_sign_off=$(((atf_sign_off + atf_size + 3) & ~3)) 83 | let tee_load_addr=$TEE_LOAD_ADDR 84 | fi 85 | 86 | tee_size=`printf "0x%X" ${tee_size}` 87 | tee_sign_off=`printf "0x%X" ${tee_sign_off}` 88 | tee_load_addr=`printf "0x%X" ${tee_load_addr}` 89 | 90 | atf_size=`printf "0x%X" ${atf_size}` 91 | atf_sign_off=`printf "0x%X" ${atf_sign_off}` 92 | atf_load_addr=`printf "0x%X" ${atf_load_addr}` 93 | 94 | echo ${atf_load_addr} ${atf_sign_off} ${atf_size} 95 | 96 | if [ ${tee_size} != 0x0 ] 97 | then 98 | echo ${tee_load_addr} ${tee_sign_off} ${tee_size} 99 | fi 100 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | MKIMG = $(PWD)/mkimage_imx8 3 | CC = gcc 4 | CFLAGS ?= -g -O2 -Wall -std=c99 -static 5 | INCLUDE += $(CURR_DIR)/src 6 | 7 | SRCS = src/imx8qxb0.c src/mkimage_imx8.c 8 | 9 | ifneq ($(findstring iMX8M,$(SOC)),) 10 | SOC_DIR = iMX8M 11 | endif 12 | ifeq ($(SOC),iMX9) 13 | SOC_DIR = iMX93 14 | endif 15 | ifeq ($(SOC),iMX8DX) 16 | SOC_DIR = iMX8QX 17 | endif 18 | SOC_DIR ?= $(SOC) 19 | 20 | vpath $(INCLUDE) 21 | 22 | .PHONY: clean all bin 23 | 24 | .DEFAULT: 25 | @$(MAKE) -s --no-print-directory bin 26 | ifdef O 27 | @$(MAKE) --no-print-directory SOC_DIR=$(SOC_DIR) -C $(O) -f ../$(SOC_DIR)/soc.mak $@ 28 | else 29 | @$(MAKE) --no-print-directory SOC_DIR=$(SOC_DIR) -C $(SOC_DIR) -f soc.mak $@ 30 | endif 31 | 32 | #print out usage as the default target 33 | all: $(MKIMG) help 34 | 35 | clean: 36 | @rm -f $(MKIMG) 37 | @rm -f src/build_info.h 38 | ifdef O 39 | @$(MAKE) --no-print-directory -C $(O) -f ../$(SOC_DIR)/soc.mak clean 40 | endif 41 | @$(MAKE) --no-print-directory -C iMX8QM -f soc.mak clean 42 | @$(MAKE) --no-print-directory -C iMX8QX -f soc.mak clean 43 | @$(MAKE) --no-print-directory -C iMX8DXL -f soc.mak clean 44 | @$(MAKE) --no-print-directory -C iMX8ULP -f soc.mak clean 45 | @$(MAKE) --no-print-directory -C iMX8M -f soc.mak clean 46 | @$(MAKE) --no-print-directory -C iMX93 -f soc.mak clean 47 | @$(MAKE) --no-print-directory -C iMX91 -f soc.mak clean 48 | @$(MAKE) --no-print-directory -C iMX95 -f soc.mak clean 49 | @$(MAKE) --no-print-directory -C iMX94 -f soc.mak clean 50 | 51 | $(MKIMG): src/build_info.h $(SRCS) 52 | @echo "Compiling mkimage_imx8" 53 | $(CC) $(CFLAGS) $(SRCS) -o $(MKIMG) -I src 54 | 55 | bin: $(MKIMG) 56 | 57 | src/build_info.h: 58 | @echo -n '#define MKIMAGE_COMMIT 0x' > src/build_info.h 59 | @git rev-parse --short=8 HEAD >> src/build_info.h 60 | @echo '' >> src/build_info.h 61 | 62 | help: 63 | @echo $(CURR_DIR) 64 | @echo "usage ${MAKE} SOC= [TARGET]" 65 | @echo "i.e. ${MAKE} SOC=iMX8QX flash" 66 | @echo "Common Targets:" 67 | @echo 68 | @echo "Parts with SCU" 69 | @echo " flash_scfw - Only boot SCU" 70 | @echo " flash - SCU + AP" 71 | @echo " flash_flexspi - SCU + AP (FlexSPI device) " 72 | @echo " flash_nand - SCU + AP (NAND device) " 73 | @echo " flash_cm4 - SCU + M4_0 TCM image" 74 | @echo " flash_linux_m4 - SCU + AP (OPTEE) + M4_0 (and M4_1) TCM image" 75 | @echo " flash_linux_m4_xip - SCU + AP (OPTEE) + M4_0 (and M4_1) FLASH XIP image" 76 | @echo " flash_linux_m4_ddr - SCU + AP (OPTEE) + M4_0 (and M4_1) DDR image" 77 | @echo "" 78 | @echo "Parts w/o SCU" 79 | @echo " flash_ddr3l_val - DisaplayPort FW + u-boot spl" 80 | @echo " flash_ddr3l_val_no_hdmi - u-boot spl" 81 | @echo " flash_hdmi_spl_uboot - HDMI FW + u-boot spl" 82 | @echo " flash_dp_spl_uboot - DisaplayPort FW + u-boot spl" 83 | @echo " flash_spl_uboot - u-boot spl" 84 | @echo 85 | @echo "Typical flash cmd: dd if=iMX8QM/flash.bin of=/dev/ bs=1k seek=33" 86 | @echo 87 | 88 | -------------------------------------------------------------------------------- /iMX8ULP/README: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------------------------------------------------------------------------------------------| 2 | | boot type | A35 | M33 | SW5[8:1] | 3 | --------------------------------------------------------------------------------------------------------------------------------------------------------------------| 4 | | Single Boot | make SOC=iMX8ULP REV=A1 flash_singleboot | | 5 | | for RAM target: make SOC=iMX8ULP REV=A1 flash_singleboot_m33 | 1000_xx00 Single Boot-eMMC| 6 | | ----------------------------------------------------------------------------------------------------------------------------------------------------| 7 | | | make SOC=iMX8ULP REV=A1 flash_singleboot_flexspi | 1010_xx00 Single Boot-Nor | 8 | | | for RAM target: make SOC=iMX8ULP REV=A1 flash_singleboot_m33_flexspi | | 9 | --------------------------------------------------------------------------------------------------------------------------------------------------------------------| 10 | | Dual Boot | make SOC=iMX8ULP REV=A1 flash_dualboot | for RAM target: make SOC=iMX8ULP REV=A1 flash_dualboot_m33 | 1000_0010 A35-eMMC/M33-Nor| 11 | | | | for Flash target: make SOC=iMX8ULP REV=A1 flash_dualboot_m33_xip | | 12 | | ---------------------------------------------------+ +---------------------------- 13 | | | make SOC=iMX8ULP REV=A1 flash_dualboot_flexspi | | 1010_0010 A35-Nor/M33-Nor | 14 | -------------------------------------------------------------------+ +---------------------------- 15 | | Low Power Boot| make SOC=iMX8ULP REV=A1 flash_dualboot | | 1000_00x1 A35-eMMC/M33-Nor| 16 | | ---------------------------------------------------+ +---------------------------- 17 | | | make SOC=iMX8ULP REV=A1 flash_dualboot_flexspi | | 1010_00x1 A35-Nor/M33-Nor | 18 | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- 19 | Note: 20 | For A0, pls replace A1 with A0. 21 | -------------------------------------------------------------------------------- /iMX8QM/scripts/android.mak: -------------------------------------------------------------------------------- 1 | flash_b0_xen_uboot: u-boot-hash.bin 2 | ./$(MKIMG) -soc QM -rev B0 -c -ap u-boot-hash.bin a53 0x81080000 -out u-boot-xen-container.img \ 3 | 4 | flash_b0_spl_container_m4_1_trusty: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_1_image.bin tee.bin u-boot-spl.bin 5 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_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 6 | cp flash.bin boot-spl-container.img 7 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 8 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 9 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 10 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 11 | 12 | flash_b0_spl_container_m4_1_trusty_a72: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_1_image.bin tee.bin u-boot-spl.bin 13 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x01200000 -scfw scfw_tcm.bin -p4 -m4 m4_1_image.bin 1 0x88800000 -ap u-boot-spl.bin a72 0x00100000 -out flash.bin 14 | cp flash.bin boot-spl-container.img 15 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 16 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 17 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 18 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 19 | 20 | flash_b0_spl_container_m4_1: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_1_image.bin u-boot-spl.bin 21 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_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 22 | cp flash.bin boot-spl-container.img 23 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 24 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 25 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 26 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 27 | 28 | flash_b0_spl_container_trusty: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img tee.bin u-boot-spl.bin 29 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -out flash.bin 30 | cp flash.bin boot-spl-container.img 31 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 32 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 33 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 34 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 35 | 36 | flash_b0_spl_container_m4_0_1_trusty_a72: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin m4_image.bin m4_1_image.bin u-boot-atf-container.img 37 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a72 0x00100000 -p3 -m4 m4_image.bin 0 0x34FE0000 -p4 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 38 | cp flash.bin boot-spl-container.img 39 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 40 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 41 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 42 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 43 | 44 | -------------------------------------------------------------------------------- /iMX95/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | ifeq ($(V),1) 4 | AT := 5 | else 6 | AT := @ 7 | endif 8 | 9 | ifeq ($(LC_REVISION),a1) 10 | LCD_REVISION = -$(LC_REVISION) 11 | else 12 | LCD_REVISION = 13 | endif 14 | 15 | # Aliases 16 | nightly : nightly_evk 17 | nightly_mek: nightly_evk 18 | nightly_evk: nightly_evk19 19 | nightly_evk19: nightly_mx95evk19 20 | nightly_evk15: nightly_mx95evk15 21 | nightly_mx95evk19: nightly_mx95-19x19-lpddr5-evk 22 | nightly_mx95evk15: nightly_mx95-15x15-lpddr4x-evk 23 | nightly_verdin: nightly_mx95verdin 24 | 25 | # MX95 19x19 LPDDR5 EVK 26 | nightly_mx95-19x19-lpddr5-evk: BOARD = $(CPU)$(LCD_REVISION)-19x19-$(DDR)-evk 27 | nightly_mx95-19x19-lpddr5-evk: DTB = imx95-19x19-evk 28 | nightly_mx95-19x19-lpddr5-evk: CPU = imx95 29 | nightly_mx95-19x19-lpddr5-evk: DDR = lpddr5 30 | nightly_mx95-19x19-lpddr5-evk: DDR_FW_VER = $(LPDDR_FW_VERSION) 31 | nightly_mx95-19x19-lpddr5-evk: M7_FILE = $(DTB)_m7_TCM_power_mode_switch.bin 32 | nightly_mx95-19x19-lpddr5-evk: core_files 33 | 34 | # MX95 15x15 LPDDR4X EVK 35 | nightly_mx95-15x15-lpddr4x-evk: BOARD = $(CPU)$(LCD_REVISION)-15x15-$(DDR)-evk 36 | nightly_mx95-15x15-lpddr4x-evk: DTB = imx95-15x15-evk 37 | nightly_mx95-15x15-lpddr4x-evk: CPU = imx95 38 | nightly_mx95-15x15-lpddr4x-evk: DDR = lpddr4x 39 | nightly_mx95-15x15-lpddr4x-evk: DDR_FW_VER = $(LPDDR_FW_VERSION) 40 | nightly_mx95-15x15-lpddr4x-evk: M7_FILE = $(DTB)_m7_TCM_power_mode_switch.bin 41 | nightly_mx95-15x15-lpddr4x-evk: core_files 42 | 43 | # MX95 19x19 Verdin 44 | nightly_mx95verdin: BOARD = $(CPU)$(LCD_REVISION)-19x19-verdin 45 | nightly_mx95verdin: DTB = imx95-verdin-evk 46 | nightly_mx95verdin: CPU = imx95 47 | nightly_mx95verdin: DDR = lpddr5 48 | nightly_mx95verdin: DDR_FW_VER = $(LPDDR_FW_VERSION) 49 | nightly_mx95verdin: M7_FILE = $(DTB)_m7_TCM_power_mode_switch.bin 50 | nightly_mx95verdin: core_files 51 | 52 | core_files: 53 | $(AT)rm -rf boot 54 | $(AT)mkdir boot 55 | $(AT)echo "Pulling nightly for EVK board from $(SERVER)/$(DIR)" 56 | $(AT)echo $(BUILD)-$(N)-iMX95-evk > nightly.txt 57 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(AHAB_IMG) -O $(AHAB_IMG) 58 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/bl31-$(CPU).bin -O bl31.bin 59 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-$(BOARD).bin-sd -O u-boot.bin 60 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-spl.bin-$(BOARD)-sd -O u-boot-spl.bin 61 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem$(DDR_FW_VER).bin -O $(DDR)_dmem$(DDR_FW_VER).bin 62 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem_qb$(DDR_FW_VER).bin -O $(DDR)_dmem_qb$(DDR_FW_VER).bin 63 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem$(DDR_FW_VER).bin -O $(DDR)_imem$(DDR_FW_VER).bin 64 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem_qb$(DDR_FW_VER).bin -O $(DDR)_imem_qb$(DDR_FW_VER).bin 65 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/oei-m33-ddr.bin -O oei-m33-ddr.bin 66 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/oei-m33-tcm.bin -O oei-m33-tcm.bin || true 67 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/m33_image-mx95evk.bin -O m33_image.bin 68 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(M7_FILE) -O m7_image.bin 69 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/Image-imx95evk.bin -O Image 70 | $(AT)mv -f Image boot 71 | -------------------------------------------------------------------------------- /iMX94/scripts/fspi_header_200: -------------------------------------------------------------------------------- 1 | 46434642 /* Tag, ASCII "FCFB" */ 2 | 00010156 /* Version */ 3 | 00000000 4 | 03030300 /* ColumnAddressWidth, DataSetupTime, DataHoldTime, ReadSampleClkSrc */ 5 | 01000000 /* Device mode cfg enable 01000000 */ 6 | 01040000 /* Cfg use lut seq cnt 1 idx 4 */ 7 | e7000000 /* MT35X Volatile Configuration Register 0, octal ddr mode, 0xe7 */ 8 | 00000000 9 | 00000000 10 | 00000000 11 | 00000000 12 | 00000000 13 | 00000000 14 | 00000000 15 | 00000000 16 | 00000000 17 | 50000000 /* DDR mode enable use safe clock for config, 0x50000000 */ 18 | 01080800 /* Nor, Octal pad, 200MHZ, 0x01080800 */ 19 | 00000000 20 | 00000000 21 | 00000010 /* SFlashA1Size */ 22 | 00000000 23 | 00000000 24 | 00000000 25 | 00000000 26 | 00000000 27 | 00000000 28 | 00000000 29 | 00000000 30 | 00000000 31 | 19000000 /* Port A data valid time out */ 32 | 00000000 33 | fd47fd47 /* Idx 0 read data */ 34 | 202b100f 35 | 043b0000 36 | 00000000 37 | 00000000 38 | 05470547 /* Idx 1 read status */ 39 | 100f043b 40 | 00000000 41 | 00000000 42 | 00000000 43 | 00000000 /* Idx 2 */ 44 | 00000000 45 | 00000000 46 | 00000000 47 | 00000000 48 | 06040000 /* Idx 3 write enable */ 49 | 00000000 50 | 00000000 51 | 00000000 52 | 00000000 53 | 81041808 /* Idx 4 use cmd 0x81h write volatile reg for MT35X */ 54 | 01200000 55 | 00000000 56 | 00000000 57 | 00000000 58 | 21042008 /* Idx 5 4k erase */ 59 | 00000000 60 | 00000000 61 | 00000000 62 | 00000000 63 | 00000000 /* Idx 6 */ 64 | 00000000 65 | 00000000 66 | 00000000 67 | 00000000 68 | 00000000 /* Idx 7 */ 69 | 00000000 70 | 00000000 71 | 00000000 72 | 00000000 73 | 00000000 /* Idx 8 */ 74 | 00000000 75 | 00000000 76 | 00000000 77 | 00000000 78 | 8e04200b /* Idx 9 octal write */ 79 | 80230000 80 | 00000000 81 | 00000000 82 | 00000000 83 | 00000000 /* Idx 10 */ 84 | 00000000 85 | 00000000 86 | 00000000 87 | 00000000 88 | 60040000 /* Idx 11 */ 89 | 00000000 90 | 00000000 91 | 00000000 92 | 00000000 93 | 00000000 /* Idx 12 */ 94 | 00000000 95 | 00000000 96 | 00000000 97 | 00000000 98 | 00000000 /* Idx 13 */ 99 | 00000000 100 | 00000000 101 | 00000000 102 | 00000000 103 | 00000000 /* Idx 14 */ 104 | 00000000 105 | 00000000 106 | 00000000 107 | 00000000 108 | 00000000 /* Idx 15 */ 109 | 00000000 110 | 00000000 111 | 00000000 112 | 00000000 113 | 00000000 /* 12 customized luts */ 114 | 00000000 115 | 00000000 116 | 00000000 117 | 00000000 118 | 00000000 119 | 00000000 120 | 00000000 121 | 00000000 122 | 00000000 123 | 00000000 124 | 00000000 125 | 00000000 /* DLLCRA SDR settings */ 126 | 00000000 /* SMPR SDR settings */ 127 | 00000000 /* DLLCRA DDR settings */ 128 | 00000000 /* SMPR DDR settings */ 129 | 00010000 /* Page Size */ 130 | 00100000 /* Sector Size */ 131 | 00000000 132 | 00000000 133 | 00000000 134 | 00000000 135 | 00000000 136 | 00000000 137 | 00000000 138 | 00000000 139 | 00000000 140 | 00000000 141 | 00000000 142 | 00000000 143 | 00000000 144 | 00000000 145 | 00000000 146 | 00000000 147 | 00000000 148 | 00000000 149 | 00000000 150 | 00000000 151 | 00000000 152 | 00000000 153 | 00000000 154 | 00000000 155 | 00000000 156 | 00000000 157 | 00000000 158 | 00000000 159 | 00000000 160 | 00000000 161 | 00000000 162 | 00000000 163 | 00000000 164 | 00000000 165 | 00000000 166 | 00000000 167 | 00000000 168 | 00000000 169 | 00000000 170 | 00000000 171 | 00000000 172 | 00000000 173 | 00000000 174 | 00000000 175 | 00000000 176 | 00000000 177 | 00000000 178 | 00000000 179 | 00000000 180 | 00000000 181 | 00000000 182 | 00000000 183 | 00000000 184 | 00000000 185 | 00000000 186 | 00000000 187 | 00000000 188 | 00000000 189 | 00000000 190 | 00000000 191 | 00000000 192 | 00000000 193 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | OPTIONS: 2 | 3 | -soc [soc] 4 | Specifies the SOC to build the image for. 5 | This option is mandatory. 6 | 7 | -rev [revision] 8 | Specifies the SOC's revision to build the image for. 9 | Valid values for revision are A0 and B0. 10 | For now, only socs QX and QM have B0 revisions. 11 | When not specified, default revision is A0. 12 | 13 | -commit 14 | Prints the commit used to build the mkimage. 15 | 16 | -dev [device] [page_size] 17 | Specifies the boot device. 18 | The valid device values are: flexspi, sd and nand. 19 | The page size argument is available only for B0 revisions when device is 'nand'. 20 | The valid page size values are: 4K, 8K or 16K. 21 | 22 | -append [filename] 23 | Specifies the container blob file to be appended as is. 24 | 25 | -out [filename] 26 | Specifies the output file for the generated and appened containers. 27 | 28 | -c, --container 29 | Create new container to be appended. 30 | 31 | -flags [value] 32 | Specifies flags for the new container. 33 | The value needs to be a 32bit value in hex. 34 | 35 | -msel [mode] 36 | Specifies the mode select value. Passed to boot FW (eg. SM). 37 | 38 | -fuse_version [value] 39 | Specifies fuse version field for the new container. 40 | 41 | -sw_version [value] 42 | Specifies SW version field for the new container. 43 | 44 | -dcd [filename] 45 | Specifies the DCD image to be appended to the new container. 46 | Not applicable for socs QX and QM revision B0. 47 | 48 | -dummy [address] 49 | Specifies address used to store V2X firmware for non-flexspi booting. 50 | If the address is not specified in non-flexspi booting, ROM won't load 51 | V2X firwmware. 52 | When setting this address to DDR, must ensure DDR is initialized by ROM. 53 | 54 | -scfw [filename] 55 | Specifies the SCFW image to be appended to the new container. 56 | 57 | -scd [filename] 58 | Specifies the SCD image to be appended to the new container. 59 | Applicable only for non B0 revisions. 60 | 61 | -seco [filename] 62 | Specifies the SECO container to be appended to the final image. 63 | 64 | -partition [partition index] 65 | Specifies the partition index for boot core. 66 | Default AP is 1 and M4 is 0 for a shared partition . 67 | 68 | -csf [filename] 69 | Specifies the CSF image to be appended to the new container. 70 | Applicable only for non B0 revisions. 71 | 72 | -ap [filename] [core] [address] (mu0|mu3) (pt[1-9]) 73 | Specifies the AP image to be appended to the new container. 74 | Valid core values for this image are 'a35', 'a53' and 'a72'. 75 | The address represents the start address and needs to be a 32bit value in hex. 76 | optional: specify MU ID and partition ID, default values are mu0 and pt1. 77 | Note: pt2 is an illegal value, it is reserved for system. 78 | 79 | -images_hash [sha256|sha384|sha512] 80 | Specifies the image hash type used in the new container. 81 | 82 | -msg_blk [filename] [fuse|field|debug|patch|zero|degrade] [address] 83 | Specifies a special A core data image used to pass a message block to SCFW 84 | for debug, secure fuse programming, field return, patch, FIPS key zeroization, 85 | and FIPS cluster degrade. 86 | 87 | -m4 [filename] [core] [address] 88 | Specifies the M4 image to be appended to the new container. 89 | Valid core values for this image are 0 and 1. 90 | The address represents the start address and needs to be a 32bit value in hex. 91 | 92 | -data [filename] [core] [address] 93 | Specifies a data image to be appended to the new container, usually a rootfs image or a kernel image. 94 | The core can be 'a35', 'a53', 'a72', 'm4', 'm4_1'. 95 | The address represents the load address and needs to be a 32bit value in hex. 96 | 97 | -fileoff [offset] 98 | Specifies a position to set the file offset of the following image to. 99 | The offset must be greater than file offset at the time and aligned to 100 | sector size. 101 | This is only aplicable for QX/QM revision B0 102 | -------------------------------------------------------------------------------- /iMX94/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | ifeq ($(V),1) 4 | AT := 5 | else 6 | AT := @ 7 | endif 8 | 9 | # Aliases 10 | nightly : nightly_evk 11 | nightly_mek: nightly_evk 12 | nightly_evk: nightly_evk19lp5 13 | nightly_evk19lp5: nightly_mx943evk19lp5 14 | nightly_evk19lp4: nightly_mx943evk19lp4 15 | nightly_evk15: nightly_mx943evk15 16 | nightly_mx943evk19lp5: nightly_mx943-19x19-lpddr5-evk 17 | nightly_mx943evk19lp4: nightly_mx943-19x19-lpddr4-evk 18 | nightly_mx943evk15: nightly_mx943-15x15-lpddr4-evk 19 | 20 | # MX943 19x19 LPDDR5 EVK 21 | nightly_mx943-19x19-lpddr5-evk: BOARD = $(CPU)-19x19-$(DDR)-evk 22 | nightly_mx943-19x19-lpddr5-evk: DTB = imx943-19x19-evk 23 | nightly_mx943-19x19-lpddr5-evk: CPU = imx943 24 | nightly_mx943-19x19-lpddr5-evk: DDR = lpddr5 25 | nightly_mx943-19x19-lpddr5-evk: DDR_FW_VER = $(LPDDR_FW_VERSION) 26 | nightly_mx943-19x19-lpddr5-evk: M7_FILE = imx943evk_cm7_core0_TCM_power_mode_switch.bin 27 | nightly_mx943-19x19-lpddr5-evk: M71_FILE = imx943evk_cm7_core1_TCM_power_mode_switch.bin 28 | nightly_mx943-19x19-lpddr5-evk: M33S_FILE = imx943evk_cm33_core1_TCM_power_mode_switch.bin 29 | nightly_mx943-19x19-lpddr5-evk: core_files 30 | 31 | # MX943 19x19 LPDDR4X EVK 32 | nightly_mx943-19x19-lpddr4-evk: BOARD = $(CPU)-19x19-lpddr4-evk 33 | nightly_mx943-19x19-lpddr4-evk: DTB = imx943-19x19-evk 34 | nightly_mx943-19x19-lpddr4-evk: CPU = imx943 35 | nightly_mx943-19x19-lpddr4-evk: DDR = lpddr4x 36 | nightly_mx943-19x19-lpddr4-evk: DDR_FW_VER = $(LPDDR_FW_VERSION) 37 | nightly_mx943-19x19-lpddr4-evk: M7_FILE = imx943evk_cm7_core0_TCM_power_mode_switch.bin 38 | nightly_mx943-19x19-lpddr4-evk: M71_FILE = imx943evk_cm7_core1_TCM_power_mode_switch.bin 39 | nightly_mx943-19x19-lpddr4-evk: M33S_FILE = imx943evk_cm33_core1_TCM_power_mode_switch.bin 40 | nightly_mx943-19x19-lpddr4-evk: core_files 41 | 42 | # MX943 15x15 LPDDR4X EVK 43 | nightly_mx943-15x15-lpddr4-evk: BOARD = $(CPU)-15x15-lpddr4-evk 44 | nightly_mx943-15x15-lpddr4-evk: DTB = imx943-15x15-evk 45 | nightly_mx943-15x15-lpddr4-evk: CPU = imx943 46 | nightly_mx943-15x15-lpddr4-evk: DDR = lpddr4x 47 | nightly_mx943-15x15-lpddr4-evk: DDR_FW_VER = $(LPDDR_FW_VERSION) 48 | nightly_mx943-15x15-lpddr4-evk: M7_FILE = imx943evk_cm7_core0_TCM_power_mode_switch.bin 49 | nightly_mx943-15x15-lpddr4-evk: M71_FILE = imx943evk_cm7_core1_TCM_power_mode_switch.bin 50 | nightly_mx943-15x15-lpddr4-evk: M33S_FILE = iimx943evk_cm33_core1_TCM_power_mode_switch.bin 51 | nightly_mx943-15x15-lpddr4-evk: core_files 52 | 53 | core_files: 54 | $(AT)rm -rf boot 55 | $(AT)mkdir boot 56 | $(AT)echo "Pulling nightly for EVK board from $(SERVER)/$(DIR)" 57 | $(AT)echo $(BUILD)-$(N)-iMX943-evk > nightly.txt 58 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(AHAB_IMG) -O $(AHAB_IMG) 59 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/bl31-imx94.bin -O bl31.bin 60 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-$(BOARD).bin-sd -O u-boot.bin 61 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/u-boot-spl.bin-$(BOARD)-sd -O u-boot-spl.bin 62 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem$(DDR_FW_VER).bin -O $(DDR)_dmem$(DDR_FW_VER).bin 63 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_dmem_qb$(DDR_FW_VER).bin -O $(DDR)_dmem_qb$(DDR_FW_VER).bin 64 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem$(DDR_FW_VER).bin -O $(DDR)_imem$(DDR_FW_VER).bin 65 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(DDR)_imem_qb$(DDR_FW_VER).bin -O $(DDR)_imem_qb$(DDR_FW_VER).bin 66 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/oei-m33-ddr.bin -O oei-m33-ddr.bin 67 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/m33_image-mx94evk.bin -O m33_image.bin 68 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(M7_FILE) -O m70_image.bin 69 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(M71_FILE) -O m71_image.bin 70 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/$(BOARD)/$(M33S_FILE) -O m33s_image.bin 71 | $(AT)$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "$(DTB)*.dtb" 72 | $(AT)$(WGET) -q $(SERVER)/$(DIR)/Image-imx943evk.bin -O Image 73 | $(AT)mv -f Image boot 74 | -------------------------------------------------------------------------------- /iMX8M/mkimage_fit_atf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # script to generate FIT image source for i.MX8MQ boards with 4 | # ARM Trusted Firmware and multiple device trees (given on the command line) 5 | # 6 | # usage: $0 [ [&2 15 | exit 0 16 | fi 17 | 18 | if [ ! -f $BL31 ]; then 19 | echo "ERROR: BL31 file $BL31 NOT found" >&2 20 | exit 0 21 | else 22 | echo "$BL31 size: " >&2 23 | ls -lct $BL31 | awk '{print $5}' >&2 24 | fi 25 | 26 | [ -z "$BL32" ] && BL32="tee.bin" 27 | LOADABLES="\"atf-1\"" 28 | 29 | PAD=../scripts/pad_image.sh 30 | 31 | if [ ! -f $BL32 ]; then 32 | BL32=/dev/null 33 | else 34 | echo "Building with TEE support, make sure $BL31 is compiled with spd. If you do not want tee, please delete $BL32" >&2 35 | if [ $TEE_COMPRESS_ENABLE ]; then 36 | echo "Start compress $BL32" >&2 37 | rm -f $BL32.lz4 38 | lz4 -9 $BL32 $BL32.lz4 >&2 39 | BL32=$BL32.lz4 40 | ./$PAD $BL32 >&2 41 | fi 42 | echo "$BL32 size: " >&2 43 | ls -lct $BL32 | awk '{print $5}' >&2 44 | LOADABLES="$LOADABLES, \"tee-1\"" 45 | fi 46 | 47 | [ -z "$BL33" ] && BL33="u-boot-nodtb.bin" 48 | DEK_BLOB="dek_blob_fit_dummy.bin" 49 | 50 | if [ ! -f $DEK_BLOB ]; then 51 | DEK_BLOB=/dev/null 52 | else 53 | echo "Building with encrypted boot support, make sure to replace DEK Blob in final image." >&2 54 | LOADABLES="\"dek_blob-1\", $LOADABLES" 55 | fi 56 | 57 | if [ ! -f $BL33 ]; then 58 | echo "ERROR: $BL33 file NOT found" >&2 59 | exit 0 60 | else 61 | 62 | echo "$BL33 size: " >&2 63 | ls -lct $BL33 | awk '{print $5}' >&2 64 | fi 65 | 66 | for dtname in $* 67 | do 68 | echo "$dtname size: " >&2 69 | ls -lct $dtname | awk '{print $5}' >&2 70 | done 71 | 72 | cat << __HEADER_EOF 73 | /dts-v1/; 74 | 75 | / { 76 | description = "Configuration to load ATF before U-Boot"; 77 | #address-cells = <1>; 78 | 79 | images { 80 | uboot-1 { 81 | description = "U-Boot (64-bit)"; 82 | data = /incbin/("$BL33"); 83 | type = "standalone"; 84 | arch = "arm64"; 85 | compression = "none"; 86 | load = <0x40200000>; 87 | }; 88 | __HEADER_EOF 89 | 90 | cnt=1 91 | for dtname in $* 92 | do 93 | cat << __FDT_IMAGE_EOF 94 | fdt-$cnt { 95 | description = "$(basename $dtname .dtb)"; 96 | data = /incbin/("$dtname"); 97 | type = "flat_dt"; 98 | compression = "none"; 99 | }; 100 | __FDT_IMAGE_EOF 101 | cnt=$((cnt+1)) 102 | done 103 | 104 | cat << __HEADER_EOF 105 | atf-1 { 106 | description = "ARM Trusted Firmware"; 107 | data = /incbin/("$BL31"); 108 | type = "firmware"; 109 | arch = "arm64"; 110 | compression = "none"; 111 | load = <$ATF_LOAD_ADDR>; 112 | entry = <$ATF_LOAD_ADDR>; 113 | }; 114 | __HEADER_EOF 115 | 116 | if [ -f $BL32 ]; then 117 | cat << __HEADER_EOF 118 | tee-1 { 119 | description = "TEE firmware"; 120 | data = /incbin/("$BL32"); 121 | type = "firmware"; 122 | arch = "arm64"; 123 | compression = "none"; 124 | load = <$TEE_LOAD_ADDR>; 125 | entry = <$TEE_LOAD_ADDR>; 126 | }; 127 | __HEADER_EOF 128 | fi 129 | 130 | if [ -f $DEK_BLOB ]; then 131 | cat << __HEADER_EOF 132 | dek_blob-1 { 133 | description = "dek_blob"; 134 | data = /incbin/("$DEK_BLOB"); 135 | type = "script"; 136 | compression = "none"; 137 | load = <$DEK_BLOB_LOAD_ADDR>; 138 | }; 139 | __HEADER_EOF 140 | fi 141 | 142 | cat << __CONF_HEADER_EOF 143 | }; 144 | configurations { 145 | default = "config-1"; 146 | 147 | __CONF_HEADER_EOF 148 | 149 | cnt=1 150 | for dtname in $* 151 | do 152 | if [ -f $BL32 ]; then 153 | if [ $ROLLBACK_INDEX_IN_FIT ]; then 154 | cat << __CONF_SECTION_EOF 155 | config-$cnt { 156 | description = "$(basename $dtname .dtb)"; 157 | firmware = "uboot-1"; 158 | loadables = $LOADABLES; 159 | fdt = "fdt-$cnt"; 160 | rbindex = "$ROLLBACK_INDEX_IN_FIT"; 161 | }; 162 | __CONF_SECTION_EOF 163 | else 164 | cat << __CONF_SECTION_EOF 165 | config-$cnt { 166 | description = "$(basename $dtname .dtb)"; 167 | firmware = "uboot-1"; 168 | loadables = $LOADABLES; 169 | fdt = "fdt-$cnt"; 170 | }; 171 | __CONF_SECTION_EOF 172 | fi 173 | else 174 | cat << __CONF_SECTION1_EOF 175 | config-$cnt { 176 | description = "$(basename $dtname .dtb)"; 177 | firmware = "uboot-1"; 178 | loadables = $LOADABLES; 179 | fdt = "fdt-$cnt"; 180 | }; 181 | __CONF_SECTION1_EOF 182 | fi 183 | cnt=$((cnt+1)) 184 | done 185 | 186 | cat << __ITS_EOF 187 | }; 188 | }; 189 | __ITS_EOF 190 | -------------------------------------------------------------------------------- /iMX8QM/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | nightly : 4 | @rm -rf boot 5 | @echo "Pulling nightly for Validation board from $(SERVER)/$(DIR)" 6 | @echo $(BUILD)-$(N)-iMX8QM-val > nightly.txt 7 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmlpddr4arm2/$(AHAB_IMG) -O $(AHAB_IMG) 8 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmlpddr4arm2/mx8qm-val-scfw-tcm.bin -O scfw_tcm.bin 9 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmlpddr4arm2/bl31-imx8qm.bin -O bl31.bin 10 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmlpddr4arm2/u-boot-imx8qmlpddr4arm2.bin-sd -O u-boot.bin 11 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/u-boot-spl.bin-imx8qmmek-sd -O u-boot-spl.bin 12 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/u-boot-spl.bin-imx8qmmek-fspi -O u-boot-spl-fspi.bin 13 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmlpddr4arm2/m4_image.bin -O m4_image.bin 14 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmlpddr4arm2/m4_1_image.bin -O m4_1_image.bin 15 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qm-lpddr4*.dtb" 16 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 17 | @mv -f Image boot 18 | 19 | nightly_mek : 20 | @rm -rf boot 21 | @echo "Pulling nightly for MEK board from $(SERVER)/$(DIR)" 22 | @echo $(BUILD)-$(N)-iMX8QM-mek > nightly.txt 23 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/$(AHAB_IMG) -O $(AHAB_IMG) 24 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/mx8qm-mek-scfw-tcm.bin -O scfw_tcm.bin 25 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/bl31-imx8qm.bin -O bl31.bin 26 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/u-boot-imx8qmmek.bin-sd -O u-boot.bin 27 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/u-boot-spl.bin-imx8qmmek-sd -O u-boot-spl.bin 28 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/u-boot-spl.bin-imx8qmmek-fspi -O u-boot-spl-fspi.bin 29 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/m4_image.bin -O m4_image.bin 30 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qmmek/m4_1_image.bin -O m4_1_image.bin 31 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qm-mek*.dtb" 32 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 33 | @mv -f Image boot 34 | 35 | nightly_cockpit : 36 | @rm -rf boot 37 | @echo "Pulling nightly for MEK cockpit board from $(SERVER)/$(DIR)" 38 | @echo $(BUILD)-$(N)-iMX8QM-cockpit-mek > nightly.txt 39 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/$(AHAB_IMG) -O $(AHAB_IMG) 40 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/mx8qm-mek_cockpit-nospl-scfw-tcm.bin -O scfw_tcm.bin 41 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/bl31-imx8qm-cockpit.bin-a53 -O bl31.bin 42 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/bl31-imx8qm-cockpit.bin-a72 -O bl31-a72.bin 43 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/u-boot.bin -O u-boot.bin 44 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/u-boot-a72.bin -O u-boot-a72.bin 45 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/m4_image.bin -O m4_image.bin 46 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/m4_1_image.bin -O m4_1_image.bin 47 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qm-mek*.dtb" 48 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8qm-cockpit-mek.bin -O Image 49 | @mv -f Image boot 50 | 51 | nightly_cockpit_spl : 52 | @rm -rf boot 53 | @echo "Pulling nightly for MEK cockpit optee board from $(SERVER)/$(DIR)" 54 | @echo $(BUILD)-$(N)-iMX8QM-cockpit-spl-mek > nightly.txt 55 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/$(AHAB_IMG) -O $(AHAB_IMG) 56 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/mx8qm-mek_cockpit-scfw-tcm.bin -O scfw_tcm.bin 57 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/bl31-imx8qm-cockpit.bin-optee-a53 -O bl31.bin 58 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/bl31-imx8qm-cockpit.bin-optee-a72 -O bl31-a72.bin 59 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/u-boot-spl.bin -O u-boot-spl.bin 60 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/u-boot-spl-a72.bin -O u-boot-spl-a72.bin 61 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/tee-a53.bin -O tee.bin 62 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/tee-a72.bin -O tee-a72.bin 63 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/u-boot.bin -O u-boot.bin 64 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/u-boot-a72.bin -O u-boot-a72.bin 65 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/m4_image.bin -O m4_image.bin 66 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qm-cockpit-mek/m4_1_image.bin -O m4_1_image.bin 67 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qm-mek*.dtb" 68 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8qm-cockpit-mek.bin -O Image 69 | @mv -f Image boot 70 | 71 | archive : 72 | git ls-files --others --exclude-standard -z | xargs -0 tar rvf $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 73 | bzip2 $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 74 | 75 | -------------------------------------------------------------------------------- /scripts/qspi_header: -------------------------------------------------------------------------------- 1 | 0 /*dqs_loopback=0 or 1*/ 2 | 0 /*hold_delay=0 to 3*/ 3 | 0 /*hsphs=0 (Half Speed Phase sampling at non-inverted clock) or 1 (sampling at inverted clock)*/ 4 | 0 /*hsdly=0 (Half Speed Delay one clk delay) or 1 (two clk cycle delay)*/ 5 | 0 /*device_quad_mode_en=1 to enable sending command to SPI device*/ 6 | 0 /*device_cmd=command to device for enableing Quad I/O mode*/ 7 | 0 /*write_cmd_ipcr=hex value to be written to IPCR register for write cmd of device*/ 8 | 2000000 /*write_enable_ipcr=hex value to be written to IPCR register for write enable of device*/ 9 | 3 /*cs_hold_time=0 to 0xF*/ 10 | 3 /*cs_setup_time=0 to 0xF*/ 11 | 8000000 /*sflash_A1_size=size in byte(hex)*/ 12 | 0 /*sflash_A2_size=size in byte(hex)*/ 13 | 8000000 /*sflash_B1_size=size in byte(hex)*/ 14 | 0 /*sflash_B2_size=size in byte(hex)*/ 15 | 0 /*sclk_freq=0 to 6*/ 16 | 0 /*busy_bit_offset=bit position of device BUSY in device status register*/ 17 | 2 /*sflash_type=1 (Single), 2 (Dual), 4 (Quad mode of operation)*/ 18 | 0 /*sflash_port=0 or 1 (Port B used)*/ 19 | 1 /*ddr_mode_enable=0 or 1*/ 20 | 0 /*dqs_enable=0 or 1*/ 21 | 0 /*parallel_mode_enable=0 or 1*/ 22 | 0 /*portA_cs1=0 or 1*/ 23 | 0 /*portB_cs1=0 or 1*/ 24 | 0 /*fsphs=0 (Full Speed Phase sampling at non-inverted clock) or 1 (sampling at inverted clock)*/ 25 | 0 /*fsdly=0 (Full Speed Delay One clk delay) or 1 (two clk cycle delay)*/ 26 | 0 /*ddrsmp=0 to 7 (sampling point for incoming data in DDR mode)*/ 27 | 2818043d /*lut[0] command sequence*/ 28 | 39040d06 /*lut[1] command sequence*/ 29 | 2400 /*lut[2] command sequence*/ 30 | 0 /*lut[3] command sequence*/ 31 | 0 /*lut[4] command sequence*/ 32 | 0 /*lut[5] command sequence*/ 33 | 0 /*lut[6] command sequence*/ 34 | 0 /*lut[7] command sequence*/ 35 | 0 /*lut[8] command sequence*/ 36 | 0 /*lut[9] command sequence*/ 37 | 0 /*lut[10] command sequence*/ 38 | 0 /*lut[11] command sequence*/ 39 | 0 /*lut[12] command sequence*/ 40 | 0 /*lut[13] command sequence*/ 41 | 0 /*lut[14] command sequence*/ 42 | 0 /*lut[15] command sequence*/ 43 | 0 /*lut[16] command sequence*/ 44 | 0 /*lut[17] command sequence*/ 45 | 0 /*lut[18] command sequence*/ 46 | 0 /*lut[19] command sequence*/ 47 | 0 /*lut[20] command sequence*/ 48 | 0 /*lut[21] command sequence*/ 49 | 0 /*lut[22] command sequence*/ 50 | 0 /*lut[23] command sequence*/ 51 | 0 /*lut[24] command sequence*/ 52 | 0 /*lut[25] command sequence*/ 53 | 0 /*lut[26] command sequence*/ 54 | 0 /*lut[27] command sequence*/ 55 | 0 /*lut[28] command sequence*/ 56 | 0 /*lut[29] command sequence*/ 57 | 0 /*lut[30] command sequence*/ 58 | 0 /*lut[31] command sequence*/ 59 | 0 /*lut[32] command sequence*/ 60 | 0 /*lut[33] command sequence*/ 61 | 0 /*lut[34] command sequence*/ 62 | 0 /*lut[35] command sequence*/ 63 | 0 /*lut[36] command sequence*/ 64 | 0 /*lut[37] command sequence*/ 65 | 0 /*lut[38] command sequence*/ 66 | 0 /*lut[39] command sequence*/ 67 | 0 /*lut[40] command sequence*/ 68 | 0 /*lut[41] command sequence*/ 69 | 0 /*lut[42] command sequence*/ 70 | 0 /*lut[43] command sequence*/ 71 | 0 /*lut[44] command sequence*/ 72 | 0 /*lut[45] command sequence*/ 73 | 0 /*lut[46] command sequence*/ 74 | 0 /*lut[47] command sequence*/ 75 | 0 /*lut[48] command sequence*/ 76 | 0 /*lut[49] command sequence*/ 77 | 0 /*lut[50] command sequence*/ 78 | 0 /*lut[51] command sequence*/ 79 | 0 /*lut[52] command sequence*/ 80 | 0 /*lut[53] command sequence*/ 81 | 0 /*lut[54] command sequence*/ 82 | 0 /*lut[55] command sequence*/ 83 | 0 /*lut[56] command sequence*/ 84 | 0 /*lut[57] command sequence*/ 85 | 0 /*lut[58] command sequence*/ 86 | 0 /*lut[59] command sequence*/ 87 | 0 /*lut[60] command sequence*/ 88 | 0 /*lut[61] command sequence*/ 89 | 0 /*lut[62] command sequence*/ 90 | 0 /*lut[63] command sequence*/ 91 | 1000001 /*read_status_ipcr=hex value to be written to IPCR register for reading status reg of device*/ 92 | 0 /*enable_dqs_phase=0 or 1*/ 93 | 0 /*config_cmds_en, enable config command*/ 94 | 0 /*config_cmds[0]*/ 95 | 0 /*config_cmds[1]*/ 96 | 0 /*config_cmds[2]*/ 97 | 0 /*config_cmds[3]*/ 98 | 0 /*config_cmds_args[0]*/ 99 | 0 /*config_cmds_args[1]*/ 100 | 0 /*config_cmds_args[2]*/ 101 | 0 /*config_cmds_args[3]*/ 102 | 0 /*io_pad_override_setting QSPI pins override setting*/ 103 | 0 /*reserve[0], 25 byte reserved area*/ 104 | 0 /*reserve[1], 25 byte reserved area*/ 105 | 0 /*reserve[2], 25 byte reserved area*/ 106 | 0 /*reserve[3], 25 byte reserved area*/ 107 | 0 /*reserve[4], 25 byte reserved area*/ 108 | 0 /*reserve[5], 25 byte reserved area*/ 109 | 0 /*reserve[6], 25 byte reserved area*/ 110 | 0 /*reserve[7], 25 byte reserved area*/ 111 | 0 /*reserve[8], 25 byte reserved area*/ 112 | 0 /*reserve[9], 25 byte reserved area*/ 113 | 0 /*reserve[10], 25 byte reserved area*/ 114 | 0 /*reserve[11], 25 byte reserved area*/ 115 | 0 /*reserve[12], 25 byte reserved area*/ 116 | 0 /*reserve[13], 25 byte reserved area*/ 117 | 0 /*reserve[14], 25 byte reserved area*/ 118 | 0 /*reserve[15], 25 byte reserved area*/ 119 | 0 /*reserve[16], 25 byte reserved area*/ 120 | 0 /*reserve[17], 25 byte reserved area*/ 121 | 0 /*reserve[18], 25 byte reserved area*/ 122 | 0 /*reserve[19], 25 byte reserved area*/ 123 | 0 /*reserve[20], 25 byte reserved area*/ 124 | 0 /*reserve[21], 25 byte reserved area*/ 125 | 0 /*reserve[22], 25 byte reserved area*/ 126 | 0 /*reserve[23], 25 byte reserved area*/ 127 | 0 /*reserve[24], 25 byte reserved area*/ 128 | c0ffee01 /*tag, QSPI configuration tag, should be 0xc0ffee01*/ 129 | -------------------------------------------------------------------------------- /iMX8QX/scripts/autobuild.mak: -------------------------------------------------------------------------------- 1 | include ../scripts/autobuild_common.mak 2 | 3 | nightly : 4 | ls 5 | @rm -rf boot 6 | @echo "Pulling nightly for Validation board from $(SERVER)/$(DIR)" 7 | @echo $(BUILD)-$(N)-iMX8QX-val > nightly.txt 8 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/$(AHAB_IMG) -O $(AHAB_IMG) 9 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/mx8qx-val-scfw-tcm.bin -O scfw_tcm.bin 10 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/bl31-imx8qx.bin -O bl31.bin 11 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/u-boot-imx8qxplpddr4arm2.bin-sd -O u-boot.bin 12 | # @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/u-boot-spl.bin-imx8qxplpddr4arm2-sd -O u-boot-spl.bin 13 | # @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/u-boot-spl.bin-imx8qxplpddr4arm2-fspi -O u-boot-spl-fspi.bin 14 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxplpddr4arm2/m4_image.bin -O m4_image.bin 15 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qxp-lpddr4*.dtb" 16 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 17 | @mv -f Image boot 18 | 19 | nightly_c0 : 20 | ls 21 | @rm -rf boot 22 | @echo "Pulling nightly for Validation board from $(SERVER)/$(DIR)" 23 | @echo $(BUILD)-$(N)-iMX8QX-val > nightly.txt 24 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/$(AHAB_IMG) -O $(AHAB_IMG) 25 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/mx8qx-val-scfw-tcm.bin -O scfw_tcm.bin 26 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/bl31-imx8qx.bin -O bl31.bin 27 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/u-boot-imx8qxpc0lpddr4arm2.bin-sd -O u-boot.bin 28 | # @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/u-boot-spl.bin-imx8qxplpddr4arm2-sd -O u-boot-spl.bin 29 | # @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/u-boot-spl.bin-imx8qxplpddr4arm2-fspi -O u-boot-spl-fspi.bin 30 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0lpddr4arm2/m4_image.bin -O m4_image.bin 31 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qxp-lpddr4*.dtb" 32 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 33 | @mv -f Image boot 34 | 35 | nightly_mek : 36 | @rm -rf boot 37 | @echo "Pulling nightly for MEK board from $(SERVER)/$(DIR)" 38 | @echo $(BUILD)-$(N)-iMX8QX-mek > nightly.txt 39 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/mx8qxb0-ahab-container.img -O mx8qxb0-ahab-container.img 40 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/mx8qx-mek-scfw-tcm.bin -O scfw_tcm.bin 41 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/bl31-imx8qx.bin -O bl31.bin 42 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/u-boot-imx8qxpmek.bin-sd -O u-boot.bin 43 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/u-boot-spl.bin-imx8qxpmek-sd -O u-boot-spl.bin 44 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/u-boot-spl.bin-imx8qxpmek-fspi -O u-boot-spl-fspi.bin 45 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpmek/m4_image.bin -O m4_image.bin 46 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qxp-mek*.dtb" 47 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 48 | @mv -f Image boot 49 | 50 | nightly_c0mek : 51 | @rm -rf boot 52 | @echo "Pulling nightly for MEK board from $(SERVER)/$(DIR)" 53 | @echo $(BUILD)-$(N)-iMX8QX-mek > nightly.txt 54 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/mx8qxc0-ahab-container.img -O mx8qxc0-ahab-container.img 55 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/mx8qx-mek-scfw-tcm.bin -O scfw_tcm.bin 56 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/bl31-imx8qx.bin -O bl31.bin 57 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/u-boot-imx8qxpc0mek.bin-sd -O u-boot.bin 58 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/u-boot-spl.bin-imx8qxpc0mek-sd -O u-boot-spl.bin 59 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/u-boot-spl.bin-imx8qxpc0mek-fspi -O u-boot-spl-fspi.bin 60 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8qxpc0mek/m4_image.bin -O m4_image.bin 61 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8qxp-mek*.dtb" 62 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 63 | @mv -f Image boot 64 | 65 | nightly_dxmek : 66 | @rm -rf boot 67 | @echo "Pulling nightly for DX MEK board from $(SERVER)/$(DIR)" 68 | @echo $(BUILD)-$(N)-iMX8DX-mek > nightly.txt 69 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/mx8qxc0-ahab-container.img -O mx8qxc0-ahab-container.img 70 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/mx8dx-mek-scfw-tcm.bin -O scfw_tcm.bin 71 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/bl31-imx8qx.bin -O bl31.bin 72 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/u-boot-imx8dxmek.bin-sd -O u-boot.bin 73 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/u-boot-spl.bin-imx8dxmek-sd -O u-boot-spl.bin 74 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/u-boot-spl.bin-imx8dxmek-fspi -O u-boot-spl-fspi.bin 75 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxmek/m4_image.bin -O m4_image.bin 76 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8dx-mek*.dtb" 77 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 78 | @mv -f Image boot 79 | 80 | nightly_dxlphantommek : 81 | @rm -rf boot 82 | @echo "Pulling nightly for DXL phantom MEK board from $(SERVER)/$(DIR)" 83 | @echo $(BUILD)-$(N)-iMX8DX-mek > nightly.txt 84 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/mx8qxb0-ahab-container.img -O mx8qxb0-ahab-container.img 85 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/mx8dxl-phantom-mek-scfw-tcm.bin -O scfw_tcm.bin 86 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/bl31-imx8qx.bin -O bl31.bin 87 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/u-boot-imx8dxlphantommek.bin-sd -O u-boot.bin 88 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/u-boot-spl.bin-imx8dxlphantommek-sd -O u-boot-spl.bin 89 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/u-boot-spl.bin-imx8dxlphantommek-fspi -O u-boot-spl-fspi.bin 90 | @$(WGET) -q $(SERVER)/$(DIR)/imx-boot/imx-boot-tools/imx8dxlphantommek/m4_image.bin -O m4_image.bin 91 | @$(RWGET) $(SERVER)/$(DIR)/imx_dtbs -P boot -A "imx8dxl-phantom-mek*.dtb" 92 | @$(WGET) -q $(SERVER)/$(DIR)/Image-imx8_all.bin -O Image 93 | @mv -f Image boot 94 | 95 | archive : 96 | git ls-files --others --exclude-standard -z | xargs -0 tar rvf $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 97 | bzip2 $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 98 | -------------------------------------------------------------------------------- /iMX8ULP/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = ../mkimage_imx8 2 | 3 | CC ?= gcc 4 | REV ?= A2 5 | CFLAGS ?= -O2 -Wall -std=c99 -static 6 | INCLUDE = ./lib 7 | 8 | #define the F(Q)SPI header file 9 | QSPI_HEADER_MCU = ../scripts/fspi_header_atxp 10 | QSPI_HEADER = ../scripts/fspi_header 11 | QSPI_PACKER = ../scripts/fspi_packer.sh 12 | PAD_IMAGE = ../scripts/pad_image.sh 13 | SPLIT_KERNEL = ../scripts/split_kernel.sh 14 | 15 | ifneq ($(wildcard /usr/bin/rename.ul),) 16 | RENAME = rename.ul 17 | else 18 | RENAME = rename 19 | endif 20 | 21 | LC_REVISION = $(shell echo $(REV) | tr ABC abc) 22 | AHAB_IMG = mx8ulp$(LC_REVISION)-ahab-container.img 23 | TEE = tee.bin 24 | UPOWER_IMG = upower.bin 25 | MCU_IMG = m33_image.bin 26 | ROM_PATCH_IMG = ahab-container-patch.bin 27 | 28 | SPL_LOAD_ADDR ?= 0x22020000 29 | ATF_LOAD_ADDR ?= 0x20040000 30 | TEE_LOAD_ADDR ?= 0xa6000000 31 | UBOOT_LOAD_ADDR ?= 0x80200000 32 | MCU_SSRAM_ADDR ?= 0x1ffc2000 33 | MCU_XIP_ADDR ?= 0x4032000 # Point entry of m33 in flexspi0 nor flash 34 | M33_IMAGE_XIP_OFFSET ?= 0x31000 # 1st container offset is 0x1000 when boot device is flexspi0 nor flash, actually the m33_image.bin is in 0x31000 + 0x1000 = 0x32000. 35 | 36 | 37 | FORCE: 38 | 39 | u-boot-hash.bin: u-boot.bin 40 | ./$(MKIMG) -commit > head.hash 41 | @cat u-boot.bin head.hash > u-boot-hash.bin 42 | 43 | u-boot-atf.bin: u-boot-hash.bin bl31.bin 44 | @cp bl31.bin u-boot-atf.bin 45 | @dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 46 | 47 | u-boot-atf.itb: u-boot-hash.bin bl31.bin 48 | ./$(PAD_IMAGE) bl31.bin 49 | ./$(PAD_IMAGE) u-boot-hash.bin 50 | TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ./mkimage_fit_atf.sh > u-boot.its; 51 | ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot-atf.itb; 52 | @rm -f u-boot.its 53 | 54 | u-boot-atf-container.img: bl31.bin u-boot-hash.bin 55 | if [ -f $(TEE) ]; then \ 56 | if [ $(shell echo $(TEE_COMPRESS_ENABLE)) ]; then \ 57 | echo "Start compress $(TEE)"; \ 58 | lz4 -9 -f --rm $(TEE) $(TEE).lz4; \ 59 | cp $(TEE).lz4 $(TEE); \ 60 | fi; \ 61 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 62 | ./$(MKIMG) -soc ULP -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -c -ap bl31.bin a35 $(ATF_LOAD_ADDR) -ap u-boot-hash.bin a35 $(UBOOT_LOAD_ADDR) -ap $(TEE) a35 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 63 | else \ 64 | ./$(MKIMG) -soc ULP -c -ap bl31.bin a35 $(ATF_LOAD_ADDR) -ap u-boot-hash.bin a35 $(UBOOT_LOAD_ADDR) -ap $(TEE) a35 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 65 | fi; \ 66 | else \ 67 | ./$(MKIMG) -soc ULP -c -ap bl31.bin a35 $(ATF_LOAD_ADDR) -ap u-boot-hash.bin a35 $(UBOOT_LOAD_ADDR) -out u-boot-atf-container.img; \ 68 | fi 69 | 70 | .PHONY: clean nightly 71 | clean: 72 | @rm -f $(MKIMG) u-boot-atf-container.img 73 | @rm -rf extracted_imgs 74 | @echo "imx8ulp clean done" 75 | 76 | flash_dualboot: $(MKIMG) u-boot-spl.bin u-boot-atf-container.img 77 | ./$(MKIMG) -soc ULP -c -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 78 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 79 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 80 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 81 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 82 | 83 | flash_dualboot_flexspi: $(MKIMG) u-boot-spl.bin u-boot-atf-container.img 84 | ./$(MKIMG) -soc ULP -dev flexspi -c -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 85 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 86 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 87 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 88 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 89 | ./$(QSPI_PACKER) $(QSPI_HEADER) 90 | 91 | flash_dualboot_m33: $(MKIMG) $(MCU_IMG) 92 | ./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) -out flash.bin 93 | ./$(QSPI_PACKER) $(QSPI_HEADER_MCU) 94 | 95 | # For m33, write the flash.bin(make SOC=iMX8ULP flash_dualboot_m33_xip) to flexspi0 nor flash of m33. 96 | flash_dualboot_m33_xip: $(MKIMG) $(MCU_IMG) 97 | ./$(MKIMG) -soc ULP -dev flexspi -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -fileoff $(M33_IMAGE_XIP_OFFSET) -m4 $(MCU_IMG) 0 $(MCU_XIP_ADDR) -out flash.bin 98 | ./$(QSPI_PACKER) $(QSPI_HEADER_MCU) 99 | 100 | flash_singleboot: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-spl.bin u-boot-atf-container.img 101 | ./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 102 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 103 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 104 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 105 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 106 | 107 | flash_singleboot_flexspi: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-spl.bin u-boot-atf-container.img 108 | ./$(MKIMG) -soc ULP -dev flexspi -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 109 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 110 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 111 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 112 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 113 | ./$(QSPI_PACKER) $(QSPI_HEADER) 114 | 115 | flash_singleboot_m33: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-atf-container.img $(MCU_IMG) u-boot-spl.bin 116 | ./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 117 | cp flash.bin boot-spl-container.img 118 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 119 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 120 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 121 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 122 | 123 | flash_singleboot_m33_rom_patch: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-atf-container.img $(MCU_IMG) u-boot-spl.bin $(ROM_PATCH_IMG) 124 | ./$(MKIMG) -soc ULP -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) --data $(ROM_PATCH_IMG) a35 0x1fff9000 -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 125 | cp flash.bin boot-spl-container.img 126 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 127 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 128 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 129 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 130 | 131 | flash_singleboot_m33_no_ahabfw: $(MKIMG) $(UPOWER_IMG) u-boot-atf-container.img $(MCU_IMG) u-boot-spl.bin 132 | ./$(MKIMG) -soc ULP -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 133 | cp flash.bin boot-spl-container.img 134 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 135 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 136 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 137 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 138 | 139 | flash_singleboot_m33_flexspi: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-atf-container.img $(MCU_IMG) u-boot-spl.bin 140 | ./$(MKIMG) -soc ULP -dev flexspi -append $(AHAB_IMG) -c -upower $(UPOWER_IMG) -m4 $(MCU_IMG) 0 $(MCU_SSRAM_ADDR) -ap u-boot-spl.bin a35 $(SPL_LOAD_ADDR) -out flash.bin 141 | cp flash.bin boot-spl-container.img 142 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 143 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 144 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 145 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 146 | ./$(QSPI_PACKER) $(QSPI_HEADER) 147 | 148 | flash_ele: $(MKIMG) ahabfw.bin 149 | ./$(MKIMG) -soc ULP -c -ele ahabfw.bin -out flash.bin 150 | 151 | ifeq ($(REV),A0) 152 | prepare_kernel_chunks: Image 153 | ./$(SPLIT_KERNEL) Image 0x80400000 0x700000 154 | 155 | flash_kernel: $(MKIMG) prepare_kernel_chunks imx8ulp-evk.dtb 156 | KERNEL_CMD="$(shell cat Image_cmd)"; \ 157 | ./$(MKIMG) -soc ULP -c $$KERNEL_CMD --data imx8ulp-evk.dtb a35 0x83000000 -out flash.bin 158 | else 159 | flash_kernel: $(MKIMG) Image imx8ulp-evk.dtb 160 | ./$(MKIMG) -soc ULP -c -ap Image a35 0x80400000 --data imx8ulp-evk.dtb a35 0x83000000 -out flash.bin 161 | endif 162 | 163 | parse_container: $(MKIMG) flash.bin 164 | ./$(MKIMG) -soc ULP -parse flash.bin 165 | 166 | extract: $(MKIMG) flash.bin 167 | ./$(MKIMG) -soc ULP -extract flash.bin 168 | 169 | -------------------------------------------------------------------------------- /iMX8QX/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = ../mkimage_imx8 2 | 3 | CC ?= gcc 4 | REV ?= B0 5 | CFLAGS ?= -O2 -Wall -std=c99 -static 6 | INCLUDE = ./lib 7 | 8 | #define the F(Q)SPI header file 9 | QSPI_HEADER = ../scripts/fspi_header 10 | QSPI_PACKER = ../scripts/fspi_packer.sh 11 | PAD_IMAGE = ../scripts/pad_image.sh 12 | 13 | ifneq ($(wildcard /usr/bin/rename.ul),) 14 | RENAME = rename.ul 15 | else 16 | RENAME = rename 17 | endif 18 | 19 | ifeq ($(REV),B0) 20 | AHAB_IMG = mx8qxb0-ahab-container.img 21 | else 22 | AHAB_IMG = mx8qxc0-ahab-container.img 23 | endif 24 | 25 | TEE = tee.bin 26 | 27 | ifeq ($(SOC),iMX8DX) 28 | TEE_LOAD_ADDR ?= 0x96000000 29 | else ifeq ($(SOC),iMX8QX) 30 | TEE_LOAD_ADDR ?= 0xFE000000 31 | endif 32 | 33 | FORCE: 34 | 35 | u-boot-hash.bin: u-boot.bin 36 | ./$(MKIMG) -commit > head.hash 37 | @cat u-boot.bin head.hash > u-boot-hash.bin 38 | 39 | u-boot-atf.bin: u-boot-hash.bin bl31.bin 40 | @cp bl31.bin u-boot-atf.bin 41 | @dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 42 | 43 | u-boot-atf.itb: u-boot-hash.bin bl31.bin 44 | ./$(PAD_IMAGE) bl31.bin 45 | ./$(PAD_IMAGE) u-boot-hash.bin 46 | TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh > u-boot.its; 47 | ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot-atf.itb; 48 | @rm -f u-boot.its 49 | 50 | u-boot-atf-container.img: bl31.bin u-boot-hash.bin 51 | if [ -f $(TEE) ]; then \ 52 | if [ $(shell echo $(TEE_COMPRESS_ENABLE)) ]; then \ 53 | echo "Start compress $(TEE)"; \ 54 | lz4 -9 -f --rm $(TEE) $(TEE).lz4; \ 55 | cp $(TEE).lz4 $(TEE); \ 56 | fi; \ 57 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 58 | ./$(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) a35 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 59 | else \ 60 | ./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -ap $(TEE) a35 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 61 | fi; \ 62 | else \ 63 | ./$(MKIMG) -soc QX -rev B0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -out u-boot-atf-container.img; \ 64 | fi 65 | 66 | Image0: Image 67 | @dd if=Image of=Image0 bs=10M count=1 68 | Image1: Image 69 | @dd if=Image of=Image1 bs=10M skip=1 70 | 71 | .PHONY: clean nightly 72 | clean: 73 | @rm -f $(MKIMG) $(DCD_CFG) .imx8qx_dcd.cfg.cfgtmp.d u-boot-atf-container.img Image0 Image1 74 | @rm -rf extracted_imgs 75 | @echo "imx8qx clean done" 76 | 77 | flash: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 78 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 79 | 80 | flash_flexspi: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin $(QSPI_HEADER) 81 | ./$(MKIMG) -soc QX -rev B0 -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 82 | ./$(QSPI_PACKER) $(QSPI_HEADER) 83 | 84 | flash_nand: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 85 | ./$(MKIMG) -soc QX -rev B0 -dev nand 16K -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 86 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash_fw.bin 87 | 88 | flash_spl: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin u-boot-atf-container.img 89 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -out flash.bin 90 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 91 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 92 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 93 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 94 | 95 | flash_spl_flexspi: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin u-boot-atf-container.img 96 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -out flash.bin 97 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 98 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 99 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 100 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 101 | ./$(QSPI_PACKER) $(QSPI_HEADER) 102 | 103 | flash_spl_nand: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin u-boot-atf-container.img 104 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -dev nand 16K -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -out flash.bin 105 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 106 | pad_cnt=$$(((flashbin_size + 0x4000 - 1) / 0x4000)); page=16;\ 107 | echo "append u-boot-atf-container.img at $$((pad_cnt * page)) a $$pad_cnt b $$page KB"; \ 108 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$((pad_cnt * page)) 109 | 110 | flash_linux_m4: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 111 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -p3 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 112 | cp flash.bin boot-spl-container.img 113 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 114 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 115 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 116 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 117 | 118 | flash_linux_m4_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 119 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a35 0x00100000 -p3 -m4 m4_image.bin 0 0x88000000 -out flash.bin 120 | cp flash.bin boot-spl-container.img 121 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 122 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 123 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 124 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 125 | 126 | flash_linux_m4_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf-container.img m4_image.bin u-boot-spl.bin 127 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x80000 -p3 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 -ap u-boot-spl.bin a35 0x00100000 -out flash.bin 128 | cp flash.bin boot-spl-container.img 129 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 130 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 131 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 132 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 133 | ./$(QSPI_PACKER) $(QSPI_HEADER) 134 | 135 | flash_regression_linux_m4: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin 136 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -p3 -m4 m4_image.bin 0 0x34FE0000 -out flash.bin 137 | 138 | flash_regression_linux_m4_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin 139 | ./$(MKIMG) -soc QX -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -p3 -m4 m4_image.bin 0 0x88000000 -out flash.bin 140 | 141 | flash_regression_linux_m4_xip : $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin $(QSPI_HEADER) 142 | ./$(MKIMG) -soc QX -rev B0 -dev flexspi -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x80000 -p3 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 143 | ./$(QSPI_PACKER) $(QSPI_HEADER) 144 | 145 | flash_scfw: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin 146 | ./$(MKIMG) -soc QX -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -out flash.bin 147 | 148 | flash_kernel: $(MKIMG) Image imx8qxp-mek.dtb 149 | ./$(MKIMG) -soc QX -rev B0 -c -ap Image a35 0x80200000 --data imx8qxp-mek.dtb a35 0x83000000 -out flash.bin 150 | 151 | parse_container: $(MKIMG) flash.bin 152 | ./$(MKIMG) -soc QX -rev B0 -parse flash.bin 153 | 154 | extract: $(MKIMG) flash.bin 155 | ./$(MKIMG) -soc QX -rev B0 -extract flash.bin 156 | 157 | 158 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/misc.mak),) 159 | $(info include misc.mak) 160 | include ../$(SOC_DIR)/scripts/misc.mak 161 | endif 162 | 163 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/m4.mak),) 164 | $(info include m4.mak) 165 | include ../$(SOC_DIR)/scripts/m4.mak 166 | endif 167 | 168 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/android.mak),) 169 | $(info include android.mak) 170 | include ../$(SOC_DIR)/scripts/android.mak 171 | endif 172 | 173 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/test.mak),) 174 | $(info include test.mak) 175 | include ../$(SOC_DIR)/scripts/test.mak 176 | endif 177 | 178 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/autobuild.mak),) 179 | $(info include autobuild.mak) 180 | include ../$(SOC_DIR)/scripts/autobuild.mak 181 | endif 182 | 183 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/alias.mak),) 184 | $(info include alias.mak) 185 | include ../$(SOC_DIR)/scripts/alias.mak 186 | endif 187 | -------------------------------------------------------------------------------- /iMX8DXL/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = ../mkimage_imx8 2 | 3 | CC ?= gcc 4 | V2X ?= YES 5 | REV ?= A1 6 | CFLAGS ?= -O2 -Wall -std=c99 -static 7 | INCLUDE = ./lib 8 | 9 | LC_REVISION = $(shell echo $(REV) | tr ABC abc) 10 | SECO_FW_NAME = mx8dxl$(LC_REVISION)-ahab-container.img 11 | 12 | #define the F(Q)SPI header file 13 | QSPI_HEADER = ../scripts/fspi_header 14 | QSPI_PACKER = ../scripts/fspi_packer.sh 15 | PAD_IMAGE = ../scripts/pad_image.sh 16 | SPLIT_SPL = ../scripts/split_spl.sh 17 | 18 | ifneq ($(wildcard /usr/bin/rename.ul),) 19 | RENAME = rename.ul 20 | else 21 | RENAME = rename 22 | endif 23 | 24 | V2X_OCRAM = 0x110000 25 | V2X_FSPI = 0x8015000 26 | ifeq ($(V2X),YES) 27 | V2X_DUMMY_DDR = -dummy 0x87fc0000 28 | V2X_DUMMY_OCRAM = -dummy ${V2X_OCRAM} 29 | V2X_DUMMY_FSPI = -dummy ${V2X_FSPI} 30 | endif 31 | 32 | TEE_LOAD_ADDR ?= 0x96000000 33 | 34 | FORCE: 35 | 36 | u-boot-hash.bin: u-boot.bin 37 | ./$(MKIMG) -commit > head.hash 38 | @cat u-boot.bin head.hash > u-boot-hash.bin 39 | 40 | u-boot-atf.bin: u-boot-hash.bin bl31.bin 41 | @cp bl31.bin u-boot-atf.bin 42 | @dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 43 | 44 | u-boot-atf.itb: u-boot-hash.bin bl31.bin 45 | ./$(PAD_IMAGE) bl31.bin 46 | ./$(PAD_IMAGE) u-boot-hash.bin 47 | TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ./mkimage_fit_atf.sh > u-boot.its; 48 | ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot-atf.itb; 49 | @rm -f u-boot.its 50 | 51 | u-boot-atf-container.img: bl31.bin u-boot-hash.bin 52 | if [ -f tee.bin ]; then \ 53 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 54 | ./$(MKIMG) -soc DXL -rev A0 -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -ap tee.bin a35 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 55 | else \ 56 | ./$(MKIMG) -soc DXL -rev A0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -ap tee.bin a35 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 57 | fi; \ 58 | else \ 59 | ./$(MKIMG) -soc DXL -rev A0 -c -ap bl31.bin a35 0x80000000 -ap u-boot-hash.bin a35 0x80020000 -out u-boot-atf-container.img; \ 60 | fi 61 | 62 | prepare_spl: u-boot-spl.bin 63 | V2X=${V2X} ./$(SPLIT_SPL) u-boot-spl.bin ${V2X_OCRAM} 64 | 65 | Image0: Image 66 | @dd if=Image of=Image0 bs=10M count=1 67 | Image1: Image 68 | @dd if=Image of=Image1 bs=10M skip=1 69 | 70 | .PHONY: clean nightly 71 | clean: 72 | @rm -f $(MKIMG) u-boot-atf-container.img Image0 Image1 u-boot-hash.bin u-boot-atf.bin head.hash u-boot-atf-container.img flash.bin 73 | @rm -rf extracted_imgs 74 | @echo "imx8dxl clean done" 75 | 76 | flash: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin 77 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 $(V2X_DUMMY_DDR) -out flash.bin 78 | 79 | flash_nand: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin 80 | ./$(MKIMG) -soc DXL -rev A0 -dev nand 16K -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 $(V2X_DUMMY_DDR) -out flash.bin 81 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 $(V2X_DUMMY_DDR) -out flash_fw.bin 82 | 83 | flash_flexspi: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin $(QSPI_HEADER) 84 | ./$(MKIMG) -soc DXL -rev A0 -dev flexspi -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 $(V2X_DUMMY_OCRAM) -out flash.bin 85 | ./$(QSPI_PACKER) $(QSPI_HEADER) 86 | 87 | flash_spl: $(MKIMG) prepare_spl $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img 88 | SPL_CMD="$(shell cat u-boot-spl.bin_cmd)"; \ 89 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin $$SPL_CMD $(V2X_DUMMY_OCRAM) -out flash.bin 90 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 91 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 92 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 93 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 94 | 95 | flash_spl_flexspi: $(MKIMG) prepare_spl $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img 96 | SPL_CMD="$(shell cat u-boot-spl.bin_cmd)"; \ 97 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -dev flexspi -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin $$SPL_CMD $(V2X_DUMMY_OCRAM) -out flash.bin 98 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 99 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 100 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 101 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 102 | ./$(QSPI_PACKER) $(QSPI_HEADER) 103 | 104 | flash_spl_nand: $(MKIMG) prepare_spl $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img 105 | SPL_CMD="$(shell cat u-boot-spl.bin_cmd)"; \ 106 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -dev nand 16K -dcd skip -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin $$SPL_CMD $(V2X_DUMMY_OCRAM) -out flash.bin 107 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 108 | pad_cnt=$$(((flashbin_size + 0x4000 - 1) / 0x4000)); page=16;\ 109 | echo "append u-boot-atf-container.img at $$((pad_cnt * page)) a $$pad_cnt b $$page KB"; \ 110 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$((pad_cnt * page)) 111 | 112 | flash_linux_m4: $(MKIMG) prepare_spl $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img m4_image.bin 113 | SPL_CMD="$(shell cat u-boot-spl.bin_cmd)"; \ 114 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -flags 0x00200000 -scfw scfw_tcm.bin $$SPL_CMD -p3 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_OCRAM) -out flash.bin 115 | 116 | cp flash.bin boot-spl-container.img 117 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 118 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 119 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 120 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 121 | 122 | flash_linux_m4_ddr: $(MKIMG) prepare_spl $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img m4_image.bin 123 | SPL_CMD="$(shell cat u-boot-spl.bin_cmd)"; \ 124 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -flags 0x00200000 -scfw scfw_tcm.bin $$SPL_CMD -p3 -m4 m4_image.bin 0 0x88000000 $(V2X_DUMMY_DDR) -out flash.bin 125 | cp flash.bin boot-spl-container.img 126 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 127 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 128 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 129 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 130 | 131 | flash_linux_m4_xip: $(MKIMG) prepare_spl $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf-container.img m4_image.bin 132 | SPL_CMD="$(shell cat u-boot-spl.bin_cmd)"; \ 133 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x80000 -p3 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 $$SPL_CMD $(V2X_DUMMY_OCRAM) -out flash.bin 134 | cp flash.bin boot-spl-container.img 135 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 136 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 137 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 138 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; \ 139 | ./$(QSPI_PACKER) $(QSPI_HEADER) 140 | 141 | flash_regression_linux_m4: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin m4_image.bin 142 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -p3 -m4 m4_image.bin 0 0x34FE0000 $(V2X_DUMMY_DDR) -out flash.bin 143 | 144 | flash_regression_linux_m4_ddr: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin m4_image.bin 145 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -p3 -m4 m4_image.bin 0 0x88000000 $(V2X_DUMMY_DDR) -out flash.bin 146 | 147 | flash_regression_linux_m4_xip : $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin u-boot-atf.bin m4_image.bin $(QSPI_HEADER) 148 | ./$(MKIMG) -soc DXL -rev A0 -dev flexspi -append $(SECO_FW_NAME) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x80000 -p3 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 -ap u-boot-atf.bin a35 0x80000000 $(V2X_DUMMY_OCRAM) -out flash.bin 149 | ./$(QSPI_PACKER) $(QSPI_HEADER) 150 | 151 | flash_scfw: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin 152 | ./$(MKIMG) -soc DXL -rev A0 -dcd skip -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin $(V2X_DUMMY_OCRAM) --out flash.bin 153 | 154 | flash_patch: $(MKIMG) $(SECO_FW_NAME) scfw_tcm.bin message_signed.bin 155 | ./$(MKIMG) -soc DXL -rev A0 -append $(SECO_FW_NAME) -c -scfw scfw_tcm.bin -msg_blk message_signed.bin patch 0x80000000 $(V2X_DUMMY_OCRAM) --out flash.bin 156 | 157 | flash_kernel: $(MKIMG) Image imx8dxl-evk.dtb 158 | ./$(MKIMG) -soc DXL -rev A0 -h sha256 -c -ap Image a35 0x80200000 --data imx8dxl-evk.dtb a35 0x83000000 -out flash.bin 159 | 160 | parse_container: $(MKIMG) flash.bin 161 | ./$(MKIMG) -soc DXL -rev A0 -parse flash.bin 162 | 163 | extract: $(MKIMG) flash.bin 164 | ./$(MKIMG) -soc DXL -rev A0 -extract flash.bin 165 | 166 | 167 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/misc.mak),) 168 | $(info include misc.mak) 169 | include ../$(SOC_DIR)/scripts/misc.mak 170 | endif 171 | 172 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/m4.mak),) 173 | $(info include m4.mak) 174 | include ../$(SOC_DIR)/scripts/m4.mak 175 | endif 176 | 177 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/android.mak),) 178 | $(info include android.mak) 179 | include ../$(SOC_DIR)/scripts/android.mak 180 | endif 181 | 182 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/test.mak),) 183 | $(info include test.mak) 184 | include ../$(SOC_DIR)/scripts/test.mak 185 | endif 186 | 187 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/autobuild.mak),) 188 | $(info include autobuild.mak) 189 | include ../$(SOC_DIR)/scripts/autobuild.mak 190 | endif 191 | 192 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/rev_a.mak),) 193 | $(info include rev_a.mak) 194 | include ../$(SOC_DIR)/scripts/rev_a.mak 195 | endif 196 | 197 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/alias.mak),) 198 | $(info include alias.mak) 199 | include ../$(SOC_DIR)/scripts/alias.mak 200 | endif 201 | -------------------------------------------------------------------------------- /iMX91/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = ../mkimage_imx8 2 | 3 | CC ?= gcc 4 | REV ?= A0 5 | OEI ?= NO 6 | MSEL ?= 0 7 | CFLAGS ?= -O2 -Wall -std=c99 -static 8 | INCLUDE = ./lib 9 | 10 | #define the F(Q)SPI header file 11 | QSPI_HEADER = ../scripts/fspi_header 12 | QSPI_PACKER = ../scripts/fspi_packer.sh 13 | QSPI_FCB_GEN = ../scripts/fspi_fcb_gen.sh 14 | PAD_IMAGE = ../scripts/pad_image.sh 15 | 16 | ifneq ($(wildcard /usr/bin/rename.ul),) 17 | RENAME = rename.ul 18 | else 19 | RENAME = rename 20 | endif 21 | 22 | LC_REVISION = $(shell echo $(REV) | tr ABC abc) 23 | # iMX91 24 | AHAB_IMG = mx91$(LC_REVISION)-ahab-container.img 25 | SPL_LOAD_ADDR ?= 0x204A0000 26 | ATF_LOAD_ADDR ?= 0x204C0000 27 | UBOOT_LOAD_ADDR ?= 0x80200000 28 | LPDDR_FW_VERSION ?= _v202201 29 | SPL_A55_IMG ?= u-boot-spl-ddr.bin 30 | KERNEL_DTB ?= imx91-11x11-evk.dtb # Used by kernel authentication 31 | KERNEL_DTB_ADDR ?= 0x83000000 32 | KERNEL_ADDR ?= 0x80400000 33 | 34 | # This Capsule_GUID is reserved by NXP 35 | CAPSULE_GUID = bc550d86-da26-4b70-ac05-2a448eda6f21 36 | 37 | FCB_LOAD_ADDR ?= $(ATF_LOAD_ADDR) 38 | 39 | TEE ?= tee.bin 40 | TEE_LOAD_ADDR ?= 0x96000000 41 | 42 | 43 | ########################### 44 | # Append container macro 45 | # 46 | # $(1) - container to append, usually: u-boot-atf-container.img 47 | # $(2) - the page at which the container must be append, usually: 1 48 | ########################### 49 | define append_container 50 | @cp flash.bin boot-spl-container.img 51 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 52 | psize=$$((0x400 * $(2))); \ 53 | pad_cnt=$$(((flashbin_size + psize - 1) / psize)); \ 54 | echo "append $(1) at $$((pad_cnt * $(2))) KB, psize=$$psize"; \ 55 | dd if=$(1) of=flash.bin bs=1K seek=$$((pad_cnt * $(2))); 56 | endef 57 | 58 | define append_fcb 59 | @mv flash.bin flash.tmp 60 | @dd if=fcb.bin of=flash.bin bs=1k seek=1 61 | @dd if=flash.tmp of=flash.bin bs=1k seek=4 62 | @rm flash.tmp 63 | @echo "Append FCB to flash.bin" 64 | endef 65 | 66 | FORCE: 67 | 68 | lpddr4_imem_1d = lpddr4_imem_1d$(LPDDR_FW_VERSION).bin 69 | lpddr4_dmem_1d = lpddr4_dmem_1d$(LPDDR_FW_VERSION).bin 70 | lpddr4_imem_2d = lpddr4_imem_2d$(LPDDR_FW_VERSION).bin 71 | lpddr4_dmem_2d = lpddr4_dmem_2d$(LPDDR_FW_VERSION).bin 72 | lpddr4_imem_qb = lpddr4_imem_qb$(LPDDR_FW_VERSION).bin 73 | lpddr4_dmem_qb = lpddr4_dmem_qb$(LPDDR_FW_VERSION).bin 74 | lpddr4_qb_data = lpddr4_qb_data.bin 75 | 76 | u-boot-spl-ddr.bin: u-boot-spl.bin $(lpddr4_imem_1d) $(lpddr4_dmem_1d) $(lpddr4_imem_2d) $(lpddr4_dmem_2d) 77 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_1d) lpddr4_pmu_train_1d_imem_pad.bin 78 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(lpddr4_dmem_1d) lpddr4_pmu_train_1d_dmem_pad.bin 79 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_2d) lpddr4_pmu_train_2d_imem_pad.bin 80 | @cat lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin > lpddr4_pmu_train_1d_fw.bin 81 | @cat lpddr4_pmu_train_2d_imem_pad.bin $(lpddr4_dmem_2d) > lpddr4_pmu_train_2d_fw.bin 82 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 83 | @cat u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin > u-boot-spl-ddr.bin 84 | @rm -f u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin 85 | @rm -f lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin lpddr4_pmu_train_2d_imem_pad.bin 86 | 87 | u-boot-spl-ddr-qb.bin: u-boot-spl.bin $(lpddr4_imem_qb) $(lpddr4_dmem_qb) $(lpddr4_qb_data) 88 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_qb) lpddr4_pmu_qb_imem_pad.bin 89 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(lpddr4_dmem_qb) lpddr4_pmu_qb_dmem_pad.bin 90 | @cat lpddr4_pmu_qb_imem_pad.bin lpddr4_pmu_qb_dmem_pad.bin > lpddr4_pmu_qb_fw.bin 91 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 92 | @cat u-boot-spl-pad.bin lpddr4_pmu_qb_fw.bin $(lpddr4_qb_data) > u-boot-spl-ddr-qb.bin 93 | @rm -f u-boot-spl-pad.bin lpddr4_pmu_qb_imem_pad.bin lpddr4_pmu_qb_dmem_pad.bin lpddr4_pmu_qb_fw.bin 94 | 95 | u-boot-hash.bin: u-boot.bin 96 | ./$(MKIMG) -commit > head.hash 97 | @cat u-boot.bin head.hash > u-boot-hash.bin 98 | 99 | u-boot-atf.bin: u-boot-hash.bin bl31.bin 100 | @cp bl31.bin u-boot-atf.bin 101 | @dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 102 | 103 | u-boot-atf.itb: u-boot-hash.bin bl31.bin 104 | ./$(PAD_IMAGE) bl31.bin 105 | ./$(PAD_IMAGE) u-boot-hash.bin 106 | TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ./mkimage_fit_atf.sh > u-boot.its; 107 | ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot-atf.itb; 108 | @rm -f u-boot.its 109 | 110 | u-boot-atf-container.img: bl31.bin u-boot-hash.bin 111 | if [ -f $(TEE) ]; then \ 112 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 113 | ./$(MKIMG) -soc IMX9 -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -c \ 114 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 115 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 116 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) \ 117 | -out u-boot-atf-container.img; \ 118 | else \ 119 | ./$(MKIMG) -soc IMX9 -c \ 120 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 121 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 122 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 123 | fi; \ 124 | else \ 125 | ./$(MKIMG) -soc IMX9 -c \ 126 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 127 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 128 | -out u-boot-atf-container.img; \ 129 | fi 130 | 131 | u-boot-atf-container-spinand.img: bl31.bin u-boot-hash.bin 132 | if [ -f $(TEE) ]; then \ 133 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 134 | ./$(MKIMG) -soc IMX9 -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) \ 135 | -dev nand 4K -c \ 136 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 137 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 138 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) \ 139 | -out u-boot-atf-container-spinand.img; \ 140 | else \ 141 | ./$(MKIMG) -soc IMX9 -dev nand 4K -c \ 142 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 143 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 144 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) \ 145 | -out u-boot-atf-container-spinand.img; \ 146 | fi; \ 147 | else \ 148 | ./$(MKIMG) -soc IMX9 -dev nand 4K -c \ 149 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 150 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 151 | -out u-boot-atf-container-spinand.img; \ 152 | fi 153 | 154 | fcb.bin: FORCE 155 | ./$(QSPI_FCB_GEN) $(QSPI_HEADER) 156 | 157 | flash_fw.bin: FORCE 158 | @$(MAKE) --no-print-directory -f soc.mak flash_singleboot 159 | @mv -f flash.bin $@ 160 | 161 | .PHONY: clean nightly 162 | clean: 163 | @rm -f $(MKIMG) u-boot-atf-container.img u-boot-spl-ddr.bin u-boot-spl-ddr-qb.bin u-boot-hash.bin 164 | @rm -rf extracted_imgs 165 | @echo "imx91 clean done" 166 | 167 | # Add for System ready 168 | ifeq ($(TEE),tee.bin-stmm) 169 | KEY_EXISTS = $(shell find -maxdepth 1 -name "CRT.*") 170 | capsule_key: 171 | ifneq ($(KEY_EXISTS),) 172 | @echo "****************************************************************" 173 | @echo "Key $(KEY_EXISTS) already existed" 174 | @echo "If you not wanna use new Key, please not run target: capsule_key" 175 | @echo "Otherwise, please delete CRT.* and re-run capsule_key" 176 | @echo "****************************************************************" 177 | @exit 1 178 | endif 179 | openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=CRT/ -keyout CRT.key -out CRT.crt -nodes -days 365 180 | cert-to-efi-sig-list CRT.crt CRT.esl 181 | 182 | delete_capsule_key: 183 | @rm -rf CRT.* 184 | 185 | overlay: u-boot.bin 186 | ./$(MKIMG) -soc IMX9 -split u-boot.bin 187 | dtc -@ -I dts -O dtb -o signature.dtbo signature.dts 188 | fdtoverlay -i gen-uboot.dtb -o gen-uboot.dtb signature.dtbo 189 | @cat gen-u-boot-nodtb.bin gen-uboot.dtb > gen-u-boot.bin 190 | @mv -f gen-u-boot.bin u-boot.bin 191 | 192 | flash_singleboot_stmm_capsule: overlay flash_singleboot 193 | ./mkeficapsule flash.bin --monotonic-count 1 \ 194 | --guid $(CAPSULE_GUID) \ 195 | --private-key CRT.key \ 196 | --certificate CRT.crt \ 197 | --index 1 --instance 0 \ 198 | capsule1.bin 199 | 200 | flash_singleboot_stmm: flash_singleboot_stmm_capsule 201 | endif 202 | 203 | 204 | flash_singleboot: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img 205 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 206 | $(call append_container,u-boot-atf-container.img,1) 207 | 208 | flash_singleboot_gdet: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img 209 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -cntr_flags 0x200010 -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 210 | $(call append_container,u-boot-atf-container.img,1) 211 | 212 | flash_singleboot_gdet_auto: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img 213 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -cntr_flags 0x100010 -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 214 | $(call append_container,u-boot-atf-container.img,1) 215 | 216 | flash_singleboot_no_ahabfw: $(MKIMG) $(SPL_A55_IMG) u-boot-atf-container.img 217 | ./$(MKIMG) -soc IMX9 -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 218 | $(call append_container,u-boot-atf-container.img,1) 219 | 220 | flash_singleboot_spinand: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container-spinand.img flash_fw.bin 221 | ./$(MKIMG) -soc IMX9 -dev nand 4K -append $(AHAB_IMG) -c \ 222 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 223 | $(call append_container,u-boot-atf-container-spinand.img,4) 224 | 225 | flash_singleboot_spinand_fw: flash_fw.bin 226 | @mv -f flash_fw.bin flash.bin 227 | 228 | flash_singleboot_qb: $(MKIMG) $(AHAB_IMG) u-boot-spl-ddr-qb.bin u-boot-atf-container.img 229 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c -ap u-boot-spl-ddr-qb.bin a55 $(SPL_LOAD_ADDR) -out flash.bin 230 | $(call append_container,u-boot-atf-container.img,1) 231 | 232 | flash_singleboot_flexspi: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img fcb.bin 233 | ./$(MKIMG) -soc IMX9 -dev flexspi -append $(AHAB_IMG) -c \ 234 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) \ 235 | -fcb fcb.bin $(FCB_LOAD_ADDR) -out flash.bin 236 | $(call append_container,u-boot-atf-container.img,1) 237 | $(call append_fcb) 238 | 239 | 240 | flash_ele: $(MKIMG) ahabfw.bin 241 | ./$(MKIMG) -soc IMX9 -c -ele ahabfw.bin -out flash.bin 242 | 243 | flash_kernel: $(MKIMG) Image $(KERNEL_DTB) 244 | ./$(MKIMG) -soc IMX9 -c -ap Image a55 $(KERNEL_ADDR) --data $(KERNEL_DTB) a55 $(KERNEL_DTB_ADDR) -out flash.bin 245 | 246 | parse_container: $(MKIMG) flash.bin 247 | ./$(MKIMG) -soc IMX9 -parse flash.bin 248 | 249 | extract: $(MKIMG) flash.bin 250 | ./$(MKIMG) -soc IMX9 -extract flash.bin 251 | 252 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/autobuild.mak),) 253 | $(info include autobuild.mak) 254 | include ../$(SOC_DIR)/scripts/autobuild.mak 255 | endif 256 | -------------------------------------------------------------------------------- /iMX8QM/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = ../mkimage_imx8 2 | 3 | CC ?= gcc 4 | INCLUDE = ./lib 5 | 6 | ifneq ($(wildcard /usr/bin/rename.ul),) 7 | RENAME = rename.ul 8 | else 9 | RENAME = rename 10 | endif 11 | 12 | #define the F(Q)SPI header file 13 | QSPI_HEADER = ../scripts/fspi_header 14 | QSPI_PACKER = ../scripts/fspi_packer.sh 15 | PAD_IMAGE = ../scripts/pad_image.sh 16 | 17 | AHAB_IMG = mx8qmb0-ahab-container.img 18 | TEE = tee.bin 19 | 20 | FORCE: 21 | 22 | u-boot-hash.bin: u-boot.bin 23 | ./$(MKIMG) -commit > head.hash 24 | @cat u-boot.bin head.hash > u-boot-hash.bin 25 | 26 | u-boot-atf.bin: u-boot-hash.bin bl31.bin 27 | @cp bl31.bin u-boot-atf.bin 28 | @dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 29 | @if [ -f "hdmitxfw.bin" ] && [ -f "hdmirxfw.bin" ]; then \ 30 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmitxfw.bin hdmitxfw-pad.bin; \ 31 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmirxfw.bin hdmirxfw-pad.bin; \ 32 | cat u-boot-atf.bin hdmitxfw-pad.bin hdmirxfw-pad.bin > u-boot-atf-hdmi.bin; \ 33 | cp u-boot-atf-hdmi.bin u-boot-atf.bin; \ 34 | fi 35 | 36 | u-boot-atf-a72.bin: u-boot-a72.bin bl31-a72.bin 37 | @cp bl31-a72.bin u-boot-atf-a72.bin 38 | ./$(MKIMG) -commit > head.hash 39 | @cat u-boot-a72.bin head.hash > u-boot-hash-a72.bin 40 | @dd if=u-boot-hash-a72.bin of=u-boot-atf-a72.bin bs=1K seek=128 41 | @if [ -f "hdmitxfw.bin" ] && [ -f "hdmirxfw.bin" ]; then \ 42 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmitxfw.bin hdmitxfw-pad.bin; \ 43 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmirxfw.bin hdmirxfw-pad.bin; \ 44 | cat u-boot-atf-a72.bin hdmitxfw-pad.bin hdmirxfw-pad.bin > u-boot-atf-a72-hdmi.bin; \ 45 | cp u-boot-atf-a72-hdmi.bin u-boot-atf-a72.bin; \ 46 | fi 47 | 48 | u-boot-atf.itb: u-boot-hash.bin bl31.bin 49 | @if [ -f "hdmitxfw.bin" ] && [ -f "hdmirxfw.bin" ]; then \ 50 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmitxfw.bin hdmitxfw-pad.bin; \ 51 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmirxfw.bin hdmirxfw-pad.bin; \ 52 | cat u-boot-hash.bin hdmitxfw-pad.bin hdmirxfw-pad.bin > u-boot-hash.bin.temp; \ 53 | mv u-boot-hash.bin.temp u-boot-hash.bin; \ 54 | fi 55 | ./$(PAD_IMAGE) bl31.bin 56 | ./$(PAD_IMAGE) u-boot-hash.bin 57 | ../$(SOC_DIR)/mkimage_fit_atf.sh > u-boot.its; 58 | ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot-atf.itb; 59 | @rm -f u-boot.its 60 | 61 | u-boot-atf-container.img: bl31.bin u-boot-hash.bin 62 | @if [ -f "hdmitxfw.bin" ] && [ -f "hdmirxfw.bin" ]; then \ 63 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmitxfw.bin hdmitxfw-pad.bin; \ 64 | objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmirxfw.bin hdmirxfw-pad.bin; \ 65 | cat u-boot-hash.bin hdmitxfw-pad.bin hdmirxfw-pad.bin > u-boot-hash.bin.temp; \ 66 | mv u-boot-hash.bin.temp u-boot-hash.bin; \ 67 | fi 68 | if [ -f $(TEE) ]; then \ 69 | if [ $(shell echo $(TEE_COMPRESS_ENABLE)) ]; then \ 70 | echo "Start compress $(TEE)"; \ 71 | lz4 -9 -f --rm $(TEE) $(TEE).lz4; \ 72 | cp $(TEE).lz4 $(TEE); \ 73 | fi; \ 74 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 75 | ./$(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) a53 0xFE000000 -out u-boot-atf-container.img; \ 76 | else \ 77 | ./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80000000 -ap u-boot-hash.bin a53 0x80020000 -ap $(TEE) a53 0xFE000000 -out u-boot-atf-container.img; \ 78 | fi; \ 79 | else \ 80 | ./$(MKIMG) -soc QM -rev B0 -c -ap bl31.bin a53 0x80000000 -ap u-boot-hash.bin a53 0x80020000 -out u-boot-atf-container.img; \ 81 | fi 82 | 83 | u-boot-atf-container-a72.img: u-boot-atf-a72.bin tee-a72.bin 84 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 85 | ./$(MKIMG) -soc QM -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -rev B0 -c -ap u-boot-atf-a72.bin a72 0xC0000000 -ap tee-a72.bin a72 0xFE000000 -out u-boot-atf-container-a72.img; \ 86 | else \ 87 | ./$(MKIMG) -soc QM -rev B0 -c -ap u-boot-atf-a72.bin a72 0xC0000000 -ap tee-a72.bin a72 0xFE000000 -out u-boot-atf-container-a72.img; \ 88 | fi; \ 89 | 90 | .PHONY: clean 91 | clean: 92 | @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 flash.bin u-boot-atf.bin u-boot-atf-a72.bin u-boot-hash-a72.bin u-boot-atf-container-a72.img 93 | @rm -rf extracted_imgs 94 | @echo "imx8qm clean done" 95 | 96 | flash: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 97 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 -out flash.bin 98 | 99 | flash_cockpit: $(MKIMG) scfw_tcm.bin $(AHAB_IMG) u-boot-atf.bin u-boot-atf-a72.bin 100 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 mu0 pt1 -ap u-boot-atf-a72.bin a72 0xC0000000 mu3 pt3 -out flash.bin 101 | 102 | flash_cockpit_spl: $(MKIMG) u-boot-atf-container-a72.img scfw_tcm.bin $(AHAB_IMG) u-boot-atf.bin tee.bin u-boot-spl-a72.bin 103 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 mu0 pt1 -ap u-boot-spl-a72.bin a72 0x00100000 mu3 pt3 -data tee.bin a53 0xBE000000 -out flash.bin 104 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 105 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 106 | echo "append u-boot-atf-container-a72.img at $$pad_cnt KB"; \ 107 | dd if=u-boot-atf-container-a72.img of=flash.bin bs=1K seek=$$pad_cnt; 108 | 109 | flash_cockpit_m4: $(MKIMG) scfw_tcm.bin $(AHAB_IMG) u-boot-atf.bin u-boot-atf-a72.bin m4_image.bin m4_1_image.bin 110 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 mu0 pt1 -ap u-boot-atf-a72.bin a72 0xC0000000 mu3 pt3 -p5 -m4 m4_image.bin 0 0x34FE0000 -p6 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 111 | 112 | flash_cockpit_m4_spl: $(MKIMG) u-boot-atf-container-a72.img scfw_tcm.bin $(AHAB_IMG) m4_image.bin m4_1_image.bin u-boot-atf.bin tee.bin u-boot-spl-a72.bin 113 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 mu0 pt1 -ap u-boot-spl-a72.bin a72 0x00100000 mu3 pt3 -data tee.bin a53 0xBE000000 -p5 -m4 m4_image.bin 0 0x34FE0000 -p6 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 114 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 115 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 116 | echo "append u-boot-atf-container-a72.img at $$pad_cnt KB"; \ 117 | dd if=u-boot-atf-container-a72.img of=flash.bin bs=1K seek=$$pad_cnt; 118 | 119 | flash_flexspi: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 120 | ./$(MKIMG) -soc QM -rev B0 -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 -out flash.bin 121 | ./$(QSPI_PACKER) $(QSPI_HEADER) 122 | 123 | flash_spl: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin u-boot-atf-container.img 124 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -out flash.bin 125 | cp flash.bin boot-spl-container.img 126 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 127 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 128 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 129 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 130 | 131 | flash_spl_flexspi: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin u-boot-atf-container.img 132 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -out flash.bin 133 | cp flash.bin boot-spl-container.img 134 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 135 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 136 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 137 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 138 | ./$(QSPI_PACKER) $(QSPI_HEADER) 139 | 140 | flash_linux_m4: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin m4_image.bin m4_1_image.bin u-boot-atf-container.img 141 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -p3 -m4 m4_image.bin 0 0x34FE0000 -p4 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 142 | cp flash.bin boot-spl-container.img 143 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 144 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 145 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 146 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 147 | 148 | flash_linux_m4_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin m4_image.bin m4_1_image.bin u-boot-atf-container.img 149 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -p3 -m4 m4_image.bin 0 0x88000000 -p4 -m4 m4_1_image.bin 1 0x88800000 -out flash.bin 150 | cp flash.bin boot-spl-container.img 151 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 152 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 153 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 154 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 155 | 156 | flash_linux_m4_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-spl.bin u-boot-atf-container.img m4_image.bin m4_1_image.bin 157 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -dev flexspi -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x80000 -p3 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 -p4 -m4 m4_1_image.bin 1 0x08181000 -fileoff 0x280000 -ap u-boot-spl.bin a53 0x00100000 -out flash.bin 158 | cp flash.bin boot-spl-container.img 159 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 160 | pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ 161 | echo "append u-boot-atf-container.img at $$pad_cnt KB"; \ 162 | dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt; 163 | ./$(QSPI_PACKER) $(QSPI_HEADER) 164 | 165 | flash_regression_linux_m4: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin m4_1_image.bin 166 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 -p3 -m4 m4_image.bin 0 0x34FE0000 -p4 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 167 | 168 | flash_regression_linux_m4_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin m4_1_image.bin 169 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 -p3 -m4 m4_image.bin 0 0x88000000 -p4 -m4 m4_1_image.bin 1 0x88800000 -out flash.bin 170 | 171 | flash_regression_linux_m4_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_image.bin m4_1_image.bin $(QSPI_HEADER) 172 | ./$(MKIMG) -soc QM -rev B0 -dev flexspi -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x80000 -p3 -m4 m4_image.bin 0 0x08081000 -fileoff 0x180000 -p4 -m4 m4_1_image.bin 1 0x08181000 -fileoff 0x280000 -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 173 | ./$(QSPI_PACKER) $(QSPI_HEADER) 174 | 175 | flash_regression_linux_m41: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_1_image.bin 176 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 -p4 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin 177 | 178 | flash_regression_linux_m41_ddr: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_1_image.bin 179 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-atf.bin a53 0x80000000 -p4 -m4 m4_1_image.bin 1 0x88800000 -out flash.bin 180 | 181 | flash_regression_linux_m41_xip: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin m4_1_image.bin $(QSPI_HEADER) 182 | ./$(MKIMG) -soc QM -rev B0 -dev flexspi -append $(AHAB_IMG) -c -flags 0x00200000 -scfw scfw_tcm.bin -fileoff 0x180000 -p4 -m4 m4_1_image.bin 1 0x08181000 -fileoff 0x280000 -ap u-boot-atf.bin a35 0x80000000 -out flash.bin 183 | ./$(QSPI_PACKER) $(QSPI_HEADER) 184 | 185 | flash_scfw: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin 186 | ./$(MKIMG) -soc QM -rev B0 -dcd skip -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -out flash.bin 187 | 188 | flash_kernel: $(MKIMG) Image imx8qm-mek.dtb 189 | ./$(MKIMG) -soc QM -rev B0 -c -ap Image a53 0x80200000 --data imx8qm-mek.dtb a53 0x83000000 -out flash.bin 190 | 191 | flash_ca72: $(MKIMG) $(AHAB_IMG) scfw_tcm.bin u-boot-atf.bin 192 | ./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a72 0x80000000 -out flash.bin 193 | 194 | parse_container: $(MKIMG) flash.bin 195 | ./$(MKIMG) -soc QM -rev B0 -parse flash.bin 196 | 197 | extract: $(MKIMG) flash.bin 198 | ./$(MKIMG) -soc QM -rev B0 -extract flash.bin 199 | 200 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/misc.mak),) 201 | $(info include misc.mak) 202 | include ../$(SOC_DIR)/scripts/misc.mak 203 | endif 204 | 205 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/m4.mak),) 206 | $(info include m4.mak) 207 | include ../$(SOC_DIR)/scripts/m4.mak 208 | endif 209 | 210 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/android.mak),) 211 | $(info include android.mak) 212 | include ../$(SOC_DIR)/scripts/android.mak 213 | endif 214 | 215 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/test.mak),) 216 | $(info include test.mak) 217 | include ../$(SOC_DIR)/scripts/test.mak 218 | endif 219 | 220 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/autobuild.mak),) 221 | $(info include autobuild.mak) 222 | include ../$(SOC_DIR)/scripts/autobuild.mak 223 | endif 224 | 225 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/alias.mak),) 226 | $(info include alias.mak) 227 | include ../$(SOC_DIR)/scripts/alias.mak 228 | endif 229 | -------------------------------------------------------------------------------- /src/mkimage_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 NXP 3 | * 4 | * SPDX-License-Identifier: GPL-2.0+ 5 | * derived from u-boot's mkimage utility 6 | * 7 | */ 8 | 9 | #ifdef _MSC_VER 10 | #define _CRT_SECURE_NO_WARNINGS 11 | #endif 12 | 13 | #define _GNU_SOURCE 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #ifndef O_BINARY 29 | #define O_BINARY 0 30 | #endif 31 | 32 | 33 | typedef enum option_type { 34 | NO_IMG = 0, 35 | DCD, 36 | SCFW, 37 | SECO, 38 | M4, 39 | M7, 40 | AP, 41 | OUTPUT, 42 | SCD, 43 | CSF, 44 | FLAG, 45 | DEVICE, 46 | NEW_CONTAINER, 47 | APPEND, 48 | DATA, 49 | PARTITION, 50 | FILEOFF, 51 | MSG_BLOCK, 52 | DUMMY_V2X, 53 | ELE, 54 | UPOWER, 55 | FCB, 56 | OEI, 57 | MSEL, 58 | HOLD, 59 | DUMMY_DDR, 60 | RECOVERY, 61 | } option_type_t; 62 | 63 | 64 | typedef struct { 65 | option_type_t option; 66 | char* filename; 67 | uint64_t src; 68 | uint64_t dst; 69 | uint64_t entry;/* image entry address or general purpose num */ 70 | uint64_t ext; 71 | uint64_t mu; 72 | uint64_t part; 73 | } image_t; 74 | 75 | typedef enum REVISION_TYPE { 76 | NO_REV = 0, 77 | A0, 78 | B0 79 | } rev_type_t; 80 | 81 | typedef enum SOC_TYPE { 82 | NONE = 0, 83 | QX, 84 | QM, 85 | DXL, 86 | ULP, 87 | IMX9, 88 | } soc_type_t; 89 | 90 | typedef struct { 91 | uint32_t addr; 92 | uint32_t value; 93 | } dcd_addr_data_t; 94 | 95 | typedef struct { 96 | uint8_t tag; 97 | uint16_t length; 98 | uint8_t version; 99 | } __attribute__((packed)) ivt_header_t; 100 | 101 | typedef struct { 102 | uint8_t tag; 103 | uint16_t length; 104 | uint8_t param; 105 | } __attribute__((packed)) write_dcd_command_t; 106 | 107 | #define MAX_HW_CFG_SIZE_V2 359 108 | 109 | struct dcd_v2_cmd { 110 | write_dcd_command_t write_dcd_command; /*4*/ 111 | dcd_addr_data_t addr_data[MAX_HW_CFG_SIZE_V2]; /*2872*/ 112 | } __attribute__((packed)); 113 | 114 | typedef struct { 115 | ivt_header_t header; /*4*/ 116 | struct dcd_v2_cmd dcd_cmd; /*2876*/ 117 | } __attribute__((packed)) dcd_v2_t; /*2880*/ 118 | 119 | #define CORE_SC 0x1 120 | #define CORE_CM4_0 0x2 121 | #define CORE_CM4_1 0x3 122 | #define CORE_CA53 0x4 123 | #define CORE_CA35 0x4 124 | #define CORE_CA72 0x5 125 | #define CORE_SECO 0x6 126 | #define CORE_V2X_P 0x9 127 | #define CORE_V2X_S 0xA 128 | 129 | #define CORE_ULP_CM33 0x1 130 | #define CORE_ULP_CA35 0x2 131 | #define CORE_ULP_UPOWER 0x4 132 | #define CORE_ULP_ELE 0x6 133 | 134 | /* TODO_IMX95: ROM still not support this, waiting check */ 135 | #define CORE_M7_0 0xB 136 | #define CORE_M7_1 0xC 137 | #define CORE_M33S 0xD 138 | #define CORE_IMX943_M33S 8U 139 | #define CORE_IMX95_M33P 0U 140 | #define CORE_IMX95_M7P 1U 141 | #define CORE_IMX95_A55C0 2U 142 | #define CORE_IMX95_A55C1 3U 143 | #define CORE_IMX95_A55C2 4U 144 | #define CORE_IMX95_A55C3 5U 145 | #define CORE_IMX95_A55C4 6U 146 | #define CORE_IMX95_A55C5 7U 147 | #define CORE_IMX95_A55P 8U 148 | 149 | #define SC_R_OTP 357U 150 | #define SC_R_DEBUG 354U 151 | #define SC_R_ROM_0 236U 152 | #define SC_R_PWM_0 191U 153 | #define SC_R_SNVS 356U 154 | #define SC_R_DC_0 32U 155 | 156 | #define MSG_DEBUG_EN SC_R_DEBUG 157 | #define MSG_FUSE SC_R_OTP 158 | #define MSG_FIELD SC_R_ROM_0 159 | #define MSG_PATCH SC_R_SNVS 160 | 161 | #define IMG_TYPE_CSF 0x01 /* CSF image type */ 162 | #define IMG_TYPE_SCD 0x02 /* SCD image type */ 163 | #define IMG_TYPE_EXEC 0x03 /* Executable image type */ 164 | #define IMG_TYPE_DATA 0x04 /* Data image type */ 165 | #define IMG_TYPE_DCD_DDR 0x05 /* DCD/DDR image type */ 166 | #define IMG_TYPE_OEI 0x05 /* Optional Executable image type */ 167 | #define IMG_TYPE_SECO 0x06 /* SECO image type */ 168 | #define IMG_TYPE_ELE 0x06 /* ELE image type */ 169 | #define IMG_TYPE_PROV 0x07 /* Provisioning image type */ 170 | #define IMG_TYPE_DEK 0x08 /* DEK validation type */ 171 | #define IMG_TYPE_FCB_CHK 0x08 /* The FCB copy image */ 172 | #define IMG_TYPE_RECOVERY 0x09 /* Recovery image only used in u-boot-atf container not by ROM */ 173 | #define IMG_TYPE_PRIM_V2X 0x0B /* Primary V2X FW image */ 174 | #define IMG_TYPE_SEC_V2X 0x0C /* Secondary V2X FW image*/ 175 | #define IMG_TYPE_V2X_ROM 0x0D /* V2X ROM Patch image */ 176 | #define IMG_TYPE_DDR_DUMMY 0x0D /* DDR training data dummy entry */ 177 | #define IMG_TYPE_V2X_DUMMY 0x0E /* V2X Dummy image */ 178 | 179 | #define IMG_TYPE_SHIFT 0 180 | #define IMG_TYPE_MASK 0x1f 181 | #define IMG_TYPE(x) (((x) & IMG_TYPE_MASK) >> IMG_TYPE_SHIFT) 182 | 183 | #define BOOT_IMG_FLAGS_CORE_MASK 0xF 184 | #define BOOT_IMG_FLAGS_CORE_SHIFT 0x04 185 | #define BOOT_IMG_FLAGS_CPU_RID_MASK 0x3FF0 186 | #define BOOT_IMG_FLAGS_CPU_RID_SHIFT 4 187 | #define BOOT_IMG_FLAGS_MU_RID_MASK 0xFFC000 188 | #define BOOT_IMG_FLAGS_MU_RID_SHIFT 14 189 | #define BOOT_IMG_FLAGS_PARTITION_ID_MASK 0x1F000000 190 | #define BOOT_IMG_FLAGS_PARTITION_ID_SHIFT 24 191 | 192 | #define SC_R_A35_0 508 193 | #define SC_R_A53_0 1 194 | #define SC_R_A72_0 6 195 | #define SC_R_MU_0A 213 196 | #define SC_R_MU_3A 216 197 | #define SC_R_M4_0_PID0 278 198 | #define SC_R_M4_0_MU_1A 297 199 | #define SC_R_M4_1_PID0 298 200 | #define SC_R_M4_1_MU_1A 317 201 | #define PARTITION_ID_M4 0 202 | #define PARTITION_ID_AP 1 203 | #define PARTITION_ID_AP2 3 204 | 205 | /* Command tags and parameters */ 206 | #define HAB_DATA_WIDTH_BYTE 1 /* 8-bit value */ 207 | #define HAB_DATA_WIDTH_HALF 2 /* 16-bit value */ 208 | #define HAB_DATA_WIDTH_WORD 4 /* 32-bit value */ 209 | #define HAB_CMD_WRT_DAT_MSK 1 /* mask/value flag */ 210 | #define HAB_CMD_WRT_DAT_SET 2 /* set/clear flag */ 211 | #define HAB_CMD_CHK_DAT_SET 2 /* set/clear flag */ 212 | #define HAB_CMD_CHK_DAT_ANY 4 /* any/all flag */ 213 | #define HAB_CMD_WRT_DAT_FLAGS_WIDTH 5 /* flags field width */ 214 | #define HAB_CMD_WRT_DAT_FLAGS_SHIFT 3 /* flags field offset */ 215 | #define HAB_CMD_WRT_DAT_BYTES_WIDTH 3 /* bytes field width */ 216 | #define HAB_CMD_WRT_DAT_BYTES_SHIFT 0 /* bytes field offset */ 217 | 218 | #define IVT_VER 0x01 219 | #define IVT_VERSION 0x43 220 | #define DCD_HEADER_TAG 0xD2 221 | #define DCD_VERSION 0x43 222 | #define DCD_WRITE_DATA_COMMAND_TAG 0xCC 223 | #define DCD_WRITE_DATA_PARAM (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT) /* 0x4 */ 224 | #define DCD_WRITE_CLR_BIT_PARAM ((HAB_CMD_WRT_DAT_MSK << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT)) /* 0xC */ 225 | #define DCD_WRITE_SET_BIT_PARAM ((HAB_CMD_WRT_DAT_MSK << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_CMD_WRT_DAT_SET << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT)) /* 0x1C */ 226 | #define DCD_CHECK_DATA_COMMAND_TAG 0xCF 227 | #define DCD_CHECK_BITS_CLR_PARAM (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT) /* 0x04 */ 228 | #define DCD_CHECK_BITS_SET_PARAM ((HAB_CMD_CHK_DAT_SET << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT)) /* 0x14 */ 229 | #define DCD_CHECK_ANY_BIT_CLR_PARAM ((HAB_CMD_CHK_DAT_ANY << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT)) /* 0x24 */ 230 | #define DCD_CHECK_ANY_BIT_SET_PARAM ((HAB_CMD_CHK_DAT_ANY << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_CMD_CHK_DAT_SET << HAB_CMD_WRT_DAT_FLAGS_SHIFT) | (HAB_DATA_WIDTH_WORD << HAB_CMD_WRT_DAT_BYTES_SHIFT)) /* 0x34 */ 231 | 232 | #define IVT_OFFSET_NAND (0x400) 233 | #define IVT_OFFSET_I2C (0x400) 234 | #define IVT_OFFSET_FLEXSPI (0x1000) 235 | #define IVT_OFFSET_SD (0x400) 236 | #define IVT_OFFSET_SATA (0x400) 237 | #define IVT_OFFSET_EMMC (0x400) 238 | 239 | #define CSF_DATA_SIZE (0x4000) 240 | #define INITIAL_LOAD_ADDR_SCU_ROM 0x2000e000 241 | #define INITIAL_LOAD_ADDR_AP_ROM 0x00110000 242 | #define INITIAL_LOAD_ADDR_FLEXSPI 0x08000000 243 | #define IMG_AUTO_ALIGN 0x10 244 | 245 | #define ALIGN(x,a) __ALIGN_MASK((x),(__typeof__(x))(a)-1) 246 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 247 | #define ALIGN_DOWN(x, a) ALIGN((x) - ((a) - 1), (a)) 248 | 249 | #define uswap_16(x) \ 250 | ((((x) & 0xff00) >> 8) | \ 251 | (((x) & 0x00ff) << 8)) 252 | #define uswap_32(x) \ 253 | ((((x) & 0xff000000) >> 24) | \ 254 | (((x) & 0x00ff0000) >> 8) | \ 255 | (((x) & 0x0000ff00) << 8) | \ 256 | (((x) & 0x000000ff) << 24)) 257 | #define _uswap_64(x, sfx) \ 258 | ((((x) & 0xff00000000000000##sfx) >> 56) | \ 259 | (((x) & 0x00ff000000000000##sfx) >> 40) | \ 260 | (((x) & 0x0000ff0000000000##sfx) >> 24) | \ 261 | (((x) & 0x000000ff00000000##sfx) >> 8) | \ 262 | (((x) & 0x00000000ff000000##sfx) << 8) | \ 263 | (((x) & 0x0000000000ff0000##sfx) << 24) | \ 264 | (((x) & 0x000000000000ff00##sfx) << 40) | \ 265 | (((x) & 0x00000000000000ff##sfx) << 56)) 266 | 267 | #if defined(__GNUC__) 268 | # define uswap_64(x) _uswap_64(x, ull) 269 | #else 270 | #error 271 | # define uswap_64(x) _uswap_64(x, ) 272 | #endif 273 | 274 | #if __BYTE_ORDER == __LITTLE_ENDIAN 275 | # define cpu_to_le16(x) (x) 276 | # define cpu_to_le32(x) (x) 277 | # define cpu_to_le64(x) (x) 278 | # define le16_to_cpu(x) (x) 279 | # define le32_to_cpu(x) (x) 280 | # define le64_to_cpu(x) (x) 281 | # define cpu_to_be16(x) uswap_16(x) 282 | # define cpu_to_be32(x) uswap_32(x) 283 | # define cpu_to_be64(x) uswap_64(x) 284 | # define be16_to_cpu(x) uswap_16(x) 285 | # define be32_to_cpu(x) uswap_32(x) 286 | # define be64_to_cpu(x) uswap_64(x) 287 | #else 288 | #error 289 | # define cpu_to_le16(x) uswap_16(x) 290 | # define cpu_to_le32(x) uswap_32(x) 291 | # define cpu_to_le64(x) uswap_64(x) 292 | # define le16_to_cpu(x) uswap_16(x) 293 | # define le32_to_cpu(x) uswap_32(x) 294 | # define le64_to_cpu(x) uswap_64(x) 295 | # define cpu_to_be16(x) (x) 296 | # define cpu_to_be32(x) (x) 297 | # define cpu_to_be64(x) (x) 298 | # define be16_to_cpu(x) (x) 299 | # define be32_to_cpu(x) (x) 300 | # define be64_to_cpu(x) (x) 301 | #endif 302 | 303 | #define UNDEFINED 0xFFFFFFFF 304 | 305 | #if 0 306 | enum imximage_fld_types { 307 | CFG_INVALID = -1, 308 | CFG_COMMAND, 309 | CFG_REG_SIZE, 310 | CFG_REG_ADDRESS, 311 | CFG_REG_VALUE 312 | }; 313 | 314 | enum imximage_cmd { 315 | CMD_INVALID, 316 | CMD_IMAGE_VERSION, 317 | CMD_BOOT_FROM, 318 | CMD_BOOT_OFFSET, 319 | CMD_WRITE_DATA, 320 | CMD_WRITE_CLR_BIT, 321 | CMD_WRITE_SET_BIT, 322 | CMD_CHECK_BITS_SET, 323 | CMD_CHECK_BITS_CLR, 324 | CMD_CHECK_ANY_BIT_SET, 325 | CMD_CHECK_ANY_BIT_CLR, 326 | CMD_CSF, 327 | CMD_PLUGIN, 328 | }; 329 | 330 | typedef struct table_entry { 331 | int id; 332 | char *sname; /* short (input) name to find table entry */ 333 | char *lname; /* long (output) name to print for messages */ 334 | } table_entry_t; 335 | 336 | /* 337 | * Supported commands for configuration file 338 | */ 339 | static table_entry_t imximage_cmds[] = { 340 | {CMD_BOOT_FROM, "BOOT_FROM", "boot command", }, 341 | {CMD_BOOT_OFFSET, "BOOT_OFFSET", "Boot offset", }, 342 | {CMD_WRITE_DATA, "DATA", "Reg Write Data", }, 343 | {CMD_WRITE_CLR_BIT, "CLR_BIT", "Reg clear bit", }, 344 | {CMD_WRITE_SET_BIT, "SET_BIT", "Reg set bit", }, 345 | {CMD_CHECK_BITS_SET, "CHECK_BITS_SET", "Reg Check all bits set", }, 346 | {CMD_CHECK_BITS_CLR, "CHECK_BITS_CLR", "Reg Check all bits clr", }, 347 | {CMD_CHECK_ANY_BIT_SET, "CHECK_ANY_BIT_SET", "Reg Check any bit set", }, 348 | {CMD_CHECK_ANY_BIT_CLR, "CHECK_ANY_BIT_CLR", "Reg Check any bit clr", }, 349 | {CMD_CSF, "CSF", "Command Sequence File", }, 350 | {CMD_IMAGE_VERSION, "IMAGE_VERSION", "image version", }, 351 | {-1, "", "", }, 352 | }; 353 | #endif 354 | 355 | void check_file(struct stat* sbuf,char * filename); 356 | void copy_file (int ifd, const char *datafile, int pad, int offset); 357 | uint32_t get_cfg_value(char *token, char *name, int linenr); 358 | void set_dcd_param_v2(dcd_v2_t *dcd_v2, uint32_t dcd_len, 359 | int32_t cmd); 360 | void set_dcd_val_v2(dcd_v2_t *dcd_v2, char *name, int lineno, 361 | int fld, uint32_t value, uint32_t off); 362 | void set_dcd_rst_v2(dcd_v2_t *dcd_v2, uint32_t dcd_len, 363 | char *name, int lineno); 364 | void parse_cfg_cmd(dcd_v2_t *dcd_v2, int32_t cmd, char *token, 365 | char *name, int lineno, int fld, int dcd_len); 366 | void parse_cfg_fld(dcd_v2_t *dcd_v2, int32_t *cmd, 367 | char *token, char *name, int lineno, int fld, int *dcd_len); 368 | uint32_t parse_cfg_file(dcd_v2_t *dcd_v2, char *name); 369 | 370 | int build_container_qm(uint32_t sector_size, uint32_t ivt_offset, char * out_file, 371 | bool emmc_fastboot, image_t* image_stack); 372 | 373 | int build_container_qx(uint32_t sector_size, uint32_t ivt_offset, char * out_file, 374 | bool emmc_fastboot, image_t* image_stack); 375 | 376 | int build_container_qx_qm_b0(soc_type_t soc, uint32_t sector_size, uint32_t ivt_offset, char * out_file, 377 | bool emmc_fastboot, image_t* image_stack, bool dcd_skip, uint8_t fuse_version, 378 | uint16_t sw_version, uint8_t cntr_version, uint32_t cntr_flags, char *images_hash); 379 | 380 | int parse_container_hdrs_qx_qm_b0(char *ifname, bool extract, soc_type_t soc, off_t file_off); 381 | -------------------------------------------------------------------------------- /iMX93/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = ../mkimage_imx8 2 | 3 | CC ?= gcc 4 | REV ?= A1 5 | OEI ?= NO 6 | MSEL ?= 0 7 | CFLAGS ?= -O2 -Wall -std=c99 -static 8 | INCLUDE = ./lib 9 | 10 | #define the F(Q)SPI header file 11 | QSPI_HEADER = ../scripts/fspi_header 12 | QSPI_PACKER = ../scripts/fspi_packer.sh 13 | QSPI_FCB_GEN = ../scripts/fspi_fcb_gen.sh 14 | PAD_IMAGE = ../scripts/pad_image.sh 15 | 16 | ifneq ($(wildcard /usr/bin/rename.ul),) 17 | RENAME = rename.ul 18 | else 19 | RENAME = rename 20 | endif 21 | 22 | LC_REVISION = $(shell echo $(REV) | tr ABC abc) 23 | 24 | # iMX93 25 | AHAB_IMG = mx93$(LC_REVISION)-ahab-container.img 26 | SPL_LOAD_ADDR ?= 0x2049A000 27 | SPL_LOAD_ADDR_M33_VIEW ?= 0x3049A000 28 | ATF_LOAD_ADDR ?= 0x204E0000 29 | UBOOT_LOAD_ADDR ?= 0x80200000 30 | MCU_TCM_ADDR ?= 0x1FFE0000 # 128KB TCM 31 | MCU_TCM_ADDR_ACORE_VIEW ?= 0x201E0000 32 | LPDDR_FW_VERSION ?= _v202201 33 | SPL_A55_IMG ?= u-boot-spl-ddr.bin 34 | KERNEL_DTB ?= imx93-11x11-evk.dtb # Used by kernel authentication 35 | KERNEL_DTB_ADDR ?= 0x83000000 36 | KERNEL_ADDR ?= 0x80400000 37 | # This Capsule_GUID is reserved by NXP 38 | CAPSULE_GUID = bc550d86-da26-4b70-ac05-2a448eda6f21 39 | 40 | FCB_LOAD_ADDR ?= $(ATF_LOAD_ADDR) 41 | MCU_IMG = m33_image.bin 42 | 43 | TEE ?= tee.bin 44 | TEE_LOAD_ADDR ?= 0x96000000 45 | MCU_XIP_ADDR ?= 0x28032000 # Point entry of m33 in flexspi0 nor flash 46 | M33_IMAGE_XIP_OFFSET ?= 0x31000 # 1st container offset is 0x1000 when boot device is flexspi0 nor 47 | # flash, actually the m33_image.bin is in 0x31000 + 0x1000 = 0x32000. 48 | 49 | 50 | ########################### 51 | # Append container macro 52 | # 53 | # $(1) - container to append, usually: u-boot-atf-container.img 54 | # $(2) - the page at which the container must be append, usually: 1 55 | ########################### 56 | define append_container 57 | @cp flash.bin boot-spl-container.img 58 | @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ 59 | psize=$$((0x400 * $(2))); \ 60 | pad_cnt=$$(((flashbin_size + psize - 1) / psize)); \ 61 | echo "append $(1) at $$((pad_cnt * $(2))) KB, psize=$$psize"; \ 62 | dd if=$(1) of=flash.bin bs=1K seek=$$((pad_cnt * $(2))); 63 | endef 64 | 65 | define append_fcb 66 | @mv flash.bin flash.tmp 67 | @dd if=fcb.bin of=flash.bin bs=1k seek=1 68 | @dd if=flash.tmp of=flash.bin bs=1k seek=4 69 | @rm flash.tmp 70 | @echo "Append FCB to flash.bin" 71 | endef 72 | 73 | FORCE: 74 | 75 | lpddr4_imem_1d = lpddr4_imem_1d$(LPDDR_FW_VERSION).bin 76 | lpddr4_dmem_1d = lpddr4_dmem_1d$(LPDDR_FW_VERSION).bin 77 | lpddr4_imem_2d = lpddr4_imem_2d$(LPDDR_FW_VERSION).bin 78 | lpddr4_dmem_2d = lpddr4_dmem_2d$(LPDDR_FW_VERSION).bin 79 | lpddr4_imem_qb = lpddr4_imem_qb$(LPDDR_FW_VERSION).bin 80 | lpddr4_dmem_qb = lpddr4_dmem_qb$(LPDDR_FW_VERSION).bin 81 | lpddr4_qb_data = lpddr4_qb_data.bin 82 | 83 | u-boot-spl-ddr.bin: u-boot-spl.bin $(lpddr4_imem_1d) $(lpddr4_dmem_1d) $(lpddr4_imem_2d) $(lpddr4_dmem_2d) 84 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_1d) lpddr4_pmu_train_1d_imem_pad.bin 85 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(lpddr4_dmem_1d) lpddr4_pmu_train_1d_dmem_pad.bin 86 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_2d) lpddr4_pmu_train_2d_imem_pad.bin 87 | @cat lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin > lpddr4_pmu_train_1d_fw.bin 88 | @cat lpddr4_pmu_train_2d_imem_pad.bin $(lpddr4_dmem_2d) > lpddr4_pmu_train_2d_fw.bin 89 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 90 | @cat u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin > u-boot-spl-ddr.bin 91 | @rm -f u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin 92 | @rm -f lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin lpddr4_pmu_train_2d_imem_pad.bin 93 | 94 | u-boot-spl-ddr-qb.bin: u-boot-spl.bin $(lpddr4_imem_qb) $(lpddr4_dmem_qb) $(lpddr4_qb_data) 95 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_qb) lpddr4_pmu_qb_imem_pad.bin 96 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(lpddr4_dmem_qb) lpddr4_pmu_qb_dmem_pad.bin 97 | @cat lpddr4_pmu_qb_imem_pad.bin lpddr4_pmu_qb_dmem_pad.bin > lpddr4_pmu_qb_fw.bin 98 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 99 | @cat u-boot-spl-pad.bin lpddr4_pmu_qb_fw.bin $(lpddr4_qb_data) > u-boot-spl-ddr-qb.bin 100 | @rm -f u-boot-spl-pad.bin lpddr4_pmu_qb_imem_pad.bin lpddr4_pmu_qb_dmem_pad.bin lpddr4_pmu_qb_fw.bin 101 | 102 | u-boot-hash.bin: u-boot.bin 103 | ./$(MKIMG) -commit > head.hash 104 | @cat u-boot.bin head.hash > u-boot-hash.bin 105 | 106 | u-boot-atf.bin: u-boot-hash.bin bl31.bin 107 | @cp bl31.bin u-boot-atf.bin 108 | @dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128 109 | 110 | u-boot-atf.itb: u-boot-hash.bin bl31.bin 111 | ./$(PAD_IMAGE) bl31.bin 112 | ./$(PAD_IMAGE) u-boot-hash.bin 113 | TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ./mkimage_fit_atf.sh > u-boot.its; 114 | ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot-atf.itb; 115 | @rm -f u-boot.its 116 | 117 | u-boot-atf-container.img: bl31.bin u-boot-hash.bin 118 | if [ -f $(TEE) ]; then \ 119 | if [ $(shell echo $(TEE_COMPRESS_ENABLE)) ]; then \ 120 | echo "Start compress $(TEE)"; \ 121 | lz4 -9 -f --rm $(TEE) $(TEE).lz4; \ 122 | cp $(TEE).lz4 $(TEE); \ 123 | fi; \ 124 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 125 | ./$(MKIMG) -soc IMX9 -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) -c \ 126 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 127 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 128 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) \ 129 | -out u-boot-atf-container.img; \ 130 | else \ 131 | ./$(MKIMG) -soc IMX9 -c \ 132 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 133 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 134 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) -out u-boot-atf-container.img; \ 135 | fi; \ 136 | else \ 137 | ./$(MKIMG) -soc IMX9 -c \ 138 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 139 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 140 | -out u-boot-atf-container.img; \ 141 | fi 142 | 143 | u-boot-atf-container-spinand.img: bl31.bin u-boot-hash.bin 144 | if [ -f $(TEE) ]; then \ 145 | if [ $(shell echo $(ROLLBACK_INDEX_IN_CONTAINER)) ]; then \ 146 | ./$(MKIMG) -soc IMX9 -sw_version $(ROLLBACK_INDEX_IN_CONTAINER) \ 147 | -dev nand 4K -c \ 148 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 149 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 150 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) \ 151 | -out u-boot-atf-container-spinand.img; \ 152 | else \ 153 | ./$(MKIMG) -soc IMX9 -dev nand 4K -c \ 154 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 155 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 156 | -ap $(TEE) a55 $(TEE_LOAD_ADDR) \ 157 | -out u-boot-atf-container-spinand.img; \ 158 | fi; \ 159 | else \ 160 | ./$(MKIMG) -soc IMX9 -dev nand 4K -c \ 161 | -ap bl31.bin a55 $(ATF_LOAD_ADDR) \ 162 | -ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \ 163 | -out u-boot-atf-container-spinand.img; \ 164 | fi 165 | 166 | fcb.bin: FORCE 167 | ./$(QSPI_FCB_GEN) $(QSPI_HEADER) 168 | 169 | flash_fw.bin: FORCE 170 | @$(MAKE) --no-print-directory -f soc.mak flash_singleboot 171 | @mv -f flash.bin $@ 172 | 173 | .PHONY: clean nightly 174 | clean: 175 | @rm -f $(MKIMG) u-boot-atf-container.img u-boot-spl-ddr.bin u-boot-spl-ddr-qb.bin u-boot-hash.bin 176 | @rm -rf extracted_imgs 177 | @echo "imx93 clean done" 178 | 179 | # Add for System ready 180 | ifeq ($(TEE),tee.bin-stmm) 181 | KEY_EXISTS = $(shell find -maxdepth 1 -name "CRT.*") 182 | capsule_key: 183 | ifneq ($(KEY_EXISTS),) 184 | @echo "****************************************************************" 185 | @echo "Key $(KEY_EXISTS) already existed" 186 | @echo "If you not wanna use new Key, please not run target: capsule_key" 187 | @echo "Otherwise, please delete CRT.* and re-run capsule_key" 188 | @echo "****************************************************************" 189 | @exit 1 190 | endif 191 | openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=CRT/ -keyout CRT.key -out CRT.crt -nodes -days 365 192 | cert-to-efi-sig-list CRT.crt CRT.esl 193 | 194 | delete_capsule_key: 195 | @rm -rf CRT.* 196 | 197 | overlay: u-boot.bin 198 | ./$(MKIMG) -soc IMX9 -split u-boot.bin 199 | dtc -@ -I dts -O dtb -o signature.dtbo signature.dts 200 | fdtoverlay -i gen-uboot.dtb -o gen-uboot.dtb signature.dtbo 201 | @cat gen-u-boot-nodtb.bin gen-uboot.dtb > gen-u-boot.bin 202 | @mv -f gen-u-boot.bin u-boot.bin 203 | 204 | flash_singleboot_stmm_capsule: overlay flash_singleboot 205 | ./mkeficapsule flash.bin --monotonic-count 1 \ 206 | --guid $(CAPSULE_GUID) \ 207 | --private-key CRT.key \ 208 | --certificate CRT.crt \ 209 | --index 1 --instance 0 \ 210 | capsule1.bin 211 | 212 | flash_singleboot_stmm: flash_singleboot_stmm_capsule 213 | endif 214 | 215 | 216 | flash_singleboot: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img 217 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 218 | $(call append_container,u-boot-atf-container.img,1) 219 | 220 | flash_singleboot_gdet: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img 221 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -cntr_flags 0x200010 -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 222 | $(call append_container,u-boot-atf-container.img,1) 223 | 224 | flash_singleboot_gdet_auto: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img 225 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -cntr_flags 0x100010 -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 226 | $(call append_container,u-boot-atf-container.img,1) 227 | 228 | flash_singleboot_no_ahabfw: $(MKIMG) $(SPL_A55_IMG) u-boot-atf-container.img 229 | ./$(MKIMG) -soc IMX9 -c -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 230 | $(call append_container,u-boot-atf-container.img,1) 231 | 232 | flash_singleboot_spinand: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container-spinand.img flash_fw.bin 233 | ./$(MKIMG) -soc IMX9 -dev nand 4K -append $(AHAB_IMG) -c \ 234 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 235 | $(call append_container,u-boot-atf-container-spinand.img,4) 236 | 237 | flash_singleboot_spinand_fw: flash_fw.bin 238 | @mv -f flash_fw.bin flash.bin 239 | 240 | flash_singleboot_qb: $(MKIMG) $(AHAB_IMG) u-boot-spl-ddr-qb.bin u-boot-atf-container.img 241 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c -ap u-boot-spl-ddr-qb.bin a55 $(SPL_LOAD_ADDR) -out flash.bin 242 | $(call append_container,u-boot-atf-container.img,1) 243 | 244 | flash_singleboot_flexspi: $(MKIMG) $(AHAB_IMG) $(SPL_A55_IMG) u-boot-atf-container.img fcb.bin 245 | ./$(MKIMG) -soc IMX9 -dev flexspi -append $(AHAB_IMG) -c \ 246 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) \ 247 | -fcb fcb.bin $(FCB_LOAD_ADDR) -out flash.bin 248 | $(call append_container,u-boot-atf-container.img,1) 249 | $(call append_fcb) 250 | 251 | flash_singleboot_m33: $(MKIMG) $(AHAB_IMG) u-boot-atf-container.img $(MCU_IMG) $(SPL_A55_IMG) 252 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) $(MCU_TCM_ADDR_ACORE_VIEW) \ 253 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 254 | $(call append_container,u-boot-atf-container.img,1) 255 | 256 | flash_singleboot_m33_no_ahabfw: $(MKIMG) u-boot-atf-container.img $(MCU_IMG) $(SPL_A55_IMG) 257 | ./$(MKIMG) -soc IMX9 -c -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) $(MCU_TCM_ADDR_ACORE_VIEW) \ 258 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin 259 | $(call append_container,u-boot-atf-container.img,1) 260 | 261 | flash_singleboot_m33_flexspi: $(MKIMG) $(AHAB_IMG) $(UPOWER_IMG) u-boot-atf-container.img $(MCU_IMG) $(SPL_A55_IMG) fcb.bin 262 | ./$(MKIMG) -soc IMX9 -dev flexspi -append $(AHAB_IMG) -c -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) $(MCU_TCM_ADDR_ACORE_VIEW) \ 263 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) \ 264 | -fcb fcb.bin $(FCB_LOAD_ADDR) -out flash.bin 265 | $(call append_container,u-boot-atf-container.img,1) 266 | $(call append_fcb) 267 | 268 | 269 | flash_lpboot: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) 270 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c \ 271 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) -out flash.bin 272 | 273 | flash_lpboot_no_ahabfw: $(MKIMG) $(MCU_IMG) 274 | ./$(MKIMG) -soc IMX9 -c \ 275 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) -out flash.bin 276 | 277 | flash_lpboot_a55: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) $(SPL_A55_IMG) 278 | ./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c \ 279 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) \ 280 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) -out flash.bin 281 | 282 | flash_lpboot_a55_no_ahabfw: $(MKIMG) $(MCU_IMG) $(SPL_A55_IMG) 283 | ./$(MKIMG) -soc IMX9 -c \ 284 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) \ 285 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) -out flash.bin 286 | 287 | flash_lpboot_flexspi: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) 288 | ./$(MKIMG) -soc IMX9 -dev flexspi -append $(AHAB_IMG) -c \ 289 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) -out flash.bin 290 | ./$(QSPI_PACKER) $(QSPI_HEADER) 291 | 292 | flash_lpboot_flexspi_no_ahabfw: $(MKIMG) $(MCU_IMG) 293 | ./$(MKIMG) -soc IMX9 -dev flexspi -c \ 294 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) -out flash.bin 295 | ./$(QSPI_PACKER) $(QSPI_HEADER) 296 | 297 | flash_lpboot_flexspi_a55: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) $(SPL_A55_IMG) 298 | ./$(MKIMG) -soc IMX9 -dev flexspi -append $(AHAB_IMG) -c \ 299 | -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) \ 300 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) -out flash.bin 301 | ./$(QSPI_PACKER) $(QSPI_HEADER) 302 | 303 | flash_lpboot_flexspi_a55_no_ahabfw: $(MKIMG) $(MCU_IMG) $(SPL_A55_IMG) 304 | ./$(MKIMG) -soc IMX9 -dev flexspi -c -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) \ 305 | -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) -out flash.bin 306 | ./$(QSPI_PACKER) $(QSPI_HEADER) 307 | 308 | flash_lpboot_flexspi_xip: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) 309 | ./$(MKIMG) -soc IMX9 -dev flexspi -append $(AHAB_IMG) -fileoff $(M33_IMAGE_XIP_OFFSET) \ 310 | -c -m33 $(MCU_IMG) 0 $(MCU_XIP_ADDR) -out flash.bin 311 | ./$(QSPI_PACKER) $(QSPI_HEADER) 312 | 313 | flash_ele: $(MKIMG) ahabfw.bin 314 | ./$(MKIMG) -soc IMX9 -c -ele ahabfw.bin -out flash.bin 315 | 316 | flash_kernel: $(MKIMG) Image $(KERNEL_DTB) 317 | ./$(MKIMG) -soc IMX9 -c -ap Image a55 $(KERNEL_ADDR) --data $(KERNEL_DTB) a55 $(KERNEL_DTB_ADDR) -out flash.bin 318 | 319 | flash_bootaux_cntr: $(MKIMG) $(MCU_IMG) 320 | ./$(MKIMG) -soc IMX9 -c -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) $(MCU_TCM_ADDR_ACORE_VIEW) -out flash.bin 321 | 322 | flash_bootaux_cntr_xip: $(MKIMG) $(MCU_IMG) 323 | ./$(MKIMG) -soc IMX9 -c -fileoff $(M33_IMAGE_XIP_OFFSET) -m33 $(MCU_IMG) 0 $(MCU_XIP_ADDR) -out flash.bin 324 | 325 | parse_container: $(MKIMG) flash.bin 326 | ./$(MKIMG) -soc IMX9 -parse flash.bin 327 | 328 | extract: $(MKIMG) flash.bin 329 | ./$(MKIMG) -soc IMX9 -extract flash.bin 330 | 331 | ifneq ($(wildcard ../$(SOC_DIR)/scripts/autobuild.mak),) 332 | $(info include autobuild.mak) 333 | include ../$(SOC_DIR)/scripts/autobuild.mak 334 | endif 335 | -------------------------------------------------------------------------------- /iMX8M/soc.mak: -------------------------------------------------------------------------------- 1 | MKIMG = mkimage_imx8 2 | OUTIMG = flash.bin 3 | 4 | CC ?= gcc 5 | CFLAGS ?= -O2 -Wall -std=c99 -static 6 | INCLUDE = ./lib 7 | 8 | WGET = /usr/bin/wget 9 | N ?= latest 10 | SERVER=http://yb2.am.freescale.net 11 | BUILD ?= Linux_IMX_Regression 12 | 13 | #DIR = internal-only/Linux_IMX_Rocko_MX8/$(N)/common_bsp 14 | #DIR = internal-only/Linux_IMX_Core/$(N)/common_bsp 15 | DIR = internal-only/$(BUILD)/$(N)/common_bsp 16 | ARCHIVE_PATH ?= ~ 17 | ARCHIVE_NAME ?= $(shell cat nightly.txt).tar 18 | 19 | BITBUCKET_SERVER=https://bitbucket.sw.nxp.com 20 | DDR_FW_DIR=projects/IMX/repos/linux-firmware-imx/raw/firmware/ddr/synopsys 21 | PAD_IMAGE = ../scripts/pad_image.sh 22 | DTB_PREPROC = ../scripts/dtb_check.sh 23 | 24 | PRINT_FIT_HAB_OFFSET ?= 0x60000 25 | DEK_BLOB_LOAD_ADDR = 0x40400000 26 | TEE ?= tee.bin 27 | 28 | dtbs ?= 29 | # Supplementary dtbs list. Will be included in the image without any check 30 | supp_dtbs ?= 31 | 32 | ifeq ($(SOC),iMX8MM) 33 | PLAT = imx8mm 34 | HDMI = no 35 | SPL_LOAD_ADDR = 0x7E1000 36 | SPL_FSPI_LOAD_ADDR = 0x7E2000 37 | TEE_LOAD_ADDR ?= 0xbe000000 38 | ATF_LOAD_ADDR = 0x00920000 39 | VAL_BOARD = val 40 | #define the F(Q)SPI header file 41 | QSPI_HEADER = ../scripts/fspi_header 0 42 | QSPI_PACKER = ../scripts/fspi_packer.sh 43 | VERSION = v1 44 | CAPSULE_GUID = ead2005e-7780-400b-9348-a282eb858b6b 45 | else ifeq ($(SOC),iMX8MN) 46 | PLAT = imx8mn 47 | HDMI = no 48 | SPL_LOAD_ADDR = 0x912000 49 | SPL_FSPI_LOAD_ADDR = 0x912000 50 | TEE_LOAD_ADDR = 0x56000000 51 | ATF_LOAD_ADDR = 0x00960000 52 | VAL_BOARD = val 53 | #define the F(Q)SPI header file 54 | QSPI_HEADER = ../scripts/fspi_header 55 | QSPI_PACKER = ../scripts/fspi_packer.sh 56 | VERSION = v2 57 | DDR_FW_VERSION = _201810 58 | CAPSULE_GUID = cbabf44d-12cc-45dd-b0c5-29c5b7422d34 59 | else ifeq ($(SOC),iMX8MP) 60 | PLAT = imx8mp 61 | HDMI = no 62 | SPL_LOAD_ADDR = 0x920000 63 | SPL_FSPI_LOAD_ADDR = 0x920000 64 | TEE_LOAD_ADDR ?= 0x56000000 65 | ATF_LOAD_ADDR = 0x00970000 66 | VAL_BOARD = val 67 | #define the F(Q)SPI header file 68 | QSPI_HEADER = ../scripts/fspi_header 69 | QSPI_PACKER = ../scripts/fspi_packer.sh 70 | VERSION = v2 71 | LPDDR_FW_VERSION = _202006 72 | DDR_FW_VERSION = _202006 73 | CAPSULE_GUID = 928b33bc-e58b-4247-9f1d-3bf1ee1cdaff 74 | else 75 | PLAT = imx8mq 76 | HDMI = yes 77 | SPL_LOAD_ADDR = 0x7E1000 78 | TEE_LOAD_ADDR = 0xfe000000 79 | ATF_LOAD_ADDR = 0x00910000 80 | VAL_BOARD = val 81 | #define the F(Q)SPI header file 82 | QSPI_HEADER = ../scripts/qspi_header 83 | QSPI_PACKER = ../scripts/fspi_packer.sh 84 | VERSION = v1 85 | CAPSULE_GUID = 296119cf-dd70-43de-8ac8-a7051f312577 86 | endif 87 | 88 | FIT_EXTERNAL_POSITION = 0x5000 89 | 90 | FW_DIR = imx-boot/imx-boot-tools/$(PLAT) 91 | 92 | $(MKIMG): ../$(SOC_DIR)/mkimage_imx8.c 93 | @echo "PLAT="$(PLAT) "HDMI="$(HDMI) 94 | @echo "Compiling mkimage_imx8" 95 | $(CC) $(CFLAGS) ../$(SOC_DIR)/mkimage_imx8.c -o $(MKIMG) $(BUILD_LDFLAGS) -lz 96 | 97 | lpddr4_imem_1d = lpddr4_pmu_train_1d_imem$(LPDDR_FW_VERSION).bin 98 | lpddr4_dmem_1d = lpddr4_pmu_train_1d_dmem$(LPDDR_FW_VERSION).bin 99 | lpddr4_imem_2d = lpddr4_pmu_train_2d_imem$(LPDDR_FW_VERSION).bin 100 | lpddr4_dmem_2d = lpddr4_pmu_train_2d_dmem$(LPDDR_FW_VERSION).bin 101 | 102 | u-boot-spl-ddr.bin: u-boot-spl.bin $(lpddr4_imem_1d) $(lpddr4_dmem_1d) $(lpddr4_imem_2d) $(lpddr4_dmem_2d) 103 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_1d) lpddr4_pmu_train_1d_imem_pad.bin 104 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(lpddr4_dmem_1d) lpddr4_pmu_train_1d_dmem_pad.bin 105 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(lpddr4_imem_2d) lpddr4_pmu_train_2d_imem_pad.bin 106 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(lpddr4_dmem_2d) lpddr4_pmu_train_2d_dmem_pad.bin 107 | @cat lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin > lpddr4_pmu_train_1d_fw.bin 108 | @cat lpddr4_pmu_train_2d_imem_pad.bin lpddr4_pmu_train_2d_dmem_pad.bin > lpddr4_pmu_train_2d_fw.bin 109 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 110 | @cat u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin > u-boot-spl-ddr.bin 111 | @rm -f u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin lpddr4_pmu_train_2d_imem_pad.bin 112 | 113 | ddr4_imem_1d = ddr4_imem_1d$(DDR_FW_VERSION).bin 114 | ddr4_dmem_1d = ddr4_dmem_1d$(DDR_FW_VERSION).bin 115 | ddr4_imem_2d = ddr4_imem_2d$(DDR_FW_VERSION).bin 116 | ddr4_dmem_2d = ddr4_dmem_2d$(DDR_FW_VERSION).bin 117 | 118 | u-boot-spl-ddr4.bin: u-boot-spl.bin $(ddr4_imem_1d) $(ddr4_dmem_1d) $(ddr4_imem_2d) $(ddr4_dmem_2d) 119 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(ddr4_imem_1d) ddr4_imem_1d_pad.bin 120 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(ddr4_dmem_1d) ddr4_dmem_1d_pad.bin 121 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(ddr4_imem_2d) ddr4_imem_2d_pad.bin 122 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(ddr4_dmem_2d) ddr4_dmem_2d_pad.bin 123 | @cat ddr4_imem_1d_pad.bin ddr4_dmem_1d_pad.bin > ddr4_1d_fw.bin 124 | @cat ddr4_imem_2d_pad.bin ddr4_dmem_2d_pad.bin > ddr4_2d_fw.bin 125 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 126 | @cat u-boot-spl-pad.bin ddr4_1d_fw.bin ddr4_2d_fw.bin > u-boot-spl-ddr4.bin 127 | @rm -f u-boot-spl-pad.bin ddr4_1d_fw.bin ddr4_2d_fw.bin ddr4_imem_1d_pad.bin ddr4_dmem_1d_pad.bin ddr4_imem_2d_pad.bin 128 | 129 | ddr3_imem_1d = ddr3_imem_1d$(DDR_FW_VERSION).bin 130 | ddr3_dmem_1d = ddr3_dmem_1d$(DDR_FW_VERSION).bin 131 | 132 | u-boot-spl-ddr3l.bin: u-boot-spl.bin $(ddr3_imem_1d) $(ddr3_dmem_1d) 133 | @objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(ddr3_imem_1d) ddr3_imem_1d.bin_pad.bin 134 | @objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(ddr3_dmem_1d) ddr3_dmem_1d.bin_pad.bin 135 | @cat ddr3_imem_1d.bin_pad.bin ddr3_dmem_1d.bin_pad.bin > ddr3_pmu_train_fw.bin 136 | @dd if=/dev/zero of=ddr3_fw_zero_pad.bin bs=1 count=49152 conv=sync 137 | @dd if=u-boot-spl.bin of=u-boot-spl-pad.bin bs=4 conv=sync 138 | @cat u-boot-spl-pad.bin ddr3_pmu_train_fw.bin ddr3_fw_zero_pad.bin > u-boot-spl-ddr3l.bin 139 | @rm -f u-boot-spl-pad.bin ddr3_pmu_train_fw.bin ddr3_imem_1d.bin_pad.bin ddr3_fw_zero_pad.bin 140 | 141 | u-boot-atf.bin: u-boot.bin bl31.bin 142 | @cp bl31.bin u-boot-atf.bin 143 | @dd if=u-boot.bin of=u-boot-atf.bin bs=1K seek=128 144 | 145 | u-boot-atf-tee.bin: u-boot.bin bl31.bin $(TEE) 146 | @cp bl31.bin u-boot-atf-tee.bin 147 | @dd if=$(TEE) of=u-boot-atf-tee.bin bs=1K seek=128 148 | @dd if=u-boot.bin of=u-boot-atf-tee.bin bs=1M seek=1 149 | 150 | .PHONY: clean 151 | clean: 152 | @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-ivt.itb u-boot-ddr4-evk.its $(OUTIMG) 153 | 154 | dtb = evk.dtb 155 | $(dtb): 156 | ./$(DTB_PREPROC) $(PLAT)-evk.dtb $(dtb) $(dtbs) 157 | 158 | u-boot.itb: $(dtb) $(supp_dtbs) 159 | ./$(PAD_IMAGE) $(TEE) 160 | ./$(PAD_IMAGE) bl31.bin 161 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs) 162 | BL32=$(TEE) DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh $(dtb) $(supp_dtbs) > u-boot.its 163 | ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot.its u-boot.itb 164 | @rm -f u-boot.its $(dtb) 165 | 166 | dtb_ddr3l = valddr3l.dtb 167 | $(dtb_ddr3l): 168 | ./$(DTB_PREPROC) $(PLAT)-ddr3l-$(VAL_BOARD).dtb $(dtb_ddr3l) $(dtbs) 169 | 170 | u-boot-ddr3l.itb: $(dtb_ddr3l) $(supp_dtbs) 171 | ./$(PAD_IMAGE) $(TEE) 172 | ./$(PAD_IMAGE) bl31.bin 173 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr3l) $(supp_dtbs) 174 | DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh $(dtb_ddr3l) $(supp_dtbs) > u-boot-ddr3l.its 175 | ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr3l.its u-boot-ddr3l.itb 176 | @rm -f u-boot.its $(dtb_ddr3l) 177 | 178 | dtb_ddr3l_evk = evkddr3l.dtb 179 | $(dtb_ddr3l_evk): 180 | ./$(DTB_PREPROC) $(PLAT)-ddr3l-evk.dtb $(dtb_ddr3l_evk) $(dtbs) 181 | 182 | u-boot-ddr3l-evk.itb: $(dtb_ddr3l_evk) $(supp_dtbs) 183 | ./$(PAD_IMAGE) $(TEE) 184 | ./$(PAD_IMAGE) bl31.bin 185 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr3l_evk) $(supp_dtbs) 186 | DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh $(dtb_ddr3l_evk) $(supp_dtbs) > u-boot-ddr3l-evk.its 187 | ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr3l-evk.its u-boot-ddr3l-evk.itb 188 | @rm -f u-boot.its $(dtb_ddr3l_evk) 189 | 190 | dtb_ddr4 = valddr4.dtb 191 | $(dtb_ddr4): 192 | ./$(DTB_PREPROC) $(PLAT)-ddr4-$(VAL_BOARD).dtb $(dtb_ddr4) $(dtbs) 193 | 194 | u-boot-ddr4.itb: $(dtb_ddr4) $(supp_dtbs) 195 | ./$(PAD_IMAGE) $(TEE) 196 | ./$(PAD_IMAGE) bl31.bin 197 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr4) $(supp_dtbs) 198 | DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh $(dtb_ddr4) $(supp_dtbs) > u-boot-ddr4.its 199 | ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr4.its u-boot-ddr4.itb 200 | @rm -f u-boot.its $(dtb_ddr4) 201 | 202 | dtb_ddr4_evk = evkddr4.dtb 203 | $(dtb_ddr4_evk): 204 | ./$(DTB_PREPROC) $(PLAT)-ddr4-evk.dtb $(dtb_ddr4_evk) $(dtbs) 205 | 206 | u-boot-ddr4-evk.itb: $(dtb_ddr4_evk) $(supp_dtbs) 207 | ./$(PAD_IMAGE) $(TEE) 208 | ./$(PAD_IMAGE) bl31.bin 209 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr4_evk) $(supp_dtbs) 210 | DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh $(dtb_ddr4_evk) $(supp_dtbs) > u-boot-ddr4-evk.its 211 | ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr4-evk.its u-boot-ddr4-evk.itb 212 | @rm -f u-boot.its $(dtb_ddr4_evk) 213 | 214 | ifeq ($(HDMI),yes) 215 | flash_evk: $(MKIMG) signed_hdmi_imx8m.bin u-boot-spl-ddr.bin u-boot.itb 216 | ./mkimage_imx8 -fit -signed_hdmi signed_hdmi_imx8m.bin -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -second_loader u-boot.itb 0x40200000 0x60000 -out $(OUTIMG) 217 | 218 | flash_evk_dual_bootloader: $(MKIMG) signed_hdmi_imx8m.bin u-boot-spl-ddr.bin u-boot.itb 219 | ./mkimage_imx8 -fit -signed_hdmi signed_hdmi_imx8m.bin -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -out $(OUTIMG) 220 | ./mkimage_imx8 -fit_ivt u-boot.itb 0x40200000 0x0 -out u-boot-ivt.itb 221 | 222 | flash_evk_emmc_fastboot: $(MKIMG) signed_hdmi_imx8m.bin u-boot-spl-ddr.bin u-boot.itb 223 | ./mkimage_imx8 -dev emmc_fastboot -fit -signed_hdmi signed_hdmi_imx8m.bin -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -second_loader u-boot.itb 0x40200000 0x60000 -out $(OUTIMG) 224 | 225 | flash_dp_evk: $(MKIMG) signed_dp_imx8m.bin u-boot-spl-ddr.bin u-boot.itb 226 | ./mkimage_imx8 -fit -signed_hdmi signed_dp_imx8m.bin -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -second_loader u-boot.itb 0x40200000 0x60000 -out $(OUTIMG) 227 | 228 | flash_ddr3l_val: $(MKIMG) signed_dp_imx8m.bin u-boot-spl-ddr3l.bin u-boot-ddr3l.itb 229 | ./mkimage_imx8 -fit -signed_hdmi signed_dp_imx8m.bin -loader u-boot-spl-ddr3l.bin $(SPL_LOAD_ADDR) -second_loader u-boot-ddr3l.itb 0x40200000 0x60000 -out $(OUTIMG) 230 | 231 | flash_ddr4_val: $(MKIMG) signed_hdmi_imx8m.bin u-boot-spl-ddr4.bin u-boot-ddr4.itb 232 | ./mkimage_imx8 -fit -signed_hdmi signed_hdmi_imx8m.bin -loader u-boot-spl-ddr4.bin $(SPL_LOAD_ADDR) -second_loader u-boot-ddr4.itb 0x40200000 0x60000 -out $(OUTIMG) 233 | 234 | else 235 | flash_evk: flash_evk_no_hdmi 236 | 237 | flash_evk_emmc_fastboot: flash_evk_no_hdmi_emmc_fastboot 238 | 239 | flash_ddr4_evk: flash_ddr4_evk_no_hdmi 240 | 241 | flash_ddr3l_evk: flash_ddr3l_evk_no_hdmi 242 | 243 | flash_ddr3l_val: flash_ddr3l_val_no_hdmi 244 | 245 | flash_ddr4_val: flash_ddr4_val_no_hdmi 246 | 247 | endif 248 | 249 | ifeq ($(TEE),tee.bin-stmm) 250 | KEY_EXISTS = $(shell find -maxdepth 1 -name "CRT.*") 251 | capsule_key: 252 | ifneq ($(KEY_EXISTS),) 253 | @echo "****************************************************************" 254 | @echo "Key $(KEY_EXISTS) already existed" 255 | @echo "If you not wanna use new Key, please not run target: capsule_key" 256 | @echo "Otherwise, please delete CRT.* and re-run capsule_key" 257 | @echo "****************************************************************" 258 | @exit 1 259 | endif 260 | openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=CRT/ -keyout CRT.key -out CRT.crt -nodes -days 365 261 | cert-to-efi-sig-list CRT.crt CRT.esl 262 | 263 | delete_capsule_key: 264 | @rm -rf CRT.* 265 | 266 | overlay: 267 | dtc -@ -I dts -O dtb -o signature.dtbo signature.dts 268 | fdtoverlay -i $(PLAT)-evk.dtb -o $(PLAT)-evk.dtb signature.dtbo 269 | 270 | 271 | flash_evk_stmm_capsule: overlay flash_evk 272 | ./mkeficapsule flash.bin --monotonic-count 1 \ 273 | --guid $(CAPSULE_GUID) \ 274 | --private-key CRT.key \ 275 | --certificate CRT.crt \ 276 | --index 1 --instance 0 \ 277 | capsule1.bin 278 | 279 | flash_evk_stmm: flash_evk 280 | endif 281 | 282 | 283 | flash_evk_no_hdmi: $(MKIMG) u-boot-spl-ddr.bin u-boot.itb 284 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -second_loader u-boot.itb 0x40200000 0x60000 -out $(OUTIMG) 285 | 286 | flash_evk_no_hdmi_dual_bootloader: $(MKIMG) u-boot-spl-ddr.bin u-boot.itb 287 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -out $(OUTIMG) 288 | ./mkimage_imx8 -fit_ivt u-boot.itb 0x40200000 0x0 -out u-boot-ivt.itb 289 | 290 | flash_evk_no_hdmi_emmc_fastboot: $(MKIMG) u-boot-spl-ddr.bin u-boot.itb 291 | ./mkimage_imx8 -version $(VERSION) -dev emmc_fastboot -fit -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -second_loader u-boot.itb 0x40200000 0x60000 -out $(OUTIMG) 292 | 293 | flash_ddr3l_val_no_hdmi: $(MKIMG) u-boot-spl-ddr3l.bin u-boot-ddr3l.itb 294 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr3l.bin $(SPL_LOAD_ADDR) -second_loader u-boot-ddr3l.itb 0x40200000 0x60000 -out $(OUTIMG) 295 | 296 | flash_ddr3l_evk_no_hdmi: $(MKIMG) u-boot-spl-ddr3l.bin u-boot-ddr3l-evk.itb 297 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr3l.bin $(SPL_LOAD_ADDR) -second_loader u-boot-ddr3l-evk.itb 0x40200000 0x60000 -out $(OUTIMG) 298 | 299 | flash_ddr4_val_no_hdmi: $(MKIMG) u-boot-spl-ddr4.bin u-boot-ddr4.itb 300 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr4.bin $(SPL_LOAD_ADDR) -second_loader u-boot-ddr4.itb 0x40200000 0x60000 -out $(OUTIMG) 301 | 302 | flash_ddr4_evk_no_hdmi: $(MKIMG) u-boot-spl-ddr4.bin u-boot-ddr4-evk.itb 303 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr4.bin $(SPL_LOAD_ADDR) -second_loader u-boot-ddr4-evk.itb 0x40200000 0x60000 -out $(OUTIMG) 304 | 305 | flash_ddr4_evk_no_hdmi_dual_bootloader: $(MKIMG) u-boot-spl-ddr4.bin u-boot-ddr4-evk.itb 306 | ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr4.bin $(SPL_LOAD_ADDR) -out $(OUTIMG) 307 | ./mkimage_imx8 -fit_ivt u-boot-ddr4-evk.itb 0x40200000 0x0 -out u-boot-ivt.itb 308 | 309 | flash_evk_flexspi: $(MKIMG) u-boot-spl-ddr.bin u-boot.itb 310 | ./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) 311 | ./$(QSPI_PACKER) $(QSPI_HEADER) 312 | 313 | flash_ddr3l_evk_flexspi: $(MKIMG) u-boot-spl-ddr3l.bin u-boot-ddr3l-evk.itb 314 | ./mkimage_imx8 -version $(VERSION) -dev flexspi -fit -loader u-boot-spl-ddr3l.bin $(SPL_FSPI_LOAD_ADDR) -second_loader u-boot-ddr3l-evk.itb 0x40200000 0x60000 -out $(OUTIMG) 315 | ./$(QSPI_PACKER) $(QSPI_HEADER) 316 | 317 | flash_ddr4_evk_flexspi: $(MKIMG) u-boot-spl-ddr4.bin u-boot-ddr4-evk.itb 318 | ./mkimage_imx8 -version $(VERSION) -dev flexspi -fit -loader u-boot-spl-ddr4.bin $(SPL_FSPI_LOAD_ADDR) -second_loader u-boot-ddr4-evk.itb 0x40200000 0x60000 -out $(OUTIMG) 319 | ./$(QSPI_PACKER) $(QSPI_HEADER) 320 | 321 | flash_hdmi_spl_uboot: flash_evk 322 | 323 | flash_dp_spl_uboot: flash_dp_evk 324 | 325 | flash_spl_uboot: flash_evk_no_hdmi 326 | 327 | print_fit_hab: u-boot-nodtb.bin bl31.bin $(dtb) $(supp_dtbs) 328 | ./$(PAD_IMAGE) $(TEE) 329 | ./$(PAD_IMAGE) bl31.bin 330 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs) 331 | FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) $(supp_dtbs) 332 | @rm -f $(dtb) 333 | 334 | print_fit_hab_ddr4: u-boot-nodtb.bin bl31.bin $(dtb_ddr4_evk) $(supp_dtbs) 335 | ./$(PAD_IMAGE) $(TEE) 336 | ./$(PAD_IMAGE) bl31.bin 337 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr4_evk) $(supp_dtbs) 338 | FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb_ddr4_evk) $(supp_dtbs) 339 | @rm -f $(dtb_ddr4_evk) 340 | 341 | print_fit_hab_flexspi: u-boot-nodtb.bin bl31.bin $(dtb) $(supp_dtbs) 342 | ./$(PAD_IMAGE) $(TEE) 343 | ./$(PAD_IMAGE) bl31.bin 344 | ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs) 345 | FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) BOOT_DEV="flexspi" ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) $(supp_dtbs) 346 | @rm -f $(dtb) 347 | 348 | nightly : 349 | @echo "Pulling nightly for $(PLAT) evk board from $(SERVER)/$(DIR)" 350 | @echo $(BUILD)-$(N)-$(PLAT) > nightly.txt 351 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/$(lpddr4_dmem_1d) -O $(lpddr4_dmem_1d) 352 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/$(lpddr4_imem_1d) -O $(lpddr4_imem_1d) 353 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/$(lpddr4_dmem_2d) -O $(lpddr4_dmem_2d) 354 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/$(lpddr4_imem_2d) -O $(lpddr4_imem_2d) 355 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/bl31-$(PLAT).bin -O bl31.bin 356 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/u-boot-spl.bin-$(PLAT)evk-sd -O u-boot-spl.bin 357 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/u-boot-nodtb.bin-$(PLAT)evk-sd -O u-boot-nodtb.bin 358 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/fsl-$(PLAT)-evk.dtb -O fsl-$(PLAT)-evk.dtb 359 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/signed_hdmi_imx8m.bin -O signed_hdmi_imx8m.bin 360 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/signed_dp_imx8m.bin -O signed_dp_imx8m.bin 361 | @$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/mkimage_uboot -O mkimage_uboot 362 | 363 | archive : 364 | git ls-files --others --exclude-standard -z | xargs -0 tar rvf $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 365 | bzip2 $(ARCHIVE_PATH)/$(ARCHIVE_NAME) 366 | 367 | #flash_dcd_uboot: $(MKIMG) $(DCD_CFG) u-boot-atf.bin 368 | # ./mkimage_imx8 -dcd $(DCD_CFG) -loader u-boot-atf.bin 0x40001000 -out $(OUTIMG) 369 | 370 | #flash_plugin: $(MKIMG) plugin.bin u-boot-spl-for-plugin.bin 371 | # ./mkimage_imx8 -plugin plugin.bin 0x912800 -loader u-boot-spl-for-plugin.bin 0x7F0000 -out $(OUTIMG) 372 | --------------------------------------------------------------------------------