RE: [PATCH] net: fec: Fix dual ethernet issue in VFxx

From: fugang.duan@xxxxxxxxxxxxx
Date: Wed Jan 07 2015 - 23:07:13 EST


From: Stefan Agner <stefan@xxxxxxxx> Sent: Wednesday, January 07, 2015 6:30 PM
> To: Duan Fugang-B38611
> Cc: Bhuvanchandra DV; linux-kernel@xxxxxxxxxxxxxxx; Zhou Luwei-B45643;
> LW@xxxxxxxxxxxxxxxxxxx; Li Frank-B20596; davem@xxxxxxxxxxxxx
> Subject: RE: [PATCH] net: fec: Fix dual ethernet issue in VFxx
>
> On 2015-01-07 03:11, fugang.duan@xxxxxxxxxxxxx wrote:
> > From: Stefan Agner <stefan@xxxxxxxx> Sent: Tuesday, January 06, 2015
> > 10:52 PM
> >> To: Bhuvanchandra DV
> >> Cc: linux-kernel@xxxxxxxxxxxxxxx; Zhou Luwei-B45643; LW@karo-
> >> electronics.de; Li Frank-B20596; Duan Fugang-B38611;
> >> davem@xxxxxxxxxxxxx
> >> Subject: Re: [PATCH] net: fec: Fix dual ethernet issue in VFxx
> >>
> >> Fwiw, this patch really touches many devices and disables the quirk
> >> for some devices, but this is done by intent.
> >>
> >> The quirk FEC_QUIRK_ENET_MAC was active for i.MX28, i.MX6Q, Vybrid
> >> (mvf600-fec) and i.MX6SX. However, the new quirk is only enabled for
> >> i.MX28. i.MX6Q doesn't need the quirk since there is one FEC instance
> >> only anyway. Vybrid and i.MX6SX have a MDIO bus for each instance.
> >>
> >> Acked-by: Stefan Agner <stefan@xxxxxxxx>
> >
> > We cannot do it by adding a quirk.
> > For Vybrid and i.MX6SX and later i.MX7 serial, there have their own
> > MDIO bus for each MAC.
> > But, for board design, to save two pin (MDIO, MDC), MAC0 and MAC1
> > share the MDIO bus. For example, i.MX6SX sdb/sabreai/arm2 boards did
> > like this.
>
> Hm, so those board use a circumstance which was SoC specific back at
> i.MX28 time. IMHO, "Out of luck" the shared MDIO bus is the first one
> even for those boards, hence this SoC specific work around still works.
> So I still think for the i.MX28 case, the quirk would be a viable
> solution, but not for those boards, I agree.
>
> > So we must add one dts property to distinguish it, not a quirk.
>
> Just adding a property to the FEC instance who's MDIO bus is in use seems
> somewhat archaic. There is a MDIO bus description for other SoC, do you
> have in mind how this should look like for fec?
>
> --
> Stefan

In general, MAC2 use MAC1 MDIO bus. Because MAC1 is registered firstly, then register MAC2.
We can invent one property like "shared-mii-bus" for MAC1 to tell driver there have other MACs use itself mii bus.
Of course, the property needs to add for MAC2 device node to tell driver it will share the MAC1 mii bus.

Whether add "shared-mii-bus" property depends on customer boards design.
The problem is related to boards design, not related to SOC itself, so I think add property is feasible.

I don't know whether there have better solution for this.

Regards,
Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/