Linux support issue on hikey 960

Yes for default Debian Linux, you need UART mezzanine board.

For latest Linux version 4.14-rc7, please use https://github.com/96boards-hikey/linux/commits/hikey960-upstream-rebase branch. It has support for hdmi and usb drivers.

Hikey960 has integrated GIC-400 which complies to GICv2 architecture.

Regards,
Sumit

Thanks for reply,
So then, can I compile and flash the 4.14-rc7 directly without using uart board? or should I firstly boot up my board with uart console, then switch the kernel into 4.14?

Thanks,

@wangmir you need to boot up board with uart console first and then switch to 4.14 kernel. Actually kernel image is part of Debian rootfs as /boot/vmlinuz-4.15-hikey.

1 Like

Ok, then do you have any guide to make new rootfs from the scratch based on 960 source with 4.14?

1 Like

Can you guide me to build & deloy latest kernel, which supports USB and HDMI drivers, to hikey 960?

I boot up basic debian linux with uart console, but then how can I build and switch to new and USB supported linux kernel when the basic debian linux does not support USB driver?

Hi @wangmir,

For the USB and HDMI support, you can use the landing team kernel [1]. Then just use the instructions in below guide for building and deploying it on HiKey960 running debian.

Note:

After installing the kernel using dpkg utility, you should boot with your devicetree. Please see the last section in above document.

Thanks,
Mani

3 Likes

Hi, what do you mean “landing team kernel”?

Hi, what do you mean “landing team kernel”?

The kernel tree maintained by HiSilicon landing team. They use this tree for the whole development around HiKey960 board.

Hi Mani, those instructions appear to be for the Hikey 620, will those instructions work without change on a Hikey 960?

Hi @morgdx,

Yes it should work for HiKey960 too. Only prerequisite is to have a running Linaro debian image on the board.

Thanks,
Mani

1 Like

@Mani

I’m trying to complete the host build steps on an Ubuntu 18.04.1 LTS host and have run into some trouble.

wget releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-*-x86_64_aarch64-linux-gnu.tar.xz
mkdir ~/toolchain
tar -xf gcc-*-x86_64_aarch64-linux-gnu.tar.xz -C ~/toolchain --strip-components=1
git clone https://github.com/suihkulokki/linux.git
cd linux/
git checkout -t origin/hikey-v4.15
sudo apt update
sudo apt install build-essential fakeroot bc kmod cpio libssl-dev bison flex
export ARCH=arm64
export CROSS_COMPILE=~/toolchain/aarch64-linux-gnu-gcc-
make defconfig distro.config
make bindeb-pkg LOCALVERSION=-hikey-linaro

And I get the following error:

arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:48: Detected assembler with broken .inst; disassembly will be unreliable
CHK     include/config/kernel.release
/bin/bash ./scripts/package/mkdebian
dpkg-buildpackage -j1 -r"fakeroot -u" -a$(cat debian/arch) -b -nc -uc
dpkg-buildpackage: info: source package linux-4.15.3-hikey-linaro-00154-gf449b3ca0861
dpkg-buildpackage: info: source version 4.15.3-hikey-linaro-00154-gf449b3ca0861-1
dpkg-buildpackage: info: source distribution bionic
dpkg-buildpackage: info: source changed by Anonymous <x@x-MacBookPro>
dpkg-buildpackage: info: host architecture arm64
 dpkg-source --before-build linux
dpkg-checkbuilddeps: error: Unmet build dependencies: libssl-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
scripts/package/Makefile:75: recipe for target 'bindeb-pkg' failed
make[1]: *** [bindeb-pkg] Error 3
Makefile:1345: recipe for target 'bindeb-pkg' failed
make: *** [bindeb-pkg] Error 2

I definitely have libssl-dev installed!

Any ideas?

I’ve just tried these exact kernel build steps on two different machines, one of which was a clean Ubuntu AWS EC2 instance that I created just to do this build:

make bin deb-pkg LOCALVERSION=-hikey-linaro
CHK include/config/kernel.release
/bin/bash ./scripts/package/mkdebian
dpkg-buildpackage -j1 -r"fakeroot -u" -a$(cat debian/arch) -b -nc -uc
dpkg-buildpackage: source package linux-4.15.3-hikey-linaro-00154-gf449b3c
dpkg-buildpackage: source version 4.15.3-hikey-linaro-00154-gf449b3c-1
dpkg-buildpackage: source distribution xenial
dpkg-buildpackage: source changed by Anonymous ubuntu@ip-172-31-17-129.eu-west-2.compute.internal
dpkg-buildpackage: host architecture arm64
dpkg-source --before-build linux
dpkg-checkbuilddeps: error: Unmet build dependencies: libssl-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
scripts/package/Makefile:75: recipe for target ‘bindeb-pkg’ failed
make[1]: *** [bindeb-pkg] Error 3
Makefile:1345: recipe for target ‘bindeb-pkg’ failed
make: *** [bindeb-pkg] Error 2

@morgdx,

Can you please verify whether you have openssl installed or not?

sudo apt install openssl

Hi @Mani thanks, yes I do:

sudo apt install openssl
Reading package lists… Done
Building dependency tree
Reading state information… Done
openssl is already the newest version (1.1.0g-2ubuntu4.1).
0 to upgrade, 0 to newly install, 0 to remove and 17 not to upgrade.

got the same error, completely useless information.

/bin/sh ./scripts/package/mkdebian
dpkg-buildpackage -j1 -r"fakeroot -u" -a$(cat debian/arch) -b -nc -uc
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package linux-4.15.3-hikey-linaro-00154-gf449b3c
dpkg-buildpackage: source version 4.15.3-hikey-linaro-00154-gf449b3c-1
dpkg-buildpackage: source distribution xenial
dpkg-buildpackage: source changed by Anonymous root@ubuntu
dpkg-buildpackage: host architecture arm64
dpkg-source --before-build linux
dpkg-checkbuilddeps: error: Unmet build dependencies: libssl-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
scripts/package/Makefile:75: recipe for target ‘bindeb-pkg’ failed
make[1]: *** [bindeb-pkg] Error 3
Makefile:1345: recipe for target ‘bindeb-pkg’ failed
make: *** [bindeb-pkg] Error 2

dpkg-checkbuilddeps: error: Unmet build dependencies: libssl-dev

This line states that you are lacking libssl-dev. You’ll need to put it using apt. Just run the command
sudo apt install openssl libssl-dev

This should solve your error.

no, I am much sure it has been installed.
install openssl libssl-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libssl-dev is already the newest version (1.0.2g-1ubuntu4.10).
openssl is already the newest version (1.0.2g-1ubuntu4.10).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

I spun up a fresh 18.04.1 container and did a quick test.

I couldn’t reproduce this behaviour… the instructions worked exactly as documented (although I did apt install git before I started reading the instructions).

I notice that I have a newer version of libssl-dev installed but I very much doubt that matters.

yes, I also have doubt about this. I tried many times to uninstall libssl-dev and then re-install again, but it always will re-install the 1.0.2g-1ubuntu4.10.

I have updated my kernel into 4.18 through this way:

Step 1: make ARCH=arm64 hikey960_defconfig
Step 2: make
Step 3: cp arch/arm64/boot/Image to your board boot folder, name it, eg, 4.18.image

Cp arch/arm64/boot/dts/hinis/ hi3660-hikey960.dtb to your board boot folder, and name it, eg, 4.18.dtb.

Step 4: modify grup.cfg

set default=“0”
set timeout=5
menuentry ‘CE Reference Platform (HiKey960 rpb)’ {
linux /boot/Image console=tty0 console=ttyAMA6,115200n8 root=/dev/sdd10 rootwait rw quiet efi=noruntime
devicetree /boot/hi3660-hikey960.dtb
}
menuentry ‘my-4.18’ {
linux /boot/4.18.image console=tty0 console=ttyAMA6,115200n8 root=/dev/sdd10 rw quiet efi=noruntime
devicetree /boot/4.18.dtb
}

@jackyard

A dirty workaround for this issue is to remove the libssl-dev dependency from scripts/package/mkdebian as below:

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index d046ddc444bd..408bae9def12 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -138,7 +138,7 @@ Source: $sourcename
 Section: kernel
 Priority: optional
 Maintainer: $maintainer
-Build-Depends: bc, kmod, cpio, libssl-dev
+Build-Depends: bc, kmod, cpio
 Homepage: http://www.kernel.org/
 
 Package: $packagename