Some question about Hikey


#1

These days, we have receive some questions about Hikey, we also comment some of the question with our answer, but we do not know if all the answer is all alright. So if anybody can help to look over the questions?

  1. The HiKey installation process cannot use the regular arm64 debian-installer. The main arm64 arch for Debian should work mostly for userland, but lacks kernel, hardware modules and (possibly) boot loader. Apart from this, Debian main is fine. WLAN support is also not included in standard firmware images and tools.
    >>>
    These are right. Please refer to:
    Kernel and rootfs: https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#debian-linux-os
    Bootloader: https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#installing-a-bootloader
    <<<

Thanks for confirming the links. So you do reckon that the pre-installed
Debian distro is the original Debian except for these two pieces?
>>>
Yes, I think so.
<<<

2a. Linux kernel must be Linaro. Stock Debian linux kernel for amd64 won’t do. Not even the testing/unstable versions. patches are publically available, yet not actively proposed at kernel.org for including them into vanilla linux, are they? This however only covers (most) of the hardware, not necessarily the CPU and mainboard itself (i.e. it might boot, just not have any hardware to install on).
>>>
In upstream kernel, please refer to https://github.com/torvalds/linux/tree/master/arch/arm64/boot/dts/hisilicon, the hikey have been supported, but it only to boot, because some drivers have not been supported。
<<<

right, that’s what I had found. But you (or Linaro) are actively pushing to
close that gap, I guess? Is it expected to have the full support still in 4.4?
>>>
I don’t think it will full support, in kernel.org, it will only gradually add the general modules, e.g. dts, driver, and so on. But for a specific board, it can’t full support, you need to develop some modules. But Linux kernel always to develop by Linaro with arm64 on hikey, but can’t boot on amd64, because the BSP can’t be supported.
<<<

Ok. Yet if I’d take a regular arm64 Debian installer and add the Linaro kernel, that should work, right? Since the HiKey hasn’t got any wired ethernet on board, have you guys tried to put together a rather complete installer on SD-card rather than just trying netboot?
>>>
The HiKey kernel sources are located at: https://github.com/96boards/linux. This sources was developed by Linaro and Hisilicon. But if you use the Linaro kernel and run on Hikey, you need to add the BSP, so I suggest you use this HiKey kernel sources.
The Hikey can’t netboot now.
<<<

2b. since Linarno patches aren’t (yet) pushed back upstream (i.e. linux on kernel.org), my [kernel] security status is mainly dependent on what Linaro gives me. it doesn’t look like they have a security announcement mailinglist to subscribe to, do they? Does LeMaker have one? Since the LeMaker HiKey has its own patches, are they mainly maintained by LeMaker or by Linaro?

  1. Bootloader seems to have custom parts that are not (yet) included in the usual upstream(s)? I don’t really see (in the given document) what is different in the GRUB on 96boards.org compared to the one in Debian. What will not be working (correctly) when using the regular one shipped in Debian? Is the custom bootloader in the doc just relevant for supporting secure boot?
    >>>
    UEFI bootloader is still under development, the method and source code link can be found from https://github.com/96boards/documentation/wiki/HiKeyUEFI . The doc now is not ready.
    <<<

Ok. I’m not seeing that this isn’t the UEFI already present inside Debian. What exactly is still “under development” and are there any patches not yet
upstream?
>>>
Please refer to : https://github.com/96boards/documentation/wiki/HiKeyUEFI#source-code Open the UEFI code link, you can find some answers in github commits.
<<<

  1. fastboot is optional as long as I use GRUB on eMMC or boot from SD card,right?
    > >>
    NOTE that the June 2015 release comes with a fastboot bootloader based on HiSilicon code. It is deprecated and will not be supported in the upcoming releases.
    <<<

Alright. So fastboot is entirely not needed when not using Android?
>>>
Yes, only use UEFI.
<<<

  1. Updating eMMC parts requires me to flash from another computer and cannot be updated online while booted into eMMC? Or if online updating is supported, what files would need to be written where to make sure the HiKey will survive a reboot after this? Losing all of my files, settings, SSH host keys etc. for every new OS release doesn’t seem to be the correct answer. Rather installing Debian updates the “normal” way and putting new kernels, bootloaders and kernel modules in-place where they belong. Is this planned for the future releases?
    >>>
    Now, it cannot be updated online. But you can use dd or copy command to update by SD card.
    e.g. dd if=<path>/boot-fat.uefi.img of=/dev/mmcblk0p6 bs=1M
    copy zImage /boot/
    copy *.ko /lib/modules/
    Partition Information: https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#appendix-1-partition-information
    <<<
    Sounds great! I’ll give it a try.

  2. Supporting WLAN requires a custom kernel module and firmware from 96boards.org. Same question for security support, announcement mailinglist and pushing these upstream into linux and the Debian firmware package as above. Any reasons not to?
    >>>
    The WLAN module and firmware are provided by TI, please refer to http://www.ti.com/product/WL1835MOD
    <<<

Thanks for the info.

  1. Linaro modified “android-tools-fsutils” is recommended. What will not work when using the regular one?
    >>>
    Sorry, Linaro had changed the link, please use this link: http://repo.linaro.org/ubuntu/linaro-staging/pool/main/a/android-tools/android-tools-fsutils_5.1.1.r29-3.linarojessie.1_amd64.deb in Linux PC. Or android-tools-fsutils_5.1.1.r29-3.linarojessie.1_arm64.deb in Hikey. They are OK. We will ask linaro to update the wiki.

Thanks. Yet this doesn’t answer what their version does different. Any
comments?

>>>
We will ask linaro to update the wiki. Sorry, I don’t know for that.
<<<

  1. Practically all of the docs only refer to cross compiling while the HiKey should have enough CPU and RAM to be able to compile simple stuff itself. Is the thermal control not enabled by default or what’s the reason behind this?
    >>>
    Hikey itself can compile the kernel, but we now just provide the method for cross compile on PC.

Sure. Would be great if we’d have docs to reflect both usecases (or actually
not need it at all and have full upstream support from Debian and Linux).

  1. HDMI sound is already reported feasible but not yet officially supported by neither LeMaker nor Linaro/96boards.org.
    >>>
    it will be supported later.
    <<<

#2

Hi @tony_zhang,

Thank you for sharing your information to us.
Let me comment on the questions one by one.


#3
1. The HiKey installation process cannot use the regular arm64 debian-installer. The main arm64 arch for Debian should work mostly for userland, but lacks kernel, hardware modules and (possibly) boot loader. Apart from this, Debian main is fine. WLAN support is also not included in standard firmware images and tools. >>> These are right. Please refer to: Kernel and rootfs: https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#debian-linux-os Bootloader: https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#installing-a-bootloader <<<

Yes, none of the 96boards are able to use regular Debian installer to install Debian to 96Boards.
Please, follow the instruction of installing Debian on the HiKey described here.


#4
2a. Linux kernel must be Linaro. Stock Debian linux kernel for amd64 won’t do. Not even the testing/unstable versions. patches are publically available, yet not actively proposed at kernel.org for including them into vanilla linux, are they? This however only covers (most) of the hardware, not necessarily the CPU and mainboard itself (i.e. it might boot, just not have any hardware to install on). >>> In upstream kernel, please refer to https://github.com/torvalds/linux/tree/master/arch/arm64/boot/dts/hisilicon, the hikey have been supported, but it only to boot, because some drivers have not been supported。 <<<

right, that’s what I had found. But you (or Linaro) are actively pushing to
close that gap, I guess? Is it expected to have the full support still in 4.4?
>>>
I don’t think it will full support, in kernel.org, it will only gradually add the general modules, e.g. dts, driver, and so on. But for a specific board, it can’t full support, you need to develop some modules. But Linux kernel always to develop by Linaro with arm64 on hikey, but can’t boot on amd64, because the BSP can’t be supported.
<<<

Ok. Yet if I’d take a regular arm64 Debian installer and add the Linaro kernel, that should work, right? Since the HiKey hasn’t got any wired ethernet on board, have you guys tried to put together a rather complete installer on SD-card rather than just trying netboot?
>>>
The HiKey kernel sources are located at: https://github.com/96boards/linux. This sources was developed by Linaro and Hisilicon. But if you use the Linaro kernel and run on Hikey, you need to add the BSP, so I suggest you use this HiKey kernel sources.
The Hikey can’t netboot now.
<<<

At the moment of February Third, not all patches Linaro have added for the Hikey is not included in the mainline kernel.
Linaro is actively conducting up-streaming effort that the patches for the Hikey to be merged in the mainline kernel. The objective of Linaro and the 96Boards program is that upstreaming all the patches and ultimately the stock mainline kernel to require no additional patches for 96boards.
Currently many of the patches went into 4.4 but still some of them are not included.
We are continuing the upstreaming for the future mainline kernel release.
When all the patches going to be merged in the mainline kernel is difficult to predict, since the process of reviewing the code and acceptance are depend on the maintainer too and not every thing is under control by Linaro.
It is likely to be endless effort to sending patches for the 96Boards to public kernel community, since we also need to adopt the changes in the mainline kernel.

The regular arm64 Debian installer and adding the Linaro is not able for 96Boards at the moment.
Please, follow the instruction of installing Debian on the HiKey described here.

The tftboot and nfs mounting are not supported yet by the boot loader but it is nice feature to have in the future. Let us consider it.


#5
2b. since Linarno patches aren’t (yet) pushed back upstream (i.e. linux on kernel.org), my [kernel] security status is mainly dependent on what Linaro gives me. it doesn’t look like they have a security announcement mailinglist to subscribe to, do they? Does LeMaker have one? Since the LeMaker HiKey has its own patches, are they mainly maintained by LeMaker or by Linaro?

The patches of LeMaker HiKey are maintained by Linaro and 96Boards project.
As mentioned in the above of my comments, we are in the middle of process of upstreaming and push all the patches to the linux on kernel.org.

We do not have a dedicated security announcement mailinglist but but our policy is to follow the LTS kernel and latest kernel on the kernel.org to have security fixes and bug fixes as much as possible.


#6
3. Bootloader seems to have custom parts that are not (yet) included in the usual upstream(s)? I don’t really see (in the given document) what is different in the GRUB on 96boards.org compared to the one in Debian. What will not be working (correctly) when using the regular one shipped in Debian? Is the custom bootloader in the doc just relevant for supporting secure boot? >>> UEFI bootloader is still under development, the method and source code link can be found from https://github.com/96boards/documentation/wiki/HiKeyUEFI . The doc now is not ready. <<<

Ok. I’m not seeing that this isn’t the UEFI already present inside Debian. What exactly is still “under development” and are there any patches not yet
upstream?
>>>
Please refer to : https://github.com/96boards/documentation/wiki/HiKeyUEFI#source-code Open the UEFI code link, you can find some answers in github commits.
<<<

The ultimate goal of Linaro and the Reference Software Platform for the 96Boards is to have single regular installer for Aarch64 debian-installer to be able to install Debian to all 96Boards.
However, for the historical reason of Linux on ARM that every single boards required dedicated bootloader, kernel and userland which requires huge amount of work to consolidated them and unifying them.
Introducing UEFI on 96Boards is one of the process of unifying them so the single image could install and run on all 96Boards.
Unfortunately the unification is not completed yet, and I really appreciate your patience.
Our future will be bright when the work is done.


#7
4. fastboot is optional as long as I use GRUB on eMMC or boot from SD card,right? > >> NOTE that the June 2015 release comes with a fastboot bootloader based on HiSilicon code. It is deprecated and will not be supported in the upcoming releases. <<<

Alright. So fastboot is entirely not needed when not using Android?
>>>
Yes, only use UEFI.
<<<

Yes, initially the fastboot was the only bootloader was able for the HiKey but moved to open source bootloader, UEFI.


#8
5. Updating eMMC parts requires me to flash from another computer and cannot be updated online while booted into eMMC? Or if online updating is supported, what files would need to be written where to make sure the HiKey will survive a reboot after this? Losing all of my files, settings, SSH host keys etc. for every new OS release doesn’t seem to be the correct answer. Rather installing Debian updates the “normal” way and putting new kernels, bootloaders and kernel modules in-place where they belong. Is this planned for the future releases? >>> Now, it cannot be updated online. But you can use dd or copy command to update by SD card. e.g. dd if=<path>/boot-fat.uefi.img of=/dev/mmcblk0p6 bs=1M copy zImage /boot/ copy *.ko /lib/modules/ Partition Information: https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#appendix-1-partition-information <<< Sounds great! I’ll give it a try.

Yes, the above procedure should work fine.


#9
6. Supporting WLAN requires a custom kernel module and firmware from 96boards.org. Same question for security support, announcement mailinglist and pushing these upstream into linux and the Debian firmware package as above. Any reasons not to? >>> The WLAN module and firmware are provided by TI, please refer to http://www.ti.com/product/WL1835MOD <<<

Thanks for the info.

It is just because the WLAN requires closed binary which even Linaro do not have the sources or not able to release the sources. It is not uncommon for WLAN devices, GPU and etc.


#10
8. Practically all of the docs only refer to cross compiling while the HiKey should have enough CPU and RAM to be able to compile simple stuff itself. Is the thermal control not enabled by default or what’s the reason behind this? >>> Hikey itself can compile the kernel, but we now just provide the method for cross compile on PC.

Sure. Would be great if we’d have docs to reflect both usecases (or actually
not need it at all and have full upstream support from Debian and Linux).

Nothing special just we are backlogged with many tasks have not reached to the point to start documenting of self compiling. It should be no difference with regular Debian on PC for self compiling.
We are always happy of the report from the community who have tried it.


#11
7. Linaro modified “android-tools-fsutils” is recommended. What will not work when using the regular one? >>> Sorry, Linaro had changed the link, please use this link: http://repo.linaro.org/ubuntu/linaro-staging/pool/main/a/android-tools/android-tools-fsutils_5.1.1.r29-3.linarojessie.1_amd64.deb in Linux PC. Or android-tools-fsutils_5.1.1.r29-3.linarojessie.1_arm64.deb in Hikey. They are OK. We will ask linaro to update the wiki.

Thanks. Yet this doesn’t answer what their version does different. Any
comments?

>>>
We will ask linaro to update the wiki. Sorry, I don’t know for that.
<<<

The upstream version assumes that all files in the root file system are owned by root and have UID=0. We added an option to make_ext4fs to preserve file ownership (-o).
For Debian image if you don’t use our version you will end up with a non working Linux system, some applications will fail to work.

We are working on getting rid of this tool for Linux images… Hopefully soon.


#12
2a. Linux kernel must be Linaro. Stock Debian linux kernel for amd64 won’t do. Not even the testing/unstable versions. patches are publically available, yet not actively proposed at kernel.org for including them into vanilla linux, are they? This however only covers (most) of the hardware, not necessarily the CPU and mainboard itself (i.e. it might boot, just not have any hardware to install on). >>> In upstream kernel, please refer to https://github.com/torvalds/linux/tree/master/arch/arm64/boot/dts/hisilicon, the hikey have been supported, but it only to boot, because some drivers have not been supported。 <<<

right, that’s what I had found. But you (or Linaro) are actively pushing to
close that gap, I guess? Is it expected to have the full support still in 4.4?

Linaro we are actively pushing hikey support into linux mainline. As of v4.4, you can build a Image with vanilla v4.4 kernel and boot it on HiKey. More drivers will be added into v4.5, v4.6 and on.

We are keeping a mainline targeting branch here: https://github.com/96boards-hikey/linux/tree/hikey-mainline-rebase

And we also have a snapshot build for it:
https://builds.96boards.org/snapshots/hikey/community/hikey-mainline-rebase/


#13
1. The HiKey installation process cannot use the regular arm64 debian-installer. The main arm64 arch for Debian should work mostly for userland, but lacks kernel, hardware modules and (possibly) boot loader. Apart from this, Debian main is fine. WLAN support is also not included in standard firmware images and tools.

Not yet :slight_smile: The plans for the reference platform kernel is to be provided as a normal kernel package, to also include support for the debian-installer (which is already the case for EE, tested on Overdrive and D02).

We’re building up the unified 4.4 kernel that will allow us to also provide a debian-installer experience for HiKey.

Hope to have more news on that over the next few weeks.


#14

For proper support you still need to use the Linaro kernel, but this will change over time. There is a big effort into upstreaming the support, so we should have more for 4.5/4.6.

Meanwhile, the reference kernel will provide support for every board in 96boards, including topic-branches for the board-specific patches, so anyone can easily consume and integrate them as part of a distro kernel.

Debian upstream support will come soon, when we get a reduced set of patches (then we just require config changes).

Now for the tftpboot, there was an internal effort to allow UEFI to boot from usb, which would allow other boot methods, but not yet sure what is the status of that.


#15

You could use the LSK 4.4 kernel + the minimal set of patches required for HiKey to work properly, if security is what concerns you (but you would need to maintain your own kernel).


#16

There is an ongoing effort to upstream the hikey UEFI support (using pure edk2 + openplatformpkg, maintained by Linaro), but that is not yet completed. Once done, we can then easily integrate the firmware as part of any distribution (which should hopefully be completed soon).

Now for grub, the only change we have is that we are using the latest version from debian unstable, since that provides PXE fixes from upstream.


#17

Once we get the unified kernel in place, you will be able to install it with apt-get update/upgrade.

For firmware (UEFI), we don’t expect that to change much once we get the support in upstream, and the only way for the distro to safely update that would be with UEFI capsule (besides running dd in a specific location, but that can easily break your boot if something bad happens).


#18

With the latest kernel (4.4) you don’t need a custom module anymore, but firmware will still be required.


#19

Will raise this point to our tech writer (which was just hired), so we should be able to get this fixed soon.