README 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. Introduction
  2. ============
  3. HiKey960 is one of the 96Boards Consumer Edition board from HiSilicon.
  4. The board/SoC has: -
  5. * HiSilicon Kirin960 (HI3660) SoC with 4xCortex-A73 and 4xCortex-A53
  6. * ARM Mali G71 MP8 GPU
  7. * 3GB LPDDR4 SDRAM
  8. * 32GB UFS Flash Storage
  9. * microSD
  10. * 802.11a/b/g/n WiFi, Bluetooth
  11. More information about this board can be found in 96Boards website:
  12. https://www.96boards.org/product/hikey960/
  13. Currently the u-boot port supports: -
  14. * SD card
  15. Compile from source
  16. ===================
  17. First get all the sources
  18. > mkdir -p ~/hikey960/src ~/hikey960/bin
  19. > cd ~/hikey960/src
  20. > git clone https://github.com/ARM-software/arm-trusted-firmware
  21. > git clone https://github.com/96boards-hikey/OpenPlatformPkg -b testing/hikey960_v1.3.4
  22. > git clone https://github.com/96boards-hikey/l-loader -b testing/hikey960_v1.2
  23. > wget http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey960/release/config
  24. > wget http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey960/release/hisi-sec_usb_xloader.img
  25. > wget http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey960/release/hisi-sec_uce_boot.img
  26. > wget http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey960/release/sec_xloader.img
  27. > wget http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey960/release/recovery.bin
  28. > wget http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey960/release/hikey_idt
  29. Get the SCP_BL2 lpm3.img binary. It is shipped as part of the UEFI source.
  30. The latest version can be obtained from the OpenPlatformPkg repo.
  31. > cp OpenPlatformPkg/Platforms/Hisilicon/HiKey960/Binary/lpm3.img ~/hikey960/bin/
  32. Compile U-Boot
  33. ==============
  34. > cd ~/hikey960/src/u-boot
  35. > make CROSS_COMPILE=aarch64-linux-gnu- hikey960_defconfig
  36. > make CROSS_COMPILE=aarch64-linux-gnu-
  37. > cp u-boot.bin ~/hikey960/bin/
  38. Compile ARM Trusted Firmware (ATF)
  39. ==================================
  40. > cd ~/hikey960/src/arm-trusted-firmware
  41. > make CROSS_COMPILE=aarch64-linux-gnu- all fip \
  42. SCP_BL2=~/hikey960/bin/lpm3.img \
  43. BL33=~/hikey960/bin/u-boot.bin DEBUG=1 PLAT=hikey960
  44. Copy the resulting FIP binary
  45. > cp build/hikey960/debug/fip.bin ~/hikey960/bin
  46. Compile l-loader
  47. ================
  48. > cd ~/hikey960/src/l-loader
  49. > ln -sf ~/hikey960/src/arm-trusted-firmware/build/hikey960/debug/bl1.bin
  50. > ln -sf ~/hikey960/src/arm-trusted-firmware/build/hikey960/debug/bl2.bin
  51. > ln -sf ~/hikey960/src/arm-trusted-firmware/build/hikey960/debug/fip.bin
  52. > ln -sf ~/hikey960/bin/u-boot.bin
  53. > make hikey960 PTABLE_LST=linux-32g NS_BL1U=u-boot.bin
  54. Copy the resulting binaries
  55. > cp *.img ~/hikey960/bin
  56. > cp l-loader.bin ~/hikey960/bin
  57. These instructions are adapted from
  58. https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/hikey960.rst
  59. Setup Console
  60. =============
  61. Install ser2net. Use telnet as the console since UEFI in recovery mode
  62. output window fails to display in minicom.
  63. > sudo apt-get install ser2net
  64. Configure ser2net
  65. > sudo vi /etc/ser2net.conf
  66. Append one line for serial-over-USB in #ser2net.conf
  67. > 2004:telnet:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner
  68. Start ser2net
  69. > sudo killall ser2net
  70. > sudo ser2net -u
  71. Open the console.
  72. > telnet localhost 2004
  73. And you could open the console remotely, too.
  74. Flashing
  75. ========
  76. 1. Boot Hikey960 into recovery mode as per the below document:
  77. https://github.com/96boards/documentation/blob/master/consumer/hikey/hikey960/installation/board-recovery.md
  78. Once Hikey960 is in recovery mode, flash the recovery binary:
  79. > cd ~/hikey960/src
  80. > chmod +x ./hikey_idt
  81. > sudo ./hikey_idt -c config -p /dev/ttyUSB1
  82. Now move to the Hikey960 console and press `f` during UEFI boot. This
  83. will allow the board to boot into fastboot mode. Once the board is in
  84. fastboot mode, you should see the ID of the HiKey960 board using the
  85. following command
  86. > sudo fastboot devices
  87. 1ED3822A018E3372 fastboot
  88. 3. Flash the images
  89. Now, the images can be flashed using fastboot:
  90. > sudo fastboot flash ptable ~/hikey960/bin/prm_ptable.img
  91. > sudo fastboot flash xloader ~/hikey960/bin/sec_xloader.img
  92. > sudo fastboot flash fastboot ~/hikey960/bin/l-loader.bin
  93. > sudo fastboot flash fip ~/hikey960/bin/fip.bin
  94. 4. Set the "Boot Mode" switch to OFF position for normal boot mode.
  95. Then power on HiKey960
  96. Observe the console traces using UART6 on the Low Speed Expansion header:
  97. NOTICE: BL2: v2.1(debug):v2.1-531-g3ee48f40
  98. NOTICE: BL2: Built : 18:15:58, Aug 2 2019
  99. INFO: BL2: Doing platform setup
  100. INFO: UFS LUN0 contains 1024 blocks with 4096-byte size
  101. INFO: UFS LUN1 contains 1024 blocks with 4096-byte size
  102. INFO: UFS LUN2 contains 2048 blocks with 4096-byte size
  103. INFO: UFS LUN3 contains 7805952 blocks with 4096-byte size
  104. INFO: ufs: change power mode success
  105. INFO: BL2: Loading image id 2
  106. INFO: Loading image id=2 at address 0x89c80000
  107. INFO: Image id=2 loaded: 0x89c80000 - 0x89cb5088
  108. INFO: BL2: Initiating SCP_BL2 transfer to SCP
  109. INFO: BL2: SCP_BL2: 0x89c80000@0x35088
  110. INFO: BL2: SCP_BL2 HEAD:
  111. INFO: BL2: SCP_BL2 0x7000 0x179 0x159 0x149
  112. INFO: BL2: SCP_BL2 0x189 0x18b 0x18d 0x0
  113. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x18f
  114. INFO: BL2: SCP_BL2 0x191 0x0 0x193 0x195
  115. INFO: BL2: SCP_BL2 0x18fd 0x18fd 0x18fd 0x18fd
  116. INFO: BL2: SCP_BL2 0x18fd 0x18fd 0x18fd 0x18fd
  117. INFO: BL2: SCP_BL2 0x18fd 0x18fd 0x18fd 0x18fd
  118. INFO: BL2: SCP_BL2 0x4d454355 0x43494741 0x424d554e 0x21215245
  119. INFO: BL2: SCP_BL2 0x4a054904 0x42912000 0xf841bfbc 0xe7fa0b04
  120. INFO: BL2: SCP_BL2 0xb88cf000 0x3b18 0x3d1c 0x6809493e
  121. INFO: BL2: SCP_BL2 0x4613680a 0x201f102 0xf0002a04 0x600a804c
  122. INFO: BL2: SCP_BL2 0x204f04f 0xf203fb02 0xf102440a 0x60100204
  123. INFO: BL2: SCP_BL2 0x160f04f 0xf103fb01 0x68004834 0x61044408
  124. INFO: BL2: SCP_BL2 0x61866145 0xf8c061c7 0xf8c08020 0xf8c09024
  125. INFO: BL2: SCP_BL2 0xf8c0a028 0xf3efb02c 0xf3ef8208 0x68118309
  126. INFO: BL2: SCP_BL2 0xf1026401 0xf0110204 0xbf070f04 0x46113220
  127. INFO: BL2: SCP_BL2 TAIL:
  128. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  129. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  130. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  131. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  132. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  133. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  134. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  135. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  136. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  137. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  138. INFO: BL2: SCP_BL2 0x0 0x19cad151 0x19b80040 0x0
  139. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  140. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  141. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  142. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  143. INFO: BL2: SCP_BL2 0x0 0x0 0x0 0x0
  144. INFO: BL2: SCP_BL2 transferred to SCP
  145. INFO: start fw loading
  146. INFO: fw load success
  147. WARNING: BL2: Platform setup already done!!
  148. INFO: BL2: Loading image id 3
  149. INFO: Loading image id=3 at address 0x1ac58000
  150. INFO: Image id=3 loaded: 0x1ac58000 - 0x1ac63024
  151. INFO: BL2: Loading image id 5
  152. INFO: Loading image id=5 at address 0x1ac98000
  153. INFO: Image id=5 loaded: 0x1ac98000 - 0x1ad0819c
  154. NOTICE: BL2: Booting BL31
  155. INFO: Entry point address = 0x1ac58000
  156. INFO: SPSR = 0x3cd
  157. NOTICE: BL31: v2.1(debug):v2.1-531-g3ee48f40
  158. NOTICE: BL31: Built : 18:16:01, Aug 2 2019
  159. INFO: ARM GICv2 driver initialized
  160. INFO: BL31: Initializing runtime services
  161. INFO: BL31: cortex_a53: CPU workaround for 855873 was applied
  162. INFO: plat_setup_psci_ops: sec_entrypoint=0x1ac580fc
  163. INFO: BL31: Preparing for EL3 exit to normal world
  164. INFO: Entry point address = 0x1ac98000
  165. INFO: SPSR = 0x3c9
  166. U-Boot 2019.07-00628-g286f05a6fc-dirty (Aug 02 2019 - 17:14:05 +0530)
  167. Hikey960
  168. DRAM: 3 GiB
  169. PSCI: v1.1
  170. MMC: dwmmc1@ff37f000: 0
  171. Loading Environment from EXT4... ** File not found /uboot.env **
  172. ** Unable to read "/uboot.env" from mmc0:2 **
  173. In: serial@fff32000
  174. Out: serial@fff32000
  175. Err: serial@fff32000
  176. Net: Net Initialization Skipped
  177. No ethernet found.
  178. Hit any key to stop autoboot: 0
  179. switch to partitions #0, OK
  180. mmc0 is current device
  181. Scanning mmc 0:1...
  182. Found /extlinux/extlinux.conf
  183. Retrieving file: /extlinux/extlinux.conf
  184. 201 bytes read in 12 ms (15.6 KiB/s)
  185. 1: hikey960-kernel
  186. Retrieving file: /Image
  187. 24689152 bytes read in 4377 ms (5.4 MiB/s)
  188. append: earlycon=pl011,mmio32,0xfff32000 console=ttyAMA6,115200 rw root=/dev/mmcblk0p2 rot
  189. Retrieving file: /hi3660-hikey960.dtb
  190. 35047 bytes read in 14 ms (2.4 MiB/s)
  191. ## Flattened Device Tree blob at 10000000
  192. Booting using the fdt blob at 0x10000000
  193. Using Device Tree in place at 0000000010000000, end 000000001000b8e6
  194. Starting kernel ...
  195. [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
  196. [ 0.000000] Linux version 5.2.0-03138-gd75da80dce39 (mani@Mani-XPS-13-9360) (gcc versi9
  197. [ 0.000000] Machine model: HiKey960
  198. [ 0.000000] earlycon: pl11 at MMIO32 0x00000000fff32000 (options '')
  199. [ 0.000000] printk: bootconsole [pl11] enabled
  200. [ 0.000000] efi: Getting EFI parameters from FDT: