All of lore.kernel.org
 help / color / mirror / Atom feed
* [QUESTION] Device tree for gmii-to-rgmii phy driver
@ 2023-03-16 16:52 Stefan Herbrechtsmeier
  2023-03-17  7:58 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Herbrechtsmeier @ 2023-03-16 16:52 UTC (permalink / raw)
  To: Siva Durga Prasad Paladugu; +Cc: U-Boot Mailing List, Michal Simek

Hi Siva Durga Prasad Paladugu,

we want to add rgmii-id support to the gmiitorgmii phy driver. How does 
the correct device tree for the gmiitorgmii looks like? The converter 
sits between the MAC and the external PHY (MAC <==> GMII2RGMII <==> 
RGMII_PHY) which would mean that the phy-handle of the MAC should point 
to the GMII2RGMII and the GMII2RGMII to RGMII_PHY:

&gem0 {
     phy-handle = <&gmiitorgmii0>;
     phy-mode = "gmii";

     mdio {
         ethphy0: ethernet-phy@1 {
         };

         gmiitorgmii0: gmiitorgmii@8 {
             compatible = "xlnx,gmii-to-rgmii-1.0";
             phy-handle = <&ethphy0>;
             phy-mode = "rgmii-id";
         };
     };
};

This device tree snippet does not work in the kernel. The kernel 
gmii2rgmii driver does not use a phy driver as base and manipulates the 
functions of the external phy object instead. It requires the following 
device tree snippet:

&gem0 {
     phy-handle = <&ethphy0>;
     phy-mode = "rgmii-id";

     mdio {
         ethphy0: ethernet-phy@1 {
         };

         gmiitorgmii0: gmiitorgmii@8 {
             compatible = "xlnx,gmii-to-rgmii-1.0";
             phy-handle = <&ethphy0>;
             phy-mode = "rgmii-id";
         };
     };
};

This does not work in u-boot because the phy framework ignores the 
phy-handle of the MAC for the gmii2rgmii but the gmii2rgmii driver 
itself checks the phy-mode of the MAC.

What is the correct device tree and thereby proper implementation?

Regards
   Stefan


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [QUESTION] Device tree for gmii-to-rgmii phy driver
  2023-03-16 16:52 [QUESTION] Device tree for gmii-to-rgmii phy driver Stefan Herbrechtsmeier
@ 2023-03-17  7:58 ` Michal Simek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2023-03-17  7:58 UTC (permalink / raw)
  To: Stefan Herbrechtsmeier, Siva Durga Prasad Paladugu, Katakam, Harini
  Cc: U-Boot Mailing List

Hi,

On 3/16/23 17:52, Stefan Herbrechtsmeier wrote:
> Hi Siva Durga Prasad Paladugu,
> 
> we want to add rgmii-id support to the gmiitorgmii phy driver. How does the 
> correct device tree for the gmiitorgmii looks like? The converter sits between 
> the MAC and the external PHY (MAC <==> GMII2RGMII <==> RGMII_PHY) which would 
> mean that the phy-handle of the MAC should point to the GMII2RGMII and the 
> GMII2RGMII to RGMII_PHY:
> 
> &gem0 {
>      phy-handle = <&gmiitorgmii0>;
>      phy-mode = "gmii";
> 
>      mdio {
>          ethphy0: ethernet-phy@1 {
>          };
> 
>          gmiitorgmii0: gmiitorgmii@8 {
>              compatible = "xlnx,gmii-to-rgmii-1.0";
>              phy-handle = <&ethphy0>;
>              phy-mode = "rgmii-id";
>          };
>      };
> };
> 
> This device tree snippet does not work in the kernel. The kernel gmii2rgmii 
> driver does not use a phy driver as base and manipulates the functions of the 
> external phy object instead. It requires the following device tree snippet:
> 
> &gem0 {
>      phy-handle = <&ethphy0>;
>      phy-mode = "rgmii-id";
> 
>      mdio {
>          ethphy0: ethernet-phy@1 {
>          };
> 
>          gmiitorgmii0: gmiitorgmii@8 {
>              compatible = "xlnx,gmii-to-rgmii-1.0";
>              phy-handle = <&ethphy0>;
>              phy-mode = "rgmii-id";
>          };
>      };
> };
> 
> This does not work in u-boot because the phy framework ignores the phy-handle of 
> the MAC for the gmii2rgmii but the gmii2rgmii driver itself checks the phy-mode 
> of the MAC.
> 
> What is the correct device tree and thereby proper implementation?

It is known issue for some time and U-Boot description is correct. Linux needs 
to be fixed. I remember there were any issue with framework not supporting it 
that's why unfortunately different description needs to be used.
I am CCing Harini. Here team should work on getting this fixed.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-17  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 16:52 [QUESTION] Device tree for gmii-to-rgmii phy driver Stefan Herbrechtsmeier
2023-03-17  7:58 ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.