Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 3 | U-Boot for JetHub J100 (A113X) |
| 4 | ============================== |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 5 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 6 | JetHome Jethub D1 (http://jethome.ru/jethub-d1) is a home automation controller device |
| 7 | manufactured by JetHome with the following specifications: |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 8 | |
| 9 | - Amlogic A113X (ARM Cortex-A53) quad-core up to 1.5GHz |
| 10 | - no video out |
Vyacheslav Bocharov | 0cdb2be | 2022-04-26 08:26:33 +0300 | [diff] [blame] | 11 | - 512MB/1GB DDR3 or 2GB DDR4 SDRAM |
| 12 | - 8/16/32GB eMMC flash |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 13 | - 1 x USB 2.0 |
| 14 | - 1 x 10/100Mbps ethernet |
Vyacheslav Bocharov | 0cdb2be | 2022-04-26 08:26:33 +0300 | [diff] [blame] | 15 | - 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 Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 19 | - 2 x gpio LEDS |
| 20 | - GPIO user Button |
Vyacheslav Bocharov | 0cdb2be | 2022-04-26 08:26:33 +0300 | [diff] [blame] | 21 | - DC source with a voltage of 9 to 56 V / Passive POE |
| 22 | - DIN Rail Mounting case |
| 23 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 24 | The basic version also has: |
Vyacheslav Bocharov | 0cdb2be | 2022-04-26 08:26:33 +0300 | [diff] [blame] | 25 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 26 | - TI CC2538 + CC2592 Zigbee Wireless with upto 20dBm output power and Zigbee 3.0 |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 27 | - 1 x 1-Wire |
| 28 | - 2 x RS-485 |
| 29 | - 4 x dry contact digital GPIO inputs |
| 30 | - 3 x relay GPIO outputs |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 31 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 32 | U-Boot Compilation |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 33 | ------------------ |
| 34 | |
| 35 | .. code-block:: bash |
| 36 | |
| 37 | $ export CROSS_COMPILE=aarch64-none-elf- |
| 38 | $ make jethub_j100_defconfig |
| 39 | $ make |
| 40 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 41 | U-Boot Signing with Pre-Built FIP repo |
| 42 | -------------------------------------- |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 43 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 44 | .. 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 | |
| 51 | U-Boot Manual Signing |
| 52 | --------------------- |
Neil Armstrong | 2ea9868 | 2022-03-02 10:42:22 +0100 | [diff] [blame] | 53 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 54 | Amlogic does not provide sources for the firmware and tools needed to create a bootloader |
| 55 | image so it is necessary to obtain binaries from sources published by the board vendor: |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 56 | |
| 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 Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 63 | Go back to the mainline U-Boot source tree then: |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 64 | |
| 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 Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 98 | --output fip/bl30_new.bin.enc \ |
| 99 | --level v3 --type bl30 |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 100 | $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl31.img \ |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 101 | --output fip/bl31.img.enc \ |
| 102 | --level v3 --type bl31 |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 103 | $ $FIPDIR/j100/aml_encrypt_axg --bl3sig --input fip/bl33.bin --compress lz4 \ |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 104 | --output fip/bl33.bin.enc \ |
| 105 | --level v3 --type bl33 |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 106 | $ $FIPDIR/j100/aml_encrypt_axg --bl2sig --input fip/bl2_new.bin \ |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 107 | --output fip/bl2.n.bin.sig |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 108 | $ $FIPDIR/j100/aml_encrypt_axg --bootmk \ |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 109 | --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 Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 114 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 115 | Then write U-Boot to SD or eMMC with: |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 116 | |
| 117 | .. code-block:: bash |
| 118 | |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 119 | $ DEV=/dev/boot_device |
Vyacheslav Bocharov | e7afdd6 | 2021-09-20 11:40:16 +0300 | [diff] [blame] | 120 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 |
Christian Hewitt | 3e2a7fa | 2023-03-20 11:45:42 +0000 | [diff] [blame] | 121 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 |