You are on page 1of 6

More questions in Microcontroller no-OS Drivers 

Log in to create and rate content, and to follow, bookmark, and share content with other members.


ANSWERED

AD9361 No-OS driver under Linux userspace


Question asked by DragosB on 13 Jun, 2014
Latest reply on 13 Jun, 2014 by DragosB 

 Like • 0  Comment • 3

Someone asked me by email:

Hello,
 
My apologies if the answer to this is readily available on the web, but I couldn't manage to find anything.
 
Would you be able to point me at a device tree entry that i could use for using the no-os ad9361 driver code
under linux? I'm specifically looking for the device tree entry that will create the "/dev/spidev32766.0"
device. I have put something together myself based on tidbits i gathered around the web, but i'm getting a
"failed to transfer one message from queue" error with 'my' spidev device. The no-os driver works fine on my
zedboard+fmcomms2 setup when running bare metal, so it appears that i have something messed up in my
linux-based spi driver or its configuration.
 
For bonus points, is there a uio device tree entry to support the uio device the no-os linux driver is
attempting to open for the adc and dac dma's?
 
Regards,
Joe

DragosB
13 Jun, 2014 11:45 AM

 Correct Answer

Joe,
 
Add the following entries to the ADV7511 devicetree (linux/arch/arm/boot/dts/zynq-zed-
adv7511.dts at xcomm_zynq · analogdevicesinc/linux · GitHub ):
 
    fmc_spi: spi@e0006000 {
        bus-num = <1>;
        compatible = "cdns,spi-r1p6", "xlnx,zynq-spi-1.00.a", "xlnx,ps7-spi-1.00.a";
        interrupt-parent = <&gic>;
        interrupts = < 0 26 4 >;
        clock-names = "ref_clk", "aper_clk", "pclk";
        clocks = <&clkc 25>, <&clkc 34>, <&clkc 34>;
        num-chip-select = <4>;
        reg = < 0xe0006000 0x1000 >;
        speed-hz = <100000000>;
        xlnx,has-ss0 = <0x1>;
        xlnx,has-ss1 = <0x1>;
        xlnx,has-ss2 = <0x1>;
        xlnx,spi-clk-freq-hz = <100000000>;
        #address-cells = <1>;
        #size-cells = <0>;
        spi@0 {
            compatible = "spidev";
            spi-cpha;
            reg = <0>;
            spi-max-frequency = <1000000>;
        };
    };
 
    ad9361: ad9361@79020000 {
        compatible = "generic-uio";
        reg = <0x79020000 0x6000>;
    };
 
We will also add this information on our wiki soon.
 
Thanks,
Dragos

See the reply in context

No one else had this question

Visibility:  Microcontroller no-OS Drivers • 768 Views


Last modified on 13 Jun, 2014 11:32 AM

3 Replies

DragosB
13 Jun, 2014 11:45 AM

Joe,
 
Add the following entries to the ADV7511 devicetree (linux/arch/arm/boot/dts/zynq-zed-
adv7511.dts at xcomm_zynq · analogdevicesinc/linux · GitHub ):
 
    fmc_spi: spi@e0006000 {
        bus-num = <1>;
        compatible = "cdns,spi-r1p6", "xlnx,zynq-spi-1.00.a", "xlnx,ps7-spi-1.00.a";
        interrupt-parent = <&gic>;
        interrupts = < 0 26 4 >;
        clock-names = "ref_clk", "aper_clk", "pclk";
        clocks = <&clkc 25>, <&clkc 34>, <&clkc 34>;
        num-chip-select = <4>;
        reg = < 0xe0006000 0x1000 >;
        speed-hz = <100000000>;
        xlnx,has-ss0 = <0x1>;
        xlnx,has-ss1 = <0x1>;
        xlnx,has-ss2 = <0x1>;
        xlnx,spi-clk-freq-hz = <100000000>;
        #address-cells = <1>;
        #size-cells = <0>;
        spi@0 {
            compatible = "spidev";
            spi-cpha;
            reg = <0>;
            spi-max-frequency = <1000000>;
        };
    };
 
    ad9361: ad9361@79020000 {
        compatible = "generic-uio";
        reg = <0x79020000 0x6000>;
    };
 
We will also add this information on our wiki soon.
 
Thanks,
Dragos

 Actions  Like • 0

sbjaver
@ DragosB on 13 Jun, 2014 12:51 PM

Dragos,
 
I've confirmed this works. I did have problems on an older version of the kernel on which i first tried
it, not sure why. But updating to the following and all works as i hoped:
 
commit df77180ff6c897c6869498097158e9edf16cf838 (HEAD, xcomm_zynq)
Author: Lars-Peter Clausen < lars@metafoo.de>
Date:   Wed Jun 11 14:38:20 2014 +0200
    iio: ad9361: Remove unnecessary spi_set_drvdata(NULL)
    The core takes already care of setting drvdata to NULL, no need to do this
    manually.
    Signed-off-by: Lars-Peter Clausen < lars@metafoo.de>
 
 
Thanks!
 
Joe

 Actions  Like • 0

DragosB
@ sbjaver on 13 Jun, 2014 2:58 PM

Hi Joe,
 
I'm glad that it works.
 
Regards,
Dragos

 Actions  Like • 0

Related Content

ad9361 + no-os + linux devicetree?

AD9361 FMCOMMS3 drivers for Petalinux 2017.2

'unbind' / 'bind' of ad9361 spi driver

ad9361

getting the AD9361 drivers into the Xilinx 4.6 kernel

Recommended Content

How do I fix an "adisAPI Transfer Timed Out" error?

AD9208 one core on 8 lanes

How-To use EVAL-ADICUP3029 / EV-COG-AD3029 with emIDE

CODEC chip ADAU1372/ADAU1777/ADAU1702 background noise problem

Strange voltage on Sync input pin

Incoming Links

Re: ad9361 + no-os + linux devicetree?

Careers | Contact ADI | About ADI | Investor Relation | News Room | Terms of Use | Privacy and Security |

SiteMap | 简体中⽂ | ⽇本語 | eNewsletters | Analog Dialogue

© 1995 - 2017 Analog Devices, Inc. All Rights Reserved


Home | Top of page | Help © 2017 Jive Software | Powered by 

You might also like