[PATCH/RFC] FS_ENET: Removed MII bitbang check for TA

Kalle Pokki kalle.pokki at iki.fi
Wed Nov 1 22:22:17 EST 2006


The PHY abstraction layer expects to receive 0xffff when
reading PHY registers if there is no PHY at that address. The
all-ones condition is guaranteed by the pull-up in the MDIO line, so
there is no need to check for the TA bits.

With this, the PHY layer is able to probe the MDIO bus as it expects.
This also removes one board dependency from the fs_enet driver, as there
is no need to set the phy_mask bits anymore.

Signed-off-by: Kalle Pokki <kalle.pokki at iki.fi>
---
  drivers/net/fs_enet/mii-bitbang.c |   17 ++---------------
  1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c
index 0b9b8b5..af36f3e 100644
--- a/drivers/net/fs_enet/mii-bitbang.c
+++ b/drivers/net/fs_enet/mii-bitbang.c
@@ -194,19 +194,6 @@ static int fs_enet_mii_bb_read(struct mi
  	mdc(bitbang, 1);
  	mii_delay(bitbang);

-	/* check the turnaround bit: the PHY should be driving it to zero */
-	if (mdio_read(bitbang) != 0) {
-		/* PHY didn't drive TA low */
-		for (j = 0; j < 32; j++) {
-			mdc(bitbang, 0);
-			mii_delay(bitbang);
-			mdc(bitbang, 1);
-			mii_delay(bitbang);
-		}
-		ret = -1;
-		goto out;
-	}
-
  	mdc(bitbang, 0);
  	mii_delay(bitbang);

@@ -229,7 +216,7 @@ static int fs_enet_mii_bb_read(struct mi
  	mii_delay(bitbang);

  	ret = rdreg;
-out:
+
  	return ret;
  }

@@ -338,7 +325,7 @@ static int __devinit fs_enet_mdio_probe(
  	new_bus->reset = &fs_enet_mii_bb_reset,
  	new_bus->id = pdev->id;

-	new_bus->phy_mask = ~0x9;
+	new_bus->phy_mask = 0;
  	pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;

  	if (NULL == pdata) {
-- 
1.4.1.1




More information about the Linuxppc-embedded mailing list