AnsweredAssumed Answered

AXI ADC Linux Driver + Device Tree

Question asked by zbergquist on Mar 30, 2015
Latest reply on Apr 2, 2015 by mhennerich

I'm having trouble setting up a device tree for the AD9361 on an Altera Cyclone V dev kit.  I'm basically trying to pick out the relevant portions from socfpga_cyclone5_sockit_fmcomms2.dts and stick them in the DTS coming out of the Altera tools.

 

The wiki page for this driver seems to be out of date.  For example, it references a Xilinx driver and not an ADI one, and also lists the "dma-request" property as required despite omitting it from the example.  Could this be updated to better reflect what needs to be done?

 

In my case, the AXI ADC driver probe is failing to find a SPI client (the probe function just keeps deferring).  I added some logging to axiadc_attach_spi_client (in cf_adc_axi_core.c) and I found that the driver is never given a chance to inspect my SPI controller.

 

Here's my DTS node for the ADC core:

 

cf_ad9361_adc_core_0: cf-ad9361-lpc@0x100020000 {

     compatible = "adi,axi-ad9361-6.00.a";

     reg = <0x00000001 0x00020000 0x00010000>;

     dmas = <&rx_dma 0>;

     dma-names = "rx";

     spibus-connected = <&adc0_ad9361>;

};

 

And here is the SPI device I want it to find:

 

spi_ad9361: spi@0x100008000 {

     compatible = "altr,spi-14.0", "altr,spi-1.0";

     reg = <0x00000001 0x00008000 0x00000020>;

     interrupt-parent = <&intc>;

     interrupts = <0 43 4>;

     #address-cells = <0x1>;

     #size-cells = <0x0>;

     adc0_ad9361: ad9361-phy@0 {

          #address-cells = <1>;

          #size-cells = <0>;

          #clock-cells = <1>;

          compatible = "ad9361";

    

          /* SPI Setup */

          reg = <0>;

                    

          /* ... */

     };    

};

 

The driver never gets to see this device though.  The only device it sees is the following, which correctly fails since the compatibility string is not "ad9361".

 

hps_0_qspi: flash@0xff705000 {

  compatible = "cadence,qspi-14.1", "cadence,qspi";

  reg = <0xff705000 0x00000100>,

  <0xffa00000 0x00000100>;

  reg-names = "axi_slave0", "axi_slave1";

  interrupt-parent = <&hps_0_arm_gic_0>;

  interrupts = <0 151 4>;

  clocks = <&qspi_clk>;

  bus-num = <2>;

  fifo-depth = <128>;

  num-chipselect = <4>;

  status = "okay";

  bank-width = <2>;

  device-width = <1>;

  #address-cells = <1>;

  #size-cells = <0>;

  master-ref-clk = <400000000>;

  ext-decoder = <0>;

 

  flash0: n25q00@0 {

       compatible = "n25q00"; /* appended from boardinfo */

       #address-cells = <1>; /* appended from boardinfo */

       #size-cells = <1>; /* appended from boardinfo */

       reg = <0>; /* appended from boardinfo */

       spi-max-frequency = <100000000>; /* appended from boardinfo */

 

I just need to find out how to fix my device tree so that my SPI device shows up under the bus_for_each_dev(&spi_bus_type, NULL, ...) call.

Outcomes