4.19.5 kernel based Debian snapshot image release for HiKey960

Hi @Mani,

I used the default HiKey960 configuration:

$ export RAMDISK=ramdisk.img
$ make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- hikey960_defconfig
$ make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
$ make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- deb-pkg

@marcodip There is no hikey960_defconfig in mainline. Did you export it from Hikey kernel? In any case, you need to make UFS drivers as builtin.

CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFSHCD_PLATFORM=y
CONFIG_SCSI_UFS_HISI=y

Recollecting my steps for booting with 5.3-rc6 + debian.

Updated low level firmwares.

git clone https://android.googlesource.com/device/linaro/hikey
cd installer/hikey960

Board in fastboot mode, flashed UFS. (no sdcard present)
(I am flashing few firmwares after a long time. So to ensure certain firmware are updated. May be you can skip this.)

./uefi-flash-all.sh
./flash-all.sh

Flashed bootloader, boot image and rootfs image from https://www.96boards.org/documentation/consumer/hikey/hikey960/downloads/Debian.md.html (build 37)

Cloned mainline kernel

git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
(While I am checking, HEAD is at, a55aa89 Linux 5.3-rc6)
Compliation:

export ARCH=arm64
export CROSS_COMPILE=your toolchain
make defconfig

Replaced ‘=m’ to ‘=y’ in .config using search and replace in my editor.
(If anyone reading this know some better method for including all modules to builtin, Let me know.)

make olddefconfig
make Image.gz dtbs

Copied Image.gz and hi3660-hikey960.dtb to /boot on board.
Created a custom kernel entry in /boot/grub/grub.cfg

menuentry 'Custom kernel' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-aab08174-8c3f-45f8-9749-79e1f1ced14b' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  aab08174-8c3f-45f8-9749-79e1f1ced14b
        else
          search --no-floppy --fs-uuid --set=root aab08174-8c3f-45f8-9749-79e1f1ced14b
        fi
        echo    'Loading Linux 4.19.5-hikey ...'
        linux   /boot/Image.gz root=UUID=aab08174-8c3f-45f8-9749-79e1f1ced14b rw no_console_suspend 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-4.19.5-hikey
        devicetree /boot/hi3660-hikey960.dtb
}

Booted using the custom entry in grub.

1 Like

@Mani
I am using this Linaro snapshot: https://git.linaro.org/people/john.stultz/android-dev.git/snapshot/android-dev-dev/hikey960-5.2.tar.gz

All modules have y.

$ grep SCSI_UFS .config
CONFIG_SCSI_UFSHCD=y
# CONFIG_SCSI_UFSHCD_PCI is not set
CONFIG_SCSI_UFSHCD_PLATFORM=y
# CONFIG_SCSI_UFS_CDNS_PLATFORM is not set
# CONFIG_SCSI_UFS_DWC_TC_PLATFORM is not set
CONFIG_SCSI_UFS_HISI=y
# CONFIG_SCSI_UFS_BSG is not set

@marcodip, you are using the AOSP kernel (don’t know why). If you don’t have any requirements to use AOSP kernel, I’d recommend you to use mainline kernel directly as per @sreenad’s reply.

1 Like

Hi @Mani,

Mani:
I usually do rsync to copy the files using network. If you don’t have network, then use uSD.

As it is difficult to always plug and unplug devices for copying files to board, I though of setting up a network via USB.
I could setup usb gadget ethernet on type-c.
Now I am using it to scp kernel image.

Capturing diffconfig:

$ scripts/diffconfig .config config_with_g_ether_working

-USB_CONFIGFS_ACM n
-USB_CONFIGFS_ECM n
-USB_CONFIGFS_ECM_SUBSET n
-USB_CONFIGFS_EEM n
-USB_CONFIGFS_F_FS n
-USB_CONFIGFS_F_HID n
-USB_CONFIGFS_F_LB_SS n
-USB_CONFIGFS_F_MIDI n
-USB_CONFIGFS_F_PRINTER n
-USB_CONFIGFS_F_UAC1 n
-USB_CONFIGFS_F_UAC1_LEGACY n
-USB_CONFIGFS_F_UAC2 n
-USB_CONFIGFS_F_UVC n
-USB_CONFIGFS_MASS_STORAGE n
-USB_CONFIGFS_NCM n
-USB_CONFIGFS_OBEX n
-USB_CONFIGFS_RNDIS n
-USB_CONFIGFS_SERIAL n
-USB_F_ACM m
-USB_F_MASS_STORAGE m
-USB_F_OBEX m
-USB_F_RNDIS m
-USB_F_SERIAL m
-USB_F_SS_LB m
-USB_G_WEBCAM n
-USB_U_SERIAL m
-USB_ZERO_HNPTEST n
-U_SERIAL_CONSOLE n
 USB_CONFIGFS m -> n
 USB_ETH m -> y
 USB_ETH_RNDIS y -> n
 USB_F_ECM m -> y
 USB_F_SUBSET m -> y
 USB_G_SERIAL m -> n
 USB_LIBCOMPOSITE m -> y
 USB_MASS_STORAGE m -> n
 USB_U_ETHER m -> y
 USB_ZERO m -> n

Regards,
Sreenad.

Hi @Mani,

Today I had to check hikey960 with 4.9 kernel + debian.
I took kernel source from:

Repo: git://github.com/96boards-hikey/linux.git
Branch: remotes/origin/hikey960-v4.9
Configuration: hikey960_defconfig

For mounting root device, I had to enable CONFIG_DEVTMPFS.

Am I using the right repo for 4.9 kernel which can work with debian in hikey960?

Regards,
Sreenad.

@sreenad The repository you pointed out is the correct one but I haven’t tested 4.9 branch. hikey960_upstream_rebase branch is known to be working.

Thanks @Mani for your quick reply.

Kernel version in hikey960_upstream_rebase is shown as 4.14.
Is there a repo or branch with kernel 4.9 (non android) available for hikey960 which is still maintained.?

Regards,
Sreenad.

@sreenad, thanks now it works!

You may use:
$ sed -i 's/=m/=y/g' .config

@sreenad AFAIK, there is no 4.9 branch which is still maintained. But you can try using the one you pointed out and share the results with us :wink:

@marcodip, Thanks, I did similar thing in Vim editor. :%s/=m/=y/g

But usually editing .config directly is not encouraged.
So just wanted to know whether any make target is available for it.
Some thing like make inbuilt_modules_config which can give a proper .config.

@Mani, kernel 5.2 works fine without devicetree.

If I add devicetree /boot/hi3660-hikey960.dtb, it cannot start.

I installed the kernel with dpkg.

That’s wierd. But it usually means, the dtb is not good.

Hi @sreenad,

is there any specific reason to build all the features into the kernel, not as module?

Is it possible to use modules too? As I would like to unload/load a specific module at run-time.

Thanks,
Marco

Hi @marcodip,

You can use modules. I prefer ‘inbuilt’ to avoid

  • missing drivers.
  • Vermagic mismatches
  • Additional task of installing modules.

Regards,
Sreenad.

Hi @sreenad,

got it, thanks! Just another question: why you call this?

make olddefconfig

Regards,
Marco

Hello @Mani,

Is there any Debian/Ubuntu release in which HDMI & WiFi works ?
Thanks in advance !

@Rajagopal No HDMI for now but WiFi should work with latest release.

http://snapshots.linaro.org/96boards/hikey/linaro/debian/latest/

Hello Mani,

Appreciate the timely reply.

No HDMI for now but WiFi should work with latest release.
Wondering why in Android we can get HDMI o/p but NOT in Linux.
Or, is it right in Android also HDMI doesn’t work & only MIPI-DSI works ?

Thanks.