Hi guodong,
Most parts of the patch are the same to mine. But There is some tiny difference in which I need to acknowledge.
Hi kaz,
Thanks for your sharing. But I am curious about your configuration for cs-gpios,
cs-gpios = <&gpio2 0 0>, <&gpio2 1 0>;
According to the configuration in arch/arm64/boot/dts/hi6220-gpio.dtsi ,these two gpios seem to have no relation to SPI.
/* LCB: GPIO2_0, J2 */ gpio_j2_2_0:gpio_j2_2_0 { gpios = <&gpio2 0 0>; }; /* LCB: GPIO2_1, J2 */ gpio_j2_2_1:gpio_j2_2_1 { gpios = <&gpio2 1 0>; };
My configuration is bus-id = <0>; enable-dma = <1>; dmas = <&dma0 12 &dma0 13>; dma-names = "rx", "tx";
num-cs = <4>; cs-gpios = <&gpio6 2 0>, <&gpio6 3 0>, <&gpio6 4 0>, <&gpio6 5 0>;
I am trying to test my configuration according to your trail today. Not finished yet due to network failure in our lab.
On 2015/11/10 9:42, Guodong Xu wrote:
Thanks Kazumoto. Kaihua, Please have a review of attached patch. Are you OK with that? If yes, I would like to integrate this into hikey (https://github.com/96boards/linux.git) -Guodong Xu
From: kkojima@drone.co.jp To: zhongkaihua@huawei.com Date: Tue, 10 Nov 2015 09:52:13 +0900 CC: dev@lists.96boards.org Subject: Re: [Dev] SPI on HiKey
Zhong Kaihua wrote:
Clock_sys 21,which is divided from syspll, is used for both work clock and bus clock on hi6220. If you refer to the docs at Documentation/devicetree/bindings/spi/, you may find that some other SOCs also work like that.
Thanks for your explanations!
BTW, we are interested in how you test SPI on Hikey board. Can you share your test methods and test case to us? We are evaluating if we should upsteam our DTSI patch to the mainline branch, and we do not have related test environment.
I've heard that the SPI suport is in testing with linaro folks already. Anyway, here is a step-by-step trial with the tiny patch attatched. I'm using uefi with the recent edk2 that enables SPI0: commit 04ba756e8996b1bdcd10ff484779cc95352a8e4a Author: Haojian Zhuang <haojian.zhuang at outlook.com> Date: Fri Oct 9 20:12:11 2015 +0800 Merge pull request #51 from hzhuang1/unreset_spi HiKeyPkg: unreset SPI0 which is on hikey branch of https://github.com/96boards/edk2.git. [On host:] git clone https://github.com/96boards/linux.git cd linux git checkout hikey git branch working-hikey cat $SOMEWHERE/hikey-spi.patch | patch -p1 wget http://builds.96boards.org/snapshots/hikey/community/hikey/latest/kernel.con... cp kernel.conf .config make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig #Check spidev support # Device Drivers->SPI support->[*] User mode SPI device driver support make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs #Install it #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 __ __ __ __ __ __ | .� Regards, kaz
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev