2019-09-25 13:58:36 +01:00
HiKey
=====
2017-06-28 15:23:03 +01:00
HiKey is one of 96boards. Hisilicon Kirin6220 processor is installed on HiKey.
More information are listed in `link`_ .
How to build
2019-09-25 13:58:36 +01:00
------------
2017-06-28 15:23:03 +01:00
Code Locations
2019-09-25 13:58:36 +01:00
~~~~~~~~~~~~~~
2017-06-28 15:23:03 +01:00
2018-03-01 18:44:00 +00:00
- Trusted Firmware-A:
2017-06-28 15:23:03 +01:00
`link <https://github.com/ARM-software/arm-trusted-firmware> `__
2017-05-27 16:14:25 +01:00
- OP-TEE
`link <https://github.com/OP-TEE/optee_os> `__
2017-06-28 15:23:03 +01:00
- edk2:
`link <https://github.com/96boards-hikey/edk2/tree/testing/hikey960_v2.5> `__
- OpenPlatformPkg:
`link <https://github.com/96boards-hikey/OpenPlatformPkg/tree/testing/hikey960_v1.3.4> `__
- l-loader:
`link <https://github.com/96boards-hikey/l-loader/tree/testing/hikey960_v1.2> `__
- atf-fastboot:
`link <https://github.com/96boards-hikey/atf-fastboot/tree/master> `__
Build Procedure
2019-09-25 13:58:36 +01:00
~~~~~~~~~~~~~~~
2017-06-28 15:23:03 +01:00
- Fetch all the above repositories into local host.
Make all the repositories in the same ${BUILD\_PATH}.
2017-09-29 19:56:39 +01:00
.. code :: shell
git clone https://github.com/ARM-software/arm-trusted-firmware -b integration
git clone https://github.com/OP-TEE/optee_os
git clone https://github.com/96boards-hikey/edk2 -b testing/hikey960_v2.5
git clone https://github.com/96boards-hikey/OpenPlatformPkg -b testing/hikey960_v1.3.4
git clone https://github.com/96boards-hikey/l-loader -b testing/hikey960_v1.2
git clone https://github.com/96boards-hikey/atf-fastboot
2017-06-28 15:23:03 +01:00
- Create the symbol link to OpenPlatformPkg in edk2.
.. code :: shell
$cd ${BUILD_PATH}/edk2
$ln -sf ../OpenPlatformPkg
- Prepare AARCH64 && AARCH32 toolchain. Prepare python.
2020-03-14 02:24:41 +00:00
- If your hikey hardware is built by CircuitCo, update *OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dsc* first. *(optional)*
2017-06-28 15:23:03 +01:00
console on hikey.**
.. code :: shell
2020-03-14 02:24:41 +00:00
DEFINE SERIAL_BASE=0xF8015000
2017-06-28 15:23:03 +01:00
2018-01-29 01:47:10 +00:00
If your hikey hardware is built by LeMaker, nothing to do.
2017-06-28 15:23:03 +01:00
- Build it as debug mode. Create your own build script file or you could refer to **build\_uefi.sh** in l-loader git repository.
.. code :: shell
2020-03-14 02:24:41 +00:00
cd {BUILD_PATH}/arm-trusted-firmware
sh ../l-loader/build_uefi.sh hikey
2017-06-28 15:23:03 +01:00
2017-09-29 19:56:39 +01:00
- 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.
2017-06-28 15:23:03 +01:00
.. code :: shell
2017-09-29 19:56:39 +01:00
cd ${BUILD_PATH}/l-loader
ln -sf ${EDK2_OUTPUT_DIR}/FV/bl1.bin
2018-01-25 08:10:14 +00:00
ln -sf ${EDK2_OUTPUT_DIR}/FV/bl2.bin
2017-09-29 19:56:39 +01:00
ln -sf ${BUILD_PATH}/atf-fastboot/build/hikey/${FASTBOOT_BUILD_OPTION}/bl1.bin fastboot.bin
make hikey PTABLE_LST=aosp-8g
2017-06-28 15:23:03 +01:00
Setup Console
-------------
- 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.**
.. code :: shell
$sudo apt-get install ser2net
- Configure ser2net.
.. code :: shell
$sudo vi /etc/ser2net.conf
Append one line for serial-over-USB in below.
*#ser2net.conf*
.. code :: shell
2004:telnet:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner
2017-07-12 08:13:43 +01:00
- Start ser2net
.. code :: shell
$sudo killall ser2net
$sudo ser2net -u
2017-06-28 15:23:03 +01:00
- Open the console.
.. code :: shell
$telnet localhost 2004
And you could open the console remotely, too.
2017-08-27 09:46:03 +01:00
Flash images in recovery mode
2017-06-28 15:23:03 +01:00
-----------------------------
- Make sure Pin3-Pin4 on J15 are connected for recovery mode. Then power on HiKey.
- Remove the modemmanager package. This package may cause the idt tool failure.
.. code :: shell
$sudo apt-get purge modemmanager
2018-01-25 08:10:14 +00:00
- Run the command to download recovery.bin into HiKey.
2017-06-28 15:23:03 +01:00
.. code :: shell
2018-01-25 08:10:14 +00:00
$sudo python hisi-idt.py -d /dev/ttyUSB1 --img1 recovery.bin
2017-06-28 15:23:03 +01:00
2019-02-08 16:43:05 +00:00
- Update images. All aosp or debian images could be fetched from `link <http://releases.linaro.org/96boards/> `__ .
2017-06-28 15:23:03 +01:00
.. code :: shell
$sudo fastboot flash ptable prm_ptable.img
2018-01-25 08:10:14 +00:00
$sudo fastboot flash loader l-loader.bin
2017-06-28 15:23:03 +01:00
$sudo fastboot flash fastboot fip.bin
$sudo fastboot flash boot boot.img
$sudo fastboot flash cache cache.img
$sudo fastboot flash system system.img
$sudo fastboot flash userdata userdata.img
Boot UEFI in normal mode
------------------------
- Make sure Pin3-Pin4 on J15 are open for normal boot mode. Then power on HiKey.
- Reference `link <https://github.com/96boards-hikey/tools-images-hikey960/blob/master/build-from-source/README-ATF-UEFI-build-from-source.md> `__
2019-02-08 16:43:05 +00:00
.. _link: https://www.96boards.org/documentation/consumer/hikey/