Post Go back to editing

AD9121-M5372-EBZ based on AD-FMCOMMS1-EBZ

Hello,

I’m using the AD9121-M5372-EBZ evaluation board connected by FMC with a ZedBoard. By using these instructions:

  1. https://wiki.analog.com/resources/fpga/docs/build#folded_1
  2. https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms1-ebz/software/linux/zynq
  3. https://wiki.analog.com/resources/tools-software/linux-drivers/iio-dds/axi-dac-dds-hdl

I try to launch LINUX – DAC working system without any success. First of all I modify HDL reference design by deleting the ADC IP blocks from block design and change pinout on FMC Connector. Then I have modified and generated the device tree file but unfortunately no communication has been established between the ARM and DAC (but the HDMI working perfectly). So I made some mistake, but I have no idea where. The differences between both evaluation boards (AD9121 and FMCOMMS1) are mainly in connection number in FMC connector. I only want to send data samples from Linux to 9121.

My board don’t have IIC connection whatsoever with AD9121. I also don’t see the my device on the list in /sys/bus/iio/devices .

After launching the Linux there are two alarming messages:

  1. UART:

spi_master spi32765: failed to transfer one message from queue

iio iio:device1: write failed (-5)

 mmcblk0: p1 p2

ad9523: probe of spi32765.3 failed with error -5

spi_master spi32765: failed to transfer one message from queue

ad9548: probe of spi32765.2 failed with error -5

spi_master spi32765: failed to transfer one message from queue

ad9122: probe of spi32765.0 failed with error -5

  1. HDMI Monitor:

Modprobe: FATAL: Could not load /lib/modules/4.6.0-ga8f23b8/modules.dep: No such file or directory

I have been researching and working on it from a long time, and I’ve exhausted all my ideas how to make this connection working.  Can anyone help me? Is someone working on this “changes” in reference design with a success?

 

Thank you in advance.

  • Your clock tree doesn't show the fixed-clock.

    That's why you get -2 (ENOENT)

    Please check your compatible string:

    It should be:

    compatible = "fixed-clock";

    -Michael

  • First of all, my main dts file:

    /dts-v1/;

    /include/ "zynq-zed.dtsi"
    /include/ "zynq-zed-adv7511.dtsi"

    &fpga_axi {
        fmc_i2c: i2c@41620000 {
            compatible = "xlnx,axi-iic-1.01.b", "xlnx,xps-iic-2.00.a";
            reg = <0x41620000 0x10000>;
            interrupt-parent = <&intc>;
            interrupts = <0 55 0x4>;
            clocks = <&clkc 15>;
            clock-names = "pclk";

            #size-cells = <0>;
            #address-cells = <1>;
        };

        tx_dma: dma@7c420000 {
            compatible = "adi,axi-dmac-1.00.a";
            reg = <0x7c420000 0x10000>;
            #dma-cells = <1>;
            interrupts = <0 56 0>;
            clocks = <&clkc 16>;

            dma-channel {
                adi,buswidth = <64>;
                adi,type = <1>;
                adi,cyclic;
            };
        };

        cf_ad9122_core_0: cf-ad9122-core-lpc@74204000 {
            compatible = "adi,axi-ad9121";
            reg = <0x74204000 0x10000>;
            clocks = <&ad9121_sampl_clk>;
            dmas = <&tx_dma 0>;
            dma-names = "tx";
        };
    };

    /include/ "adi-9121-ebz.dtsi"

    And adi-9121-ebz.dtsi:

    /{
        clocks{
            ad9121_sampl_clk: clock@0 {
            #clock-cells = <0>;
            compatible = "fixed_clock";
            clock-frequency = <500000000>;
            clock-output-names = "sampl_clk";
            };
        };
    };

    The log from clk_summary don't contain the sampl_clk:

       clock                         enable_cnt  prepare_cnt        rate   accuracy   phase
    ----------------------------------------------------------------------------------------
     audio_clock                              1            1    12288000          0 0
     ps_clk                                   3            3    33333333          0 0
        iopll_int                             1            1   999999990          0 0
           iopll                             10           10   999999990          0 0
              dbg_mux                         1            1   999999990          0 0
                 dbg_div                      1            1    66666666          0 0
                    dbg_emio_mux              1            1    66666666          0 0
                       dbg_trc                1            1    66666666          0 0
              can_mux                         0            0   999999990          0 0
                 can_div0                     0            0    40000000          0 0
                    can_div1                  0            0     8000000          0 0
                       can1_gate              0            0     8000000          0 0
                          can1                0            0     8000000          0 0
                       can0_gate              0            0     8000000          0 0
                          can0                0            0     8000000          0 0
              gem1_mux                        0            0   999999990          0 0
                 gem1_div0                    0            0    16666667          0 0
                    gem1_div1                 0            0    16666667          0 0
                       gem1_emio_mux           0            0    16666667          0 0
                          gem1                0            0    16666667          0 0
              gem0_mux                        1            1   999999990          0 0
                 gem0_div0                    1            1   124999999          0 0
                    gem0_div1                 1            1   124999999          0 0
                       gem0_emio_mux           1            1   124999999          0 0
                          gem0                1            1   124999999          0 0
              spi0_mux                        0            0   999999990          0 0
                 spi0_div                     0            0   166666665          0 0
                    spi1                      0            0   166666665          0 0
                    spi0                      0            0   166666665          0 0
              uart0_mux                       1            1   999999990          0 0
                 uart0_div                    1            1    50000000          0 0
                    uart1                     1            1    50000000          0 0
                    uart0                     0            0    50000000          0 0
              sdio0_mux                       1            1   999999990          0 0
                 sdio0_div                    1            1    50000000          0 0
                    sdio1                     0            0    50000000          0 0
                    sdio0                     1            1    50000000          0 0
              pcap_mux                        1            1   999999990          0 0
                 pcap_div                     1            1   199999998          0 0
                    pcap                      1            2   199999998          0 0
              lqspi_mux                       1            1   999999990          0 0
                 lqspi_div                    1            1   199999998          0 0
                    lqspi                     1            1   199999998          0 0
              fclk3_mux                       1            1   999999990          0 0
                 fclk3_div0                   1            1    50000000          0 0
                    fclk3_div1                1            1    50000000          0 0
                       fclk3                  1            1    50000000          0 0
              fclk2_mux                       1            1   999999990          0 0
                 fclk2_div0                   1            1    50000000          0 0
                    fclk2_div1                1            1    50000000          0 0
                       fclk2                  1            1    50000000          0 0
              fclk1_mux                       1            1   999999990          0 0
                 fclk1_div0                   1            1   199999998          0 0
                    fclk1_div1                1            1   199999998          0 0
                       fclk1                  3            3   199999998          0 0
                          axi-clkgen           1            1   148500880          0 0
              fclk0_mux                       1            1   999999990          0 0
                 fclk0_div0                   1            1    99999999          0 0
                    fclk0_div1                1            1    99999999          0 0
                       fclk0                  5            5    99999999          0 0
        ddrpll_int                            1            1  1066666656          0 0
           ddrpll                             3            3  1066666656          0 0
              dci_div0                        1            1    30476191          0 0
                 dci_div1                     1            1    10158731          0 0
                    dci                       1            1    10158731          0 0
              ddr3x_div                       1            1   533333328          0 0
                 ddr3x                        1            1   533333328          0 0
              ddr2x_div                       1            1   355555552          0 0
                 ddr2x                        1            1   355555552          0 0
        armpll_int                            1            1  1333333320          0 0
           armpll                             1            1  1333333320          0 0
              smc_mux                         0            0  1333333320          0 0
                 smc_div                      0            0    22222222          0 0
                    smc                       0            0    22222222          0 0
              cpu_mux                         1            1  1333333320          0 0
                 cpu_div                      3            3   666666660          0 0
                    cpu_1x_div                1            1   111111110          0 0
                       cpu_1x                10           10   111111110          0 0
                          smc_aper            0            0   111111110          0 0
                          lqspi_aper           1            1   111111110          0 0
                          gpio_aper           1            1   111111110          0 0
                          uart1_aper           1            1   111111110          0 0
                          uart0_aper           0            0   111111110          0 0
                          i2c1_aper           0            0   111111110          0 0
                          i2c0_aper           0            0   111111110          0 0
                          can1_aper           0            0   111111110          0 0
                          can0_aper           0            0   111111110          0 0
                          spi1_aper           0            0   111111110          0 0
                          spi0_aper           0            0   111111110          0 0
                          sdio1_aper           0            0   111111110          0 0
                          sdio0_aper           1            1   111111110          0 0
                          gem1_aper           0            0   111111110          0 0
                          gem0_aper           2            2   111111110          0 0
                          usb1_aper           0            0   111111110          0 0
                          usb0_aper           1            1   111111110          0 0
                          dbg_apb             1            1   111111110          0 0
                          swdt                1            1   111111110          0 0
                    cpu_2x_div                1            1   222222220          0 0
                       cpu_2x                 2            2   222222220          0 0
                          dma                 1            1   222222220          0 0
                    cpu_3or2x_div             1            1   333333330          0 0
                       cpu_3or2x              2            2   333333330          0 0
                    cpu_6or4x                 0            0   666666660          0 0
     can1_mio_mux                             0            0           0          0 0
     can0_mio_mux                             0            0           0          0 0

  • Thank You for Your help so far Michael.

    Ok, I checked everything and now I can see he sampl_clk that I initialize:

    clock                         enable_cnt  prepare_cnt        rate          accuracy   phase
    ----------------------------------------------------------------------------------------
    sampl_clk                              0            0            500000000          0             0

    However, the error -2 still is appearing, and in IIO devices I cant see the AD9121. I can only see some "xadc" named device on the device0, which is strange.

    Do You have any other ideas whats going on? And what could be the next step?

  • Can you add some printk debug into the drivers probe function - to see what is returning -2?

    -Michael

  • I will send them tommorow.

    Am I thinking correctly that You want to have a debug from "cf_axi_dds_probe" function?

  • Sorry - I totally overseen that the clock-name property is missing.

        cf_ad9122_core_0: cf-ad9122-core-lpc@74204000 {
            compatible = "adi,axi-ad9121";
            reg = <0x74204000 0x10000>;
            clocks = <&ad9121_sampl_clk>;

            clock-names = "sampl_clk";
            dmas = <&tx_dma 0>;
            dma-names = "tx";
        };

    -Michael

  • After some debug analysis, the problem is here:

    st->clk = devm_clk_get(&pdev->dev, "sampl_clk");
    if (IS_ERR(st->clk)) {
    ret = PTR_ERR(st->clk);
    goto err_iio_device_free;

    }

    Then it goes to err_iio_device_free section. It seems that for some reason the clock is not detected despite the fact that he is in the clk_summary list.

  • Thank You Michael. Now this condition is working, unfortunately there is some critical error. Here is the error that comes from Linux:

    Unable to handle kernel NULL pointer dereference at virtual address 00000004
    pgd = c0004000
    [00000004] *pgd=00000000
    Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    Modules linked in:
    CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.6.0-ga8f23b8-dirty #11
    Hardware name: Xilinx Zynq Platform
    task: d744b600 ti: d744c000 task.ti: d744c000
    PC is at cf_axi_dds_probe+0x260/0x7cc
    LR is at clk_notifier_register+0xc4/0xd8
    pc : [<c03b8db4>]    lr : [<c037f708>]    psr: 60000013
    sp : d744de20  ip : 00000008  fp : d75b26d0
    r10: d7533400  r9 : d74ca0c0  r8 : d7533410
    r7 : d7bb4a94  r6 : c0508eec  r5 : 00000000  r4 : d75b2400
    r3 : 00000000  r2 : 00000044  r1 : 00000000  r0 : d75b26d0
    Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
    Control: 18c5387d  Table: 0000404a  DAC: 00000051
    Process swapper/0 (pid: 1, stack limit = 0xd744c210)
    Stack: (0xd744de20 to 0xd744e000)
    de20: 00000004 d7534af0 d7534af0 d7534af0 d7592aa0 d7592a00 00000000 d7592aa0
    de40: c060fc68 d7534af0 00000001 d7592a00 c06a5578 c03b8b54 d7533410 c07159c4
    de60: 00000000 c06e6b88 c06a5578 00000000 c06dc250 c02514d8 d7533410 00000000
    de80: c07159c4 c024fee0 00000000 d7533410 d7533444 c07159c4 00000000 c02500dc
    dea0: c07159c4 d744deb0 c025005c c024e820 d740f75c d7531bb4 c07159c4 c07159c4
    dec0: d7591b00 c06f69a0 00000000 c024f5bc c062d469 c062d46a 00000000 c07159c4
    dee0: d6c84b80 00000000 c06e6b88 c02508cc c025114c c06c36ec d6c84b80 c00097a0
    df00: c049475c d7436000 c072be48 c071f340 c0674100 c011e540 c05e3485 d7436280
    df20: 00000000 d7fffe49 00000000 c003a750 d7fffe51 00000000 c067341c 000000ab
    df40: 00000006 00000006 c06ea684 00000006 c06d084c 00000006 c06d0850 c06d0830
    df60: c071f340 000000ab c06a5578 c06a5d20 00000006 00000006 00000000 c06a5578
    df80: c0489f54 00000000 c0489f54 00000000 00000000 00000000 00000000 00000000
    dfa0: 00000000 c0489f5c 00000000 c000ef18 00000000 00000000 00000000 00000000
    dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 8032e721 1106b1a2
    [<c03b8db4>] (cf_axi_dds_probe) from [<c02514d8>] (platform_drv_probe+0x50/0x98)
    [<c02514d8>] (platform_drv_probe) from [<c024fee0>] (driver_probe_device+0x12c/0x2a8)
    [<c024fee0>] (driver_probe_device) from [<c02500dc>] (__driver_attach+0x80/0xa4)
    usb 1-1: new high-speed USB device number 2 using ci_hdrc
    [<c02500dc>] (__driver_attach) from [<c024e820>] (bus_for_each_dev+0x50/0x84)
    [<c024e820>] (bus_for_each_dev) from [<c024f5bc>] (bus_add_driver+0xc8/0x1e0)
    [<c024f5bc>] (bus_add_driver) from [<c02508cc>] (driver_register+0x9c/0xe0)
    [<c02508cc>] (driver_register) from [<c00097a0>] (do_one_initcall+0x100/0x1b4)
    [<c00097a0>] (do_one_initcall) from [<c06a5d20>] (kernel_init_freeable+0x114/0x1e4)
    [<c06a5d20>] (kernel_init_freeable) from [<c0489f5c>] (kernel_init+0x8/0xf4)
    [<c0489f5c>] (kernel_init) from [<c000ef18>] (ret_from_fork+0x14/0x3c)
    Code: e3a02001 e5842004 1593300c e3a02044 (05933004)
    ---[ end trace 018da82fce3b4062 ]---
    Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

    CPU1: stopping
    CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.6.0-ga8f23b8-dirty #11
    Hardware name: Xilinx Zynq Platform
    [<c0015020>] (unwind_backtrace) from [<c0011ce8>] (show_stack+0x10/0x14)
    [<c0011ce8>] (show_stack) from [<c01b27fc>] (dump_stack+0x7c/0x9c)
    [<c01b27fc>] (dump_stack) from [<c00138a0>] (ipi_cpu_stop+0x3c/0x70)
    [<c00138a0>] (ipi_cpu_stop) from [<c0013f9c>] (handle_IPI+0x5c/0x7c)
    [<c0013f9c>] (handle_IPI) from [<c00093e8>] (gic_handle_irq+0x80/0x8c)
    [<c00093e8>] (gic_handle_irq) from [<c0012754>] (__irq_svc+0x54/0x90)
    Exception stack(0xd746ff60 to 0xd746ffa8)
    ff60: 00000000 00000000 174c0000 d7ba1100 00000000 00000001 d7ba0490 00000050
    ff80: 3e27039a 00000000 c070bdec 00000000 00000008 d746ffb0 c03328a8 c03328f0
    ffa0: 60000113 ffffffff
    [<c0012754>] (__irq_svc) from [<c03328f0>] (cpuidle_enter_state+0x104/0x224)
    [<c03328f0>] (cpuidle_enter_state) from [<c0051f18>] (cpu_startup_entry+0x1c8/0x254)
    [<c0051f18>] (cpu_startup_entry) from [<0000948c>] (0x948c)

    I will try to debug the driver once again tommorow, but maybe You got some idea about this.

  • The chip_info member is missing in your struct axidds_core_info ad9121_info.

    It's mandatory for standalone implementation.

    -Michael