[U-Boot] [PATCH 1/4] net: fec_mxc: add 1000 Mbps selection

Andy Fleming afleming at gmail.com
Mon Jan 30 02:56:51 CET 2012


> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 3affda8..3fffe79 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -378,6 +378,7 @@ static int fec_set_hwaddr(struct eth_device *dev)
>  static int fec_open(struct eth_device *edev)
>  {
>        struct fec_priv *fec = (struct fec_priv *)edev->priv;
> +       int speed;
>
>        debug("fec_open: fec_open(dev)\n");
>        /* full-duplex, heartbeat disabled */
> @@ -427,8 +428,23 @@ static int fec_open(struct eth_device *edev)
>  #endif
>
>        miiphy_wait_aneg(edev);
> -       miiphy_speed(edev->name, fec->phy_id);
> +       speed = miiphy_speed(edev->name, fec->phy_id);
>        miiphy_duplex(edev->name, fec->phy_id);
> +#ifdef CONFIG_MX6Q

What does this ifdef mean? Can you come up with a name that reflects
the actual configuration difference (ie - it supports gigabit, or it
has the extended whatsit register). When, invariably, the MX7Q (or
whatever) comes out, some unfortunate soul is going to have to figure
out which of the various ifdefs applies *only* to MX6Q, and which
apply also to the new chip.

Even better if this is something that can be determined at runtime.

Andy


More information about the U-Boot mailing list