[meta-xilinx] Control of two PHYs from a single MAC (Device tree configuration)

Nathan Rossi nathan at nathanrossi.com
Thu May 21 05:40:08 PDT 2015


On Thu, May 21, 2015 at 9:37 PM, Stephen Mossom
<stephen.mossom at calnexsol.com> wrote:
> Hi All
>
>
>
> I made use of a  patch to the dizzy branch to get my Ethernet PHY detected
> but my configuration is slightly different. I have a second PHY which has a
> MDIO connection from the same MAC.
>
>
>
> The patch is discussed here:-
>
>
>
> https://lists.yoctoproject.org/pipermail/meta-xilinx/2015-April/000960.html
>
>
>
> I have 2 MACS (MAC0, MAC1) and 2 PHYS (PHY0, PHY1) but one of the MACs
> controls both PHYs.
>
>
>
> The MDIO for both PHY0 and PHY1 is connected to MAC1.
>
>
>
> The GMII for PHY0 is connected to MAC0 and the GMII for PHY1 is connected to
> MAC1.
>
>
>
> It's a similar setup to that discussed here....
>
>
>
> http://forums.xilinx.com/t5/Embedded-Linux/zynq-linux-dual-emacps-gem-problem/td-p/263964/page/3
>
>
>
> ...except the PHYs are both connected to the second MAC rather than the
> first one.
>
>
>
> With the device tree like this the PHY for MAC1 (ps7_ethernet_1) is detected
> only:-
>
>
>
>        ps7_ethernet_0: ps7-ethernet at e000b000 {
>
>             phy-handle = <&phy0>;
>
>             phy-mode = "rgmii-id";
>
>             phy0: phy at 1 {
>
>                 compatible = "marvell,88e1116r";
>
>                 device_type = "ethernet-phy";
>
>                 reg = <1>;
>
>             } ;
>
>         } ;
>
>         ps7_ethernet_1: ps7-ethernet at e000c000 {
>
>             phy-handle = <&phy1>;
>
>             phy-mode = "rgmii-id";
>
>             phy1: phy at 2 {
>
>                 compatible = "marvell,88e1116r";
>
>                 device_type = "ethernet-phy";
>
>                 reg = <2>;
>
>             } ;
>
>         } ;
>
>
>
>
>
> I also tried this (which is something like the link in the forums) and
> neither PHY is detected:-
>
>
>
>        ps7_ethernet_0: ps7-ethernet at e000b000 {
>
>             phy-handle = <&phy0>;
>
>             phy-mode = "rgmii-id";
>
>         } ;
>
>         ps7_ethernet_1: ps7-ethernet at e000c000 {
>
>             phy-handle = <&phy1>;
>
>             phy-mode = "rgmii-id";
>
>             phy1: phy at 2 {
>
>                 compatible = "marvell,88e1116r";
>
>                 device_type = "ethernet-phy";
>
>                 reg = <2>;
>
>             } ;
>
>             phy0: phy at 1 {
>
>                 compatible = "marvell,88e1116r";
>
>                 device_type = "ethernet-phy";
>
>                 reg = <1>;
>
>             } ;
>
>         } ;

This is the right way to setup the device tree for 2 phys off one
mac's mdio bus.

I assume you have not disabled the macb driver, which is most likely
the reason this doesn't work right. This is because the macb driver
does not follow the "phy-handle" property (and thus ps7_ethernet_0 in
this case doesn't know how to probe its phy). In this specific case
you will need to use the linux-xlnx vendor tree xemacps driver, to do
that you use the kernel feature to disable the macb driver (use the
following in your local.conf or in your <machine>.conf):

KERNEL_FEATURES_append += "bsp/xilinx/disable-macb.scc"

I have been meaning to make a patch for the macb driver so that it can
handle the phy-handle property (which is the standard way to do
ethernet phy's in device-trees), will have to sort that out.

Regards,
Nathan

>
>
>
> How do I configure the device tree to get both PHYs detected through the
> second MAC?
>
>
>
> Thanks
>
>
>
> Stephen
>
>
>
>
>
> Stephen Mossom  |  Calnex Solutions Ltd  |  +44 (0) 1506-671-416
>
>
>
>
> --
> _______________________________________________
> meta-xilinx mailing list
> meta-xilinx at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-xilinx
>



More information about the meta-xilinx mailing list