AnsweredAssumed Answered

AD9371 Linux integration error.

Question asked by truecool on Sep 8, 2017
Latest reply on Oct 30, 2017 by jaygarner

I am trying to integrate AD9371 Linux kernel code on my custom fpga and custom linux on zc706 and below is my device tree. I have removed JESD related clocks as I am trying to up SPI first.

 

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>;
clk0_ad9528: ad9528-1@0 {
#address-cells = <1>;
#size-cells = <0>;
#clock-cells = <1>;
compatible = "ad9528";

spi-cpol;
spi-cpha;
spi-max-frequency = <10000000>;
//adi,spi-3wire-enable;
reg = <0>;

clock-output-names = "ad9528-1_out0", "ad9528-1_out1", "ad9528-1_out2", "ad9528-1_out3", "ad9528-1_out4", "ad9528-1_out5", "ad9528-1_out6", "ad9528-1_out7", "ad9528-1_out8", "ad9528-1_out9", "ad9528-1_out10", "ad9528-1_out11", "ad9528-1_out12", "ad9528-1_out13";
adi,vcxo-freq = <122880000>;

adi,refa-enable;
adi,refa-diff-rcv-enable;
adi,refa-r-div = <1>;
adi,osc-in-cmos-neg-inp-enable;

/* PLL1 config */
adi,pll1-feedback-div = <4>;
adi,pll1-charge-pump-current-nA = <5000>;


/* PLL2 config */
adi,pll2-ndiv-a-cnt = <2>; /* N = 30 */
adi,pll2-ndiv-b-cnt = <7>;
adi,pll2-vco-diff-m1 = <3>; /* use 5 for 184320000 output device clock */
adi,pll2-n2-div = <10>; /* N / M1 */
adi,pll2-r1-div = <1>;
adi,pll2-charge-pump-current-nA = <805000>;

/* SYSREF config */
adi,sysref-src = <SYSREF_SRC_INTERNAL>;
adi,sysref-pattern-mode = <SYSREF_PATTERN_CONTINUOUS>;
adi,sysref-k-div = <512>;
adi,sysref-request-enable;
/*adi,sysref-nshot-mode = <SYSREF_NSHOT_4_PULSES>;*/
/*adi,sysref-request-trigger-mode = <SYSREF_LEVEL_HIGH>;*/

adi,rpole2 = <RPOLE2_900_OHM>;
adi,rzero = <RZERO_1850_OHM>;
adi,cpole1 = <CPOLE1_16_PF>;

adi,status-mon-pin0-function-select = <1>; /* PLL1 & PLL2 Locked */
adi,status-mon-pin1-function-select = <7>; /* REFA Correct */

ad9528_0_c13: channel@13 {
reg = <13>;
adi,extended-name = "DEV_CLK";
adi,driver-mode = <DRIVER_MODE_LVDS>;
adi,divider-phase = <0>;
adi,channel-divider = <10>;
adi,signal-source = <SOURCE_VCO>;
};

ad9528_0_c1: channel@1 {
reg = <1>;
adi,extended-name = "FMC_CLK";
adi,driver-mode = <DRIVER_MODE_LVDS>;
adi,divider-phase = <0>;
adi,channel-divider = <10>;
adi,signal-source = <SOURCE_VCO>;
};

ad9528_0_c12: channel@12 {
reg = <12>;
adi,extended-name = "DEV_SYSREF";
adi,driver-mode = <DRIVER_MODE_LVDS>;
adi,divider-phase = <0>;
adi,channel-divider = <10>;
adi,signal-source = <SOURCE_SYSREF_VCO>;
};

ad9528_0_c3: channel@3 {
reg = <3>;
adi,extended-name = "FMC_SYSREF";
adi,driver-mode = <DRIVER_MODE_LVDS>;
adi,divider-phase = <0>;
adi,channel-divider = <10>;
adi,signal-source = <SOURCE_SYSREF_VCO>;
};

ad9371: ad9371-phy@1 {
#address-cells = <1>;
#size-cells = <0>;
#clock-cells = <1>;
compatible = "ad9371";

/* SPI Setup */
reg = <1>;
spi-max-frequency = <25000000>;

/* Clocks */
clocks = <&clk0_ad9528 13>, <&clk0_ad9528 1>;
clock-names = "dev_clk", "fmc_clk";


};


};

 

On Linux boot I am getting following error

spi32766.0 supply vcc not found , using dummy regulator

iio iio:device1 : ad9528 setup

iio iio:device1 : SPI Read verify failed (0x0)

ad9528: probe of spi32766.0 failed with error -5

 

SPI probe is failing with EIO error. What could be the reason and how to fix it?

Outcomes