Post Go back to editing

iio attribute channel not present in device when building with Petalinux -- AD9081 + ZCU102

Category: Software
Product Number: AD9081
Software Version: petalinux 2022.2

Dear all,

We are building the linux image using Petalinux (version 2022.2) for a ZCU-102 and an AD9081-FMCA-EBZ connected to it. We have included both adi-layers of analogdevicesinc/meta-adi 2022_R2 and so far everything works fine. We have a custom hdl project in which we are using only DAC0.

We are encountering an issue where the out_voltage0_i_main_nco_frequency attribute is not available in the /sys/bus/iio/devices/iio:deviceX directory when using the AD9081 MxFE Linux driver.

Unlikely linux-drivers/iio-mxfe_ad9081 most of the attributes channels are not available in the AD9081 MxFE Linux Driver.

If we do as suggested in the the link, we obtain:

dummy_usr:~# cd /sys/bus/iio/devices/
dummy_usr:/sys/bus/iio/devices# ls
iio:device0 iio:device1 iio:device2 iio_sysfs_trigger
dummy_usr:/sys/bus/iio/devices# cd iio:device2
dummy_usr:/sys/bus/iio/devices/iio:device2# ls -al
total 0
drwxr-xr-x 3 root root 0 Nov 25 10:07 .
drwxr-xr-x 5 root root 0 Nov 25 10:07 ..
-r--r--r-- 1 root root 4096 Nov 25 10:07 name
lrwxrwxrwx 1 root root 0 Nov 25 10:07 of_node -> ../../../../../firmware/devicetree/base/fpga-axi@0/axi-ad9081-tx-hpc@84b10000
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage0_TX1_I_F1_frequency
-r--r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage0_TX1_I_F1_label
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage0_TX1_I_F1_phase
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage0_TX1_I_F1_raw
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage0_TX1_I_F1_scale
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage1_TX1_I_F2_frequency
-r--r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage1_TX1_I_F2_label
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage1_TX1_I_F2_phase
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage1_TX1_I_F2_raw
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage1_TX1_I_F2_scale
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage2_TX1_Q_F1_frequency
-r--r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage2_TX1_Q_F1_label
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage2_TX1_Q_F1_phase
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage2_TX1_Q_F1_raw
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage2_TX1_Q_F1_scale
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage3_TX1_Q_F2_frequency
-r--r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage3_TX1_Q_F2_label
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage3_TX1_Q_F2_phase
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage3_TX1_Q_F2_raw
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage3_TX1_Q_F2_scale
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_altvoltage_sampling_frequency
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_voltage0_i_calibphase
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_voltage0_i_calibscale
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_voltage0_q_calibphase
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_voltage0_q_calibscale
-rw-r--r-- 1 root root 4096 Nov 25 10:07 out_voltage_sampling_frequency
drwxr-xr-x 2 root root 0 Nov 25 10:07 power
lrwxrwxrwx 1 root root 0 Nov 25 10:07 subsystem -> ../../../../../bus/iio
-rw-r--r-- 1 root root 4096 Nov 25 10:07 sync_start_enable
-r--r--r-- 1 root root 4096 Nov 25 10:07 sync_start_enable_available
-rw-r--r-- 1 root root 4096 Nov 25 10:07 uevent
dummy_usr:/sys/bus/iio/devices/iio:device2#

While some of the attributes are available in the petalinux building, some of them, for example the out_voltage0_i_main_nco_frequency are not present in the building. 

What could be the reason for the missing attributes, and how can we modify our setup to make them available? Is there a specific device tree or driver configuration required to expose these attributes?

Thank you in advance for your assistance!

Bruno. 

Thread Notes

  • Hi, we'll look into this and get back to you shortly.

  • Thanks yhkim! We haven't solved this problem yet..

  • Hi yhkim, any news on this? We have seen that in other Linux implementations, for example in linux kuiper, the parameter in question is present:

    analog@analog:~$ ls /sys/bus/iio/devices/iio:device2
    adc_clk_powerdown
    buffer
    dev
    filter_fir_config
    in_temp0_input
    in_temp0_label
    in_voltage0_i_channel_6db_digital_gain_en
    in_voltage0_i_channel_nco_frequency
    in_voltage0_i_channel_nco_frequency_available
    in_voltage0_i_channel_nco_phase
    in_voltage0_i_label
    in_voltage0_i_main_6db_digital_gain_en

    ...

    analog@analog:~$

    Thank you!

    B.

  • Sorry for the delay. I've had some difficulties with 2022.2 in my enviornment, but I'm having a good progress with 2023.2. I'll let you know if I find anything. As I checked with the team, you should have same number of attribues with petalinux as with the Kuiper linux. If anything is missing, probably there might be some error. Could you check the log whether there is any error associated with it? In the meantime, I believe we can confirm this behaviour in a day or two.

  • I overlooked one thing in your original post. If you use stock HDL instead of customer HDL, do you still see the same behaviour?

  • No problem, and thank you for the answers and suggestions.

    I didn't find any error in the logs concerning the issue.


    I did a couple of implementation buildings with PetaLinux for the Vivado designs generated by your scripts for the AD9081_FMCA_EBZ on the ZCU-102, as in https://analogdevicesinc.github.io/hdl/projects/ad9081_fmca_ebz/index.html and indeed, the attributes are now present.

    Could you please tell me how these attributes are included in Linux? Do they depend only on the hardware instantiated in the Vivado design, or are they part of the device tree? In that case wich are the nodes correspondece with the attributes?

    In our FPGA design, we removed the RX part of the original design (the one generated with your scripts) leaving the Tx part as so far we don't need the Rx. We need to modify the NCO values for the Tx. Are these two parts of the designs (Tx-Rx) somehow related in terms of how are the attributes presented inside /sys/bus/iio/devices/iio:device2? In addition, I would like to know where I can find more information about this. Do you have any documentation on these topics apart from the Wiki?

    Thanks!

    B.

  • Hi, thank you for the update. What you asked is done through meta-adi layer, which enables you to integrate ADI Linux kernel, libiio utilities, and device tree. You specify the device tree when you build the petalinux, and you shoudl have HDL that corresponds to the device tree that you specified. If the device tree and HDL don't match, I believe the device driver will produce some errors. I suggest you start with standard HDL you get from adi HDL github, remove RX in HDL, and make corresponding changes in the device tree. I'll see whether there are some instructions that explains this procedure more easily, and will let you know if I find anything.

  • Hello yhkim, thank you.

    So far we are working with the meta-adi layer and using some of the utilities offered by you. In the specific I was asking how are related and how to proceede to include or remove the different attributes of the device/IP (in this case the axi-ad9081-tx-hpc), sorry if I was not clear. Which is the IP in charge of expose the NCO (as an example) and how is recognized by the device drivers? Should we be attached to some type of name/AXI-address to make it work? 

    For example, if we run the iio_info tool, we see the following:

    iio:device2: axi-ad9081-tx-hpc
    6 channels found:
    altvoltage3: TX1_Q_F2 (output)
    6 channel-specific attributes found:
    attr 0: frequency value: 39990844
    attr 1: label value: TX1_Q_F2
    attr 2: phase value: 0
    attr 3: raw value: 1
    attr 4: sampling_frequency value: 3200000000
    attr 5: scale value: 0.250000
    altvoltage2: TX1_Q_F1 (output)
    6 channel-specific attributes found:
    attr 0: frequency value: 39990844
    attr 1: label value: TX1_Q_F1
    attr 2: phase value: 0
    attr 3: raw value: 1
    attr 4: sampling_frequency value: 3200000000
    attr 5: scale value: 0.250000
    voltage0_q: (output)
    3 channel-specific attributes found:
    attr 0: calibphase value: 0.000000
    attr 1: calibscale value: 1.000000
    attr 2: sampling_frequency value: 3200000000
    altvoltage1: TX1_I_F2 (output)
    6 channel-specific attributes found:
    attr 0: frequency value: 39990844
    attr 1: label value: TX1_I_F2
    attr 2: phase value: 90000
    attr 3: raw value: 1
    attr 4: sampling_frequency value: 3200000000
    attr 5: scale value: 0.250000
    altvoltage0: TX1_I_F1 (output)
    6 channel-specific attributes found:
    attr 0: frequency value: 39990844
    attr 1: label value: TX1_I_F1
    attr 2: phase value: 90000
    attr 3: raw value: 1
    attr 4: sampling_frequency value: 3200000000
    attr 5: scale value: 0.250000
    voltage0_i: (output)
    3 channel-specific attributes found:
    attr 0: calibphase value: 0.000000
    attr 1: calibscale value: 1.000000
    attr 2: sampling_frequency value: 3200000000
    2 device-specific attributes found:
    attr 0: sync_start_enable value: disarm
    attr 1: sync_start_enable_available value: arm disarm trigger_manual
    No trigger on this device

    Those corresponds to the same attributes I posted before.

    I understand that I don't see the axi-ad9081-rx-hpc because I did not instantiate the Rx parts for interfacing with the AD9081. 
    What I don't understand is why I can't see the others attributes for the axi-ad9081-tx-hpc, which I do expect to see and use.

    Thanks in advance!

    B.

  • Good morning,

    After conducting some tests, I found that in order to enable all the IIO attributes, it seems that both the RX and TX parts need to be included.

    For example, if I remove the FRAMER_LINK0_RX from the device tree—both from the jesd204-ids and jesd204-inputs—the IIO attributes exposed in /sys/bus/iio/devices/iio:device2 are as I originally posted. However, if I include the FRAMER_LINK0_RX, all the attributes are present, as seen in linux-drivers/iio-mxfe_ad9081.

    Would it be possible to access documentation on these topics? I may be mistaken, but I couldn't find any in the wikis.

    Thank you again!

    Best regards,

    B.

  • Thank you very much for your feedback. I'll confirm/communicate with the team and add this into the document.