Hikey960 SPI not enabling in Aosp

Hi, I use this branch:

git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9

And follow the guide:

https://source.android.com/setup/build/devices#960kernel

I add this line

 BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_spidev0

on device/linaro/hikey/hikey960/BoardConfig.mk

but I can not get /dev/spidev to appear

You realize that in order to make it use the 4.9 kernel while building AOSP, you have to set a variable to tell it so?

TARGET_KERNEL_USE=4.9

The default kernel is now 4.19.

This is the step for me to do this thing:

  1. download aosp master branch code

2.add BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_spidev0
on device/linaro/hikey/hikey960/BoardConfig.mk

3.build with hikey960-userdebug and flash img with build

  1. building the kernel
git clone https://android.googlesource.com/kernel/hikey-linaro
cd hikey-linaro
git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9
make ARCH=arm64 hikey960_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24

5.update the kernel in the boot image

 Copy  `hi3660-hikey960.dtb`  ( `arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb` ) to the  `hikey-kernel`  directory as file:  `hi3660-hikey960.dtb-4.9`
 Copy the Image file  `(arch/arm64/boot/Image.gz-dtb` ) to the  `hikey-kernel`  directory as file:  `Image.gz-dtb-hikey960-4.9`

and make bootimage

6.flash boot.img

do you mean the aosp kernel default value is 4.19?

Yes. You can still use 4.9 if you like by setting the variable like I said, but its going to ignore it otherwise and use 4.19.

I will set TARGET_KERNEL_USE=4.9
on the following file:

device/linaro/hikey/hikey960.mk
device/linaro/hikey/hikey-common.mk

Won’t work like that.

Set it when you compile.

TARGET_KERNEL_USE=4.9 make -j9

Thank you for you help