xref: /openbmc/u-boot/board/hisilicon/hikey/README (revision 412400ab)
1Introduction
2============
3
4HiKey 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
12The HiKey schematic can be found here: -
13https://github.com/96boards/documentation/blob/master/hikey/96Boards-Hikey-Rev-A1.pdf
14
15A SoC datasheet can be found here: -
16https://github.com/96boards/documentation/blob/master/hikey/
17Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf
18
19Currently the u-boot port supports: -
20* USB
21* eMMC
22* SD card
23* GPIO
24
25Compile u-boot
26==============
27
28make CROSS_COMPILE=aarch64-linux-gnu- hikey_config
29make CROSS_COMPILE=aarch64-linux-gnu-
30
31ARM Trusted Firmware (ATF) & l-loader
32=====================================
33
34This u-boot port has been tested with l-loader, booting ATF, which then boots
35u-boot as the bl33.bin executable.
36
371. Get ATF source code
38git clone https://github.com/96boards/arm-trusted-firmware.git
39
402. Compile ATF I use the makefile here
41http://people.linaro.org/~peter.griffin/hikey/hikey-u-boot-release_r1/build-tf.mak
42
433. Get l-loader
44git clone https://github.com/96boards/l-loader.git
45
464. Make sym links to ATF bip / fip binaries
47ln -s /home/griffinp/aarch64/bl1-hikey.bin bl1.bin
48ln -s /home/griffinp/aarch64/fip-hikey.bin fip.bin
49
50arm-linux-gnueabihf-gcc -c -o start.o start.S
51arm-linux-gnueabihf-gcc -c -o debug.o debug.S
52arm-linux-gnueabihf-ld -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o debug.o -o loader
53arm-linux-gnueabihf-objcopy -O binary loader temp
54
55python gen_loader.py -o l-loader.bin --img_loader=temp --img_bl1=bl1.bin
56sudo bash -x generate_ptable.sh
57python gen_loader.py -o ptable.img --img_prm_ptable=prm_ptable.img --img_sec_ptable=sec_ptable.img
58
59These instructions are adapted from
60https://github.com/96boards/documentation/wiki/HiKeyUEFI
61
62FLASHING
63========
64
651. 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
712. 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
74sudo fastboot devices
75
763. Flash the images
77wget https://builds.96boards.org/releases/hikey/nvme.img
78sudo fastboot flash ptable ptable.img
79sudo fastboot flash fastboot fip.bin
80sudo fastboot flash nvme nvme.img
81
824. 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
86See working boot trace below: -
87
88debug EMMC boot: print init OK
89debug EMMC boot: send RST_N .
90debug EMMC boot: start eMMC boot......
91load fastboot1!
92Switch to aarch64 mode. CPU0 executes at 0xf9801000!
93NOTICE:  Booting Trusted Firmware
94NOTICE:  BL1: v1.1(release):a0c0399
95NOTICE:  BL1: Built : 13:23:48, May 22 2015
96NOTICE:  succeed to init lpddr3 rank0 dram phy
97INFO:    lpddr3_freq_init, set ddrc 533mhz
98INFO:    init ddr3 rank0
99INFO:    ddr3 rank1 init pass
100INFO:    lpddr3_freq_init, set ddrc 800mhz
101INFO:    init ddr3 rank0
102INFO:    ddr3 rank1 init pass
103INFO:    Elpida DDR
104NOTICE:  BL1: Booting BL2
105INFO:    [BDID] [fff91c18] midr: 0x410fd033
106INFO:    [BDID] [fff91c1c] board type: 0
107INFO:    [BDID] [fff91c20] board id: 0x2b
108INFO:    init_acpu_dvfs: pmic version 17
109INFO:    init_acpu_dvfs: ACPU_CHIP_MAX_FREQ=0x186a00.
110INFO:    acpu_dvfs_volt_init: success!
111INFO:    acpu_dvfs_set_freq: support freq num is 5
112INFO:    acpu_dvfs_set_freq: start prof is 0x4
113INFO:    acpu_dvfs_set_freq: magic is 0x5a5ac5c5
114INFO:    acpu_dvfs_set_freq: voltage:
115INFO:      - 0: 0x3a
116INFO:      - 1: 0x3a
117INFO:      - 2: 0x4a
118INFO:      - 3: 0x5b
119INFO:      - 4: 0x6b
120NOTICE:  acpu_dvfs_set_freq: set acpu freq success!NOTICE:  BL2: v1.1(debug):a0c0399
121NOTICE:  BL2: Built : 10:19:28, May 27 2015
122INFO:    BL2: Loading BL3-0
123INFO:    Using FIP
124WARNING: Failed to access image 'bl30.bin' (-1)
125ERROR:   Failed to load BL3-0 (-1)
126ERROR:   Please burn mcu image:
127ERROR:     sudo fastboot flash mcuimage mcuimage.bin
128INFO:    BL2: TrustZone: protecting 16777216 bytes of memory at 0x3f000000
129INFO:    BL2: Loading BL3-1
130INFO:    Using FIP
131INFO:    Loading file 'bl31.bin' at address 0xf9858000
132INFO:    File 'bl31.bin' loaded: 0xf9858000 - 0xf9860010
133INFO:    BL2: Loading BL3-2
134INFO:    Using FIP
135WARNING: Failed to access image 'bl32.bin' (-1)
136WARNING: Failed to load BL3-2 (-1)
137INFO:    BL2: Loading BL3-3
138INFO:    Using FIP
139INFO:    Loading file 'bl33.bin' at address 0x35000000
140INFO:    File 'bl33.bin' loaded: 0x35000000 - 0x35042938
141NOTICE:  BL1: Booting BL3-1
142NOTICE:  BL3-1: v1.1(debug):a0c0399
143NOTICE:  BL3-1: Built : 10:19:31, May 27 2015
144INFO:    BL3-1: Initializing runtime services
145INFO:    BL3-1: Preparing for EL3 exit to normal world
146INFO:    BL3-1: Next image address = 0x35000000
147INFO:    BL3-1: Next image spsr = 0x3c9
148
149
150U-Boot 2015.04-00007-g1b3d379-dirty (May 27 2015 - 10:18:16) hikey
151
152DRAM:  1008 MiB
153MMC:   sd_card_detect: SD card present
154HiKey DWMMC: 0, HiKey DWMMC: 1
155In:    serial
156Out:   serial
157Err:   serial
158Net:   Net Initialization Skipped
159No ethernet found.
160Hit any key to stop autoboot:  0
161