Looking for programming guide to enable SPI on Hikey with Android running onit

Thank you, I thought posting multiple times reaches more people. From now I don’t double post.

Hi Praveen,

Your post is quit old, but the only one who try to use the SPI on HiKey. I also want to connect a SPI slave to my board. I use Android.

Did you change the configuration files?

When I check my boot log, I see:

hikey:/ # dmesg | grep spi
[    1.736005] ssp-pl022 f7106000.spi: could not find pctldev for node /soc/pinmux@f7010000/spi0_pmx_func, deferring probe
[    4.998933] ssp-pl022 f7106000.spi: ARM PL022 driver, device ID: 0x00041022
[    5.006071] ssp-pl022 f7106000.spi: mapped registers from 0x00000000f7106000 to ffffff80098a0000
hikey:/ #

So the SPI0 should be available. Do you know a good example to start programming the SPI driver?

Thanks,
Tristar

I used the spi lines on the low speed expansion header.

I just added my node as the child for the spi node and it is working fine most of the time.

But there is some issue, I am currently debugging that and if I find anything that related to spi then I will update here.

Mostly its the issue with my configuration or my board set up.

Hi Praveen,

Only for clarify: in my file
hikey-linaro/arch/arm64/boot/dts/hisilicon/hi6220.dtsi

I find:
spi0: spi@f7106000 {
compatible = “arm,pl022”, “arm,primecell”;

status = “disabled”;
};

I have to set status = “ok”. Do I also have to add:

spidev@0 {
		compatible = "linux,spidev";
		spi-max-frequency = <500000>;
		reg = <0>;
		status = "ok";
	};

There is no “spidev” in my dtsi or dts files.

Sorry for the stupid questions, but I am starting with my investigations building on the HiKey board.
Did you fix all issues and the SPI is working on the Low Speed Expansion Connector?

Thanks,
Tristar

Hi Tristar,

The spi on the low-speed expansion header is working fine.

In my case, we are connecting my board as a slave to the spi.

What I did was that just adding the node as a child to the spi node.

I didn’t use the spidev in my case.
Even if you use it, whenever you do some transactions using the spi, you should get the signals on the low-speed expansion header.

For me without any debugging, it started working the basic stuff.
I used the spi max frequency to 4MHz.

Background: I am working on audio stuff and the codec should expose the registers in some manner (regmap i2c or spi).
Whenever I write something into the reigsters or read from them, I get the signals on the low-speed expansion header.