blob: 922ab0c0b408be11b2d89d0de8e882819c4e083b [file] [log] [blame]
Neil Armstrong0ce36392020-06-11 10:53:49 +02001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewitt1181e202023-03-20 11:45:51 +00003U-Boot for ODROID-C2 (S905)
4===========================
Neil Armstrong0ce36392020-06-11 10:53:49 +02005
Christian Hewitt1181e202023-03-20 11:45:51 +00006ODROID-C2 is a single board computer manufactured by Hardkernel with the following
7specifications:
Neil Armstrong0ce36392020-06-11 10:53:49 +02008
Christian Hewitt1181e202023-03-20 11:45:51 +00009 - Amlogic S905 ARM Cortex-A53 quad-core SoC @ 1.5GHz
Neil Armstrong0ce36392020-06-11 10:53:49 +020010 - ARM Mali 450 GPU
11 - 2GB DDR3 SDRAM
12 - Gigabit Ethernet
13 - HDMI 2.0 4K/60Hz display
14 - 40-pin GPIO header
15 - 4 x USB 2.0 Host, 1 x USB OTG
16 - eMMC, microSD
17 - Infrared receiver
18
Christian Hewitt1181e202023-03-20 11:45:51 +000019Schematics are available on the manufacturer website: https://wiki.odroid.com
Neil Armstrong0ce36392020-06-11 10:53:49 +020020
Christian Hewitt1181e202023-03-20 11:45:51 +000021U-Boot Compilation
Neil Armstrong0ce36392020-06-11 10:53:49 +020022------------------
23
24.. code-block:: bash
25
26 $ export CROSS_COMPILE=aarch64-none-elf-
27 $ make odroid-c2_defconfig
28 $ make
29
Christian Hewitt1181e202023-03-20 11:45:51 +000030U-Boot Signing with Pre-Built FIP repo
31--------------------------------------
Neil Armstrong0ce36392020-06-11 10:53:49 +020032
Christian Hewitt1181e202023-03-20 11:45:51 +000033.. code-block:: bash
Neil Armstrong4c605122022-03-02 10:42:22 +010034
Christian Hewitt1181e202023-03-20 11:45:51 +000035 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
36 $ cd amlogic-boot-fip
37 $ mkdir my-output-dir
38 $ ./build-fip.sh odroid-c2 /path/to/u-boot/u-boot.bin my-output-dir
39
40U-Boot Manual Signing
41---------------------
42
43Amlogic does not provide sources for the firmware and tools needed to create a bootloader
44image so it is necessary to obtain binaries from sources published by the board vendor:
Neil Armstrong0ce36392020-06-11 10:53:49 +020045
46.. code-block:: bash
47
48 $ DIR=odroid-c2
Christian Hewitt1181e202023-03-20 11:45:51 +000049 $ git clone --depth 1 https://github.com/hardkernel/u-boot.git -b odroidc2-v2015.01 $DIR
50
Neil Armstrong0ce36392020-06-11 10:53:49 +020051 $ $DIR/fip/fip_create --bl30 $DIR/fip/gxb/bl30.bin \
Christian Hewitt1181e202023-03-20 11:45:51 +000052 --bl301 $DIR/fip/gxb/bl301.bin \
53 --bl31 $DIR/fip/gxb/bl31.bin \
54 --bl33 u-boot.bin \
55 $DIR/fip.bin
56
Neil Armstrong0ce36392020-06-11 10:53:49 +020057 $ $DIR/fip/fip_create --dump $DIR/fip.bin
58 $ cat $DIR/fip/gxb/bl2.package $DIR/fip.bin > $DIR/boot_new.bin
59 $ $DIR/fip/gxb/aml_encrypt_gxb --bootsig \
Christian Hewitt1181e202023-03-20 11:45:51 +000060 --input $DIR/boot_new.bin \
61 --output $DIR/u-boot.img
Neil Armstrong0ce36392020-06-11 10:53:49 +020062 $ dd if=$DIR/u-boot.img of=$DIR/u-boot.gxbb bs=512 skip=96
63
Christian Hewitt1181e202023-03-20 11:45:51 +000064Then write U-Boot to SD or eMMC with:
Neil Armstrong0ce36392020-06-11 10:53:49 +020065
66.. code-block:: bash
67
Christian Hewitt1181e202023-03-20 11:45:51 +000068 $ DEV=/dev/your_boot_device
Neil Armstrong0ce36392020-06-11 10:53:49 +020069 $ BL1=$DIR/sd_fuse/bl1.bin.hardkernel
70 $ dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
71 $ dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
72 $ dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97