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: 
Highlighted
Participant tkato@poc.com
Participant
114 Views
Registered: ‎09-06-2019

MACB probe of multiple GEMs with shared MDIO

We have a system that implements all 4 GEMs of the Zynq ultrascale with the MDIO on GEM2. We are running into issues where only the GEM2 and GEM3 drivers are properly initialzed.

There are problems upon boot where GEM0 and GEM1 MACB drivers are probed prior to GEM2. This is an issue beause they reference PHY handles that are intantiated later in the probe process in GEM2 adn there for are not initialized correctly are never available one we enter linux.

We currently use the 2019.1 toolset coupled with buildroot for our linux system.

Here is our device tree entry for the GEMs:

/* eth@ff0e0000 */
&gem3 {
	status = "okay";
	phy-handle = <&phy1>;
	phy-mode = "rgmii-id";
	local-mac-address = [00 0a 35 00 00 03];
};
/* eth@ff0d0000 */
&gem2 {
	status = "okay";
	phy-handle = <&phy0>;
	phy-mode = "rgmii-id";
	local-mac-address = [00 0a 35 00 00 02];
	phy0: phy@0 {
		reg = <0x0>;
		ti,rx-internal-delay = <0x8>;
		ti,tx-internal-delay = <0xa>;
		ti,fifo-depth = <0x1>;
		ti,rxctrl-strap-worka;
	};
	phy1: phy@1 {
		reg = <0x1>;
		ti,rx-internal-delay = <0x8>;
		ti,tx-internal-delay = <0xa>;
		ti,fifo-depth = <0x1>;
		ti,rxctrl-strap-worka;
	};
	phy2: phy@2 {
		reg = <0x2>;
	};
	phy8: phy@8 {
		reg = <0x8>;
	};
};

/* eth@ff0c0000 */
&gem1 {
	status = "okay";
	phy-handle = <&phy8>;
	phy-mode = "sgmii";
	pinctrl-names = "default";
	reset-gpios = <&gpio 45 0>;
	local-mac-address = [00 0a 35 00 00 01];
};

/* eth@ff0b0000 */	
&gem0 {
	status = "okay";
	phy-handle = <&phy2>;
	phy-mode = "sgmii";
	pinctrl-names = "default";
	reset-gpios = <&gpio 13 0>;
	local-mac-address = [00 0a 35 00 00 00];
};

As you can see the MDIO is set up in such a way where GEM2 controls the bus for all the other GEMs.

Here is the boot log during the MACB driver probing (with some debug prints added in the driver): 

[    3.203218] macb ff0b0000.ethernet: Not enabling partial store and forward
[    3.210660] libphy: MACB_mii_bus: probed
[    3.214577] mdio_bus ff0b0000.ethernet-ffffffff: Loop over the child nodes and register a phy_device for each phy
[    3.356082] macb ff0c0000.ethernet: Not enabling partial store and forward
[    3.363514] libphy: MACB_mii_bus: probed
[    3.367428] mdio_bus ff0c0000.ethernet-ffffffff: Loop over the child nodes and register a phy_device for each phy
[    3.500009] macb ff0d0000.ethernet: Not enabling partial store and forward
[    3.507411] libphy: MACB_mii_bus: probed
[    3.511332] mdio_bus ff0d0000.ethernet-ffffffff: Loop over the child nodes and register a phy_device for each phy
[    3.521583] mdio_bus ff0d0000.ethernet-ffffffff: address found. scan phy phyat address 0
[    3.529755] mdio_bus ff0d0000.ethernet-ffffffff: This child node is a phy node of mdio
[    3.540927] mdio_bus ff0d0000.ethernet-ffffffff: address found. scan phy phyat address 1
[    3.549113] mdio_bus ff0d0000.ethernet-ffffffff: This child node is a phy node of mdio
[    3.559888] mdio_bus ff0d0000.ethernet-ffffffff: address found. scan phy phyat address 8
[    3.568067] mdio_bus ff0d0000.ethernet-ffffffff: This child node is a phy node of mdio
[    3.576042] mdio_bus ff0d0000.ethernet-ffffffff: MDIO device at address 8 is missing.
[    3.583867] mdio_bus ff0d0000.ethernet-ffffffff: address found. scan phy phyat address 2
[    3.592036] mdio_bus ff0d0000.ethernet-ffffffff: This child node is a phy node of mdio
[    3.603382] TI DP83867 ff0d0000.ethernet-ffffffff:00: attached PHY driver [TIDP83867] (mii_bus:phy_addr=ff0d0000.ethernet-ffffffff:00, irq=POLL)[    3.616418] macb ff0d0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0d0000 irq 32 (00:0a:35:00:00:02)
[    3.626659] macb ff0e0000.ethernet: Not enabling partial store and forward
[    3.634066] libphy: MACB_mii_bus: probed
[    3.637985] mdio_bus ff0e0000.ethernet-ffffffff: Loop over the child nodes and register a phy_device for each phy
[    3.738185] TI DP83867 ff0d0000.ethernet-ffffffff:01: attached PHY driver [TIDP83867] (mii_bus:phy_addr=ff0d0000.ethernet-ffffffff:01, irq=POLL)
[    3.751235] macb ff0e0000.ethernet eth1: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 33 (00:0a:35:00:00:03)

As you can see in red the GEM0 and GEM1, located at the lower addresses, are probed first (0xFF0B0000 and 0xFF0C0000) in which the PHYs are not found and driver does not enable them.

Moving to GEM2, the driver properly identifies the PHY instaniations and finds the PHYs (blue), enables GEM2 and moves on to then enable GEM3 (green). 

Is there a way to prioritize the probe of a driver when multiple probes are required? We would like to prioritize the MACB probe to probe GEM2 (0xFF0D000) prior such that the PHYs intantiated are correctly identified for each GEM. Changing the driver intialization order seems like it should be a standard practice but am unclear how to go about it.

Another approach we may pursue if this is not possible is to enable a device tree overlay to enable GEMs 0 and 1 while keeping them disabled in the main device tree. What is the standard method to adding a .dtbo to the buildroot system?

 

 

 

 

 

 

0 Kudos