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: 
Visitor karikalan
Visitor
10,707 Views
Registered: ‎11-03-2015

Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

Hello,

 

In petalinux 2015.4, the configuration for ethernet is provided with "cdns,gem" compatible.

In the "cdns,gem" Timestamping Unit cpabability (MACB_CAPS_TSU) is not enabled.

But in "cdns,zynqmp-gem" Timestamping Unit cpabability is enabled (.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_TSU). If i want to change the compatible in device tree to  "cdns,zynqmp-gem" what are the other details i have to change.

 

gem0: ethernet@e000b000 {
                        compatible = "cdns,gem";
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };

 

Thanks,

Karikalan K

0 Kudos
9 Replies
Xilinx Employee
Xilinx Employee
10,682 Views
Registered: ‎09-10-2008

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

Hi Karikalan,

 

That compatible string is for the MAC that is in the Zynq MPSOC, but not in Zynq 7000 if that's what you are thinking.

 

Thanks

John

0 Kudos
Visitor karikalan
Visitor
10,623 Views
Registered: ‎11-03-2015

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

Hello John,

 

Thanks for your response.

I think i am not little bit clear with my query.

 

Let me breif, my agenda is to achecive Hardware Time staming for PTP messages and my processor is Xilinx XC7Z020.

 

When i boot up the board with petalinux, ptp clock is not reflected in "/dev/".

While debugging the source code of ethernet driver (MACB), i found that ptp initialization is happening after checking the capability of the device.

 

if ((gem_readl(bp, DCFG5) & GEM_BIT(TSU)) &&
            (bp->caps & MACB_CAPS_TSU)) {
                macb_ptp_init(bp);
        }

 

In parallel i checked the MAC configuration in device tree of "zynq-7000". It is configured with "cdns,gem".

 

gem0: ethernet@e000b000 {
                        compatible = "cdns,gem";
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };

In ethernet driver (macb.c), the device capability configurtion corresponding to "cdns,gem" is not configured with "MACB_CAPS_TSU", so ptp is not intialised.

 

 

But "MACB_CAPS_TSU" is enabled in "cdns,zynqmp-gem",

 

static const struct of_device_id macb_dt_ids[] = {
        { .compatible = "cdns,at32ap7000-macb" },
        { .compatible = "cdns,at91sam9260-macb" },
        { .compatible = "cdns,macb" },
        { .compatible = "cdns,pc302-gem", .data = &pc302gem_config },
        { .compatible = "cdns,gem", .data = &pc302gem_config },
        { .compatible = "atmel,sama5d3-gem", .data = &sama5d3_config },
        { .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },
        { .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
        { /* sentinel */ }
};

 

 

static const struct macb_config pc302gem_config = {
        .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE,
        .dma_burst_length = 16,
};

 

static const struct macb_config zynqmp_config = {
        .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_TSU,
        .dma_burst_length = 16,
        .jumbo_max_len = 10240,
};

 

Fine.

 

My question is can i directly change the MAC configuration in device tree to "cdns,zynqmp-gem" or correspondingly whether i have to change other details in device tree like interrupt , clocks, clock name etc...

 

Let me know if you need further info.

 

Thanks,

Karikalan K

0 Kudos
Scholar trenz-al
Scholar
10,606 Views
Registered: ‎11-09-2013

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

????

 

zynqMP is ultrascale + Zynq and the hardware is TOTALLY different.

 

you can not of course use ZU+ driver on ZYNQ 7 !!

0 Kudos
Visitor karikalan
Visitor
10,597 Views
Registered: ‎11-03-2015

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

Hello,

 

Then how to enable ptp configuration for Zynq?

 

Regards,

Karikalan K

 

0 Kudos
Scholar trenz-al
Scholar
10,589 Views
Registered: ‎11-09-2013

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

let say so:

 

I would be VERY surprised if there is a configuration trick that works with current mainstream - xilinx kernel and drivers and fully supports PTP...

 

more likely deep PATCHING is required, and some 3-6 week work in testing and debugging.. have fun!

 

and lets hope a +surprise that it works and no patching is required.. we can always hope :)

0 Kudos
Xilinx Employee
Xilinx Employee
10,569 Views
Registered: ‎09-10-2008

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

It might be worth reviewing the hardware and it's capabilities on this page.  The Xilinx (not Cadence) driver was being used for this test and the newer cadence driver does not support it from what I've heard (not facts :)).

 

http://www.wiki.xilinx.com/Zynq-7000+AP+SoC+-+Precision+Timing+with+IEEE1588+v2+Protocol+Tech+Tip

 

Thanks

John

0 Kudos
Scholar trenz-al
Scholar
10,563 Views
Registered: ‎11-09-2013

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

nanu super eh!

 

there is some TIP, and some comments that it aint working, and then some more rumor that that there are unknown diffferencies that may case unknown..

 

==> 2+ weeks of hard work (to get it working)

0 Kudos
Visitor karikalan
Visitor
10,510 Views
Registered: ‎11-03-2015

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

Hello John,

 

In the link provided they are using "emacps" driver.

If new cadence driver is not supporting the PTP (Harware timestamping) means,  is it possible to use the emacps driver by changing the device tree compatible details directly as below or is there any addition changes has to be done in interrupts and clocks.

 

gem0: ethernet@e000b000 {
                        compatible = "cdns,gem";

                        compatible = "xlnx,ps7-ethernet-1.00.a"
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };

 

 

By the way, is there any patch available for cadence driver to support PTP (Hardware Timestamping) .

 

Regards,

Karikalan K

0 Kudos
Highlighted
Contributor
Contributor
8,773 Views
Registered: ‎01-09-2014

Re: Zynq Device tree configuration for ethernet with "cdns,zynqmp-gem" in petalinux 2015.4

In regards to prevoius comment - It is better just to cahnge system-top.dts

 

xemacps ethernet driver (and its timestamping) needs also be enabled in the kernel of course

 

In my example (PicoZed & Petalinux 2015.4) system-top.dts (etherent stuff only)

 

	&gem0 {
		compatible = "xlnx,ps7-ethernet-1.00.a";
			/* reg = <0xe000b000 0x1000>;			--- already in zynq-7000.dtsi in 2015.4		*/
			/* status = "okay"; 				--- already in pcw.dtsi in 2015.4		*/
			/* interrupts = <0 22 4>;			--- already in zynq-7000.dtsi in 2015.4		*/
			
		clocks = <&clkc 13>, <&clkc 30>;	
		clock-names = "ref_clk", "aper_clk";	
			
			/* local-mac-address = [aa bb cc dd 19 86];	--- already in system-conf.dtsi in 2015.4	*/
		xlnx,has-mdio = <0x1>;  				/* is present in 2014.4 thus I added it here	*/
			
			/* #address-cells = <1>;								        */
			/* #size-cells = <0>;										*/
	};


	&gem0 {
		phy-handle = <&phy0>; 
			/* phy-mode = "rgmii-id";			--- already in pcw.dtsi in 2015.4		*/
		
		mdio {
			#address-cells = <1>;
			#size-cells = <0>;
			
			phy0: phy@0 {
				compatible = "marvell,88e1510";
				device_type = "ethernet-phy";
				reg = <0x0>;
				marvell,reg-init = <3 16 0xff00 0x1e 3 17 0xfff0 0x00>;
			};
		};
	}; 

 

If you run into somthing like

ifconfig: SIOCSIFFLAGS: No such device or address

 

then probably the PHY part in your system-top.dts is incorrect - browse the forum there is a lot about it

 

With Regards

T

Tags (5)
0 Kudos