blob: 86acdafa06f0aa822343a000c7614899c4cf66d5 [file] [log] [blame]
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +00003U-Boot for JetHub J100 (A113X)
4==============================
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03005
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +00006JetHome Jethub D1 (http://jethome.ru/jethub-d1) is a home automation controller device
7manufactured by JetHome with the following specifications:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03008
9 - Amlogic A113X (ARM Cortex-A53) quad-core up to 1.5GHz
10 - no video out
Vyacheslav Bocharov0cdb2be2022-04-26 08:26:33 +030011 - 512MB/1GB DDR3 or 2GB DDR4 SDRAM
12 - 8/16/32GB eMMC flash
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030013 - 1 x USB 2.0
14 - 1 x 10/100Mbps ethernet
Vyacheslav Bocharov0cdb2be2022-04-26 08:26:33 +030015 - WiFi / Bluetooth one from:
16 - AMPAK AP6255 (Broadcom BCM43455) IEEE 802.11a/b/g/n/ac, Bluetooth 4.2
17 - RTL8822CS IEEE 802.11a/b/g/n/ac, Bluetooth 5.0
18 - Amlogic W155S1 WiFi5 IEEE 802.11a/b/g/n/ac, Bluetooth 5.2
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030019 - 2 x gpio LEDS
20 - GPIO user Button
Vyacheslav Bocharov0cdb2be2022-04-26 08:26:33 +030021 - DC source with a voltage of 9 to 56 V / Passive POE
22 - DIN Rail Mounting case
23
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000024The basic version also has:
Vyacheslav Bocharov0cdb2be2022-04-26 08:26:33 +030025
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000026 - TI CC2538 + CC2592 Zigbee Wireless with upto 20dBm output power and Zigbee 3.0
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030027 - 1 x 1-Wire
28 - 2 x RS-485
29 - 4 x dry contact digital GPIO inputs
30 - 3 x relay GPIO outputs
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030031
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000032U-Boot Compilation
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030033------------------
34
35.. code-block:: bash
36
37 $ export CROSS_COMPILE=aarch64-none-elf-
38 $ make jethub_j100_defconfig
39 $ make
40
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000041U-Boot Signing with Pre-Built FIP repo
42--------------------------------------
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030043
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000044.. code-block:: bash
45
46 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
47 $ cd amlogic-boot-fip
48 $ mkdir my-output-dir
49 $ ./build-fip.sh jethub-j100 /path/to/u-boot/u-boot.bin my-output-dir
50
51U-Boot Manual Signing
52---------------------
Neil Armstrong2ea98682022-03-02 10:42:22 +010053
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000054Amlogic does not provide sources for the firmware and tools needed to create a bootloader
55image so it is necessary to obtain binaries from sources published by the board vendor:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030056
57.. code-block:: bash
58
59 $ git clone https://github.com/jethome-ru/jethub-aml-tools jethub-u-boot
60 $ cd jethub-u-boot
61 $ export FIPDIR=$PWD
62
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000063Go back to the mainline U-Boot source tree then:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030064
65.. code-block:: bash
66
67 $ mkdir fip
68
69 $ cp $FIPDIR/j100/bl2.bin fip/
70 $ cp $FIPDIR/j100/acs.bin fip/
71 $ cp $FIPDIR/j100/bl21.bin fip/
72 $ cp $FIPDIR/j100/bl30.bin fip/
73 $ cp $FIPDIR/j100/bl301.bin fip/
74 $ cp $FIPDIR/j100/bl31.img fip/
75 $ cp u-boot.bin fip/bl33.bin
76
77 $ $FIPDIR/blx_fix.sh \
78 fip/bl30.bin \
79 fip/zero_tmp \
80 fip/bl30_zero.bin \
81 fip/bl301.bin \
82 fip/bl301_zero.bin \
83 fip/bl30_new.bin \
84 bl30
85
86 $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
87
88 $ $FIPDIR/blx_fix.sh \
89 fip/bl2_acs.bin \
90 fip/zero_tmp \
91 fip/bl2_zero.bin \
92 fip/bl21.bin \
93 fip/bl21_zero.bin \
94 fip/bl2_new.bin \
95 bl2
96
97 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000098 --output fip/bl30_new.bin.enc \
99 --level v3 --type bl30
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300100 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl31.img \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000101 --output fip/bl31.img.enc \
102 --level v3 --type bl31
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300103 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000104 --output fip/bl33.bin.enc \
105 --level v3 --type bl33
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300106 $ $FIPDIR/j100/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000107 --output fip/bl2.n.bin.sig
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300108 $ $FIPDIR/j100/aml_encrypt_axg --bootmk \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000109 --output fip/u-boot.bin \
110 --bl2 fip/bl2.n.bin.sig \
111 --bl30 fip/bl30_new.bin.enc \
112 --bl31 fip/bl31.img.enc \
113 --bl33 fip/bl33.bin.enc --level v3
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300114
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000115Then write U-Boot to SD or eMMC with:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300116
117.. code-block:: bash
118
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000119 $ DEV=/dev/boot_device
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300120 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000121 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440