iMX93 uboot合成步骤说明

This section is uboot combine steps, you can also follow the file "AN14093-Fast Boot on i.MX 8M and i.MX9 using Falon Mode and kernel.pdf".

My host machine operation system is ubuntu22.04 LTS.

1. Install the required dependencies,the gcc-aarch64 tools will be installed in PATH: /usr/bin

$ sudo apt install gcc-aarch64-linux-gnu

2. Download the required sources. cause we use the v6.1.22 Linux Version, so choose the sources "lf-6.1.22-2.0.0" git branch.

Download imx-mkimage, mkimage is a tool, which combines the SPL, U-Boot proper, ATF and DDR firmware into a single image.

$ sudo clone https://github.com/nxp-imx/imx-mkimage
$ cd imx-mkimage
$ git checkout lf-6.1.22-2.0.0

Download ATF,ATF-Arm Trusted Firmware is a reference implementation of secure world software for Arm A-Profile architectures(Armv8-A and Armv7-A),including an Excepation Level 3 Secure Monitor.It provides a suitable starting point for productization of secure world boot and runtime firmware, in either the AArch32 or AArch64 execution states.

$ git clone https://github.com/nxp-imx/uboot-imx
$ cd uboot-imx
$ git checkout lf-6.1.22-2.0.0

Download U-Boot, we can use NXP offical git sources, as below. I use the MYIR uboot sources, there is no dirrerent.

$ git clone https://github.com/nxp-imx/uboot-imx
$ cd uboot-imx
$ git checkout lf-6.1.22-2.0.0

Download Linux kernel, we use the myir linux kernel.

$ git clone https://github.com/nxp-imx/linux-imx
$ cd linux-imx
$ git checkout lf-6.1.22-2.0.0

Download the double data rate(DDR)firmware

$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.21.bin
$ chmod +x firmware-imx-8.21.bin
$ ./firmware-imx-8.21.bin

[Only for i.MX 93] Download the EdgeLock Secure Enclave (ELE) firmware

$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.9.bin
$ chmod +x firmware-sentinel-0.9.bin
$ ./firmware-sentinel-0.9.bin

 

3. Build the images
Build the Arm Trusted Firmware

$ make clean PLAT=imx93 CROSS_COMPILE=aarch64-linux-gnu-
$ make PLAT=imx93 CROSS_COMPILE=aarch64-linux-gnu- bl31The generated binary is located in the build/imx93/release/bl31.bin

OK,we have got all the pieces, now we can combine the u-boot:
1) Copy bl31.bin from ATF(build/imx93/release/)to imx_mkimage/iMX9/.
2) Copy all lpddr4* files from firmware-imx-8.21/firmware/ddr/synopsys/ to imx_mkimage/iMX9/.
3) [Only for i.MX 93] Copy the image of the ELE firmware container mx93a0-ahab-container.img of the firmware-sentinel to imx-mkimage/iMX9/.
4) Compile the U-Boot and then copy u-boot*.bin and spl/u-boot-spl*.bin into imx-mkimage/iMX9/.
5) Copy imx93-11x11-evk.dtb for (i.MX 93 11x11 LPDDR4 EVK) from uboot-imx/arch/arm/dts/ to imx-mkimage/<platform>/. Attention: the dtb file must be named "imx93-11x11-evk.dtb"!
6) Copy mkimage from uboot-imx/tools/ into imx-mkimage/iMX9/, renaming into mkimage_uboot.
7)Generate the coplete U-Boot image: flash.bin

$ cd imx-mkimage
$ make SOC=iMX9 flash_singleboot

The generated binary is located int the imx-mkimage/iMX9/flash.bin


4. Burner flash.bin int SOC
Connect Soc board to PC with USB-TypeC line,  use uuu tool to burne uboot. Command as below:

$sudo uuu -b emmc flash.bin

 



 

posted @ 2023-11-27 14:47  yu_chun_de_ren_lei  阅读(50)  评论(0)    收藏  举报