HiKey: Difference between revisions

From Xen
Jump to navigationJump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
= Building Xen =
= 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 [http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=2831f2099b6175384817d7afd952f7918998b39a 2831f2099b6175384817d7afd952f7918998b39a].
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 [http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=2831f2099b6175384817d7afd952f7918998b39a 2831f2099b6175384817d7afd952f7918998b39a].
No other special requirements are needed.w
No other special requirements are needed.


= Building Linux =
= Building Linux =
Line 25: Line 25:
kernel=Image console=hvc0 root=/dev/mmcblk1p4 rootwait rw
kernel=Image console=hvc0 root=/dev/mmcblk1p4 rootwait rw


Be careful that on some device trees the uart path is <b>/soc</b>/uart@f7113000 instead of /smb/uart@f7113000.
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>.
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>.



Alternatively you could also install your Linux system on an external USB drive, but unfortunately the UEFI firmware on the HiKey is not able to pick up USB drives at boot, so you still need to install Linux and Xen on the FAT partition of the SD card.
= Known Issues =

* The UEFI firmware on the HiKey is not able to pick up USB drives at boot, so even if you install your Linux system on a USB drive, you still need to copy the Linux and Xen binaries to the FAT partition of the SD card.
* Having a USB ethernet adapter plugged at boot crashes the kernel sometimes. If you see this problem reboot without ethernet adapter and plug it in later.
* There is no support for UHS SD cards

Latest revision as of 18:56, 17 July 2017

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.

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

Be careful that on some device trees the uart path is /soc/uart@f7113000 instead of /smb/uart@f7113000. 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.


Known Issues

  • The UEFI firmware on the HiKey is not able to pick up USB drives at boot, so even if you install your Linux system on a USB drive, you still need to copy the Linux and Xen binaries to the FAT partition of the SD card.
  • Having a USB ethernet adapter plugged at boot crashes the kernel sometimes. If you see this problem reboot without ethernet adapter and plug it in later.
  • There is no support for UHS SD cards