blob: cbf1ea761077f4bf0dde17dc5a3173fedbff8262 [file] [log] [blame]
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03001.. SPDX-License-Identifier: GPL-2.0+
2
Viacheslav Bocharov6a9e8112024-02-27 09:54:06 +03003U-Boot for JetHub J100/J110 (A113X)
4===================================
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +03005
Viacheslav Bocharov6a9e8112024-02-27 09:54:06 +03006JetHome Jethub D1/D1+ (http://jethome.ru/jethub-d1p) is a home automation controller device
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +00007manufactured 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
Viacheslav Bocharov6a9e8112024-02-27 09:54:06 +030026 - Zigbee module one from:
27 - TI CC2538 + CC2592 Zigbee 3.0 Wireless
28 - TI CC2652P1 Zigbee 3.0 Wireless
29 - Silicon Labs EFT32MG21 Zigbee 3.0/Thread Wireless
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030030 - 1 x 1-Wire
31 - 2 x RS-485
32 - 4 x dry contact digital GPIO inputs
33 - 3 x relay GPIO outputs
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030034
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000035U-Boot Compilation
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030036------------------
37
38.. code-block:: bash
39
40 $ export CROSS_COMPILE=aarch64-none-elf-
41 $ make jethub_j100_defconfig
42 $ make
43
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000044U-Boot Signing with Pre-Built FIP repo
45--------------------------------------
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030046
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000047.. code-block:: bash
48
49 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
50 $ cd amlogic-boot-fip
51 $ mkdir my-output-dir
52 $ ./build-fip.sh jethub-j100 /path/to/u-boot/u-boot.bin my-output-dir
53
54U-Boot Manual Signing
55---------------------
Neil Armstrong2ea98682022-03-02 10:42:22 +010056
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000057Amlogic does not provide sources for the firmware and tools needed to create a bootloader
58image so it is necessary to obtain binaries from sources published by the board vendor:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030059
60.. code-block:: bash
61
62 $ git clone https://github.com/jethome-ru/jethub-aml-tools jethub-u-boot
63 $ cd jethub-u-boot
64 $ export FIPDIR=$PWD
65
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +000066Go back to the mainline U-Boot source tree then:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +030067
68.. code-block:: bash
69
70 $ mkdir fip
71
72 $ cp $FIPDIR/j100/bl2.bin fip/
73 $ cp $FIPDIR/j100/acs.bin fip/
74 $ cp $FIPDIR/j100/bl21.bin fip/
75 $ cp $FIPDIR/j100/bl30.bin fip/
76 $ cp $FIPDIR/j100/bl301.bin fip/
77 $ cp $FIPDIR/j100/bl31.img fip/
78 $ cp u-boot.bin fip/bl33.bin
79
80 $ $FIPDIR/blx_fix.sh \
81 fip/bl30.bin \
82 fip/zero_tmp \
83 fip/bl30_zero.bin \
84 fip/bl301.bin \
85 fip/bl301_zero.bin \
86 fip/bl30_new.bin \
87 bl30
88
89 $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
90
91 $ $FIPDIR/blx_fix.sh \
92 fip/bl2_acs.bin \
93 fip/zero_tmp \
94 fip/bl2_zero.bin \
95 fip/bl21.bin \
96 fip/bl21_zero.bin \
97 fip/bl2_new.bin \
98 bl2
99
100 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl30_new.bin \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000101 --output fip/bl30_new.bin.enc \
102 --level v3 --type bl30
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300103 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl31.img \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000104 --output fip/bl31.img.enc \
105 --level v3 --type bl31
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300106 $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000107 --output fip/bl33.bin.enc \
108 --level v3 --type bl33
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300109 $ $FIPDIR/j100/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000110 --output fip/bl2.n.bin.sig
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300111 $ $FIPDIR/j100/aml_encrypt_axg --bootmk \
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000112 --output fip/u-boot.bin \
113 --bl2 fip/bl2.n.bin.sig \
114 --bl30 fip/bl30_new.bin.enc \
115 --bl31 fip/bl31.img.enc \
116 --bl33 fip/bl33.bin.enc --level v3
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300117
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000118Then write U-Boot to SD or eMMC with:
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300119
120.. code-block:: bash
121
Christian Hewitt3e2a7fa2023-03-20 11:45:42 +0000122 $ DEV=/dev/boot_device
Vyacheslav Bocharove7afdd62021-09-20 11:40:16 +0300123 $ 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 +0000124 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440