DART-6UL SPI: Difference between revisions
From Variscite Wiki
(Created page with "{{PageHeader|DART-6UL- SPI}} {{DocImage|category1=DART-6UL|category2=Yocto}} __toc__ Testing SPI from user space require some changes. * Configure your kernel and add spidev ...") |
No edit summary |
||
Line 6: | Line 6: | ||
<pre>&ecspi1 { | <pre>&ecspi1 { | ||
fsl,spi-num-chipselects = <1>; | fsl,spi-num-chipselects = <1>; | ||
cs-gpios = <& | cs-gpios = <&gpio3 10 0>; | ||
pinctrl-names = "default"; | pinctrl-names = "default"; | ||
pinctrl-0 = <& | pinctrl-0 = <&pinctrl_ecspi1_1>; | ||
status = "okay"; | status = "okay"; | ||
Line 23: | Line 23: | ||
}; | }; | ||
*/ | */ | ||
}; | |||
};</pre> | };</pre> | ||
Pick and choose the right chip select and you can also have multiple chip selects. | Pick and choose the right chip select and you can also have multiple chip selects. | ||
* Compile the Linux kernel and device tree. | * Compile the Linux kernel and device tree. | ||
* For testing use the application:<br>https://raw.githubusercontent.com/varigit/linux-2.6-imx/master/Documentation/spi/spidev_test.c | * For testing use the application:<br>https://raw.githubusercontent.com/varigit/linux-2.6-imx/master/Documentation/spi/spidev_test.c |
Revision as of 09:55, 28 December 2015
DART-6UL- SPI
Testing SPI from user space require some changes.
- Configure your kernel and add spidev driver. Device Drivers -> SPI support -> <*> User mode SPI device driver support
- Add spidev to your device tree
&ecspi1 { fsl,spi-num-chipselects = <1>; cs-gpios = <&gpio3 10 0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ecspi1_1>; status = "okay"; chip1: spidev@0 { compatible = "spidev"; spi-max-frequency = <12000000>; reg = <0>; }; /* chip2: spidev@1 { compatible = "spidev"; spi-max-frequency = <20000000>; reg = <1>; }; */ }; };
Pick and choose the right chip select and you can also have multiple chip selects.
- Compile the Linux kernel and device tree.
- For testing use the application:
https://raw.githubusercontent.com/varigit/linux-2.6-imx/master/Documentation/spi/spidev_test.c