cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
469 Views
Registered: ‎11-26-2018

zcu106 petalinux i2c si570 clock configuration error

Hi,

I'm using the zcu106 board and I need to change the si570 user clock (default is 300MHz) from petalinux (I need 156.25MHz for the 10G ethernet subsystem). In my system-user.dts I added this:

&i2c1 {
	status = "okay";
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_i2c1_default>;
	pinctrl-1 = <&pinctrl_i2c1_gpio>;
	scl-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
	sda-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;

	/* PL i2c via PCA9306 - u45 */
	i2c-mux@74 { /* u34 */
		compatible = "nxp,pca9548";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x74>;
		i2c@2 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <2>;
			si570_1: clock-generator@5d { /* USER SI570 - u42 */
				#clock-cells = <0>;
				compatible = "silabs,si570";
				reg = <0x5d>;
				temperature-stability = <50>;
				factory-fout = <156250000>;
				clock-frequency = <156250000>;
				clock-output-names = "si570_user";
			};
		};
		i2c@3 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <3>;
			si570_2: clock-generator@5d { /* USER MGT SI570 - u56 */
				#clock-cells = <0>;
				compatible = "silabs,si570";
				reg = <0x5d>;
				temperature-stability = <50>; /* copy from zc702 */
				factory-fout = <156250000>;
				clock-frequency = <156250000>;
				clock-output-names = "si570_mgt";
			};
		};
		i2c@4 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <4>;
			si5328: clock-generator@69 {/* SI5328 - u20 */
				compatible = "silabs,si5328";
				reg = <0x69>;
			};
		};
	};
};

But the clock does not change and remains at 300MHz.

Tags (3)
0 Kudos
4 Replies
Highlighted
Voyager
Voyager
460 Views
Registered: ‎06-28-2018

Hi andrea@ross 

Why not use User MGT Clock whose frequency is 156.25MHz by default?

Screenshot from 2020-01-31 15-07-01.pngScreenshot from 2020-01-31 15-07-23.png

0 Kudos
Highlighted
Adventurer
Adventurer
373 Views
Registered: ‎11-26-2018

The user MGT clock in the zcu106-reva.dts is set to 148.5MHz, it's used for hdmi.

i2c@3 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <3>;
			si570_2: clock-generator@5d { /* USER MGT SI570 - u56 */
				#clock-cells = <0>;
				compatible = "silabs,si570";
				reg = <0x5d>;
				temperature-stability = <50>; /* copy from zc702 */
				factory-fout = <156250000>;
				clock-frequency = <148500000>;
				clock-output-names = "si570_mgt";
			};
		};
0 Kudos
Highlighted
Observer
Observer
154 Views
Registered: ‎05-07-2018

This may be late for OP but for anyone having similar problems.

For example in order to successfully change the output frequency to 156.25 MHz clock-frequency = <156250000>, default frequency for factory-fout = <100000000>; of 100 MHz has to be set.

Now default frequency may vary between different Si570 versions and factory settings. Easiest way to confirm factory frequency is to disable any device tree settings related to Si570 and measure the output clock with a scope.

Below is an example device tree entry of two Si570 over PCA9306 I2C mux

&i2c0 {
	status = "okay";
	clock-frequency = <400000>;
	scl-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
	sda-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;

	/* PL i2c via PCA9306 - u45 */
	i2c-mux@70 { /* u34 */
		compatible = "nxp,pca9546";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x70>;
		/* factory-fout has to be set to factory default in order to change clock-frequency */
		/* default factory-fout for our si570 is 100 MHz */
		i2c@2 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <2>;
			si570_1: clock-generator@55 { /* USER SI570 - u42 */
				#clock-cells = <0>;
				compatible = "silabs,si570";
				reg = <0x55>;
				temperature-stability = <50>;
				factory-fout = <100000000>;
				clock-frequency = <156250000>;
				clock-output-names = "si570_user";
			};
		};
		i2c@3 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <3>;
			si570_2: clock-generator@55 { /* USER MGT SI570 - u56 */
				#clock-cells = <0>;
				compatible = "silabs,si570";
				reg = <0x55>;
				temperature-stability = <50>; /* copy from zc702 */
				factory-fout = <100000000>;
				clock-frequency = <156250000>;
				clock-output-names = "si570_mgt";
			};
		};
	};
};
0 Kudos
Highlighted
Moderator
Moderator
136 Views
Registered: ‎04-24-2017

Hi @darko31 ,

You don't need to add complete nodes in system-user.dtsi file. Already zcu106 board dtsi has node_label for si570 you can just override with frequency changes.

/include/ "system-conf.dtsi"
/ {
};

&si570_1{ factory-fout = <100000000>; clock-frequency = <156250000>; };

&si570_2{
factory-fout = <100000000>;
clock-frequency = <156250000>;
};
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------