blob: 53213fdb683058544173e8703440ad21f5ea19dd [file] [log] [blame]
Neil Armstrong84e5e8e2020-06-11 10:53:49 +02001.. SPDX-License-Identifier: GPL-2.0+
2
3U-Boot for Amlogic U200
4=======================
5
6U200 is a reference board manufactured by Amlogic with the following
7specifications:
8
9 - Amlogic S905D2 ARM Cortex-A53 quad-core SoC
10 - 2GB DDR4 SDRAM
11 - 10/100 Ethernet (Internal PHY)
12 - 1 x USB 3.0 Host
13 - eMMC
14 - SDcard
15 - Infrared receiver
16 - SDIO WiFi Module
17 - MIPI DSI Connector
18 - Audio HAT Connector
19 - PCI-E M.2 Connector
20
21Schematics are available from Amlogic on demand.
22
23U-Boot compilation
24------------------
25
26.. code-block:: bash
27
28 $ export CROSS_COMPILE=aarch64-none-elf-
29 $ make u200_defconfig
30 $ make
31
32Image creation
33--------------
34
Neil Armstrong2ea98682022-03-02 10:42:22 +010035For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `u200`
36
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020037Amlogic doesn't provide sources for the firmware and for tools needed
38to create the bootloader image, so it is necessary to obtain them from
39the git tree published by the board vendor:
40
41.. code-block:: bash
42
43 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
44 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
45 $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
46 $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
47 $ 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
48 $ git clone https://github.com/BayLibre/u-boot.git -b buildroot-openlinux-20180418 amlogic-u-boot
49 $ cd amlogic-u-boot
50 $ make g12a_u200_v1_defconfig
51 $ make
52 $ export UBOOTDIR=$PWD
53
54Download the latest Amlogic Buildroot package, and extract it :
55
56.. code-block:: bash
57
58 $ wget http://openlinux2.amlogic.com:8000/ARM/filesystem/Linux_BSP/buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz
59 $ tar xfz buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz buildroot_openlinux_kernel_4.9_fbdev_20180706/bootloader
60 $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706
61 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip
62
63Go back to mainline U-Boot source tree then :
64
65.. code-block:: bash
66
67 $ mkdir fip
68
69 $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
70 $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/
71 $ cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/
72 $ cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/
73 $ cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin fip/
74 $ cp $BRDIR/bootloader/uboot-repo/bl31_1.3/bin/g12a/bl31.img fip/
75 $ cp $FIPDIR/g12a/ddr3_1d.fw fip/
76 $ cp $FIPDIR/g12a/ddr4_1d.fw fip/
77 $ cp $FIPDIR/g12a/ddr4_2d.fw fip/
78 $ cp $FIPDIR/g12a/diag_lpddr4.fw fip/
79 $ cp $FIPDIR/g12a/lpddr4_1d.fw fip/
80 $ cp $FIPDIR/g12a/lpddr4_2d.fw fip/
81 $ cp $FIPDIR/g12a/piei.fw fip/
82 $ cp u-boot.bin fip/bl33.bin
83
84 $ sh fip/blx_fix.sh \
85 fip/bl30.bin \
86 fip/zero_tmp \
87 fip/bl30_zero.bin \
88 fip/bl301.bin \
89 fip/bl301_zero.bin \
90 fip/bl30_new.bin \
91 bl30
92
93 $ sh fip/blx_fix.sh \
94 fip/bl2.bin \
95 fip/zero_tmp \
96 fip/bl2_zero.bin \
97 fip/acs.bin \
98 fip/bl21_zero.bin \
99 fip/bl2_new.bin \
100 bl2
101
102 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
103 --output fip/bl30_new.bin.g12a.enc \
104 --level v3
105 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
106 --output fip/bl30_new.bin.enc \
107 --level v3 --type bl30
108 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
109 --output fip/bl31.img.enc \
110 --level v3 --type bl31
111 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
112 --output fip/bl33.bin.enc \
113 --level v3 --type bl33
114 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
115 --output fip/bl2.n.bin.sig
116 $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \
117 --output fip/u-boot.bin \
118 --bl2 fip/bl2.n.bin.sig \
119 --bl30 fip/bl30_new.bin.enc \
120 --bl31 fip/bl31.img.enc \
121 --bl33 fip/bl33.bin.enc \
122 --ddrfw1 fip/ddr4_1d.fw \
123 --ddrfw2 fip/ddr4_2d.fw \
124 --ddrfw3 fip/ddr3_1d.fw \
125 --ddrfw4 fip/piei.fw \
126 --ddrfw5 fip/lpddr4_1d.fw \
127 --ddrfw6 fip/lpddr4_2d.fw \
128 --ddrfw7 fip/diag_lpddr4.fw \
129 --level v3
130
131and then write the image to SD with:
132
133.. code-block:: bash
134
135 $ DEV=/dev/your_sd_device
136 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
137 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444