Skip to content

Notes on Hikey960

About the board. Pros: OPTEE support; Arm Mali; run Debian (community support)

Cons: lots of hardware quirks. Not easy to buy

Goal: Linux kernel development on Hikey960 with Debian support. (not AOSP)

Flash debian

follow the tutorial here https://wiki.debian.org/InstallingDebianOn/96Boards/HiKey960

except using the newest UEFI. download all files there. https://snapshots.linaro.org/reference-platform/components/uefi-staging/107/hikey960/debug/ (and config file is correct)

OS: * boot-linaro-stretch-developer-hikey-20200720-48.img * rootfs-linaro-stretch-developer-hikey-20200720-48.img

Serial

Note: it's 1.8v (not 3.3v). Will need an adapter that supports 1.8v. Can bought one from Amazon.

image-20210120215507900 image-20210120215527930 image-20210120215553232

Wifi

use nmtui

Console display issue

Install ser2net. Use telnet as the console since UEFI will output window that fails to display in minicom.

$sudo apt-get install ser2net
# Configure ser2net.
$sudo vi /etc/ser2net.conf
# Append one line for serial-over-USB in #ser2net.conf
2004:telnet:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner

# Start ser2net
$sudo killall ser2net
$sudo ser2net -u
# Open the console.
$telnet localhost 2004

And you could open the console remotely, too.

USB

hikey960 ethernet over USBC --> pretty much usb2.0 speed

 ------------------------------------------------------------
[  3] local 10.42.0.2 port 55184 connected with 10.42.0.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   405 MBytes   340 Mbits/sec

Custom kernel compilation

kernel: hikey-4.19.5. Config from the Debian 9 image. May want to set DEV_MEM_STRICT=no for hacking

cross compilation

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make -j24 bindeb-pkg LOCALVERSION=xzl

After the compilation, in the directory one level above the kernel source tree, you will get:

  • linux-image-xxx.deb, a Debian package with the kernel and modules

  • linux-headers-xxx.deb, a Debian package with kernel headers (not needed mostly)

Build the Bifrost kernel module (Arm mali)

make all KDIR=/usr/src/linux-headers-$(uname -r) CONFIG_MALI_MIDGARD=m CONFIG_MALI_GATOR_SUPPORT=y CONFIG_MALI_MIDGARD_DVFS=y CONFIG_MALI_EXPERT=y CONFIG_MALI_PLATFORM_FAKE=y CONFIG_MALI_PLATFORM_THIRDPARTY=y CONFIG_MALI_PLATFORM_THIRDPARTY_NAME=devicetree

cf: https://www.96boards.org/documentation/consumer/hikey/hikey960/guides/openCL-support.md.html

What works?

boot from sd card (debian SD images). 4.19 kernel * stock (coming with the debian SD image), i.e. *.sd * custom (4.19.5 + config.gz from the debian stock kernel). source: hikey-4.19.5.tar.gz both have usb working (and ethernet!)

root@linaro-developer:~# lsusb
Bus 002 Device 003: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 002 Device 002: ID 0424:5734 Standard Microsystems Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0424:2740 Standard Microsystems Corp.
Bus 001 Device 002: ID 0424:2734 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

NOTE: must unplug the usbc cable. custom kernel. built & installed as a deb package UFS: debian images + custom kernel? not tried.

What does not work

  • boot from internal flash (debian images loaded via fastboot). 4.19 kernel.
  • usb seems broken. (lsusb shows nothing)

Install GPU driver and OpenCL

https://www.96boards.org/documentation/consumer/hikey/hikey960/guides/openCL-support.md.html