Post Go back to editing

How to use multi adau1761 with axi i2s adi ip

Category: Software
Product Number: ADAU1761
Software Version: Petalinux 2019.2

I am using the ADAU1761 audio codec on my system with the Analog Devices AXI I2S ADI IP. I have successfully validated and run the system for one ADAU1761 using the following device tree on PetaLinux 2019.2:

/include/ "system-conf.dtsi"
/ {
    fpga_axi: fpga-axi@0 {
        compatible = "simple-bus";
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        ranges;

        audio_clock: audio_clock {
            compatible = "fixed-clock";
            #clock-cells = <0>;
            clock-frequency = <12288000>;
        };

        zed_sound {
            compatible = "simple-audio-card";
            simple-audio-card,name = "ZED ADAU1761";
            simple-audio-card,widgets =
                "Microphone", "Mic In",
                "Headphone", "Headphone Out",
                "Line", "Line In",
                "Line", "Line Out";
            simple-audio-card,routing =
                "Line Out", "LOUT",
                "Line Out", "ROUT",
                "Headphone Out", "LHP",
                "Headphone Out", "RHP",
                "Mic In", "MICBIAS",
                "LINN", "Mic In",
                "RINN", "Mic In",
                "LAUX", "Line In",
                "RAUX", "Line In";

            simple-audio-card,dai-link@0 {
                format = "i2s";
                cpu {
                    sound-dai = <&axi_i2s_adi_0>;
                };
                codec {
                    sound-dai = <&adau1761>;
                };
            };
        };
    };
};

&i2c0 {
    status = "okay";
    compatible = "xlnx,xps-iic-2.00.a";
    reg = <0x41600000 0x10000>;
    interrupt-parent = <&intc>;
    interrupts = <0 30 4>;
    clocks = <&clkc 15>;
    clock-names = "pclk"; 
    #size-cells = <0>;
    #address-cells = <1>; 
    adau1761: adau1761@3b {
        #sound-dai-cells = <0>;   // only single DAI
        compatible = "adi,adau1761";
        reg = <0x3b>;
        clocks = <&misc_clk_0>;
        clock-names = "mclk";
    };
};

&axi_i2s_adi_0 {
    #sound-dai-cells = <0>;            
    compatible = "adi,axi-i2s-1.00.a";
    dmas = <&dmac_s 1 &dmac_s 2>;
    dma-names = "tx", "rx";
    clocks = <&clkc 15>, <&audio_clock>;
    clock-names = "axi", "ref";
    reg = <0x77600000 0x10000>;
    xlnx,bclk-pol = <0x0>;
    xlnx,dma-type = <0x1>;
    xlnx,has-rx = <0x1>;
    xlnx,has-tx = <0x1>;
    xlnx,lrclk-pol = <0x0>;
    xlnx,num-ch = <0x1>;
    xlnx,slot-width = <0x18>;
};

Also you can see my block design below for two adau1761(i could not run this with proper device tree);

Actually my goal is that i want to use 8 ADAU1761 chips in the system. How should I modify the device tree when I increase the number of channels by updating xlnx,num-ch = <0x1>; for the AXI I2S ADI, to accommodate this configuration?

Could you give me an example?

Thanks ,

Sincerely Emre OGUT

  • Hello Emre,

    This is tough because you are straddling the boundry of the hardware and Linux software. I am not a Linux expert. 

    How are you communicating with the DSPs? I2C or SPI?

    If it is I2C then there are only four address combinations so you would not be able to connect eight chips unless you have some bus isolators/routing parts in the design. 

    But, each part will only cover the amount of channels it can process into and out of the serial port. If each part is doing the same thing then I guess you could load each DSP with the same exact program and they would share data according to the hardware connections. I like your detailed diagram but I do not fully understand what is going on with the data flows and connections. 

    This might end up being a question you ask in the Linux space on the forum. But they will not know the part. So this will be a team effort. 

    Dave T

  • Thanks Dave,

    İs there any documentation for axi_i2s_adi ip other than this link?

  • Hello eogut,

    I am not aware of more info. I think you should ask the Linux driver team for help on this.

    (+) Linux Software Drivers - EngineerZone (analog.com)

    From my viewpoint I think you are trying to increase the channels beyond what the driver was written for. This driver was meant to make this part into an ALSA audio resource. This part only has two ADCs and two DACs so the driver is setup to only do stereo. If the part needs to process more than two channels then it will have to use the serial port in TDM mode and I am not sure the driver will support that and the DSP would need to have a program loaded into it. From my viewpoint this all gets to be more of a custom configuration and coding rather than standard Linux, however, I am not a Linux expert so there may be a standard way to do this. A custom DSP program would still need to be loaded up.

    Dave T

     

  • Thanks for answer Dave, I moved question there.