+email@example.com for further discussons.
On 17 May 2016 at 14:59, Zhong Kaihua firstname.lastname@example.org wrote:
On 2016/4/26 16:20, Denis Ciocca wrote:
Hi Mr. Zhong,
I've been working with Hikey board using Hisilicon 6220. I need to use SPI0, availabe on expansion connecto. I'm using android-linaro-kernel4.1.
Using spidev driver, I can see with oscilloscope that MOSI and CS are working correctly but CLK is not moving. Is it working corretly in the board and mine is broken somehow or something wrong with the code?
Thanks & BR, Denis
Excuse me for the delay of reply. The spi clock is divided from syspll and we have not met this situation before.
Please check you have configured SPI driver as follow,
(1) Change the status of SPI0 to "ok" in hi6220.dtsi
(2) Enable the SPI suppORt in menuconfig
Device Drivers->SPI support->[*] User mode SPI device driver support
We ran spidev_test when we upstream the code, and it works well. You may use it to test your board. If the test is OK and the clock still cannot work, please contact us for further investigation.
#Get latest spidev test, for example # https://github.com/torvalds/linux/blob/master/Documentation/spi/spidev_test.... #and send it to the target. [On target with the new kernel:] [Confirm that there is f7106000.spi under /sys/devices/smb] [Compile spidev_test.c] $gcc -O2 -o spidev_test spidev_test.c
[Target root:] [Loop test where connecting SDO to SDI on HiKey] #./spidev_test -D /dev/spidev0.0 spi mode: 0x0 bits per word: 8 max speed: 500000 Hz (500 KHz) RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@....�..................�.
[Send two bytes to some device. This is the result from gyroscope of ST LSM9DS0.] #./spidev_test -D /dev/spidev0.0 -p "\x8f\x00" spi mode: 0x0 bits per word: 8 max speed: 500000 Hz (500 KHz) RX | 00 D4 __ __ __ __ __ __ | .�