HIkey960 SPI0/SPI2 support on LS expansion connector


Which SPI Bus supported on LS expansion connector with HIkey960. ?
I have tried below things.
SPI2 used —> My driver not loaded with this config.
SPI0 ------> Node address not available for this config to try this option
SPI1 ------> My driver loaded with this conf , but this is not available in LS connector

Please help me on this.


I have used SPI2 as its wired out on LS connector and i found the following issues.
1.There is some issue with clock configuration "clock-names"
with the below config it is not booting.

spi2: spi@ffd68000 {
compatible = “arm,pl022”, “arm,primecell”;
reg = <0x0 0xffd68000 0x0 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0 116 4>;
clocks = <&crg_ctrl HI3660_CLK_GATE_SPI2>;
clock-names =“apb_pclk”;
pinctrl-names = “default”;
pinctrl-0 = <&spi2_pmx_func &spi2_cfg_func>;
num-cs = <1>;
cs-gpios = <&gpio27 2 0>;
status = “ok”;

and i have modified clock-names as below

clock-names =“xyz”,“apb_pclk”;

with this config Booting is fine but amba_device_add_failled with -2 error.

Please find my kernel logs below(Debugging logs added).

0m Creating amba device /soc/spi@ffd68000
^[[32m[ 0.387402] ^[[0m Test1
^[[32m[ 0.387415] ^[[0m Test2
^[[32m[ 0.387427] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387430] ^[[0m Test3
^[[32m[ 0.387435] ^[[0m Test4
^[[32m[ 0.387440] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387466] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387479] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387493] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387506] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387519] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387532] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387545] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387558] ^[[0m __of_parse_phandle_with_args Test2 return err -2
^[[32m[ 0.387570] ^[[0m Test5
^[[32m[ 0.387582] ^[[0m Test7 []
^[[32m[ 0.387586] ^[[0m amba_device_add Test1
^[[32m[ 0.387590] ^[[0m amba_device_add Test4
^[[32m[ 0.387597] ^[[0m amba_device_add Test6
^[[32m[ 0.387601] ^[[0m amba_get_enable_pclk Test1
^[[32m[ 0.387604] ^[[0m __of_clk_get_by_name Test1
^[[32m[ 0.387608] ^[[0m __of_clk_get_by_name Test2 name [apb_pclk] dev_id:[ffd68000.spi]
^[[32m[ 0.387613] ^[[0m (p + l > end return success
^[[32m[ 0.387617] ^[[0m (p + l > end return success
^[[32m[ 0.387621] ^[[0m __of_clk_get_by_name Test3 index [1]
^[[32m[ 0.387625] ^[[0m of_clk_get Test1 index[1] dev_id:[ffd68000.spi] con_id:[apb_pclk]
^[[32m[ 0.387629] ^[[0m of_clk_get Test2
^[[32m[ 0.387635] ^[[0m^[[33m of_clk_get Test3 rc^[[0m: [-2]
^[[32m[ 0.387640] ^[[0m^[[33m of_clk_get Test4 rc^[[0m: [-2]
^[[32m[ 0.387644] ^[[0m^[[33mERROR^[[0m^[[31m: could not get clock /soc/spi@ffd68000:apb_pclk(1)^[[0m
^[[32m[ 0.387649] ^[[0m amba_get_enable_pclk Test2
^[[32m[ 0.387655] ^[[0m amba_device_add Test10 ret value [-2]
^[[32m[ 0.387659] ^[[0m amba_device_add Test11
^[[32m[ 0.387663] ^[[0m Test8
^[[32m[ 0.387669] ^[[0m^[[33mof_amba_device_create()^[[0m^[[31m: amba_device_add() failed (-2) for /soc/spi@ffd68000^[[0m


@leo-yan any idea on this issue?

With SPI1 its working fine but its not there in LS connector.So i am trying on SPI2 but no luck.


@rvmanjumce Could you tell me which bootloader images you are using?

I can reproduce the spi2 booting failure with UEFI+ARM-TF, if you have the same failure with me, I filed one bug for tracking: https://bugs.96boards.org/show_bug.cgi?id=534

If you don’t worry about for the bootloaders, could you try to use legacy booting images? From my understanding, the landing team uses legacy booting image + branch: https://github.com/96boards-hikey/linux/blob/hikey960-upstream-rebase, they have not found spi2 initialization issue.


I have followed the below link to generate bootloader image.

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

As you suggested i will try with hikey960-upstream-rebase and will update the status.


I have tried hikey960-upstream-rebase here they supported only arm/config/ but for arm64/config/ i didnt find defconfig for hikey960.

Note: I am trying on arm64 platform


@rvmanjumce yeah, because this branch is for mainline kernel upstreaming, so you could directly use arch/arm64/configs/defconfig: make defconfig.


This issue is resolved in the bug report Bug 512 - SPI2: causing kernel panic when enabled and below is the link for the same.


After this changes LS connector Clock speed effected and its very very slow.
I have verified the SPI2 and I2C0 on LS connector and its very very slow and its not acceptable speed.


I wonder if usage of SPI on Low Speed Connector (i.e. SPI2 ) is now ok.
Is there any update ? is there still any limitation ?
thanks a lot.


AFAIK several SPI issues have been fixed on Hikey960 (speed, clock), You should be able to use it.