using spidev on iMx233

Started by trackit, January 22, 2013, 12:03:36 PM

Previous topic - Next topic

trackit

Hello @all,

i need to access the SPI interface from userspace. Unfortunally i have not been able to convince archlinux to create any /dev/spidevicename. Can anybody supply a working device tree configuartion file for this case (adding a SPI flash device was no problem)? Are there any other things to do to create the device in the dev tree?

Thanks and best regards,
Ralf

jlumme

#1
I'm not sure about arch, but in my buildroot generated file system, the trick was to mount devtmpfs to dev mount -t devtmpfs devtmpfs /dev and the node appears.
I can check the dtsi file once I get home from work today, but it was quite straightforward..

Edit: mode -> node

jlumme

trackit,
My dtsi looks like this:

imx23-olinuxino.dts:

flash: m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "sst,sst25vf064b";
spi-max-frequency = <1000000>;
reg = <0>;
};
ucontroller: spidev@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "linux,spidev";
spi-max-frequency = <1000000>;
reg = <1>;
};


Also, since I have 2 devices in the bus, I also added the CS to the pinmux:
imx23.dtsi:

spi2_pins_a: spi2@0 {
reg = <0>;
fsl,pinmux-ids = <
0x0182 /* MX23_PAD_GPMI_WRN__SSP2_SCK */
0x0142 /* MX23_PAD_GPMI_RDY1__SSP2_CMD */
0x0002 /* MX23_PAD_GPMI_D00__SSP2_DATA0 */
0x0032 /* MX23_PAD_GPMI_D03__SSP2_DATA3 */
0x0042 /* MX23_PAD_GPMI_D03__SSP2_DATA4 */ <- CS 1
>;
fsl,drive-strength = <1>;
fsl,voltage = <1>;
fsl,pull-up = <0>;
};