Differences between revisions 1 and 2
Revision 1 as of 2018-03-21 15:21:19
Size: 6358
Editor: ?ThomasLange
Comment: first version
Revision 2 as of 2018-03-21 15:22:00
Size: 6362
Editor: ?ThomasLange
Comment:
Deletions are marked like this. Additions are marked like this.
Line 184: Line 184:
* UFS
* SD card
* WLAN using nmtui
* USB is NOT working
 * UFS
 * SD card
 * WLAN using nmtui
 * USB is NOT working

HiKey960

The HiKey960 is based on a HiSilicon Kirin 960 processor, but is different to the Hikey, which uses a Kirin 620 processor. Do not mix up the Hikey960 with the Hikey. These are different computers.

Tools needed on your Debian host machine

# apt install fastboot minicom simg2img

USB to Serial adapter

You want to use a USB to serial adapter to have a serial console. You will see boot messages of the UEFI bios and the kernel.

The UART of the Hikey960 is using 1.8V, not 3.3V or 5V as other boards do. It's possible to modify a cheap USB to Serial adapter to work with 1.8V. See https://discuss.96boards.org/t/1-8v-uart-ttl-to-usb-diy-for-around-5-for-ce-boards/1911

Adapters using the FT232 chip are supported by the Linux kernel. Some adapters use other chips. I use a LDO Voltage Regulators 1.8V 0.8A Positive to get the 1.8V on my adapter board. Adpaters usually have mini or micro USB connector. For e.g. https://eckstein-shop.de/FT232-USB-UART-Board-mini

Connect the USB to serial adapter to the Hikey960 to PIN 11,13 and GND (e.g. 1,2) and the USB to your computer. The serial console will appear as /dev/ttyUSB0 on your host. You can then use minicom -con to connect to the serial console.

During booting and flashing new software, you will see output on this console.

Flashing a new UEFI version

First, you should update to the newest UEFI version.

Connect the serial console to your computer, start minicom. Connect the USB OTG (the USB C small thing) port to your computer. This USB device is used for flashing UEFI and the OS.

The switches of the Hikey 960 must be set to recovery mode. See https://www.96boards.org/documentation/consumer/hikey960/getting-started/

Get the newest firmware from

http://builds.96boards.org/snapshots/reference-platform/components/uefi-staging/59/hikey960/release/

or

http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/135/rpb/bootloader/

I used the files from 96boards

# flash new UEFI version to hikey960

UEFI_URL=https://builds.96boards.org/snapshots/reference-platform/components/uefi-staging/59/hikey960/release/

files="config hikey_idt prm_ptable.img sec_xloader.img sec_usb_xloader.img sec_uce_boot.img l-loader.bin fip.bin"
rm -f $files
for f in $files; do
    wget $UEFI_URL/$f
done

echo Running hikey_idt...
chmod +x hikey_idt
# in version 59 the file config had a wrong file name for l-loader.bin
./hikey_idt -c config

echo "Sleeping till device resets... zzz"
sleep 15

fastboot flash ptable prm_ptable.img
fastboot flash xloader sec_xloader.img
fastboot flash fastboot l-loader.bin
fastboot flash fip fip.bin

When the command hikey_idt is called you see some boot messags in the serial console. Type f to enter the fastboot mode. Otherwise my system is doing the UEFI boot, boots grub and the the system. In the serial console you see a message like this:

Press ESCAPE for boot options .Android Fastboot mode - version 0.7.
Press RETURN or SPACE key to quit.

If you are in fastboot mode, a new device /dev/ttyUSB1 appears after several seconds and now you can see the fastboot device on the computer.

# fastboot devices
8211F5D02876987 fastboot

Now you can flash the images using the four fastboot flash command from above.

Debian Installation

Installation onto the UFS storage

The Hikey960 has 32GB of onbard UFS storage.

# flash debian
fastboot flash boot boot-linaro-stretch-developer-hikey-20180212-17.img
fastboot flash system rootfs-linaro-stretch-developer-hikey-20180212-17.img
fastboot reboot

Installing Debian onto SD card

wget http://snapshots.linaro.org/96boards/hikey/linaro/debian/latest/linaro-stretch-developer-hikey-20180212-17.sd.gz
gunzip *sd.gz
dd if=linaro-stretch-developer-hikey-20180212-17.sd of=/dev/mmcblk0 bs=1M status=progress

When booting the Hikey960 press ESC to enter the UEFI menu, then select Boot from CD card, which may be the default entry.

Running the installer

Not done yet.

Using a different kernel with Debian

Currently (2018/3/19), the Debian kernel Linux linaro-developer 4.15-hikey #1 SMP PREEMPT Mon Feb 12 14:07:40 UTC 2018 does not support all hardware, for e.g. the USB devices.

Therefore we install an additional kernel but still run the Debian OS. Get the Reference Platform Build – CE ?OpenEmbedded

http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/135/rpb/

wget http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/129/rpb/rpb-console-image-hikey960-20180209072216-129.rootfs.tar.xz
tar axf rpb-console-image-hikey960-20180209072216-129.rootfs.tar.xz
tar Jcvf kernel.tar.xz boot/*.dtb boot/Image* lib/modules/4.14.0-rc7-linaro-hikey960/

Now mount the SD card and extract the kernel.tar.xz there.

# change the root device to your UUID or mmcblk0p2, do not use sdd10, which is the onboard UFS storage

Then, create an additional grub menu entry.

/etc/grub.d/40_custom

menuentry 'CE Reference Platform kernel' {
    linux /boot/Image console=tty0 console=ttyAMA6,115200n8 root=/dev/mmcblk0p2 rootwait rw quiet efi=noruntime
    devicetree /boot/hi3660-hikey960.dtb
}

mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
chroot /mnt update-grub
umount /mnt/proc
umount /mnt/dev
umount /mnt

What is working

Using the Debian kernel 4.15

  • UFS
  • SD card
  • WLAN using nmtui
  • USB is NOT working

Speed of UFS using dd to an file in an ext4 FS. read 280 MB/s, write 130 MB/s

Using the CE Reference Platform kernel

IMO everything is working.