How to enable SPI on HiKey 960


#1

Hi, after cloned the lastest android linux source and build, there is no spi node in /dev directory, dmesg shows:

[    1.710853] ssp-pl022 ffd68000.spi: could not find pctldev for node /soc/pinmux@fff11000/spi2_pmx_func, deferring probe
[    1.710881] ssp-pl022 ff3b3000.spi: could not find pctldev for node /soc/pinmux@ff3b6000/spi3_pmx_func, deferring probe

The path “/soc/pinmux@fff11000/spi2_pmx_func” I can find in Hikey960-pinctrl.dtsi.

  • I didn’t do any change with the code

Thanks for help.


#2

Hi @jinfeng,

This means, SPI driver tried to access pinctrl handles before the pinctrl subsystem gets registered. This should be of no problem since the deferred driver probe will be triggered later during boot process.

Since you said that you haven’t done any modification to the source, can you please share the location of AOSP source from where you have cloned?

Thanks,
Mani


#3

Thanks for your reply, the code location is:

https://android.googlesource.com/kernel/hikey-linaro

I searched almost every post about this, it is strange, there exist some difference with others’ source maybe ?


#4

@jinfeng, sorry I forgot to ask the branch also! Which branch are you using?


#5

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

#6

Did you add: overlay_mgr.overlay_dt_entry=hardware_cfg_spidev0 to your boot argument?

Forgive me, as I don’t have any SPI devices, so I don’t have much experience here.


#7

@jstultz
after adding that I can now see:

console:/ # ls /dev | grep spi
spidev32766.0

and

console:/ # ls /sys/bus/spi/devices/                                           
spi32766.0
console:/ # ls /sys/bus/spi/devices/spi32766.0/                                
driver/      of_node/     spidev/      subsystem/
modalias     power/       statistics/  uevent

Assuming this means spi is now available, why don’t we have this added to AOSP source?


#8

@ric96

SPIDEV is an (optional) kernel driver used to provide userspace interface to SPI subsystem. So this won’t be enabled by default! Either you have to populate the SPI node in devicetree or just apply the relevant devicetree overlay.

Hope this makes clear!

Thanks,
Mani