This is a cache of https://discuss.96boards.org/t/spi-on-android/1089. It is a snapshot of the page at 2024-09-19T04:51:20.414+0000.
SPI on <strong>android</strong> - DragonBoard410c - 96Boards Forum

SPI on android

Hi everyone!

I am having pretty much the same problems as the guy in this post: http://www.96boards.org/forums/topic/spi-on-android/#gsc.tab=0
There, Akira Tsukamoto said that they were working on a fix. Is this fix already available?
If not, I am afraid, I have to rebuild the kernel as the guy in this post:
http://www.96boards.org/forums/topic/spi-on-dragon-board-410-not-functional-on-ls-expansion-conector/#gsc.tab=0
However I have never done that. Is there any good documentation?

Best,
Raphael

Hi,

Refer to https://developer.qualcomm.com/download/db410c/linux-android-software-build-and-installation-guide.pdf for building the kernel. Once you have the kernel source code downloaded, you can check the device tree to see if the relevant spi nodes are defined. E.g. for Debian they are msm8916.dtsi « qcom « dts « boot « arm64 « arch - working/qualcomm/kernel.git - Qualcomm Landing Team kernel and http://git.linaro.org/landing-teams/working/qualcomm/kernel.git/tree/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi#n27. Then you need to register your slave device. For that you can reference https://github.com/96boards/documentation/blob/master/ConsumerEdition/DragonBoard-410c/Configuration/EnableSPI.md.

Thank you for your help!

Meanwhile there came a much simpler solution to my mind, where we don’t even need the SPI module: We only need it to write some configuration bytes. So we will just do it by simulating a SPI with software (setting the GPIOs).
However I hope that your summary of links will be useful to others with a similar problem.

You’re welcome!
For SPI via GPIO bit-banging, just make sure the GPIO pins used are configured as GPIO since they can sometimes be used/configured for other functions. Or manually change the configurations yourself (to GPIO) before using the pins, if they’re not used for other required functions.