Post Go back to editing

ZC702 +FMCOMMS3 with Petalinux-2016.2

I am  trying to transmit the custom data  from custom HLS generated IP using AD9361.

I  am  able to transmit data using NO-OS drivers, checked with spectrum analyser- able to see some expected spectrum.

Now, we shifted to Linux drivers and  booting the Zynq from SD-Card. I am using the external linux kernel-2016-R2 downloaded from the analog devices site which has the ad9361 drivers.  I have added ad-fmcomms2.dtsi file in the device tree. I have written an application which triggers the custom IP which is connected to ad9361. The data is being generated at the transmitter output(checked the output through the application created in petalinux), but I am unable to see any spectrum from the ad9361TX port which is expected after initialising ad9361 through the dts files. The same blockdesign is used in transmitting the data through  no-os drivers, so there is no problem with the hardware part. I am able to initialise ad9361, set the bandwidth , lo frequency and every other parameter through serial terminal, when booted from sdcard(Linux device drivers). The only problem is I don't see any spectrum. Please help me in debugging this, and tell me the ways to check and find if ad9361 is being initialized correctly or do I have to set any registers further?

In the dmesg | grep ad9361

ad9361 spi32766.0: ad9361_probe: failed to register debugfs
ad9361 spi32766.0: ad9361_probe : AD936x Rev 2 successfully initialized
ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed

ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed

root@Xilinx-ZC702-2016_2:~# modprobe ad9361_drv
ad9361 spi32766.0: ad9361_probe : enter (ad9361)
ad9361 spi32766.0: ad9361_probe: failed to register debugfs
ad9361 spi32766.0: ad9361_probe : AD936x Rev 2 successfully initialized
root@Xilinx-ZC702-2016_2:~# lsmod
    Not tainted
ad9361_drv 88020 0 - Live 0xbf06f000
cf_axi_adc 12035 1 ad9361_drv, Live 0xbf068000
industrialio_buffer_dmaengine 2175 1 cf_axi_adc, Live 0xbf064000
industrialio_buffer_dma 7056 1 industrialio_buffer_dmaengine, Live 0xbf05d000
ipv6 272298 14 [permanent], Live 0xbf000000

  • ad9361_probe: failed to register debugfs

    That's because CONFIG_DEBUG_FS is not enabled in your kernel.

    Can you share you device tree and kernel config?

    Looks like the cf_axi_dds driver is not instantiated

      cf_ad9361_dac_core_0: cf-ad9361-dds-core-lpc@79024000 {
       compatible = "adi,axi-ad9361-dds-6.00.a";

    -Michael

  • The device tree provide can't be complete -

    ad9361_drv 88020 0 - Live 0xbf06f000
    cf_axi_adc 12035 1 ad9361_drv, Live 0xbf068000

    this shows cf_axi_adc - but there is no relevant snippet in the tree you provided.

    With the given information - it's hard to tell what might be wrong.

    -Michael

  • There is one physical ad9361 IP block mapped to 0x79020000 - however logically it's split internally in an receive and transmit block. Two different drivers take care of it. The offset to the transmit block is 0x4000.

    cf_ad9361_adc_core_0: cf-ad9361-lpc@79020000 {
            compatible = "adi,axi-ad9361-6.00.a";
            reg = <0x79020000 0x6000>;

    cf_ad9361_dac_core_0: cf-ad9361-dds-core-lpc@79024000 {

            compatible = "adi,axi-ad9361-dds-6.00.a";
            reg = <0x79024000 0x1000>;

    -Michael

  • forget about the auto generated device tress completely.

    In most situations they are not working properly. Yes add is manually.

  • Hi,

    Now, I enabled the debugfs in the kernel config. Below are the dmesg, device tree and kernel config  after updation.

    root@Xilinx-ZC702-2016_2:~# dmesg
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: cdns_spi_setup_transfer, mode 1, 8 bits/w, 5208333 clock speed
    ad9361 spi32766.0: ad9361_probe : AD936x Rev 2 successfully initialized

    root@Xilinx-ZC702-2016_2:~# modprobe ad9361_drv
    ad9361 spi32766.0: ad9361_probe : enter (ad9361)
    ad9361 spi32766.0: ad9361_probe : AD936x Rev 2 successfully initialized

    root@Xilinx-ZC702-2016_2:~# lsmod
        Not tainted
    ad9361_drv 90987 0 - Live 0xbf070000
    cf_axi_adc 13224 1 ad9361_drv, Live 0xbf068000
    industrialio_buffer_dmaengine 2175 1 cf_axi_adc, Live 0xbf064000
    industrialio_buffer_dma 7056 1 industrialio_buffer_dmaengine, Live 0xbf05d000
    ipv6 272298 14 [permanent], Live 0xbf000000
    root@Xilinx-ZC702-2016_2:~#

    Device tree :

    system-top.dts

    /dts-v1/;
    /include/ "system-conf.dtsi"
    / {
    };
    #define fmc_spi spi0
    #define pmod_spi spi1
    &i2c0 {
        #address-cells = <1>;
        #size-cells = <0>;
        i2cswitch@74 {
            compatible = "nxp,pca9548";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0x74>;
            i2c@0 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0>;
                si570: clock-generator@5d {
                    #clock-cells = <0>;
                    compatible = "silabs,si570";
                    temperature-stability = <50>;
                    reg = <0x5d>;
                    factory-fout = <156250000>;
                    clock-frequency = <148500000>;
                };
            };

            i2c@2 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <2>;
                eeprom@54 {
                    compatible = "at,24c08";
                    reg = <0x54>;
                };
            };

            i2c@3 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <3>;
                gpio@21 {
                    compatible = "ti,tca6416";
                    reg = <0x21>;
                    gpio-controller;
                    #gpio-cells = <2>;
                };
            };

            i2c@4 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <4>;
                rtc@54 {
                    compatible = "nxp,pcf8563";
                    reg = <0x51>;
                };
            };

            i2c@7 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <7>;
                hwmon@52 {
                    compatible = "ti,ucd9248";
                    reg = <52>;
                };
                hwmon@53 {
                    compatible = "ti,ucd9248";
                    reg = <53>;
                };
                hwmon@54 {
                    compatible = "ti,ucd9248";
                    reg = <54>;
                };
            };
        };
    };

    &qspi {
        flash0: flash@0 {
            compatible = "micron,n25q128a13";
        };
    };

    &gem0 {
        phy-handle = <&phy0>;
        ps7_ethernet_0_mdio: mdio {
            phy0: phy@7 {
                compatible = "marvell,88e1116r";
                device_type = "ethernet-phy";
                reg = <7>;
            };
        };
    };

    /{
        usb_phy0: usb_phy@0 {
            compatible = "ulpi-phy";
            #phy-cells = <0>;
            reg = <0xe0002000 0x1000>;
            view-port = <0x0170>;
            drv-vbus;
        };
    };

    &usb0 {
        dr_mode = "host";
        usb-phy = <&usb_phy0>;
    };

    #include "adi-fmcomms2.dtsi"
    #include "adi-fmcomms3-up-down-converter.dtsi"

    &adc0_ad9361 {
        en_agc-gpios = <&gpio0 98 0>;
        sync-gpios = <&gpio0 99 0>;
        reset-gpios = <&gpio0 100 0>; /* Previously 84 */
        enable-gpios = <&gpio0 101 0>;
        txnrx-gpios = <&gpio0 102 0>;
    };

              

     

  • Hi,

    And, I am not using DMAs in my design, Please find the tcl file below for reference.

    system.tcl - Google Docs 

    Thanks.

  • Hi,

    I have shared all the dts*  files in my /$project/subsystems/linux/configs/device-tree. Please check it again. What other information should I provide?

    This cf_axi_adc  driver is  added in the kernel. I believe that corresponds to ad9361 ipblock in the design.  I verified the address of the axi-ad9361 ipblock.

    The below lines are snippets from the zynq-zc702-adv7511-ad9361-fmcomms2-3.dts

    cf_ad9361_adc_core_0: cf-ad9361-lpc@79020000 {
            compatible = "adi,axi-ad9361-6.00.a";
            reg = <0x79020000 0x6000>;
            dmas = <&rx_dma 0>;
            dma-names = "rx";
            spibus-connected = <&adc0_ad9361>;
            xlnx,dphase-timeout = <0x8>;
            xlnx,num-mem = <0x1>;
            xlnx,num-reg = <0x1>;
            xlnx,s-axi-min-size = <0x1ff>;
            xlnx,slv-awidth = <0x20>;
            xlnx,slv-dwidth = <0x20>;
            xlnx,use-wstrb = <0x0>;
        };

    cf_ad9361_dac_core_0: cf-ad9361-dds-core-lpc@79024000 {

            compatible = "adi,axi-ad9361-dds-6.00.a";
            reg = <0x79024000 0x1000>;
            clocks = <&adc0_ad9361 13>;
            clock-names = "sampl_clk";
            dmas = <&tx_dma 0>;
            dma-names = "tx";
            dac-sample-frequency = <491520000>;
            xlnx,dphase-timeout = <0x8>;
            xlnx,num-mem = <0x1>;
            xlnx,num-reg = <0x1>;
            xlnx,s-axi-min-size = <0x1ff>;
            xlnx,slv-awidth = <0x20>;
            xlnx,slv-dwidth = <0x20>;
            xlnx,use-wstrb = <0x0>;
        };
    };

    Considering this:

    cf_ad9361_adc_core_0: cf-ad9361-lpc@79020000 { :

    compatible = "adi,axi-ad9361-6.00.a";
    79020000 is the physical address of the ad9361 ip block in the bare metal design.

    I used the same bare metal design. So I believe, the lines below also represent the same ad9361 ip block with same physical address.

    axi_ad9361:  axi_ad9361@79020000:  {

              compatible = "xlnx,axi-ad9361-1.0";

              reg = <0x79020000 0x10000>;

          };

      cf_ad9361_dac_core_0: cf-ad9361-dds-core-lpc@79024000 {   (mentioned above )

    But there is no IP block with this physical address(79024000). What does this correspond to?

     Should I add the above lines from zynq-zc702-adv7511-ad9361-fmcomms2-3.dts corresonding to the ddscore to my device tree, in the same way I added gpios and adi-fmcomms2.dtsi file to the system-top.dts?

    cf-ad9361-dds-core-lpc@79024000:  and what IP block does this correspond to in the bare metal design. what does this core do?

    and how do I instantiate, If I need the dac core/ddscore s for the wrking of my design .

    Thanks in advance!!!

  • But the lines corresponding to the transmit block  are not generated in  the device tree, even though physical ad9361 ip block is present in the block design.

           cf_ad9361_dac_core_0: cf-ad9361-dds-core-lpc@79024000 {

            compatible = "adi,axi-ad9361-dds-6.00.a";
            reg = <0x79024000 0x1000>;

    should I add it manually?

  •  Also,  You said : Looks like the cf_axi_dds driver is not instantiated. How do I instantiate it?

  • Not sure about your HDL modifications. However the DAC-DDS core may be setup to generate a DDS tone.

    You can control the DDS tones using the out_altvoltageX_* attributes.

    Please see here:

    https://wiki.analog.com/resources/tools-software/linux-drivers/iio-dds/axi-dac-dds-hdl

    -Michael