cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
7,627 Views
Registered: ‎11-12-2008

Query about using SPI driver with Xilinx kernel 2.6.29

Hello,

I will want use the Xilinx_spi driver through Xilinx Linux kernel for communicated with DAC and others components.

I use Xilinx Linux kernel 2.6.29 and the enable SPI working. But now, I have not devices like dev/spidev1.1 or another.

I do not find how used this driver and populated my /dev folder . Have you got any idea for resolved my problem.

 

So thank you for your time.

0 Kudos
5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
7,618 Views
Registered: ‎09-10-2008

I have some information about using SPI on the following page, see if this helps.

 

http://xilinx.wikidot.com/osl-spi-driver

 

Thanks,

John

0 Kudos
Highlighted
Observer
Observer
7,610 Views
Registered: ‎11-12-2008

Hi John,

Thank you to your answer.

 

I read the link which you suggest. I have tried different syntaxes, but I can implement a new device.

My personal device is a DAC, the EEPROM use different option like addr-size, page-size which I do not need.

 

Have you got another device declaration sample for simple SPI peripheral?

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
7,606 Views
Registered: ‎09-10-2008

No I don't. I would look in the kernel tree.

 

Look at the dts files in arch/powerpc/boot/dts as I'm sure there are some there.

 

I assume you are implying you need to understand the device tree entry, but it's not real clear from your message. 

 

-- John

0 Kudos
Highlighted
Observer
Observer
7,554 Views
Registered: ‎11-12-2008

Hi John,

 

It is true, my answer is not very clear :)

I wanted to say: I read the doc, and I had done different tests but I did not get good results.

 

I modify my SPI driver to virtex405-ml405.dts file as shown below:

xps_spi_0: xps-spi@84000000 {

            compatible = "xlnx,xps-spi-2.00.b";

            interrupt-parent = <&xps_intc_0>;

            interrupts = < 0 2 >;

            reg = < 0x84000000 0x1000 >;

            xlnx,family = "virtex4";

            xlnx,fifo-exist = <0x1>;

            xlnx,num-ss-bits = <0x1>;

            xlnx,num-transfer-bits = <0x8>;

            xlnx,sck-ratio = <0x20>;

            #address-cells = <1>;

            #size-cells = <0>;

 

            Dactest@0 {

                compatible = "spidev";

                spi-max-frequency = <100000000>;

                reg = <0>;

                #addr-size = <2>;

                #page-size = <32>;

                Dactest -size = <128>;

                Dactest -name = "Dactestname";

            };

        } ;

 

This is my last try.

I do not find:

  • a basic sample with simple SPI device
  • the description of different fields in this file as “compatible”, … .

 

I am not sure that the fields “addr-size” and “page-size” are needed for my device (Dactest).

 

Best regard,

Rémi

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
7,548 Views
Registered: ‎09-10-2008

I haven't done what you're trying to do other than the eeprom.

 

The compatible field is what a driver will check to make sure it's compatible with the h/w in the tree. Is there a driver for the DAC that you are trying to use?

 

There was a driver for the eeprom I was using, the at25, and it runs on top of the spi driver.  

 

You can also read <kernel>/documentation/powerpc/booting-without-of.txt for more description of the device tree itself.  I'm sure not an expert on it.

 

It sort of appears that you are trying to use the spidev interface to open the DAC as a file and talk to it.  If that's true, you don't need a device tree entry as you only need an entry for the SPI controller I believe.  We do something similar with an I2C eeprom (http://xilinx.wikidot.com/osl-i2c-driver). This should be pretty easy as you just need to know how to setup messages to talk to the DAC over the SPI bus.  You may also check the documentation/spi directory of the kernel as it may have some examples.

 

-- John

 

0 Kudos