1 .. SPDX-License-Identifier: GPL-2.0+
3 U-Boot for Khadas VIM3L
4 =======================
6 Khadas VIM3L is a single board computer manufactured by Shenzhen Wesion
7 Technology Co., Ltd. with the following specifications:
9 - Amlogic S905D3 Arm Cortex-A55 quad-core SoC
14 - 1 x USB 3.0 Host, 1 x USB 2.0 Host
19 Schematics are available on the manufacturer website.
23 The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential
24 lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between
25 an USB3.0 Type A connector and a M.2 Key M slot.
26 The PHY driving these differential lines is shared between
27 the USB3.0 controller and the PCIe Controller, thus only
28 a single controller can use it.
30 To setup for PCIe, run the following commands from U-Boot:
37 Then power-cycle the board.
39 To set back to USB3.0, run the following commands from U-Boot:
46 Then power-cycle the board.
53 $ export CROSS_COMPILE=aarch64-none-elf-
54 $ make khadas-vim3l_defconfig
60 For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `khadas-vim3l`
62 Amlogic doesn't provide sources for the firmware and for tools needed
63 to create the bootloader image, so it is necessary to obtain them from
64 the git tree published by the board vendor:
68 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
69 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
70 $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
71 $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
72 $ 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
75 $ git clone --depth 1 \
76 https://github.com/khadas/u-boot.git -b khadas-vims-v2015.01 \
80 $ make kvim3l_defconfig
81 $ make CROSS_COMPILE=aarch64-none-elf-
82 $ export UBOOTDIR=$PWD
84 Go back to mainline U-Boot source tree then :
90 $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
91 $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/
92 $ cp $UBOOTDIR/build/board/khadas/kvim3l/firmware/acs.bin fip/
93 $ cp $UBOOTDIR/fip/g12a/bl2.bin fip/
94 $ cp $UBOOTDIR/fip/g12a/bl30.bin fip/
95 $ cp $UBOOTDIR/fip/g12a/bl31.img fip/
96 $ cp $UBOOTDIR/fip/g12a/ddr3_1d.fw fip/
97 $ cp $UBOOTDIR/fip/g12a/ddr4_1d.fw fip/
98 $ cp $UBOOTDIR/fip/g12a/ddr4_2d.fw fip/
99 $ cp $UBOOTDIR/fip/g12a/diag_lpddr4.fw fip/
100 $ cp $UBOOTDIR/fip/g12a/lpddr3_1d.fw fip/
101 $ cp $UBOOTDIR/fip/g12a/lpddr4_1d.fw fip/
102 $ cp $UBOOTDIR/fip/g12a/lpddr4_2d.fw fip/
103 $ cp $UBOOTDIR/fip/g12a/piei.fw fip/
104 $ cp $UBOOTDIR/fip/g12a/aml_ddr.fw fip/
105 $ cp u-boot.bin fip/bl33.bin
107 $ bash fip/blx_fix.sh \
116 $ bash fip/blx_fix.sh \
125 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
126 --output fip/bl30_new.bin.g12a.enc \
128 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
129 --output fip/bl30_new.bin.enc \
130 --level v3 --type bl30
131 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
132 --output fip/bl31.img.enc \
133 --level v3 --type bl31
134 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
135 --output fip/bl33.bin.enc \
136 --level v3 --type bl33 --compress lz4
137 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
138 --output fip/bl2.n.bin.sig
139 $ $UBOOTDIR/fip/g12a/aml_encrypt_g12a --bootmk \
140 --output fip/u-boot.bin \
141 --bl2 fip/bl2.n.bin.sig \
142 --bl30 fip/bl30_new.bin.enc \
143 --bl31 fip/bl31.img.enc \
144 --bl33 fip/bl33.bin.enc \
145 --ddrfw1 fip/ddr4_1d.fw \
146 --ddrfw2 fip/ddr4_2d.fw \
147 --ddrfw3 fip/ddr3_1d.fw \
148 --ddrfw4 fip/piei.fw \
149 --ddrfw5 fip/lpddr4_1d.fw \
150 --ddrfw6 fip/lpddr4_2d.fw \
151 --ddrfw7 fip/diag_lpddr4.fw \
152 --ddrfw8 fip/aml_ddr.fw \
153 --ddrfw9 fip/lpddr3_1d.fw \
156 and then write the image to SD with:
160 $ DEV=/dev/your_sd_device
161 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
162 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444