blob: 9195df690502056d7455996564555b660bed9227 [file] [log] [blame]
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewitt6cb82142023-03-20 11:45:43 +00003U-Boot for JetHub J80 (S905W)
4=============================
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03005
Christian Hewitt6cb82142023-03-20 11:45:43 +00006JetHome Jethub H1 (http://jethome.ru/jethub-h1) is a home automation controller device
7manufactured by JetHome with the following specifications:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03008
9 - Amlogic S905W (ARM Cortex-A53) quad-core up to 1.5GHz
10 - No video out
11 - 1GB DDR3
12 - 8/16GB eMMC flash
13 - 2 x USB 2.0
14 - 1 x 10/100Mbps ethernet
15 - SDIO WiFi / Bluetooth RTL8822CS IEEE 802.11a/b/g/n/ac, Bluetooth 5.0.
16 - TI CC2538 + CC2592 Zigbee Wireless Module with up to 20dBm output
17 power and Zigbee 3.0 support.
18 - MicroSD 2.x/3.x/4.x DS/HS cards.
19 - 1 x gpio LED
20 - ADC user Button
21 - DC source 5V microUSB
22 - Square plastic case
23
Christian Hewitt6cb82142023-03-20 11:45:43 +000024U-Boot Compilation
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030025------------------
26
27.. code-block:: bash
28
29 $ export CROSS_COMPILE=aarch64-none-elf-
30 $ make jethub_j80_defconfig
31 $ make
32
Christian Hewitt6cb82142023-03-20 11:45:43 +000033U-Boot Signing with Pre-Built FIP repo
34--------------------------------------
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030035
Christian Hewitt6cb82142023-03-20 11:45:43 +000036.. code-block:: bash
37
38 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
39 $ cd amlogic-boot-fip
40 $ mkdir my-output-dir
41 $ ./build-fip.sh jethub-j80 /path/to/u-boot/u-boot.bin my-output-dir
42
43U-Boot Manual Signing
44---------------------
Neil Armstrong2ea98682022-03-02 10:42:22 +010045
Christian Hewitt6cb82142023-03-20 11:45:43 +000046Amlogic does not provide sources for the firmware and tools needed to create a bootloader
47image so it is necessary to obtain binaries from sources published by the board vendor:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030048
49.. code-block:: bash
50
51 $ git clone https://github.com/jethome-ru/jethub-aml-tools jethub-u-boot
52 $ cd jethub-u-boot
53 $ export FIPDIR=$PWD
54
Christian Hewitt6cb82142023-03-20 11:45:43 +000055Go back to the mainline U-Boot source tree then:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030056
57.. code-block:: bash
58
59 $ mkdir fip
60
61 $ cp $FIPDIR/j80/bl2.bin fip/
62 $ cp $FIPDIR/j80/acs.bin fip/
63 $ cp $FIPDIR/j80/bl21.bin fip/
64 $ cp $FIPDIR/j80/bl30.bin fip/
65 $ cp $FIPDIR/j80/bl301.bin fip/
66 $ cp $FIPDIR/j80/bl31.img fip/
67 $ cp u-boot.bin fip/bl33.bin
68
69 $ $FIPDIR/blx_fix.sh \
70 fip/bl30.bin \
71 fip/zero_tmp \
72 fip/bl30_zero.bin \
73 fip/bl301.bin \
74 fip/bl301_zero.bin \
75 fip/bl30_new.bin \
76 bl30
77
78 $ python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
79
80 $ $FIPDIR/blx_fix.sh \
81 fip/bl2_acs.bin \
82 fip/zero_tmp \
83 fip/bl2_zero.bin \
84 fip/bl21.bin \
85 fip/bl21_zero.bin \
86 fip/bl2_new.bin \
87 bl2
88
89 $ $FIPDIR/j80/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
90 $ $FIPDIR/j80/aml_encrypt_gxl --bl3enc --input fip/bl31.img
91 $ $FIPDIR/j80/aml_encrypt_gxl --bl3enc --input fip/bl33.bin --compress lz4
92 $ $FIPDIR/j80/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
93 $ $FIPDIR/j80/aml_encrypt_gxl --bootmk \
Christian Hewitt6cb82142023-03-20 11:45:43 +000094 --output fip/u-boot.bin \
95 --bl2 fip/bl2.n.bin.sig \
96 --bl30 fip/bl30_new.bin.enc \
97 --bl31 fip/bl31.img.enc \
98 --bl33 fip/bl33.bin.enc
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030099
Christian Hewitt6cb82142023-03-20 11:45:43 +0000100Then write U-Boot to SD or eMMC with:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300101
102.. code-block:: bash
103
Christian Hewitt6cb82142023-03-20 11:45:43 +0000104 $ DEV=/dev/boot_device
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300105 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
Christian Hewitt6cb82142023-03-20 11:45:43 +0000106 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440