hikey.rst 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. HiKey
  2. =====
  3. HiKey is one of 96boards. Hisilicon Kirin6220 processor is installed on HiKey.
  4. More information are listed in `link`_.
  5. How to build
  6. ------------
  7. Code Locations
  8. ~~~~~~~~~~~~~~
  9. - Trusted Firmware-A:
  10. `link <https://github.com/ARM-software/arm-trusted-firmware>`__
  11. - OP-TEE
  12. `link <https://github.com/OP-TEE/optee_os>`__
  13. - edk2:
  14. `link <https://github.com/96boards-hikey/edk2/tree/testing/hikey960_v2.5>`__
  15. - OpenPlatformPkg:
  16. `link <https://github.com/96boards-hikey/OpenPlatformPkg/tree/testing/hikey960_v1.3.4>`__
  17. - l-loader:
  18. `link <https://github.com/96boards-hikey/l-loader/tree/testing/hikey960_v1.2>`__
  19. - atf-fastboot:
  20. `link <https://github.com/96boards-hikey/atf-fastboot/tree/master>`__
  21. Build Procedure
  22. ~~~~~~~~~~~~~~~
  23. - Fetch all the above repositories into local host.
  24. Make all the repositories in the same ${BUILD\_PATH}.
  25. .. code:: shell
  26. git clone https://github.com/ARM-software/arm-trusted-firmware -b integration
  27. git clone https://github.com/OP-TEE/optee_os
  28. git clone https://github.com/96boards-hikey/edk2 -b testing/hikey960_v2.5
  29. git clone https://github.com/96boards-hikey/OpenPlatformPkg -b testing/hikey960_v1.3.4
  30. git clone https://github.com/96boards-hikey/l-loader -b testing/hikey960_v1.2
  31. git clone https://github.com/96boards-hikey/atf-fastboot
  32. - Create the symbol link to OpenPlatformPkg in edk2.
  33. .. code:: shell
  34. $cd ${BUILD_PATH}/edk2
  35. $ln -sf ../OpenPlatformPkg
  36. - Prepare AARCH64 && AARCH32 toolchain. Prepare python.
  37. - If your hikey hardware is built by CircuitCo, update *OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dsc* first. *(optional)*
  38. console on hikey.**
  39. .. code:: shell
  40. DEFINE SERIAL_BASE=0xF8015000
  41. If your hikey hardware is built by LeMaker, nothing to do.
  42. - Build it as debug mode. Create your own build script file or you could refer to **build\_uefi.sh** in l-loader git repository.
  43. .. code:: shell
  44. cd {BUILD_PATH}/arm-trusted-firmware
  45. sh ../l-loader/build_uefi.sh hikey
  46. - Generate l-loader.bin and partition table for aosp. The eMMC capacity is either 8GB or 4GB. Just change "aosp-8g" to "linux-8g" for debian.
  47. .. code:: shell
  48. cd ${BUILD_PATH}/l-loader
  49. ln -sf ${EDK2_OUTPUT_DIR}/FV/bl1.bin
  50. ln -sf ${EDK2_OUTPUT_DIR}/FV/bl2.bin
  51. ln -sf ${BUILD_PATH}/atf-fastboot/build/hikey/${FASTBOOT_BUILD_OPTION}/bl1.bin fastboot.bin
  52. make hikey PTABLE_LST=aosp-8g
  53. Setup Console
  54. -------------
  55. - Install ser2net. Use telnet as the console since UEFI fails to display Boot Manager GUI in minicom. **If you don't need Boot Manager GUI, just ignore this section.**
  56. .. code:: shell
  57. $sudo apt-get install ser2net
  58. - Configure ser2net.
  59. .. code:: shell
  60. $sudo vi /etc/ser2net.conf
  61. Append one line for serial-over-USB in below.
  62. *#ser2net.conf*
  63. .. code:: shell
  64. 2004:telnet:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner
  65. - Start ser2net
  66. .. code:: shell
  67. $sudo killall ser2net
  68. $sudo ser2net -u
  69. - Open the console.
  70. .. code:: shell
  71. $telnet localhost 2004
  72. And you could open the console remotely, too.
  73. Flash images in recovery mode
  74. -----------------------------
  75. - Make sure Pin3-Pin4 on J15 are connected for recovery mode. Then power on HiKey.
  76. - Remove the modemmanager package. This package may cause the idt tool failure.
  77. .. code:: shell
  78. $sudo apt-get purge modemmanager
  79. - Run the command to download recovery.bin into HiKey.
  80. .. code:: shell
  81. $sudo python hisi-idt.py -d /dev/ttyUSB1 --img1 recovery.bin
  82. - Update images. All aosp or debian images could be fetched from `link <http://releases.linaro.org/96boards/>`__.
  83. .. code:: shell
  84. $sudo fastboot flash ptable prm_ptable.img
  85. $sudo fastboot flash loader l-loader.bin
  86. $sudo fastboot flash fastboot fip.bin
  87. $sudo fastboot flash boot boot.img
  88. $sudo fastboot flash cache cache.img
  89. $sudo fastboot flash system system.img
  90. $sudo fastboot flash userdata userdata.img
  91. Boot UEFI in normal mode
  92. ------------------------
  93. - Make sure Pin3-Pin4 on J15 are open for normal boot mode. Then power on HiKey.
  94. - Reference `link <https://github.com/96boards-hikey/tools-images-hikey960/blob/master/build-from-source/README-ATF-UEFI-build-from-source.md>`__
  95. .. _link: https://www.96boards.org/documentation/consumer/hikey/