From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 07/17] SPEAr : Network driver support added
Date: Sun, 25 Apr 2010 22:02:49 -0700 [thread overview]
Message-ID: <4BD51E79.4020401@gmail.com> (raw)
In-Reply-To: <4BD17747.2010307@st.com>
Hi Armando,
On 4/23/2010 3:32 AM, Armando VISCONTI wrote:
> Ben,
>
> I have a specific question on the way we handle phy address
> in SPEAr.
>>> +
>>> +static u8 find_phy(struct eth_device *dev)
>>> +{
>>> + u8 phy_addr = 0;
>>> + u16 ctrl, oldctrl;
>>> +
>>> + do {
>>> + eth_mdio_read(dev, phy_addr, PHY_BMCR,&ctrl);
>>> + oldctrl = ctrl& PHY_BMCR_AUTON;
>>> +
>>> + ctrl ^= PHY_BMCR_AUTON;
>>> + eth_mdio_write(dev, phy_addr, PHY_BMCR, ctrl);
>>> + eth_mdio_read(dev, phy_addr, PHY_BMCR,&ctrl);
>>> + ctrl&= PHY_BMCR_AUTON;
>>> +
>>> + if (ctrl == oldctrl) {
>>> + phy_addr++;
>>> + } else {
>>> + ctrl ^= PHY_BMCR_AUTON;
>>> + eth_mdio_write(dev, phy_addr, PHY_BMCR, ctrl);
>>> + break;
>>> + }
>>> + } while (phy_addr< 32);
>>> +
>>> + return phy_addr;
>>> +}
>>> +
> As you can see we use an auto-probing mechanism implemented as find_phy()
> routine. This auto-probing is also used in other cases, like the
> drivers/net/mcfmii.c (mii_discover_phy()).
>
> Actually I'm not sure this auto-probing mechanism is correct, as it
> works only
> in case (very used) in which the MAC-PHY are in 1:1 relationship.
>
> Instead, the MDIO bus nature implies that there might be N MACs and M
> PHYs connected
> to the bus, so the auto-probing would not work.
>
> See here some comments on the same:
> http://lists.ozlabs.org/pipermail/devicetree-discuss/2010-February/001670.html
>
>
>
> In our PCB we have the 1:1 relationship, but since the dw_eth.c driver
> is generic, it
> might be used on differently designed pcb.
>
> What is your general opinion in that?
> Should we implement it differently?
>
I agree that MDIO bus probing doesn't make much sense. I don't know
anything about your SOC, but the ones that I work with typically have
multiple MACs (data link) but only one MDIO bus (control link). The end
result is multiple PHYs on a multi-drop bus, and there's no way of
knowing which one has its data link connected to which MAC.
I'd prefer to see it hard-coded, either through a CONFIG option or an
environment variable.
> Regards,
> Arm
regards,
Ben
next prev parent reply other threads:[~2010-04-26 5:02 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 7:54 [U-Boot] [PATCH 00/17] Network support for spear platform and spear1300 support Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 01/17] u-boot.img file not created when srctree and objtree are different Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 02/17] change_bit routine defined Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 03/17] SPEAr : SMI erase and write timeouts increased Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 04/17] SPEAr : Placing ethaddr write and read within CONFIG_CMD_NET Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 05/17] SPEAr : Reducing the max RAM size to 128MB Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 06/17] SPEAr : Basic arch related support added for SPEAr SoCs Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 07/17] SPEAr : Network driver support added Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 08/17] SPEAr : Network support configured for spear SoCs Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 09/17] SPEAr : macb driver support added for spear310 and spear320 Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 10/17] SPEAr : FSMC driver support added Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 11/17] SPEAr : Configuring FSMC driver for NAND interface Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 12/17] SPEAr : i2c driver moved completely into drivers/i2c Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 13/17] SPEAr : smi driver moved completely into drivers/mtd Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 14/17] SPEAr : USBD driver support added Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 15/17] SPEAr : Basic spear1300 architecture " Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 16/17] SPEAr : spear1300 SoC " Vipin KUMAR
2010-04-21 7:54 ` [U-Boot] [PATCH 17/17] SPEAr : Supporting various configurations for spear3xx and spear6xx boards Vipin KUMAR
2010-04-21 12:11 ` [U-Boot] [PATCH 12/17] SPEAr : i2c driver moved completely into drivers/i2c Peter Tyser
2010-04-22 4:07 ` Vipin KUMAR
2010-04-21 17:02 ` [U-Boot] [PATCH 11/17] SPEAr : Configuring FSMC driver for NAND interface Scott Wood
2010-04-22 4:21 ` Vipin KUMAR
2010-04-22 15:39 ` Scott Wood
2010-04-21 17:02 ` [U-Boot] [PATCH 10/17] SPEAr : FSMC driver support added Scott Wood
2010-04-22 4:28 ` Vipin KUMAR
2010-04-22 16:01 ` Scott Wood
2010-04-21 12:00 ` [U-Boot] [PATCH 07/17] SPEAr : Network " Peter Tyser
2010-04-22 4:30 ` Vipin KUMAR
2010-04-21 17:48 ` Ben Warren
2010-04-22 4:43 ` Vipin KUMAR
2010-04-23 10:32 ` Armando VISCONTI
2010-04-26 5:02 ` Ben Warren [this message]
2010-04-26 8:01 ` Armando VISCONTI
2010-04-26 8:34 ` Vipin KUMAR
2010-04-21 11:51 ` [U-Boot] [PATCH 06/17] SPEAr : Basic arch related support added for SPEAr SoCs Peter Tyser
2010-04-22 4:45 ` Vipin KUMAR
2010-04-21 11:54 ` [U-Boot] [PATCH 00/17] Network support for spear platform and spear1300 support Peter Tyser
2010-04-21 12:00 ` Vipin KUMAR
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=4BD51E79.4020401@gmail.com \
--to=biggerbadderben@gmail.com \
--cc=u-boot@lists.denx.de \
/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