Peter Griffin | 6de280f | 2015-07-30 18:55:24 +0100 | [diff] [blame^] | 1 | Introduction |
| 2 | ============ |
| 3 | |
| 4 | HiKey is the first certified 96Boards Consumer Edition board. The board/SoC has: - |
| 5 | * HiSilicon Kirin 6220 eight-core ARM Cortex-A53 64-bit SoC running at 1.2GHz. |
| 6 | * ARM Mali 450-MP4 GPU |
| 7 | * 1GB 800MHz LPDDR3 DRAM |
| 8 | * 4GB eMMC Flash Storage |
| 9 | * microSD |
| 10 | * 802.11a/b/g/n WiFi, Bluetooth |
| 11 | |
| 12 | The HiKey schematic can be found here: - |
| 13 | https://github.com/96boards/documentation/blob/master/hikey/96Boards-Hikey-Rev-A1.pdf |
| 14 | |
| 15 | A SoC datasheet can be found here: - |
| 16 | https://github.com/96boards/documentation/blob/master/hikey/ |
| 17 | Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf |
| 18 | |
| 19 | Currently the u-boot port supports: - |
| 20 | * USB |
| 21 | * eMMC |
| 22 | * SD card |
| 23 | * GPIO |
| 24 | |
| 25 | Compile u-boot |
| 26 | ============== |
| 27 | |
| 28 | make CROSS_COMPILE=aarch64-linux-gnu- hikey_config |
| 29 | make CROSS_COMPILE=aarch64-linux-gnu- |
| 30 | |
| 31 | ARM Trusted Firmware (ATF) & l-loader |
| 32 | ===================================== |
| 33 | |
| 34 | This u-boot port has been tested with l-loader, booting ATF, which then boots |
| 35 | u-boot as the bl33.bin executable. |
| 36 | |
| 37 | 1. Get ATF source code |
| 38 | git clone https://github.com/96boards/arm-trusted-firmware.git |
| 39 | |
| 40 | 2. Compile ATF I use the makefile here |
| 41 | http://people.linaro.org/~peter.griffin/hikey/hikey-u-boot-release_r1/build-tf.mak |
| 42 | |
| 43 | 3. Get l-loader |
| 44 | git clone https://github.com/96boards/l-loader.git |
| 45 | |
| 46 | 4. Make sym links to ATF bip / fip binaries |
| 47 | ln -s /home/griffinp/aarch64/bl1-hikey.bin bl1.bin |
| 48 | ln -s /home/griffinp/aarch64/fip-hikey.bin fip.bin |
| 49 | |
| 50 | arm-linux-gnueabihf-gcc -c -o start.o start.S |
| 51 | arm-linux-gnueabihf-gcc -c -o debug.o debug.S |
| 52 | arm-linux-gnueabihf-ld -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o debug.o -o loader |
| 53 | arm-linux-gnueabihf-objcopy -O binary loader temp |
| 54 | |
| 55 | python gen_loader.py -o l-loader.bin --img_loader=temp --img_bl1=bl1.bin |
| 56 | sudo bash -x generate_ptable.sh |
| 57 | python gen_loader.py -o ptable.img --img_prm_ptable=prm_ptable.img --img_sec_ptable=sec_ptable.img |
| 58 | |
| 59 | These instructions are adapted from |
| 60 | https://github.com/96boards/documentation/wiki/HiKeyUEFI |
| 61 | |
| 62 | FLASHING |
| 63 | ======== |
| 64 | |
| 65 | 1. Connect jumper J2 to go into recovery mode and flash l-loader.bin with |
| 66 | fastboot using the hisi-idt.py utility |
| 67 | |
| 68 | > git clone https://github.com/96boards/burn-boot.git |
| 69 | > sudo python /home/griffinp/Software/hikey/burn-boot/hisi-idt.py -d /dev/ttyUSB0 --img1=/tmp/l-loader.bin |
| 70 | |
| 71 | 2. Once LED 0 comes on solid, it should be detected as a fastboot device |
| 72 | (on some boards I've found this to be unreliable) |
| 73 | |
| 74 | sudo fastboot devices |
| 75 | |
| 76 | 3. Flash the images |
| 77 | wget https://builds.96boards.org/releases/hikey/nvme.img |
| 78 | sudo fastboot flash ptable ptable.img |
| 79 | sudo fastboot flash fastboot fip.bin |
| 80 | sudo fastboot flash nvme nvme.img |
| 81 | |
| 82 | 4. Disconnect jumper J2, and reset the board and you will now (hopefully) |
| 83 | have ATF, booting u-boot from eMMC. On 'new' boards I've had to do the |
| 84 | flashing twice in the past to avoid an ATF error. |
| 85 | |
| 86 | See working boot trace below: - |
| 87 | |
| 88 | debug EMMC boot: print init OK |
| 89 | debug EMMC boot: send RST_N . |
| 90 | debug EMMC boot: start eMMC boot...... |
| 91 | load fastboot1! |
| 92 | Switch to aarch64 mode. CPU0 executes at 0xf9801000! |
| 93 | NOTICE: Booting Trusted Firmware |
| 94 | NOTICE: BL1: v1.1(release):a0c0399 |
| 95 | NOTICE: BL1: Built : 13:23:48, May 22 2015 |
| 96 | NOTICE: succeed to init lpddr3 rank0 dram phy |
| 97 | INFO: lpddr3_freq_init, set ddrc 533mhz |
| 98 | INFO: init ddr3 rank0 |
| 99 | INFO: ddr3 rank1 init pass |
| 100 | INFO: lpddr3_freq_init, set ddrc 800mhz |
| 101 | INFO: init ddr3 rank0 |
| 102 | INFO: ddr3 rank1 init pass |
| 103 | INFO: Elpida DDR |
| 104 | NOTICE: BL1: Booting BL2 |
| 105 | INFO: [BDID] [fff91c18] midr: 0x410fd033 |
| 106 | INFO: [BDID] [fff91c1c] board type: 0 |
| 107 | INFO: [BDID] [fff91c20] board id: 0x2b |
| 108 | INFO: init_acpu_dvfs: pmic version 17 |
| 109 | INFO: init_acpu_dvfs: ACPU_CHIP_MAX_FREQ=0x186a00. |
| 110 | INFO: acpu_dvfs_volt_init: success! |
| 111 | INFO: acpu_dvfs_set_freq: support freq num is 5 |
| 112 | INFO: acpu_dvfs_set_freq: start prof is 0x4 |
| 113 | INFO: acpu_dvfs_set_freq: magic is 0x5a5ac5c5 |
| 114 | INFO: acpu_dvfs_set_freq: voltage: |
| 115 | INFO: - 0: 0x3a |
| 116 | INFO: - 1: 0x3a |
| 117 | INFO: - 2: 0x4a |
| 118 | INFO: - 3: 0x5b |
| 119 | INFO: - 4: 0x6b |
| 120 | NOTICE: acpu_dvfs_set_freq: set acpu freq success!NOTICE: BL2: v1.1(debug):a0c0399 |
| 121 | NOTICE: BL2: Built : 10:19:28, May 27 2015 |
| 122 | INFO: BL2: Loading BL3-0 |
| 123 | INFO: Using FIP |
| 124 | WARNING: Failed to access image 'bl30.bin' (-1) |
| 125 | ERROR: Failed to load BL3-0 (-1) |
| 126 | ERROR: Please burn mcu image: |
| 127 | ERROR: sudo fastboot flash mcuimage mcuimage.bin |
| 128 | INFO: BL2: TrustZone: protecting 16777216 bytes of memory at 0x3f000000 |
| 129 | INFO: BL2: Loading BL3-1 |
| 130 | INFO: Using FIP |
| 131 | INFO: Loading file 'bl31.bin' at address 0xf9858000 |
| 132 | INFO: File 'bl31.bin' loaded: 0xf9858000 - 0xf9860010 |
| 133 | INFO: BL2: Loading BL3-2 |
| 134 | INFO: Using FIP |
| 135 | WARNING: Failed to access image 'bl32.bin' (-1) |
| 136 | WARNING: Failed to load BL3-2 (-1) |
| 137 | INFO: BL2: Loading BL3-3 |
| 138 | INFO: Using FIP |
| 139 | INFO: Loading file 'bl33.bin' at address 0x35000000 |
| 140 | INFO: File 'bl33.bin' loaded: 0x35000000 - 0x35042938 |
| 141 | NOTICE: BL1: Booting BL3-1 |
| 142 | NOTICE: BL3-1: v1.1(debug):a0c0399 |
| 143 | NOTICE: BL3-1: Built : 10:19:31, May 27 2015 |
| 144 | INFO: BL3-1: Initializing runtime services |
| 145 | INFO: BL3-1: Preparing for EL3 exit to normal world |
| 146 | INFO: BL3-1: Next image address = 0x35000000 |
| 147 | INFO: BL3-1: Next image spsr = 0x3c9 |
| 148 | |
| 149 | |
| 150 | U-Boot 2015.04-00007-g1b3d379-dirty (May 27 2015 - 10:18:16) hikey |
| 151 | |
| 152 | DRAM: 1008 MiB |
| 153 | MMC: sd_card_detect: SD card present |
| 154 | HiKey DWMMC: 0, HiKey DWMMC: 1 |
| 155 | In: serial |
| 156 | Out: serial |
| 157 | Err: serial |
| 158 | Net: Net Initialization Skipped |
| 159 | No ethernet found. |
| 160 | Hit any key to stop autoboot: 0 |