blob: 8038a24fe16a6476771d68288325b22b1d10a5d8 [file] [log] [blame]
Heinrich Schuchardt991bf062023-11-11 02:36:37 +01001.. SPDX-License-Identifier: GPL-2.0-or-later
2
3HiKey board
4###########
5
6Introduction
7============
8
9HiKey is the first certified 96Boards Consumer Edition board. The board/SoC has:
10
11* HiSilicon Kirin 6220 eight-core ARM Cortex-A53 64-bit SoC running at 1.2GHz.
12* ARM Mali 450-MP4 GPU
13* 1GB 800MHz LPDDR3 DRAM
14* 4GB eMMC Flash Storage
15* microSD
16* 802.11a/b/g/n WiFi, Bluetooth
17
18The HiKey schematic can be found here:
19https://github.com/96boards/documentation/blob/master/consumer/hikey/hikey620/hardware-docs/HiKey_schematics_LeMaker_version_Rev_A1.pdf
20
21The SoC datasheet can be found here:
22https://github.com/96boards/documentation/blob/master/consumer/hikey/hikey620/hardware-docs/Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf
23
24Currently the u-boot port supports:
25
26* USB
27* eMMC
28* SD card
29* GPIO
30
31The HiKey U-Boot port has been tested with l-loader, booting ATF, which then
32boots U-Boot as the bl33.bin executable.
33
34Compile from source
35===================
36
37First get all the sources
38
39.. code-block:: bash
40
41 mkdir -p ~/hikey/src ~/hikey/bin
42 cd ~/hikey/src
43 git clone https://github.com/96boards-hikey/edk2 -b testing/hikey960_v2.5
44 git clone https://github.com/ARM-software/arm-trusted-firmware
45 git clone https://github.com/96boards-hikey/l-loader -b testing/hikey960_v1.2
46 git clone https://github.com/96boards-hikey/OpenPlatformPkg -b testing/hikey960_v1.3.4
47 git clone https://github.com/96boards-hikey/atf-fastboot
48 wget https://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey/release/hisi-idt.py
49
50Get the BL30 mcuimage.bin binary. It is shipped as part of the UEFI source.
51The latest version can be obtained from the OpenPlatformPkg repo.
52
53.. code-block:: bash
54
55 cp OpenPlatformPkg/Platforms/Hisilicon/HiKey/Binary/mcuimage.bin ~/hikey/bin/
56
57Get nvme.img binary
58
59.. code-block:: bash
60
61 wget -P ~/hikey/bin https://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey/release/nvme.img
62
63Compile U-Boot
64==============
65
66.. code-block:: bash
67
68 cd ~/hikey/src/u-boot
69 make CROSS_COMPILE=aarch64-linux-gnu- hikey_config
70 make CROSS_COMPILE=aarch64-linux-gnu-
71 cp u-boot.bin ~/hikey/bin
72
73Compile ARM Trusted Firmware (ATF)
74==================================
75
76.. code-block:: bash
77
78 cd ~/hikey/src/arm-trusted-firmware
79 make CROSS_COMPILE=aarch64-linux-gnu- all fip \
80 SCP_BL2=~/hikey/bin/mcuimage.bin \
81 BL33=~/hikey/bin/u-boot.bin DEBUG=1 PLAT=hikey
82
83Copy the resulting FIP binary
84
85.. code-block:: bash
86
87 cp build/hikey/debug/fip.bin ~/hikey/bin
88
89Compile ATF Fastboot
90====================
91
92.. code-block:: bash
93
94 cd ~/hikey/src/atf-fastboot
95 make CROSS_COMPILE=aarch64-linux-gnu- PLAT=hikey DEBUG=1
96
97Compile l-loader
98================
99
100.. code-block:: bash
101
102 cd ~/hikey/src/l-loader
103 ln -sf ~/hikey/src/arm-trusted-firmware/build/hikey/debug/bl1.bin
104 ln -sf ~/hikey/src/arm-trusted-firmware/build/hikey/debug/bl2.bin
105 ln -sf ~/hikey/src/atf-fastboot/build/hikey/debug/bl1.bin fastboot.bin
106 make hikey PTABLE_LST=aosp-8g
107
108Copy the resulting binaries
109
110.. code-block:: bash
111
112 cp *.img ~/hikey/bin
113 cp l-loader.bin ~/hikey/bin
114 cp recovery.bin ~/hikey/bin
115
116These instructions are adapted from
117https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/hikey.rst
118
119Flashing
120========
121
1221. Connect the second jumper on J15 BOOT SEL, to go into recovery mode and flash l-loader.bin with
123the hisi-idt.py utility. Then connect a USB A to B mini cable from your PC to the USB OTG port of HiKey and execute the below command.
124
125The command below assumes HiKey enumerated as the first USB serial port
126
127.. code-block:: bash
128
129 sudo python ~/hikey/src/hisi-idt.py -d /dev/ttyUSB0 --img1 ~/hikey/bin/recovery.bin
130
1312. Once LED 0 comes on solid, HiKey board should be detected as a fastboot device.
132
133.. code-block::
134
135 sudo fastboot devices
136
137 0123456789ABCDEF fastboot
138
1393. Flash the images
140
141.. code-block::
142
143 sudo fastboot flash ptable ~/hikey/bin/prm_ptable.img
144 sudo fastboot flash loader ~/hikey/bin/l-loader.bin
145 sudo fastboot flash fastboot ~/hikey/bin/fip.bin
146 sudo fastboot flash nvme ~/hikey/bin/nvme.img
147
1484. Disconnect second jumper on J15 BOOT SEL, and reset the board and you will now (hopefully)
149 have ATF, booting u-boot from eMMC.
150
151 Note: To get USB host working, also disconnect the USB OTG cable used for flashing. Otherwise you
152 will get 'dwc_otg_core_host_init: Timeout!' errors.
153
154See working boot trace below on UART3 available at Low Speed Expansion header::
155
156 NOTICE: BL2: v1.5(debug):v1.5-694-g6d4f6aea
157 NOTICE: BL2: Built : 09:21:42, Aug 29 2018
158 INFO: BL2: Doing platform setup
159 INFO: ddr3 rank1 init pass
160 INFO: succeed to set ddrc 150mhz
161 INFO: ddr3 rank1 init pass
162 INFO: succeed to set ddrc 266mhz
163 INFO: ddr3 rank1 init pass
164 INFO: succeed to set ddrc 400mhz
165 INFO: ddr3 rank1 init pass
166 INFO: succeed to set ddrc 533mhz
167 INFO: ddr3 rank1 init pass
168 INFO: succeed to set ddrc 800mhz
169 INFO: Samsung DDR
170 INFO: ddr test value:0xa5a55a5a
171 INFO: BL2: TrustZone: protecting 16777216 bytes of memory at 0x3f000000
172 INFO: BL2: TrustZone: protecting 4194304 bytes of memory at 0x3e800000
173 INFO: [BDID] [fff91c18] midr: 0x410fd033
174 INFO: init_acpu_dvfs: pmic version 17
175 INFO: init_acpu_dvfs: ACPU_CHIP_MAX_FREQ=0x186a00.
176 INFO: acpu_dvfs_volt_init: success!
177 INFO: acpu_dvfs_set_freq: support freq num is 5
178 INFO: acpu_dvfs_set_freq: start prof is 0x4
179 INFO: acpu_dvfs_set_freq: magic is 0x5a5ac5c5
180 INFO: acpu_dvfs_set_freq: voltage:
181 INFO: - 0: 0x49
182 INFO: - 1: 0x49
183 INFO: - 2: 0x50
184 INFO: - 3: 0x60
185 INFO: - 4: 0x78
186 NOTICE: acpu_dvfs_set_freq: set acpu freq success!INFO: BL2: Loading image id 2
187 INFO: Loading image id=2 at address 0x1000000
188 INFO: Image id=2 loaded: 0x1000000 - 0x1023d00
189 INFO: hisi_mcu_load_image: mcu sections 0:
190 INFO: hisi_mcu_load_image: src = 0x1000200
191 INFO: hisi_mcu_load_image: dst = 0xf6000000
192 INFO: hisi_mcu_load_image: size = 31184
193 INFO: hisi_mcu_load_image: [SRC 0x1000200] 0x8000 0x3701 0x7695 0x7689
194 INFO: hisi_mcu_load_image: [DST 0xf6000000] 0x8000 0x3701 0x7695 0x7689
195 INFO: hisi_mcu_load_image: mcu sections 1:
196 INFO: hisi_mcu_load_image: src = 0x1007bd0
197 INFO: hisi_mcu_load_image: dst = 0x5e00000
198 INFO: hisi_mcu_load_image: size = 93828
199 INFO: hisi_mcu_load_image: [SRC 0x1007bd0] 0xf000b510 0x2103fb3d 0xf0004604 0xf003fb57
200 INFO: hisi_mcu_load_image: [DST 0x5e00000] 0xf000b510 0x2103fb3d 0xf0004604 0xf003fb57
201 INFO: hisi_mcu_load_image: mcu sections 2:
202 INFO: hisi_mcu_load_image: src = 0x101ea54
203 INFO: hisi_mcu_load_image: dst = 0x5e16e84
204 INFO: hisi_mcu_load_image: size = 15428
205 INFO: hisi_mcu_load_image: [SRC 0x101ea54] 0x9 0x1020640 0x10001 0x8f0d180
206 INFO: hisi_mcu_load_image: [DST 0x5e16e84] 0x9 0x1020640 0x10001 0x8f0d180
207 INFO: hisi_mcu_load_image: mcu sections 3:
208 INFO: hisi_mcu_load_image: src = 0x1022698
209 INFO: hisi_mcu_load_image: dst = 0x5e22a10
210 INFO: hisi_mcu_load_image: size = 3060
211 INFO: hisi_mcu_load_image: [SRC 0x1022698] 0x0 0x0 0x0 0x0
212 INFO: hisi_mcu_load_image: [DST 0x5e22a10] 0x0 0x0 0x0 0x0
213 INFO: hisi_mcu_load_image: mcu sections 4:
214 INFO: hisi_mcu_load_image: src = 0x102328c
215 INFO: hisi_mcu_load_image: dst = 0x5e23604
216 INFO: hisi_mcu_load_image: size = 2616
217 INFO: hisi_mcu_load_image: [SRC 0x102328c] 0xf80000a0 0x0 0xf80000ac 0x0
218 INFO: hisi_mcu_load_image: [DST 0x5e23604] 0xf80000a0 0x0 0xf80000ac 0x0
219 INFO: hisi_mcu_start_run: AO_SC_SYS_CTRL2=0
220 INFO: plat_hikey_bl2_handle_scp_bl2: MCU PC is at 0x42933301
221 INFO: plat_hikey_bl2_handle_scp_bl2: AO_SC_PERIPH_CLKSTAT4 is 0x3b018f09
222 WARNING: BL2: Platform setup already done!!
223 INFO: BL2: Loading image id 3
224 INFO: Loading image id=3 at address 0xf9858000
225 INFO: Image id=3 loaded: 0xf9858000 - 0xf9860058
226 INFO: BL2: Loading image id 5
227 INFO: Loading image id=5 at address 0x35000000
228 INFO: Image id=5 loaded: 0x35000000 - 0x35061cd2
229 NOTICE: BL2: Booting BL31
230 INFO: Entry point address = 0xf9858000
231 INFO: SPSR = 0x3cd
232 NOTICE: BL31: v1.5(debug):v1.5-694-g6d4f6aea
233 NOTICE: BL31: Built : 09:21:44, Aug 29 2018
234 WARNING: Using deprecated integer interrupt array in gicv2_driver_data_t
235 WARNING: Please migrate to using an interrupt_prop_t array
236 INFO: ARM GICv2 driver initialized
237 INFO: BL31: Initializing runtime services
238 INFO: BL31: cortex_a53: CPU workaround for disable_non_temporal_hint was applied
239 INFO: BL31: cortex_a53: CPU workaround for 843419 was applied
240 INFO: BL31: cortex_a53: CPU workaround for 855873 was applied
241 INFO: BL31: Preparing for EL3 exit to normal world
242 INFO: Entry point address = 0x35000000
243 INFO: SPSR = 0x3c9
244
245 U-Boot 2018.09-rc1 (Aug 22 2018 - 14:55:49 +0530)hikey
246
247 DRAM: 990 MiB
248 HI6553 PMIC init
249 MMC: config_sd_carddetect: SD card present
250 Hisilicon DWMMC: 0, Hisilicon DWMMC: 1
251 Loading Environment from FAT... Unable to use mmc 1:1... Failed (-5)
252 In: uart@f7113000
253 Out: uart@f7113000
254 Err: uart@f7113000
255 Net: Net Initialization Skipped
256 No ethernet found.
257 Hit any key to stop autoboot: 0
258 starting USB...
259 USB0: scanning bus 0 for devices... 2 USB Device(s) found
260 scanning usb for storage devices... 0 Storage Device(s) found
261 scanning usb for ethernet devices... 0 Ethernet Device(s) found