cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
6,700 Views

Zedbooard PetaLinux SPI Problem

Hi,

 

I want to use SPI1 on zedboard over PetaLinux 2013.10. I have connected SS0 to VCC. Here is my system.dts:

ps7_spi_1: ps7-spi@e0007000 {
            clock-names = "ref_clk", "aper_clk";
            clocks = <&clkc 26>, <&clkc 35>;
            compatible = "xlnx,ps7-spi-1.00.a";
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 49 4>;
            num-chip-select = <4>;
            bus-num = <0>;
            reg = <0xe0007000 0x1000>;
            spidev@1{
                compatible="spidev";
                reg =<1>; //chipselect 0
                spi-max-frequency= <50000000>;
            };
            spidev@2{
                compatible="spidev";
                reg =<2>; //chipselect 0
                spi-max-frequency= <50000000>;
            };
        } ;

To whom trying to get SPI working:

without bus-num = <0>; kernel panics.

without spidev@1{
                compatible="spidev";
                reg =<1>; //chipselect 0
                spi-max-frequency= <50000000>;
            };

devices wil not be listed in /dev

 

My problem is when I use https://www.kernel.org/doc/Documentation/spi/spidev_test.c this code to test SPI peripheral I get awkward signals. I have attached analyzed signals.

I think I can succesfuly acces to peripheral otherwise I couldn't get any signal. I have played with SPI mode, bits per word and spi speed but nothing has chanced. Also when I use echo asd > /dev/spidev0.1 same signals generated.

 

Any help appreciated

 

spidev1-2.png
0 Kudos
1 Reply
Anonymous
Not applicable
6,686 Views

OK. I found the solution :)

When I use clock value 1048576 = 2^20 and  2^21, it works with frequnecy of 666.7khz and 1333 khz respectively .

But I tried 2^19, 2^18, 2^16, it doesn't work.

0 Kudos