[U-Boot] [PATCH 1/1] ppc4xx: Add support for GPCS, SGMII and M88E1112 PHY

Stefan Roese sr at denx.de
Sat Aug 30 19:56:20 CEST 2008


Ben,

On Saturday 30 August 2008, Ben Warren wrote:
> > +#if !defined(CONFIG_PHY_LESS)
> > +#define CONFIG_PHY_LESS        0xFFFFFFFF /* PHY-less mode */
> > +#define CONFIG_PHY_LESS_SPEED  1000
> > +#define CONFIG_PHY_LESS_DUPLEX FULL
> > +#endif
> > +
>
> Sorry, but this is not scalable.  There are many real-world examples
> of boards where one controller is connected to a PHY, and another has
> a FIXED link to a switch or something else.  This driver is already an
> unwieldy mess and adding this sort of thing only makes it worse.  If
> you want to add fixed-link capabilities, please re-direct your efforts
> towards a more generic, scalable solution.

Yes, this was my first fear too. But take a look at the commet Victor added in 
his 2nd patch version (I asked specifically for this comment to learn how 
this should work):

+/*
+ * Some boards do not have a PHY for each ethernet port.
+ * For example on Arches board (2 CPU system) eth0 does not have
+ * a PHY, both CPU's are wired directly together (AC coupled)
+ * using SGMII0. In these cases set the appropriate
+ * CONFIG_PHY_ADDR equal to CONFIG_PHY_LESS to detect that
+ * the specified ethernet port does not have a PHY.
+ */
+#if !defined(CONFIG_PHY_LESS)
+#define CONFIG_PHY_LESS        0xFFFFFFFF /* PHY-less mode */
+#define CONFIG_PHY_LESS_SPEED  1000
+#define CONFIG_PHY_LESS_DUPLEX FULL
+#endif

So it's a per ethernet-interface selectable define of the CONFIG_PHY_ADDR and 
it kind of scales. It's not perfect but at least it's a way to support boards 
with interfaces connected to PHY's and other without PHY connection.

What do you think? Is this acceptable? Or what other solution would be 
acceptable?

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list