Post Go back to editing

AD9361 (re)-initialization from linux

Hi,

i wanted to know if there is a way to "re-initialize" the AD9361 from linux userspace with the libiio driver? With no-os driver this seems to be possible, but i did not found any solution so far from linux. I can trigger the resetb from gpio drivers but then i need to reconfigure/re-initialize the device, in best case like it is done in the no-os init function.

If there is no solution available so far, is it possible to compile the no-os init programm to a linux executeable? (out of SDK for example)

Thanks and kindly regards

Jan

Parents
  • Please see here: Runtime Device Driver Customization

    There is a file in debugfs (initialize) which allows you to reinitialized the device from reset.

    You can also unbind and rebind the driver from sysfs.

    -Michael

  • Hi Michael,

    Can you please let me know which drivers I need to unbind and re-bind to properly reset the AD9361?

    I saw in a similar post that Lars recommended this:

    echo 7c40000.dma > /sys/bus/platform/drivers/dma-axi-dmac/unbind

    echo 7c42000.dma > /sys/bus/platform/drivers/dma-axi-dmac/unbind

    # reload bitstream

    echo 7c40000.dma > /sys/bus/platform/drivers/dma-axi-dmac/bind

    echo 7c42000.dma > /sys/bus/platform/drivers/dma-axi-dmac/bind


    However I am sure there are more drivers that I need to bind and unbind, I would really appreciate your help in detailing to me the full list of drivers to bind and unbind. I am on the zed fmcomms2-3 platform.

    Thanks!


  • I found a solution that works for me on the zed board using the fmcomms2 project. For other boards it is probably a very similar process. I needed to unbind and then rebind certain drivers to re-initialize the AD9361. Here are the commands I ran:

    echo 79020000.cf-ad9361-lpc > /sys/bus/platform/drivers/cf_axi_adc/unbind
    echo 79024000.cf-ad9361-dds-core-lpc > /sys/bus/platform/drivers/cf_axi_dds/unbind
    echo 7c400000.dma > /sys/bus/platform/drivers/dma-axi-dmac/unbind
    echo 7c420000.dma > /sys/bus/platform/drivers/dma-axi-dmac/unbind
    # PerformFPGA update (fpgautil -b bit.bin)
    echo 7c400000.dma > /sys/bus/platform/drivers/dma-axi-dmac/bind
    echo 7c420000.dma > /sys/bus/platform/drivers/dma-axi-dmac/bind
    echo 79024000.cf-ad9361-dds-core-lpc > /sys/bus/platform/drivers/cf_axi_dds/bind
    echo 79020000.cf-ad9361-lpc > /sys/bus/platform/drivers/cf_axi_adc/bind

    After doing it like this I have a new FPGA image and I can continue to use the AD9361 for transmission ( i am not using for RX and have not tested).

    I needed to do it in this specific order to get it to work properly. I am not sure on other platforms if the exact same commands will work but the idea is similar. There might be more drivers I need to unbind and rebind in case anything else got into a bad state during FPGA update, but I will find those out soon enough.

Reply

  • I found a solution that works for me on the zed board using the fmcomms2 project. For other boards it is probably a very similar process. I needed to unbind and then rebind certain drivers to re-initialize the AD9361. Here are the commands I ran:

    echo 79020000.cf-ad9361-lpc > /sys/bus/platform/drivers/cf_axi_adc/unbind
    echo 79024000.cf-ad9361-dds-core-lpc > /sys/bus/platform/drivers/cf_axi_dds/unbind
    echo 7c400000.dma > /sys/bus/platform/drivers/dma-axi-dmac/unbind
    echo 7c420000.dma > /sys/bus/platform/drivers/dma-axi-dmac/unbind
    # PerformFPGA update (fpgautil -b bit.bin)
    echo 7c400000.dma > /sys/bus/platform/drivers/dma-axi-dmac/bind
    echo 7c420000.dma > /sys/bus/platform/drivers/dma-axi-dmac/bind
    echo 79024000.cf-ad9361-dds-core-lpc > /sys/bus/platform/drivers/cf_axi_dds/bind
    echo 79020000.cf-ad9361-lpc > /sys/bus/platform/drivers/cf_axi_adc/bind

    After doing it like this I have a new FPGA image and I can continue to use the AD9361 for transmission ( i am not using for RX and have not tested).

    I needed to do it in this specific order to get it to work properly. I am not sure on other platforms if the exact same commands will work but the idea is similar. There might be more drivers I need to unbind and rebind in case anything else got into a bad state during FPGA update, but I will find those out soon enough.

Children
No Data