README 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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/hikey/96Boards-Hikey-Rev-A1.pdf
  12. A SoC datasheet can be found here: -
  13. https://github.com/96boards/documentation/blob/master/hikey/
  14. Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf
  15. Currently the u-boot port supports: -
  16. * USB
  17. * eMMC
  18. * SD card
  19. * GPIO
  20. The HiKey U-Boot port has been tested with l-loader, booting ATF, which then boots
  21. U-Boot as the bl33.bin executable.
  22. Compile from source
  23. ===================
  24. First get all the sources
  25. > mkdir -p ~/hikey/src ~/hikey/bin
  26. > cd ~/hikey/src
  27. > git clone https://github.com/96boards/edk2.git
  28. > git clone https://github.com/96boards/arm-trusted-firmware.git
  29. > git clone https://github.com/96boards/l-loader.git
  30. > git clone https://github.com/96boards/burn-boot.git
  31. Get the BL30 mcuimage.bin binary. It is shipped as part of the UEFI source.
  32. The latest version can be obtained from the edk2 repo.
  33. > cp edk2/HisiPkg/HiKeyPkg/NonFree/mcuimage.bin ~/hikey/bin/
  34. Get nvme.img binary (check this link is still the latest)
  35. > wget -P ~/hikey/bin https://builds.96boards.org/releases/reference-platform/debian/hikey/16.03/bootloader/nvme.img
  36. Compile U-Boot
  37. ==============
  38. > cd ~/hikey/src/u-boot
  39. > make CROSS_COMPILE=aarch64-linux-gnu- hikey_config
  40. > make CROSS_COMPILE=aarch64-linux-gnu-
  41. > cp u-boot.bin ~/hikey/bin
  42. Compile ARM Trusted Firmware (ATF)
  43. ==================================
  44. > cd ~/hikey/src/atf
  45. > make CROSS_COMPILE=aarch64-linux-gnu- all fip \
  46. BL30=~/hikey/bin/mcuimage.bin \
  47. BL33=~/hikey/bin/u-boot.bin DEBUG=1 PLAT=hikey
  48. Copy resulting binaries
  49. > cp build/hikey/debug/bl1.bin ~/hikey/bin
  50. > cp build/hikey/debug/fip.bin ~/hikey/bin
  51. Compile l-loader
  52. ===============
  53. > cd ~/hikey/l-loader
  54. > make BL1=~/hikey/bin/bl1.bin all
  55. > cp *.img ~/hikey/bin
  56. > cp l-loader.bin ~/hikey.bin
  57. These instructions are adapted from
  58. https://github.com/96boards/documentation/wiki/HiKeyUEFI
  59. FLASHING
  60. ========
  61. 1. Connect the second jumper on J15 BOOT SEL, to go into recovery mode and flash l-loader.bin with
  62. the hisi-idt.py utility.
  63. The command below assumes HiKey enumerated as the first USB serial port
  64. > sudo ~/hikey/burn_boot/hisi-idt.py -d /dev/ttyUSB0 --img1=~/hikey/bin/l-loader.bin
  65. 2. Once LED 0 comes on solid, HiKey board should be detected as a fastboot device by plugging a USB A to mini B
  66. cable from your PC to the USB OTG port of HiKey (on some boards I've found this to be unreliable).
  67. > sudo fastboot devices
  68. 0123456789ABCDEF fastboot
  69. 3. Flash the images
  70. > sudo fastboot flash ptable ~/hikey/bin/ptable.img
  71. > sudo fastboot flash fastboot ~/hikey/bin/fip.bin
  72. > sudo fastboot flash nvme ~/hikey/bin/nvme.img
  73. 4. Disconnect second jumper on J15 BOOT SEL, and reset the board and you will now (hopefully)
  74. have ATF, booting u-boot from eMMC. On 'new' boards I've had to do the
  75. flashing twice in the past to avoid an ATF error.
  76. Note: To get USB host working, also disconnect the USB OTG cable used for flashing. Otherwise you
  77. will get 'dwc_otg_core_host_init: Timeout!' errors.
  78. See working boot trace below (by default trace is now output to UART3 not UART0 on latest
  79. ATF, U-Boot and Kernel sources): -
  80. debug EMMC boot: send RST_N .
  81. debug EMMC boot: start eMMC boot......
  82. load fastboot1!
  83. Switch to aarch64 mode. CPU0 executes at 0xf9801000!
  84. INFO: BL1: 0xf9810000 - 0xf9817000 [size = 28672]
  85. NOTICE: Booting Trusted Firmware
  86. NOTICE: BL1: v1.1(debug):e8b7174
  87. NOTICE: BL1: Built : 19:16:44, Sep 8 2015
  88. INFO: BL1: RAM 0xf9810000 - 0xf9817000
  89. NOTICE: syspll frequency:1190494208Hz
  90. NOTICE: succeed to init lpddr3 rank0 dram phy
  91. INFO: lpddr3_freq_init, set ddrc 533mhz
  92. INFO: init ddr3 rank0
  93. INFO: ddr3 rank1 init pass
  94. INFO: lpddr3_freq_init, set ddrc 800mhz
  95. INFO: init ddr3 rank0
  96. INFO: ddr3 rank1 init pass
  97. INFO: Elpida DDR
  98. INFO: ddr test value:0xa5a55a5a
  99. INFO: Hisilicon HiKey platform is initialized
  100. INFO: Using FIP
  101. INFO: Loading file 'bl2.bin' at address 0xf9818000
  102. INFO: File 'bl2.bin' loaded: 0xf9818000 - 0xf9821100
  103. NOTICE: BL1: Booting BL2
  104. INFO: BL1: BL2 address = 0xf9818000
  105. INFO: BL1: BL2 spsr = 0x3c5
  106. INFO: [BDID] [fff91c18] midr: 0x410fd033
  107. INFO: [BDID] [fff91c1c] board type: 0
  108. INFO: [BDID] [fff91c20] board id: 0x2b
  109. INFO: init_acpu_dvfs: pmic version 17
  110. INFO: init_acpu_dvfs: ACPU_CHIP_MAX_FREQ=0x186a00.
  111. INFO: acpu_dvfs_volt_init: success!
  112. INFO: acpu_dvfs_set_freq: support freq num is 5
  113. INFO: acpu_dvfs_set_freq: start prof is 0x4
  114. INFO: acpu_dvfs_set_freq: magic is 0x5a5ac5c5
  115. INFO: acpu_dvfs_set_freq: voltage:
  116. INFO: - 0: 0x49
  117. INFO: - 1: 0x49
  118. INFO: - 2: 0x50
  119. INFO: - 3: 0x60
  120. INFO: - 4: 0x78
  121. NOTICE: acpu_dvfs_set_freq: set acpu freq success!NOTICE: BL2: v1.1(debug):e8b7174
  122. NOTICE: BL2: Built : 19:16:46, Sep 8 2015
  123. INFO: BL2: Loading BL3-0
  124. INFO: Using FIP
  125. INFO: Loading file 'bl30.bin' at address 0x1000000
  126. INFO: Skip reserving memory: 0x1000000 - 0x1023270
  127. INFO: File 'bl30.bin' loaded: 0x1000000 - 0x1023270
  128. INFO: bl2_plat_handle_bl30: [1000000] 3a334d43 34313032 2f38302f 30203133
  129. INFO: bl2_plat_handle_bl30: [10000c8] 0 0 b 0
  130. INFO: bl2_plat_handle_bl30: [1000190] 17 0 0 0
  131. INFO: bl2_plat_handle_bl30: [1023260] 0 0 0 0
  132. INFO: hisi_mcu_load_image: mcu sections 0:
  133. INFO: hisi_mcu_load_image: src = 0x1000200
  134. INFO: hisi_mcu_load_image: dst = 0xf6000000
  135. INFO: hisi_mcu_load_image: size = 512
  136. INFO: hisi_mcu_load_image: [SRC 0x1000200] 0x7600 0x201 0x1eae1 0x1ea71
  137. INFO: hisi_mcu_load_image: [DST 0xf6000000] 0x7600 0x201 0x1eae1 0x1ea71
  138. INFO: hisi_mcu_load_image: mcu sections 1:
  139. INFO: hisi_mcu_load_image: src = 0x1000400
  140. INFO: hisi_mcu_load_image: dst = 0xf6000200
  141. INFO: hisi_mcu_load_image: size = 27828
  142. INFO: hisi_mcu_load_image: [SRC 0x1000400] 0xbf00bf00 0x4815b672 0x48154780 0x60014915
  143. INFO: hisi_mcu_load_image: [DST 0xf6000200] 0xbf00bf00 0x4815b672 0x48154780 0x60014915
  144. INFO: hisi_mcu_load_image: mcu sections 2:
  145. INFO: hisi_mcu_load_image: src = 0x10070b4
  146. INFO: hisi_mcu_load_image: dst = 0xf6007200
  147. INFO: hisi_mcu_load_image: size = 1024
  148. INFO: hisi_mcu_load_image: [SRC 0x10070b4] 0x55 0x0 0x0 0x0
  149. INFO: hisi_mcu_load_image: [DST 0xf6007200] 0x55 0x0 0x0 0x0
  150. INFO: hisi_mcu_load_image: mcu sections 3:
  151. INFO: hisi_mcu_load_image: src = 0x10074b4
  152. INFO: hisi_mcu_load_image: dst = 0xfff8e000
  153. INFO: hisi_mcu_load_image: size = 12704
  154. INFO: hisi_mcu_load_image: [SRC 0x10074b4] 0x55 0x0 0x0 0x0
  155. INFO: hisi_mcu_load_image: [DST 0xfff8e000] 0x55 0x0 0x0 0x0
  156. INFO: hisi_mcu_load_image: mcu sections 4:
  157. INFO: hisi_mcu_load_image: src = 0x100a654
  158. INFO: hisi_mcu_load_image: dst = 0x5e00000
  159. INFO: hisi_mcu_load_image: size = 82912
  160. INFO: hisi_mcu_load_image: [SRC 0x100a654] 0x4ff0e92d 0x2cc5f645 0x2600b0ab 0x2c7cf6c0
  161. INFO: hisi_mcu_load_image: [DST 0x5e00000] 0x4ff0e92d 0x2cc5f645 0x2600b0ab 0x2c7cf6c0
  162. INFO: hisi_mcu_load_image: mcu sections 5:
  163. INFO: hisi_mcu_load_image: src = 0x101ea34
  164. INFO: hisi_mcu_load_image: dst = 0x5e143e0
  165. INFO: hisi_mcu_load_image: size = 12816
  166. INFO: hisi_mcu_load_image: [SRC 0x101ea34] 0x33323130 0x37363534 0x42413938 0x46454443
  167. INFO: hisi_mcu_load_image: [DST 0x5e143e0] 0x33323130 0x37363534 0x42413938 0x46454443
  168. INFO: hisi_mcu_load_image: mcu sections 6:
  169. INFO: hisi_mcu_load_image: src = 0x1021c44
  170. INFO: hisi_mcu_load_image: dst = 0x5e1c1d0
  171. INFO: hisi_mcu_load_image: size = 3060
  172. INFO: hisi_mcu_load_image: [SRC 0x1021c44] 0x0 0x0 0x0 0x0
  173. INFO: hisi_mcu_load_image: [DST 0x5e1c1d0] 0x0 0x0 0x0 0x0
  174. INFO: hisi_mcu_load_image: mcu sections 7:
  175. INFO: hisi_mcu_load_image: src = 0x1022838
  176. INFO: hisi_mcu_load_image: dst = 0x5e1cdc4
  177. INFO: hisi_mcu_load_image: size = 2616
  178. INFO: hisi_mcu_load_image: [SRC 0x1022838] 0xf80000a0 0x0 0xf80000ac 0x0
  179. INFO: hisi_mcu_load_image: [DST 0x5e1cdc4] 0xf80000a0 0x0 0xf80000ac 0x0
  180. INFO: hisi_mcu_start_run: AO_SC_SYS_CTRL2=0
  181. INFO: bl2_plat_handle_bl30: mcu pc is 42933301
  182. INFO: bl2_plat_handle_bl30: AO_SC_PERIPH_CLKSTAT4 is 39018f09
  183. INFO: BL2: TrustZone: protecting 16777216 bytes of memory at 0x3f000000
  184. INFO: BL2: Loading BL3-1
  185. INFO: Using FIP
  186. INFO: Loading file 'bl31.bin' at address 0xf9858000
  187. INFO: File 'bl31.bin' loaded: 0xf9858000 - 0xf9861010
  188. INFO: BL2: Loading BL3-2
  189. INFO: Using FIP
  190. WARNING: Failed to access image 'bl32.bin' (-1)
  191. WARNING: Failed to load BL3-2 (-1)
  192. INFO: BL2: Loading BL3-3
  193. INFO: Using FIP
  194. INFO: Loading file 'bl33.bin' at address 0x35000000
  195. INFO: File 'bl33.bin' loaded: 0x35000000 - 0x3504c468
  196. NOTICE: BL1: Booting BL3-1
  197. INFO: BL1: BL3-1 address = 0xf9858000
  198. INFO: BL1: BL3-1 spsr = 0x3cd
  199. INFO: BL1: BL3-1 params address = 0xf9821920
  200. INFO: BL1: BL3-1 plat params address = 0x0
  201. NOTICE: BL3-1: v1.1(debug):e8b7174
  202. NOTICE: BL3-1: Built : 19:16:49, Sep 8 2015
  203. INFO: BL3-1: Initializing runtime services
  204. INFO: BL3-1: Preparing for EL3 exit to normal world
  205. INFO: BL3-1: Next image address = 0x35000000
  206. INFO: BL3-1: Next image spsr = 0x3c9
  207. U-Boot 2015.10-rc2 (Sep 08 2015 - 20:29:33 +0100)hikey
  208. DRAM: 1008 MiB
  209. HI6553 PMIC init
  210. MMC: config_sd_carddetect: SD card not present
  211. HiKey DWMMC: 0, HiKey DWMMC: 1
  212. Card did not respond to voltage select!
  213. ** Bad device mmc 1 **
  214. Using default environment
  215. In: serial
  216. Out: serial
  217. Err: serial
  218. Net: Net Initialization Skipped
  219. No ethernet found.
  220. Hit any key to stop autoboot: 0
  221. starting USB...
  222. USB0: Core Release: 3.00a
  223. scanning bus 0 for devices... 2 USB Device(s) found
  224. scanning usb for storage devices... 0 Storage Device(s) found
  225. scanning usb for ethernet devices... 0 Ethernet Device(s) found