This is a cache of https://www.96boards.org/blog/debian-snapshot-image-for-hiKey-boards/. It is a snapshot of the page at 2024-12-22T04:07:23.751+0000.
Debian Snapshot Image for <strong>hikey</strong> boards - 96Boards

Debian Snapshot Image for hikey boards

Manivannan Sadhasivam
|

Introduction

Hello and Welcome to the blog on, “Debian Snapshot Image for hikey boards”. This blog will give a quick summary of the recently released Debian release image for hikey boards. Why it was needed, how it was done and the future plans.

Recap of the State of Debian support for hikey boards

Before this new snapshot image, there was a Debian snapshot build existed for the hikey boards (hikey, and hikey960) based on old 4.14 stable Linux Kernel. So we decided to spin next version of the Debian snapshot image with 4.19.5 recent LTS Kernel, hikey960 UFS fix, hikey960 USB support.

Recent LTS Kernel for hikey and hikey960

I started this work by collecting the patches for UFS Fix, USB support and couple of misc fixes into my hikey Kernel tree based on 4.19.5 LTS Kernel. A special thanks to John Stultz of Linaro for helping along the way.

Then I tried to boot the kernel on both hikey and hikey boards. Interestingly, I found some issues on both boards which prevented booting of the Kernel. When I debugged, I found that both boards were not able to work properly with 4 bit bus width using the Designware MMC driver. For sure it was a regression, but my initial debugging/bisect didn’t spot the actual issue. So in the meantime, I added a commit as a quick workaround for letting the MMC driver to work on both boards. Basically, it just removes the bus-width property from dwmmc driver to force it to use 1 bit mode. I know that this will decrease the performance of MMC block but I just insisted on creating a working Debian image. With this commit, both boards were able to boot fine without any issues.

hikey970 Support

While doing this process, I also thought about including the Debian support for hikey970 board, which is also from HiSilicon but there was no upstream support from the vendor. So, I upstreamed the basic bits for this board which enables it to boot mainline Linux kernel with a standard distro from UFS. But since most of the patches were merged for 4.20 Kernel, nothing existed on 4.19.5 LTS Kernel. So I collected all patches into my hikey tree. Finally I was able to boot 4.19.5 LTS Kernel on hikey970 board!!!

New Debian Snapshot Image

With all of these patches, I started the Debian image process using our internal OBS tool. Riku Voipio of Linaro helped me to go through the Debian snapshot image process and we both worked together to create the final Snapshot image for all hikey boards. We generated Boot image and Debian RFS image using the tool.

But there was one more bit missing, which is the new UEFI image. Since we use the same Debian image for all hikey boards, the distinguishing factor for these boards comes in the form of Devicetree Binary(DTB) passed by the UEFI bootloader to Linux Kernel. So inorder to use all features of the latest image, we must pass the corresponding DTB from UEFI during boot. For this, I submitted a patch for updating the DTB in UEFI for both hikey and hikey960 and it was merged by Haojian Zhuang of Linaro.

Note: Currently we have no official UEFI build for hikey970, so users need to use the vendor UEFI for booting this image.

With this new image, below features are supported for all hikey boards:

  • hikey - SD/MMC, HDMI, USB, WiFi/BT
  • hikey960 - UFS, SD/MMC, USB, WiFi/BT, PCI-E
  • hikey970 - UFS, SD/MMC

Conclusion

At the end, we have a working Debian image for all hikey boards. We also have plans to release major snapshot image for every new LTS Kernel and minor snapshot image for feature addition like HDMI for hikey960. Below are the forum posts, describing the image release:

comments powered by Disqus