Porting ADRV9002 to Cyclone V SoC

Hi 

I am porting the ADRV9002 hdl reference design to the DataStorm DAQ carrier card.

ADI has been working on a port on the design to the Arria 10 SoC development card but it is not complete. ADI gave me a reference to the repository. I took that and ported it to Cyclone V SoC. 

I am now in the process of building the bootable Linux image.

I have been using the 2019_R2 branch of the ADI repo. Is this the one that I should use or is there a better one that you would recommend?

I updated the defconfig and device tree files with references to the ADRV9002. I have attached these files to the request.

The probe for the ADRV9002 driver is successfully executed.

I am currently at a standstill because the system is not seeing any iio devices. I have looked in /sys/bus/iio/devices and no devices are listed.

I have used the internal logic analyzer in the FPGA to look at a few signals.

I do not see any activity on the spi interface or the reset signal. The reset signal is continually in the asserted state.

Any thoughts would be greatly appreciated.

Steven

Parents
  • 0
    •  Analog Employees 
    on Mar 15, 2021 4:33 PM

    Hi Steven,

    The corresponding Linux branch for the Arria 10 project is: https://github.com/analogdevicesinc/linux/tree/dev_adrv9001_a10soc

    Everything is working, we only need to do some cleanup on both HDL and Linux before doing the merge to master.

    Thanks,
    Dragos

  • Hi Dragos

    I have made some progress with your assistance. Now using the branch of Linux listed above. 

    Failing during boot with the following message

    adrv9002 spi0.0: adrv9002_setup, 2512: failed with "Failed to reset the device and set SPI Config"

    I have the SPI controller set up as 8 bits wide and a spi clock rate of 10M. Is this correct? I do see the reset line asserting and deasserting during boot. The spi master does have some activity during boot but it does not look very interesting.

    I get a kernel panic due to a divide by zero in the dds driver. It is dividing a frequency. I think this is because the spi config failed.

    I do now see some of the IIO devices listed under /sys/bus/iio/devices.

    Thanks

    Steven

  • Thanks. 

    Do you have a recommended set of steps for using Iio scope with the a10soc for the adrv9001 in loopback? There are a lot of options.

    Do I need to download a profile and / or a stream file or is this done by The Linux driver when it boots?

    I do not get any data showing in the iio scope time or frequency views. Probably still have to do some debug.

    Regards 

    Steven

  • +1
    •  Analog Employees 
    on Mar 23, 2021 5:20 PM in reply to skravats

    No, you shouldn't do anything special to get data.

    These are some details captured from my setup:

    [   11.586035] adrv9002 spi0.0: adrv9002-phy Rev 12.0, Firmware 0.14.5.6,  Stream 0.5.18.0,  API version: 39.0.7 successfully initialized
    [   11.599273] cf_axi_adc ff220000.axi-adrv9002-rx-lpc: ADI AIM (10.01.b) at 0xFF220000 mapped to 0xc515b125, probed ADC ADRV9002 as MASTER
    [   11.639475] cf_axi_dds ff22a000.axi-adrv9002-tx-lpc: Analog Devices CF_AXI_DDS_DDS MASTER (9.01.b) at 0xFF22A000 mapped to 0x6aef2554, probed DDS ADRV9002

    root@analog:/sys/bus/iio/devices# ls -l
    total 0
    lrwxrwxrwx 1 root root 0 Mar 23 17:05 iio:device0 -> ../../../devices/platform/soc/ff200000.bridge/ff200040.spi/spi_master/spi0/spi0.0/iio:device0
    lrwxrwxrwx 1 root root 0 Mar 23 17:05 iio:device1 -> ../../../devices/platform/soc/ff200000.bridge/ff220000.axi-adrv9002-rx-lpc/iio:device1
    lrwxrwxrwx 1 root root 0 Mar 23 17:05 iio:device2 -> ../../../devices/platform/soc/ff200000.bridge/ff22a000.axi-adrv9002-tx-lpc/iio:device2
    lrwxrwxrwx 1 root root 0 Mar 23 17:05 iio_sysfs_trigger -> ../../../devices/iio_sysfs_trigger
    root@analog:/sys/bus/iio/devices# cat */name
    adrv9002-phy
    axi-adrv9002-rx-lpc
    axi-adrv9002-tx-lpc

    By the way, for capturing this, I've used:
     - ronagyl/hdl at dev_adrv9001_a10soc_zc706 (github.com) - Quartus Pro 20.1 since it was rebased on top of our current master (I've only removed hdl/system_qsys.tcl at dev_adrv9001_a10soc_zc706 · ronagyl/hdl (github.com))
     - analogdevicesinc/linux at dev_adrv9001_a10soc (github.com)

    Thanks,
    Dragos

  • Hi Dragos

    This is what i see. The same except for adrv9002-phy Rev 11.0. Is this because i have rev B silicon?

    root@analog:~# dmesg | grep 'adrv'
    [ 13.027866] adrv9002 spi0.0: adrv9002-phy Rev 11.0, Firmware 0.13.6.7, Stream 0.5.18.0, API version: 39.0.7 successfully initialized
    [ 13.041799] cf_axi_adc ff230000.axi-adrv9002-rx-lpc: ADI AIM (10.01.b) at 0xFF230000 mapped to 0x188716af, probed ADC ADRV9002 as MASTER
    [ 13.076993] cf_axi_dds ff23a000.axi-adrv9002-tx-lpc: Analog Devices CF_AXI_DDS_DDS MASTER (9.01.b) at 0xFF23A000 mapped to 0x1fb61dd6, probed DDS ADRV9002
    root@analog:~# cd /sys/bus/iio/devices
    root@analog:/sys/bus/iio/devices# ls -l
    total 0
    lrwxrwxrwx 1 root root 0 Jan 1 1970 iio:device0 -> ../../../devices/platform/soc/ff200000.bridge/ff220060.spi/spi_master/spi0/spi0.0/iio:device0
    lrwxrwxrwx 1 root root 0 Jan 1 1970 iio:device1 -> ../../../devices/platform/soc/ff200000.bridge/ff230000.axi-adrv9002-rx-lpc/iio:device1
    lrwxrwxrwx 1 root root 0 Jan 1 1970 iio:device2 -> ../../../devices/platform/soc/ff200000.bridge/ff23a000.axi-adrv9002-tx-lpc/iio:device2
    lrwxrwxrwx 1 root root 0 Jan 1 1970 iio_sysfs_trigger -> ../../../devices/iio_sysfs_trigger
    root@analog:/sys/bus/iio/devices# cat */name
    adrv9002-phy
    axi-adrv9002-rx-lpc
    axi-adrv9002-tx-lpc

    I did not include the axi_sys_id & rom in the my Cyclone V version of the design. Could this be an issue?

    Thanks

  • 0
    •  Analog Employees 
    on Mar 23, 2021 7:03 PM in reply to skravats

    Steven,

    No, that shouldn't mater.

    I would generate a .dts from the .sopcinfo using sopc2dts (can be called from Embedded Command Shell) and I would compare all the addresses and the interrupts with the ones specified in the devicetree.

    Dragos

  • Hi Dragos

    I do not see any reference to the following signals in the devicetree.

    gpio_tx2_enable_in
    gpio_tx1_enable_in
    gpio_rx2_enable_in
    gpio_rx1_enable_in

    They are connected from the gpio peripheral (bits [18:15]) to the adrv9001_tdd_if inputs. Should I see these signals assert at any point or are they unused?

    Thanks

Reply Children