blob: 94e8397e9b23596139eaf69f9ab1654fb7a65ef6 [file] [log] [blame]
Peter Griffin6de280f2015-07-30 18:55:24 +01001Introduction
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: -
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053013https://github.com/96boards/documentation/blob/master/consumer/hikey/hikey620/hardware-docs/HiKey_schematics_LeMaker_version_Rev_A1.pdf
Peter Griffin6de280f2015-07-30 18:55:24 +010014
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053015The SoC datasheet can be found here: -
16https://github.com/96boards/documentation/blob/master/consumer/hikey/hikey620/hardware-docs/Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf
Peter Griffin6de280f2015-07-30 18:55:24 +010017
18Currently the u-boot port supports: -
19* USB
20* eMMC
21* SD card
22* GPIO
23
Peter Griffinb956d982016-04-20 17:14:03 +010024The HiKey U-Boot port has been tested with l-loader, booting ATF, which then boots
25U-Boot as the bl33.bin executable.
Peter Griffin6de280f2015-07-30 18:55:24 +010026
Peter Griffinb956d982016-04-20 17:14:03 +010027Compile from source
28===================
Peter Griffin6de280f2015-07-30 18:55:24 +010029
Peter Griffinb956d982016-04-20 17:14:03 +010030First get all the sources
Peter Griffin6de280f2015-07-30 18:55:24 +010031
Peter Griffinb956d982016-04-20 17:14:03 +010032 > mkdir -p ~/hikey/src ~/hikey/bin
33 > cd ~/hikey/src
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053034 > git clone https://github.com/96boards-hikey/edk2 -b testing/hikey960_v2.5
35 > git clone https://github.com/ARM-software/arm-trusted-firmware
36 > git clone https://github.com/96boards-hikey/l-loader -b testing/hikey960_v1.2
37 > git clone https://github.com/96boards-hikey/OpenPlatformPkg -b testing/hikey960_v1.3.4
38 > git clone https://github.com/96boards-hikey/atf-fastboot
39 > wget https://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey/release/hisi-idt.py
Peter Griffin6de280f2015-07-30 18:55:24 +010040
Peter Griffinb956d982016-04-20 17:14:03 +010041Get the BL30 mcuimage.bin binary. It is shipped as part of the UEFI source.
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053042The latest version can be obtained from the OpenPlatformPkg repo.
Peter Griffin8afec9a2015-09-10 21:55:11 +010043
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053044 > cp OpenPlatformPkg/Platforms/Hisilicon/HiKey/Binary/mcuimage.bin ~/hikey/bin/
Peter Griffin6de280f2015-07-30 18:55:24 +010045
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053046Get nvme.img binary
47 > wget -P ~/hikey/bin https://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey/release/nvme.img
Peter Griffin6de280f2015-07-30 18:55:24 +010048
Peter Griffinb956d982016-04-20 17:14:03 +010049Compile U-Boot
50==============
Peter Griffin6de280f2015-07-30 18:55:24 +010051
Peter Griffinb956d982016-04-20 17:14:03 +010052 > cd ~/hikey/src/u-boot
53 > make CROSS_COMPILE=aarch64-linux-gnu- hikey_config
54 > make CROSS_COMPILE=aarch64-linux-gnu-
55 > cp u-boot.bin ~/hikey/bin
56
57Compile ARM Trusted Firmware (ATF)
58==================================
59
Michal Simek90675672017-05-31 11:28:30 +020060 > cd ~/hikey/src/arm-trusted-firmware
Peter Griffinb956d982016-04-20 17:14:03 +010061 > make CROSS_COMPILE=aarch64-linux-gnu- all fip \
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053062 SCP_BL2=~/hikey/bin/mcuimage.bin \
Peter Griffinb956d982016-04-20 17:14:03 +010063 BL33=~/hikey/bin/u-boot.bin DEBUG=1 PLAT=hikey
Peter Griffin6de280f2015-07-30 18:55:24 +010064
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053065Copy the resulting FIP binary
Peter Griffinb956d982016-04-20 17:14:03 +010066 > cp build/hikey/debug/fip.bin ~/hikey/bin
67
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053068Compile ATF Fastboot
69====================
70
71 > cd ~/hikey/src/atf-fastboot
72 > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=hikey DEBUG=1
73
Peter Griffinb956d982016-04-20 17:14:03 +010074Compile l-loader
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053075================
Michal Simek90675672017-05-31 11:28:30 +020076 > cd ~/hikey/src/l-loader
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053077 > ln -sf ~/hikey/src/arm-trusted-firmware/build/hikey/debug/bl1.bin
78 > ln -sf ~/hikey/src/arm-trusted-firmware/build/hikey/debug/bl2.bin
79 > ln -sf ~/hikey/src/atf-fastboot/build/hikey/debug/bl1.bin fastboot.bin
80 > make hikey PTABLE_LST=aosp-8g
81
82Copy the resulting binaries
Peter Griffinb956d982016-04-20 17:14:03 +010083 > cp *.img ~/hikey/bin
Michal Simek90675672017-05-31 11:28:30 +020084 > cp l-loader.bin ~/hikey/bin
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053085 > cp recovery.bin ~/hikey/bin
Peter Griffin6de280f2015-07-30 18:55:24 +010086
87These instructions are adapted from
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053088https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/hikey.rst
Peter Griffin6de280f2015-07-30 18:55:24 +010089
90FLASHING
91========
92
Peter Griffin8afec9a2015-09-10 21:55:11 +0100931. Connect the second jumper on J15 BOOT SEL, to go into recovery mode and flash l-loader.bin with
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053094the 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.
Peter Griffin6de280f2015-07-30 18:55:24 +010095
Peter Griffin8afec9a2015-09-10 21:55:11 +010096The command below assumes HiKey enumerated as the first USB serial port
Peter Griffin6de280f2015-07-30 18:55:24 +010097
Manivannan Sadhasivam22846412018-08-29 10:07:36 +053098 > sudo python ~/hikey/src/hisi-idt.py -d /dev/ttyUSB0 --img1 ~/hikey/bin/recovery.bin
99
1002. Once LED 0 comes on solid, HiKey board should be detected as a fastboot device.
Peter Griffin8afec9a2015-09-10 21:55:11 +0100101
102 > sudo fastboot devices
103
1040123456789ABCDEF fastboot
Peter Griffin6de280f2015-07-30 18:55:24 +0100105
1063. Flash the images
Peter Griffinb956d982016-04-20 17:14:03 +0100107
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530108 > sudo fastboot flash ptable ~/hikey/bin/prm_ptable.img
109 > sudo fastboot flash loader ~/hikey/bin/l-loader.bin
Peter Griffinb956d982016-04-20 17:14:03 +0100110 > sudo fastboot flash fastboot ~/hikey/bin/fip.bin
111 > sudo fastboot flash nvme ~/hikey/bin/nvme.img
Peter Griffin6de280f2015-07-30 18:55:24 +0100112
Peter Griffin8afec9a2015-09-10 21:55:11 +01001134. Disconnect second jumper on J15 BOOT SEL, and reset the board and you will now (hopefully)
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530114 have ATF, booting u-boot from eMMC.
Peter Griffin6de280f2015-07-30 18:55:24 +0100115
Peter Griffin8afec9a2015-09-10 21:55:11 +0100116 Note: To get USB host working, also disconnect the USB OTG cable used for flashing. Otherwise you
117 will get 'dwc_otg_core_host_init: Timeout!' errors.
118
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530119See working boot trace below on UART3 available at Low Speed Expansion header: -
Peter Griffin6de280f2015-07-30 18:55:24 +0100120
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530121NOTICE: BL2: v1.5(debug):v1.5-694-g6d4f6aea
122NOTICE: BL2: Built : 09:21:42, Aug 29 2018
123INFO: BL2: Doing platform setup
124INFO: ddr3 rank1 init pass
125INFO: succeed to set ddrc 150mhz
Peter Griffin6de280f2015-07-30 18:55:24 +0100126INFO: ddr3 rank1 init pass
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530127INFO: succeed to set ddrc 266mhz
Peter Griffin6de280f2015-07-30 18:55:24 +0100128INFO: ddr3 rank1 init pass
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530129INFO: succeed to set ddrc 400mhz
130INFO: ddr3 rank1 init pass
131INFO: succeed to set ddrc 533mhz
132INFO: ddr3 rank1 init pass
133INFO: succeed to set ddrc 800mhz
134INFO: Samsung DDR
Peter Griffin8afec9a2015-09-10 21:55:11 +0100135INFO: ddr test value:0xa5a55a5a
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530136INFO: BL2: TrustZone: protecting 16777216 bytes of memory at 0x3f000000
137INFO: BL2: TrustZone: protecting 4194304 bytes of memory at 0x3e800000
Peter Griffin6de280f2015-07-30 18:55:24 +0100138INFO: [BDID] [fff91c18] midr: 0x410fd033
Peter Griffin6de280f2015-07-30 18:55:24 +0100139INFO: init_acpu_dvfs: pmic version 17
140INFO: init_acpu_dvfs: ACPU_CHIP_MAX_FREQ=0x186a00.
141INFO: acpu_dvfs_volt_init: success!
142INFO: acpu_dvfs_set_freq: support freq num is 5
143INFO: acpu_dvfs_set_freq: start prof is 0x4
144INFO: acpu_dvfs_set_freq: magic is 0x5a5ac5c5
145INFO: acpu_dvfs_set_freq: voltage:
Peter Griffin8afec9a2015-09-10 21:55:11 +0100146INFO: - 0: 0x49
147INFO: - 1: 0x49
148INFO: - 2: 0x50
149INFO: - 3: 0x60
150INFO: - 4: 0x78
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530151NOTICE: acpu_dvfs_set_freq: set acpu freq success!INFO: BL2: Loading image id 2
152INFO: Loading image id=2 at address 0x1000000
153INFO: Image id=2 loaded: 0x1000000 - 0x1023d00
Peter Griffin8afec9a2015-09-10 21:55:11 +0100154INFO: hisi_mcu_load_image: mcu sections 0:
155INFO: hisi_mcu_load_image: src = 0x1000200
156INFO: hisi_mcu_load_image: dst = 0xf6000000
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530157INFO: hisi_mcu_load_image: size = 31184
158INFO: hisi_mcu_load_image: [SRC 0x1000200] 0x8000 0x3701 0x7695 0x7689
159INFO: hisi_mcu_load_image: [DST 0xf6000000] 0x8000 0x3701 0x7695 0x7689
Peter Griffin8afec9a2015-09-10 21:55:11 +0100160INFO: hisi_mcu_load_image: mcu sections 1:
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530161INFO: hisi_mcu_load_image: src = 0x1007bd0
162INFO: hisi_mcu_load_image: dst = 0x5e00000
163INFO: hisi_mcu_load_image: size = 93828
164INFO: hisi_mcu_load_image: [SRC 0x1007bd0] 0xf000b510 0x2103fb3d 0xf0004604 0xf003fb57
165INFO: hisi_mcu_load_image: [DST 0x5e00000] 0xf000b510 0x2103fb3d 0xf0004604 0xf003fb57
Peter Griffin8afec9a2015-09-10 21:55:11 +0100166INFO: hisi_mcu_load_image: mcu sections 2:
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530167INFO: hisi_mcu_load_image: src = 0x101ea54
168INFO: hisi_mcu_load_image: dst = 0x5e16e84
169INFO: hisi_mcu_load_image: size = 15428
170INFO: hisi_mcu_load_image: [SRC 0x101ea54] 0x9 0x1020640 0x10001 0x8f0d180
171INFO: hisi_mcu_load_image: [DST 0x5e16e84] 0x9 0x1020640 0x10001 0x8f0d180
Peter Griffin8afec9a2015-09-10 21:55:11 +0100172INFO: hisi_mcu_load_image: mcu sections 3:
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530173INFO: hisi_mcu_load_image: src = 0x1022698
174INFO: hisi_mcu_load_image: dst = 0x5e22a10
Peter Griffin8afec9a2015-09-10 21:55:11 +0100175INFO: hisi_mcu_load_image: size = 3060
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530176INFO: hisi_mcu_load_image: [SRC 0x1022698] 0x0 0x0 0x0 0x0
177INFO: hisi_mcu_load_image: [DST 0x5e22a10] 0x0 0x0 0x0 0x0
178INFO: hisi_mcu_load_image: mcu sections 4:
179INFO: hisi_mcu_load_image: src = 0x102328c
180INFO: hisi_mcu_load_image: dst = 0x5e23604
Peter Griffin8afec9a2015-09-10 21:55:11 +0100181INFO: hisi_mcu_load_image: size = 2616
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530182INFO: hisi_mcu_load_image: [SRC 0x102328c] 0xf80000a0 0x0 0xf80000ac 0x0
183INFO: hisi_mcu_load_image: [DST 0x5e23604] 0xf80000a0 0x0 0xf80000ac 0x0
Peter Griffin8afec9a2015-09-10 21:55:11 +0100184INFO: hisi_mcu_start_run: AO_SC_SYS_CTRL2=0
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530185INFO: plat_hikey_bl2_handle_scp_bl2: MCU PC is at 0x42933301
186INFO: plat_hikey_bl2_handle_scp_bl2: AO_SC_PERIPH_CLKSTAT4 is 0x3b018f09
187WARNING: BL2: Platform setup already done!!
188INFO: BL2: Loading image id 3
189INFO: Loading image id=3 at address 0xf9858000
190INFO: Image id=3 loaded: 0xf9858000 - 0xf9860058
191INFO: BL2: Loading image id 5
192INFO: Loading image id=5 at address 0x35000000
193INFO: Image id=5 loaded: 0x35000000 - 0x35061cd2
194NOTICE: BL2: Booting BL31
195INFO: Entry point address = 0xf9858000
196INFO: SPSR = 0x3cd
197NOTICE: BL31: v1.5(debug):v1.5-694-g6d4f6aea
198NOTICE: BL31: Built : 09:21:44, Aug 29 2018
199WARNING: Using deprecated integer interrupt array in gicv2_driver_data_t
200WARNING: Please migrate to using an interrupt_prop_t array
201INFO: ARM GICv2 driver initialized
202INFO: BL31: Initializing runtime services
203INFO: BL31: cortex_a53: CPU workaround for disable_non_temporal_hint was applied
204INFO: BL31: cortex_a53: CPU workaround for 843419 was applied
205INFO: BL31: cortex_a53: CPU workaround for 855873 was applied
206INFO: BL31: Preparing for EL3 exit to normal world
207INFO: Entry point address = 0x35000000
208INFO: SPSR = 0x3c9
Peter Griffin6de280f2015-07-30 18:55:24 +0100209
Peter Griffin6de280f2015-07-30 18:55:24 +0100210
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530211U-Boot 2018.09-rc1 (Aug 22 2018 - 14:55:49 +0530)hikey
Peter Griffin8afec9a2015-09-10 21:55:11 +0100212
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530213DRAM: 990 MiB
214HI6553 PMIC init
215MMC: config_sd_carddetect: SD card present
216Hisilicon DWMMC: 0, Hisilicon DWMMC: 1
217Loading Environment from FAT... Unable to use mmc 1:1... Failed (-5)
218In: uart@f7113000
219Out: uart@f7113000
220Err: uart@f7113000
Peter Griffin6de280f2015-07-30 18:55:24 +0100221Net: Net Initialization Skipped
222No ethernet found.
223Hit any key to stop autoboot: 0
Peter Griffin8afec9a2015-09-10 21:55:11 +0100224starting USB...
Manivannan Sadhasivam22846412018-08-29 10:07:36 +0530225USB0: scanning bus 0 for devices... 2 USB Device(s) found
Peter Griffin8afec9a2015-09-10 21:55:11 +0100226 scanning usb for storage devices... 0 Storage Device(s) found
227 scanning usb for ethernet devices... 0 Ethernet Device(s) found