I apologize if this topic has been discussed before.
I am trying to bring up a SPI slave on HiKey 960 Low Speed Expansion (J2002). I have connected GPIO 209 (pin 24) as the interrupt line and corresponding entries are made in the dts file:
arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
@@ -670,6 +670,12 @@
/* On Low speed expansion */
label = “LS-SPI0”;
status = “okay”;
-
compatible = "spi_driver";
-
spi-max-frequency = <1000000>;
-
reg = <0>;
-
interrupt-parent = <&gpio27>;
-
interrupts = <209 1>;
};
After flashing the board with a boot image (generated after building the dtb files from kernel build and copying over to AOSP_ROOT/device/ and running make bootimage), I do not see the interrupt number 209 in /proc/interrupts. I don’t see GPIO_297 as the interrupt either, if I assume that GPIO 209 is represented as GPIO 297 in kernel (as per that pin mapping table for HiKey 960).
Following is the result from cat /proc/interrupts:
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
4: 6431 5239 4615 4055 5186 4588 4465 4077 GIC-0 27 Level arch_timer
6: 0 0 0 0 0 0 0 0 GIC-0 80 Level timer
7: 0 0 0 0 0 0 0 0 GIC-0 56 Level arm-pmu
8: 0 0 0 0 0 0 0 0 GIC-0 57 Level arm-pmu
9: 0 0 0 0 0 0 0 0 GIC-0 58 Level arm-pmu
10: 0 0 0 0 0 0 0 0 GIC-0 59 Level arm-pmu
11: 0 0 0 0 0 0 0 0 GIC-0 34 Level arm-pmu
12: 0 0 0 0 0 0 0 0 GIC-0 35 Level arm-pmu
13: 0 0 0 0 0 0 0 0 GIC-0 36 Level arm-pmu
14: 0 0 0 0 0 0 0 0 GIC-0 37 Level arm-pmu
18: 0 0 0 0 0 0 0 0 GIC-0 150 Level ffd71000.i2c
19: 370 0 0 0 0 0 0 0 GIC-0 151 Level ffd72000.i2c
20: 0 0 0 0 0 0 0 0 GIC-0 346 Level fdf0b000.i2c
22: 350 0 0 0 0 0 0 0 GIC-0 109 Level uart-pl011
23: 1 0 0 0 0 0 0 0 GIC-0 111 Level uart-pl011
24: 287 0 0 0 0 0 0 0 GIC-0 175 Level k3-dma
25: 0 0 0 0 0 0 0 0 GIC-0 248 Level k3-dma
26: 0 0 0 0 0 0 0 0 GIC-0 78 Level rtc-pl031
56: 0 0 0 0 0 0 0 0 GIC-0 344 Level pl022
58: 5894 0 0 0 0 0 0 0 GIC-0 310 Level ufshcd
59: 0 0 0 0 0 0 0 0 GIC-0 171 Level dw-mci
60: 323 0 0 0 0 0 0 0 GIC-0 172 Level dw-mci
63: 0 0 0 0 0 0 0 0 GIC-0 177 Level hisi_thermal
64: 0 0 0 0 0 0 0 0 GIC-0 290 Level e82c0000.mali
65: 0 0 0 0 0 0 0 0 GIC-0 291 Level e82c0000.mali
66: 29 0 0 0 0 0 0 0 GIC-0 292 Level e82c0000.mali
The spi2 connector has this entry in the (hi3660-hikey960.dtsi) file:
spi2: spi@ffd68000 {
compatible = “arm,pl022”, “arm,primecell”;
reg = <0x0 0xffd68000 0x0 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&crg_ctrl HI3660_CLK_GATE_SPI2>;
clock-names = “apb_pclk”;
pinctrl-names = “default”;
pinctrl-0 = <&spi2_pmx_func>;
num-cs = <1>;
cs-gpios = <&gpio27 2 0>;
status = “disabled”;
I would have expected to see an entry like ffd68000.spi2 (something similar to any of the i2c entries, GIC-0 346 Level fdf0b000.i2c…) in the above /proc/interrupts table.
Clearly, the kernel didn’t detect the SPI device (kernel driver complains that the SPI device wasn’t configured correctly). What am I missing?
I am not sure if Pin 209 is under interrupt-parent gpio26 or gpio27 (from arch/arm64/boot/dts/hisilicon/hi3660.dtsi, it appears to be under gpio26 but the spi2: spi@ffd68000 entry in the above dtsi file shows that the spi2 will have interrupts under gpio27. In the end I tried both the options, once with gpio26 and another time with gpio27, but still didn’t see the device detected in the device tree.
Any pointer will be highly appreciated. Thanks much.