From: Domen Puncer <domen@coderock.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: netdev@vger.kernel.org, linuxppc-embedded@ozlabs.org
Subject: Re: [RFC PATCH v0.2] net driver: mpc52xx fec
Date: Sat, 15 Sep 2007 14:14:44 +0200 [thread overview]
Message-ID: <20070915121444.GA19857@nd47.coderock.org> (raw)
In-Reply-To: <fa686aa40709030857j6c36c87ek60215f812864ee0f@mail.gmail.com>
On 03/09/07 09:57 -0600, Grant Likely wrote:
> On 9/2/07, Domen Puncer <domen@coderock.org> wrote:
> > Hi!
> >
> > new in this version:
> > - fixed stuff that was commented on.
> > - added 7-wire support (compile at least, if someone has the hardware,
> > please test!)
> > - ethtool support
>
> Thanks for this work Domen, comments below...
Thanks for reviewing and sorry for not replying sooner, I lost the
mail.
>
> This is a large patch, and it should be broken up into logical
> changes. ie. split into dts changes, bestcomm changes, fec driver and
> mdio driver. Easier to review that way. The bestcomm and dts changes
> don't need to go to the netdev list.
OK.
> > +config FEC_MPC52xx
> > + tristate "FEC Ethernet"
> > + depends on NET_ETHERNET
> > + select PPC_BESTCOMM
> > + select PPC_BESTCOMM_FEC
> > + select CRC32
> > + ---help---
> > + This option enables support for the MPC5200's on-chip
> > + Fast Ethernet Controller
> > +
> > +config FEC_MPC52xx_MDIO
> > + bool "Use external Ethernet MII PHY"
> > + depends on FEC_MPC52xx
> > + select PHYLIB
> > + default y
> > + ---help---
> > + The MPC5200's FEC can connect to the Ethernet either with
> > + an external MII PHY chip or 10 Mbps 7-wire interface
> > + (Motorola? industry standard).
> > + If your board uses an external PHY, say y, else n.
>
> This option should change. Either build the MDIO driver into the FEC
> driver unconditionally and drop this option, or make the MDIO driver
> independent from the FEC driver (it does use the MDIO bus
> infrastructure after all). Either way the FEC driver should detect
> the phy type at runtime (possibly based on the presence/absence of a
> phy-handle property) instead of being hard compiled. 5200 support is
> now multiplatform after all.
>
> If you drop the MDIO config option, then I'd also consider eliminating
> driver/net/fec_mpc52xx/Kconfig entirely and rolling the single
> MPC52xx_FEC option into drivers/net/Kconfig.
Right. I separated it.
> > +static irqreturn_t fec_interrupt(int, void *);
> > +static irqreturn_t fec_rx_interrupt(int, void *);
> > +static irqreturn_t fec_tx_interrupt(int, void *);
> > +static struct net_device_stats *fec_get_stats(struct net_device *);
> > +static void fec_set_multicast_list(struct net_device *dev);
> > +static void fec_hw_init(struct net_device *dev);
> > +static void fec_stop(struct net_device *dev);
> > +static void fec_start(struct net_device *dev);
> > +static void fec_reset(struct net_device *dev);
>
> Nit: Are all these forward decls needed?
Some aren't - cleaned.
>
> > +
> > +static u8 mpc52xx_fec_mac_addr[6];
>
> Why isn't this part of struct fec_priv?
Because at __setup time, there's no fec_priv instance.
OTOH, does anyone even use mpc52xx-mac=?
>
> > +static const u8 null_mac[6];
>
> null_mac?!? Just for comparing a mac addr against 0?
right, is_zero_ether_addr is the right thing.
>
> <snip>
>
> > +#ifdef CONFIG_FEC_MPC52xx_MDIO
>
> Once again; don't make this a conditional compile; detect at runtime.
>
> <snip>
>
> > +static void __init fec_str2mac(char *str, unsigned char *mac)
> > +{
> > + int i;
> > + u64 val64;
> > +
> > + val64 = simple_strtoull(str, NULL, 16);
> > +
> > + for (i = 0; i < 6; i++)
> > + mac[5-i] = val64 >> (i*8);
> > +}
> > +
> > +static int __init mpc52xx_fec_mac_setup(char *mac_address)
> > +{
> > + fec_str2mac(mac_address, mpc52xx_fec_mac_addr);
> > + return 0;
> > +}
>
> fec_str2mac is called in *1* place. I'd roll it into mpc52xx_fec_mac_setup.
>
> > +
> > +__setup("mpc52xx-mac=", mpc52xx_fec_mac_setup);
> > +
>
OK.
Updated and split version at:
http://coderock.org/tmp/fec-v3rc1/
I'll repost to lists once I run-test them.
Domen
>
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
> grant.likely@secretlab.ca
> (403) 399-0195
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
next prev parent reply other threads:[~2007-09-15 12:15 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 9:51 [RFC PATCH v0.1] net driver: mpc52xx fec Domen Puncer
2007-08-10 13:02 ` Arnaldo Carvalho de Melo
2007-08-13 7:21 ` Domen Puncer
2007-08-18 10:06 ` Domen Puncer
2007-08-19 15:39 ` Matt Sealey
2007-08-20 8:31 ` Domen Puncer
2007-08-20 13:13 ` Domen Puncer
2007-08-20 19:02 ` Matt Sealey
2007-08-21 5:49 ` Domen Puncer
2007-09-02 7:41 ` [RFC PATCH v0.2] " Domen Puncer
2007-09-03 15:57 ` Grant Likely
2007-09-03 16:09 ` Jon Smirl
2007-09-03 16:41 ` Grant Likely
2007-09-15 12:14 ` Domen Puncer [this message]
2007-09-17 9:53 ` Sven Luther
2007-09-17 20:21 ` [PATCH] phy: export phy_mii_ioctl Domen Puncer
2007-09-17 22:08 ` Jon Smirl
2007-09-18 15:16 ` Domen Puncer
2007-09-18 19:17 ` Jon Smirl
2007-09-19 11:56 ` Domen Puncer
2007-09-19 18:44 ` Jon Smirl
2007-09-19 21:18 ` Jon Smirl
2007-09-18 19:29 ` Jon Smirl
2007-09-19 8:54 ` Pedro Luis D. L.
2007-09-19 10:37 ` Juergen Beisert
2007-09-19 11:38 ` Pedro Luis D. L.
2007-09-19 14:51 ` Juergen Beisert
2007-09-19 15:11 ` Pedro Luis D. L.
2007-09-19 13:56 ` Jon Smirl
2007-09-19 14:31 ` Pedro Luis D. L.
2007-09-19 8:54 ` Pedro Luis D. L.
2007-09-20 6:36 ` Jeff Garzik
2007-10-02 12:49 ` [RFC PATCH v0.2] net driver: mpc52xx fec Sascha Hauer
2007-10-02 14:32 ` Domen Puncer
2007-10-02 15:46 ` Robert Schwebel
2007-09-27 17:07 ` [RFC PATCH v0.1] " Juergen Beisert
2007-09-27 18:12 ` Jon Smirl
2007-09-27 18:43 ` Scott Wood
2007-09-28 9:12 ` Juergen Beisert
2007-09-28 15:40 ` Scott Wood
2007-10-08 8:48 ` Sascha Hauer
2007-10-08 9:01 ` Sascha Hauer
2007-10-08 16:46 ` Jon Smirl
2007-09-28 15:07 ` Juergen Beisert
2007-09-28 15:38 ` Jon Smirl
2007-10-01 8:35 ` Juergen Beisert
2007-10-01 16:24 ` Juergen Beisert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070915121444.GA19857@nd47.coderock.org \
--to=domen@coderock.org \
--cc=grant.likely@secretlab.ca \
--cc=linuxppc-embedded@ozlabs.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).