UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant igal_kroyter
Participant
2,180 Views
Registered: ‎09-13-2016

Supporting SGTL5000 on ZCU102 via I2C

Hi,

 

I am trying to configure the ZCU102 to support the SGTL5000 audio CODEC. Working with 2017.1.

 

I have connected the the SGTL evaluation board I2C pin (data & clock) to connector J160 on the ZCU102 board pins (5 & 7), these pins exposes the I2C0 port.

I understand that somewhere this port is defined (couldn't find where...) so I updated the device tree in system-user.dtsi file with the following lines:

amba: amba {
...
&i2c@ff020000 { status = "okay"; sgtl5000@0a { compatible = "fsl,sgtl5000"; reg = <0x0a>; clocks = <&clks 150>; micbias-resistor-k-ohms = <2>; micbias-voltage-m-volts = <2250>; VDDA-supply = <&reg_3p3v>; VDDIO-supply = <&reg_3p3v>; }; };
...
};

I have also added the SGTL5000 driver via kernel configuration.

but when I tried to compile I got this error: FATAL ERROR: Unable to parse input tree

 

Could someone advice on the matter?

 

thanks,

Igal

0 Kudos
10 Replies
Voyager
Voyager
2,164 Views
Registered: ‎06-24-2013

Re: Supporting SGTL5000 on ZCU102 via I2C

Hey @igal_kroyter,

 

but when I tried to compile I got this error: FATAL ERROR: Unable to parse input tree ...

The problem with your device tree snippet is that for itself it is fine, except that it is very likely on the wrong I2C bus but it refers to two other sections with &clks and &reg_3p3v, which might or might not be there.

 

It would help a lot if you could upload the complete device tree for further analysis.

 

Thanks in advance,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Highlighted
Participant igal_kroyter
Participant
2,158 Views
Registered: ‎09-13-2016

Re: Supporting SGTL5000 on ZCU102 via I2C

 

 

0 Kudos
Voyager
Voyager
2,153 Views
Registered: ‎06-24-2013

Re: Supporting SGTL5000 on ZCU102 via I2C

Hey @igal_kroyter,

 

thanks for the reply the device tree file is attached.

I wasn't referring to the part you modified, I was referring to the entire device tree as it is uploaded to the device.

This one will have a .dts extension.

 

Thanks,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Participant igal_kroyter
Participant
2,146 Views
Registered: ‎09-13-2016

Re: Supporting SGTL5000 on ZCU102 via I2C

 

 

 

 

0 Kudos
Voyager
Voyager
2,137 Views
Registered: ‎06-24-2013

Re: Supporting SGTL5000 on ZCU102 via I2C

Hey @igal_kroyter,

 

If you are aware of any other file then please point me to the correct one.

The problem here is I have no clue about your design and project, so I don't know what files you are using ...

 

xilinx-zcu102-zu9-es2-rev1.0-2017.1/project-spec/meta-user/recipes-bsp/device-tree/files

Assuming this one is the one you are using in your project, then the problem is as expected because none of the labels (clks, reg_3p3v) is present there.

 

Will take a moment for me to adapt the section to your device tree an check which I2C bus is the correct one ...

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Voyager
Voyager
2,129 Views
Registered: ‎06-24-2013

Re: Supporting SGTL5000 on ZCU102 via I2C

Hey @igal_kroyter,

 

So your device tree (if that is the one you are actually using in your project) is missing the declarations for the first I2C bus (i2c0), so the first step is to enable this controller.

Once that is done, add the following section for the SGTL5000 ...

&i2c0 {
sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
micbias-resistor-k-ohms = <2>;
micbias-voltage-m-volts = <2250>;
}
}

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Participant igal_kroyter
Participant
2,113 Views
Registered: ‎09-13-2016

Re: Supporting SGTL5000 on ZCU102 via I2C

 

Device Drivers → I2C support → I2C Hardware Bus support

Moreover,

 

I have copied the I2C1 configuration and reconfigured

i2c0: i2c0@0xFF020000 {
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			clocks = <0x38>;
			compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10";
			interrupts = <0x12>;
			reg = <0x0 0xff020000 0x1000>;

				sgtl5000@0a {
					compatible = "fsl,sgtl5000";
					reg = <0x0a>;

					clocks = <&clks 150>;
					micbias-resistor-k-ohms = <2>;
					micbias-voltage-m-volts = <2250>;
				};
		};

and got the following error: ERROR (duplicate_label): Duplicate label 'i2c0' on /amba/i2c0@0xFF020000 and /amba/i2c@ff020000

 

Which means that the i2c0 is defined somewhere...

 

Please advise.

 

Igal

 

0 Kudos
Voyager
Voyager
2,108 Views
Registered: ‎06-24-2013

Re: Supporting SGTL5000 on ZCU102 via I2C

Hey @igal_kroyter,

 

Which means that the i2c0 is defined somewhere...

Yeah, looks like the device tree you provided is not the one you are actually using.

 

Please advise.

Let's assume, that the i2c0 definition is proper and we just need to enable and augment it.

I.e. let's try the following...

&i2c0 {
    status = "okay";

    sgtl5000@0a {
        compatible = "fsl,sgtl5000";
        reg = <0x0a>;
        micbias-resistor-k-ohms = <2>;
        micbias-voltage-m-volts = <2250>;
    };
};

Let's see how that goes and what the kernel has to say ...

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Participant igal_kroyter
Participant
2,096 Views
Registered: ‎09-13-2016

Re: Supporting SGTL5000 on ZCU102 via I2C

 

		i2c@ff020000 { 
			sgtl5000@0a {
				compatible = "fsl,sgtl5000";
				reg = <0x0a>;

				micbias-resistor-k-ohms = <2>;
				micbias-voltage-m-volts = <2250>;
			};
		};

Though I cannot close yet the post because I need to access the SGTL5000 evaluation board.

Which I said connected it via J160, through the pins and the board stuck upon power on.

if I remove the pins (which are connected on the board to I2C DATA & clock) the board boots up correctly.

 

Any suggestions?

 

Igal

0 Kudos
Voyager
Voyager
729 Views
Registered: ‎06-24-2013

Re: Supporting SGTL5000 on ZCU102 via I2C

Hey @igal_kroyter,

 

This is very likely identical to not adding anything at all because it does not refer to the right section.

 

Which I said connected it via J160, through the pins and the board stuck upon power on.

You are connecting to an I2C bus which is used for many other devices, so if your device happens to pull down the I2C bus, it will prevent other devices on the bus from working.

 

if I remove the pins

What do you mean by 'remove the pins'?

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos