1 U-Boot for Khadas VIM3L
2 =======================
4 Khadas VIM3L is a single board computer manufactured by Shenzhen Wesion
5 Technology Co., Ltd. with the following specifications:
7 - Amlogic S905D3 Arm Cortex-A55 quad-core SoC
12 - 1 x USB 3.0 Host, 1 x USB 2.0 Host
17 Schematics are available on the manufacturer website.
19 Currently the U-Boot port supports the following devices:
33 > export CROSS_COMPILE=aarch64-none-elf-
34 > make khadas-vim3l_defconfig
40 Amlogic doesn't provide sources for the firmware and for tools needed
41 to create the bootloader image, so it is necessary to obtain them from
42 the git tree published by the board vendor:
44 > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
45 > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
46 > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
47 > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
48 > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
51 > git clone --depth 1 \
52 https://github.com/khadas/u-boot.git -b khadas-vims-v2015.01 \
56 > make kvim3l_defconfig
58 > export UBOOTDIR=$PWD
60 Go back to mainline U-Boot source tree then :
63 > cp $UBOOTDIR/build/scp_task/bl301.bin fip/
64 > cp $UBOOTDIR/build/board/khadas/kvim3l/firmware/acs.bin fip/
65 > cp $UBOOTDIR/fip/g12a/bl2.bin fip/
66 > cp $UBOOTDIR/fip/g12a/bl30.bin fip/
67 > cp $UBOOTDIR/fip/g12a/bl31.img fip/
68 > cp $UBOOTDIR/fip/g12a/ddr3_1d.fw fip/
69 > cp $UBOOTDIR/fip/g12a/ddr4_1d.fw fip/
70 > cp $UBOOTDIR/fip/g12a/ddr4_2d.fw fip/
71 > cp $UBOOTDIR/fip/g12a/diag_lpddr4.fw fip/
72 > cp $UBOOTDIR/fip/g12a/lpddr3_1d.fw fip/
73 > cp $UBOOTDIR/fip/g12a/lpddr4_1d.fw fip/
74 > cp $UBOOTDIR/fip/g12a/lpddr4_2d.fw fip/
75 > cp $UBOOTDIR/fip/g12a/piei.fw fip/
76 > cp $UBOOTDIR/fip/g12a/aml_ddr.fw fip/
77 > cp u-boot.bin fip/bl33.bin
97 > $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
98 --output fip/bl30_new.bin.g12a.enc \
100 > $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
101 --output fip/bl30_new.bin.enc \
102 --level v3 --type bl30
103 > $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
104 --output fip/bl31.img.enc \
105 --level v3 --type bl31
106 > $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
107 --output fip/bl33.bin.enc \
108 --level v3 --type bl33 --compress lz4
109 > $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
110 --output fip/bl2.n.bin.sig
111 > $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \
112 --output fip/u-boot.bin \
113 --bl2 fip/bl2.n.bin.sig \
114 --bl30 fip/bl30_new.bin.enc \
115 --bl31 fip/bl31.img.enc \
116 --bl33 fip/bl33.bin.enc \
117 --ddrfw1 fip/ddr4_1d.fw \
118 --ddrfw2 fip/ddr4_2d.fw \
119 --ddrfw3 fip/ddr3_1d.fw \
120 --ddrfw4 fip/piei.fw \
121 --ddrfw5 fip/lpddr4_1d.fw \
122 --ddrfw6 fip/lpddr4_2d.fw \
123 --ddrfw7 fip/diag_lpddr4.fw \
124 --ddrfw8 fip/aml_ddr.fw \
125 --ddrfw9 fip/lpddr3_1d.fw \
128 and then write the image to SD with:
130 > DEV=/dev/your_sd_device
131 > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
132 > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444