linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Domen Puncer" <domen.puncer@telargo.com>
Cc: linuxppc-dev@ozlabs.org, jgarzik@pobox.com, netdev@vger.kernel.org
Subject: Re: [PATCH v3 4/4] FEC mpc52xx: phy part of the driver
Date: Sun, 14 Oct 2007 16:05:17 -0600	[thread overview]
Message-ID: <fa686aa40710141505w1787e7e1g6116185001561a4d@mail.gmail.com> (raw)
In-Reply-To: <20071014075958.GG3000@nd47.coderock.org>

On 10/14/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> PHY part of the driver for mpc5200(b) ethernet.

Assuming I understand correctly, this comment is not correct and this
patch just adds an MDIO bus driver.  PHY drivers are in phylib and
data transfer is setup via the core driver, correct?

It is conceivable that the PHY is connected to an alternate MDIO bus,
or the MDIO bus is used for a PHY connected to an external Ethernet
controller.

Speaking of which, is it possible to use this MDIO bus without the
core FEC being initialized?

> +static struct of_device_id fec_mdio_match[] = {
> +       {
> +               .type = "mdio",
> +               .compatible = "mpc5200b-fec-phy",

This is not a phy; it's an MDIO bus.  Also, shouldn't this be
"mpc5200-..." instead of "mpc5200b-..."?

> +       },
> +       {},
> +};
> +
> +struct of_platform_driver mpc52xx_fec_mdio_driver = {
> +       .name = "mpc5200b-fec-phy",
> +       .probe = fec_mdio_probe,
> +       .remove = fec_mdio_remove,
> +       .match_table = fec_mdio_match,

Inconsistent naming.  Please use the same prefix on all global/static
symbols (ie. use "mpc52xx_mdio_" instead of the mix of
"mpc52xx_fec_mdio_", "fec_mdio_", etc.)  I also thing that "fec_mdio_"
is too generic because there are a number of different incompatible
FEC devices.

> +};
> +
> +/* let fec driver call it, since this has to be registered before it */
> +EXPORT_SYMBOL_GPL(mpc52xx_fec_mdio_driver);

Why not have a module_init()/module_exit() in this file?  I don't
think the FEC driver calls this driver's functions directly anymore,
and it's still dependent on the of_platform bus probe order anyway.

As an added bonus, it makes your Makefile much simpler.

> +
> +
> +MODULE_LICENSE("Dual BSD/GPL");
> Index: linux.git/drivers/net/fec_mpc52xx/Makefile
> ===================================================================
> --- linux.git.orig/drivers/net/fec_mpc52xx/Makefile
> +++ linux.git/drivers/net/fec_mpc52xx/Makefile
> @@ -1,2 +1,7 @@
>  obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx.o
>  fec_mpc52xx-objs := fec.o
> +
> +ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y)
> +       obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx_phy.o
> +       fec_mpc52xx_phy-objs := fec_phy.o
> +endif
> Index: linux.git/drivers/net/fec_mpc52xx/Kconfig
> ===================================================================
> --- linux.git.orig/drivers/net/fec_mpc52xx/Kconfig
> +++ linux.git/drivers/net/fec_mpc52xx/Kconfig
> @@ -11,5 +11,18 @@ config FEC_MPC52xx
>         ---help---
>           This option enables support for the MPC5200's on-chip
>           Fast Ethernet Controller
> +         If compiled as module, it will be called 'fec_mpc52xx.ko'.

Drop this line and make the help text the same format as the other eth
drivers in drivers/net.

> +
> +config FEC_MPC52xx_MDIO
> +       bool "FEC MII PHY driver"
> +       depends on FEC_MPC52xx
> +       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, enable this.

Not strictly true.  This enables talking to a PHY using the internal
MDIO controller.  PHY register access could just as easily be accessed
via an alternate interface.

> +         If not sure, enable.
> +         If compiled as module, it will be called 'fec_mpc52xx_phy.ko'.

Drop the module name comment.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

  reply	other threads:[~2007-10-14 22:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-14  7:55 [PATCH v3 0/4] FEC - fast ethernet controller for mpc52xx Domen Puncer
2007-10-14  7:57 ` [PATCH v3 1/4] FEC mpc52xx: device tree changes Domen Puncer
2007-10-14  7:58 ` [PATCH v3 2/4] FEC mpc52xx: add some bestcomm flags Domen Puncer
2007-10-14  7:59 ` [PATCH v3 3/4] FEC mpc52xx: the driver Domen Puncer
2007-10-14 21:43   ` Grant Likely
2007-10-14  7:59 ` [PATCH v3 4/4] FEC mpc52xx: phy part of " Domen Puncer
2007-10-14 22:05   ` Grant Likely [this message]
2007-10-15 10:56     ` [PATCH v3 4/4] FEC mpc52xx: phy part of the driver\ Domen Puncer
2007-10-15 14:30       ` Grant Likely
2007-10-15 19:06 ` [PATCH v3 0/4] FEC - fast ethernet controller for mpc52xx Jeff Garzik
2007-10-15 19:19   ` Grant Likely
2007-10-18 14:15   ` Grant Likely
2007-10-18 19:14     ` Jeff Garzik
2007-10-19 11:27       ` [PATCH v4] " Domen Puncer
2007-10-21 18:32         ` Grant Likely
2007-10-25  9:29         ` Jeff Garzik
2007-10-25 14:10           ` Domen Puncer
2007-10-25 18:57             ` Dale Farnsworth
2007-10-25 19:41               ` Domen Puncer
2007-10-25 20:29                 ` Dale Farnsworth
2007-10-25 22:46                   ` Jeff Garzik
2007-10-25 23:50                   ` Stephen Hemminger
2007-10-26 11:59                   ` [PATCH v4.2] " Domen Puncer
2007-10-26 14:18                     ` Dale Farnsworth
2007-10-26 16:07                       ` [PATCH v4.3] " Domen Puncer
2007-10-29  9:59                         ` Jeff Garzik
2007-10-29 15:37                           ` Grant Likely
2007-11-01 11:31             ` [PATCH v4] " tnt

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=fa686aa40710141505w1787e7e1g6116185001561a4d@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=domen.puncer@telargo.com \
    --cc=jgarzik@pobox.com \
    --cc=linuxppc-dev@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).