HiKey: Difference between revisions

From Xen
Jump to navigationJump to search
No edit summary
No edit summary
Line 9: Line 9:
HiKey support is not upstream in Linux. The Linux tree with HiKey support provided by 96boards is on [https://github.com/96boards/linux.git github].
HiKey support is not upstream in Linux. The Linux tree with HiKey support provided by 96boards is on [https://github.com/96boards/linux.git github].
At the time of writing this article, 96boards.org recommends the usage of tag "96boards-hikey-15.11", which is based on Linux 3.18. However Linux 3.18 doesn't work very well on Xen on this board, I recommend using a newer branch, like [https://github.com/96boards/linux/tree/android-hikey-linaro-4.1 android-hikey-linaro-4.1]. Use [http://xenbits.xen.org/people/sstabellini/config-hikey this kernel config] for Dom0, which is based on the default kernel config with a few options removed.
At the time of writing this article, 96boards.org recommends the usage of tag "96boards-hikey-15.11", which is based on Linux 3.18. However Linux 3.18 doesn't work very well on Xen on this board, I recommend using a newer branch, like [https://github.com/96boards/linux/tree/android-hikey-linaro-4.1 android-hikey-linaro-4.1]. Use [http://xenbits.xen.org/people/sstabellini/config-hikey this kernel config] for Dom0, which is based on the default kernel config with a few options removed.

= Installation =
The best way to use your HiKey board is by installing your Linux rootfs on an external microSD card. HiKey comes with UEFI firmware and by default it will look into the external SD card first. For example you could dd a [http://mirror.centos.org/altarch/7/isos/aarch64 CentOS 7 ARM64 rootfs] to the microSD. CentOS 7 supports UEFI booting which is helpful.
Unfortunately changing the UEFI boot entries permanently is not easy on the HiKey at the moment, but it is possible to use Xen as bootloader or boot Linux directly using the startup.nsh UEFI script.

Copy the Linux <b>Image</b> file to the FAT partition on the microSD card. Then write the following lines to a file called <b>startup.nsh</b>:

FS0:
Image console=ttyAMA3,115200 root=/dev/mmcblk1p4 rootwait rw efi=noruntime

The root device here is the one of a CentOS 7 installation.
Copy <b>xen.efi</b> to the FAT partition on the microSD card. Write the following lines to a file called <b>xen.cfg</b>:

options=console=dtuart dom0_mem=512M dom0_max_vcpus=4 conswitch=x dtuart=/smb/uart@f7113000
kernel=Image console=hvc0 root=/dev/mmcblk1p4 rootwait rw
dtb=hi6220-hikey.dtb

The next time you boot the board, type <b>4</b> to get into the UEFI shell, then if you just wait for the timeout to run out, Linux will boot by default. Otherwise if you want to boot xen, just type the <b>ESC</b> key, then type <b>xen</b>.

Revision as of 17:51, 11 December 2015

Xen ARM64 on 96boards HiKey

Xen is now supported upstream on the 96boards HiKey, however beware that to run Xen on HiKey you need the 96Boards UART Serial Adapter, available here. Given that the board doesn't come with an ethernet interface, a USB ethernet adapter is also recommended.

Building Xen

Make sure to build a version of Xen which is new enough to support PSCI 1.0, which was added during the 4.7 development window by 2831f2099b6175384817d7afd952f7918998b39a. No other special requirements are needed.w

Building Linux

HiKey support is not upstream in Linux. The Linux tree with HiKey support provided by 96boards is on github. At the time of writing this article, 96boards.org recommends the usage of tag "96boards-hikey-15.11", which is based on Linux 3.18. However Linux 3.18 doesn't work very well on Xen on this board, I recommend using a newer branch, like android-hikey-linaro-4.1. Use this kernel config for Dom0, which is based on the default kernel config with a few options removed.

Installation

The best way to use your HiKey board is by installing your Linux rootfs on an external microSD card. HiKey comes with UEFI firmware and by default it will look into the external SD card first. For example you could dd a CentOS 7 ARM64 rootfs to the microSD. CentOS 7 supports UEFI booting which is helpful. Unfortunately changing the UEFI boot entries permanently is not easy on the HiKey at the moment, but it is possible to use Xen as bootloader or boot Linux directly using the startup.nsh UEFI script.

Copy the Linux Image file to the FAT partition on the microSD card. Then write the following lines to a file called startup.nsh:

 FS0:
 Image console=ttyAMA3,115200 root=/dev/mmcblk1p4 rootwait rw efi=noruntime

The root device here is the one of a CentOS 7 installation. Copy xen.efi to the FAT partition on the microSD card. Write the following lines to a file called xen.cfg:

 options=console=dtuart dom0_mem=512M dom0_max_vcpus=4 conswitch=x dtuart=/smb/uart@f7113000
 kernel=Image console=hvc0 root=/dev/mmcblk1p4 rootwait rw
 dtb=hi6220-hikey.dtb

The next time you boot the board, type 4 to get into the UEFI shell, then if you just wait for the timeout to run out, Linux will boot by default. Otherwise if you want to boot xen, just type the ESC key, then type xen.