README 8.9 KB

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