diff options
author | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2007-05-07 17:26:22 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-07 21:54:20 -0400 |
commit | c1b78d05b3281d6f84284d421fc20eed8b8b78ce (patch) | |
tree | b43b65f028cbec38752ed4357c7067d94e48f59b /drivers/net | |
parent | 08390db07a012b972189629a30eb695cdcb0ec14 (diff) |
[POWERPC] Generalize tsi108 PHY types
Add a phy_type field to the tsi108 ethernet structures to indicate which PHY
is used on a board. This is derived from the "compatible" property in the
ethernet-phy node of the device tree. The default remains the MV88E PHY.
Also, convert the setup code to use of_get_mac_address instead of hard coding
a lookup for the "address" property in the ethernet node.
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/tsi108_eth.c | 12 | ||||
-rw-r--r-- | drivers/net/tsi108_eth.h | 9 |
2 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 0bfc2c9c1c08..1aabc91f6458 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c | |||
@@ -82,6 +82,7 @@ struct tsi108_prv_data { | |||
82 | unsigned int phy; /* Index of PHY for this interface */ | 82 | unsigned int phy; /* Index of PHY for this interface */ |
83 | unsigned int irq_num; | 83 | unsigned int irq_num; |
84 | unsigned int id; | 84 | unsigned int id; |
85 | unsigned int phy_type; | ||
85 | 86 | ||
86 | struct timer_list timer;/* Timer that triggers the check phy function */ | 87 | struct timer_list timer;/* Timer that triggers the check phy function */ |
87 | unsigned int rxtail; /* Next entry in rxring to read */ | 88 | unsigned int rxtail; /* Next entry in rxring to read */ |
@@ -1256,11 +1257,11 @@ static void tsi108_init_phy(struct net_device *dev) | |||
1256 | if (i == 0) | 1257 | if (i == 0) |
1257 | printk(KERN_ERR "%s function time out \n", __FUNCTION__); | 1258 | printk(KERN_ERR "%s function time out \n", __FUNCTION__); |
1258 | 1259 | ||
1259 | #if (TSI108_PHY_TYPE == PHY_BCM54XX) /* Broadcom BCM54xx PHY */ | 1260 | if (data->phy_type == TSI108_PHY_BCM54XX) { |
1260 | tsi108_write_mii(data, 0x09, 0x0300); | 1261 | tsi108_write_mii(data, 0x09, 0x0300); |
1261 | tsi108_write_mii(data, 0x10, 0x1020); | 1262 | tsi108_write_mii(data, 0x10, 0x1020); |
1262 | tsi108_write_mii(data, 0x1c, 0x8c00); | 1263 | tsi108_write_mii(data, 0x1c, 0x8c00); |
1263 | #endif | 1264 | } |
1264 | 1265 | ||
1265 | tsi108_write_mii(data, | 1266 | tsi108_write_mii(data, |
1266 | MII_BMCR, | 1267 | MII_BMCR, |
@@ -1587,6 +1588,7 @@ tsi108_init_one(struct platform_device *pdev) | |||
1587 | data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if); | 1588 | data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if); |
1588 | 1589 | ||
1589 | data->phy = einfo->phy; | 1590 | data->phy = einfo->phy; |
1591 | data->phy_type = einfo->phy_type; | ||
1590 | data->irq_num = einfo->irq_num; | 1592 | data->irq_num = einfo->irq_num; |
1591 | data->id = pdev->id; | 1593 | data->id = pdev->id; |
1592 | dev->open = tsi108_open; | 1594 | dev->open = tsi108_open; |
diff --git a/drivers/net/tsi108_eth.h b/drivers/net/tsi108_eth.h index 77a769df228a..5a77ae6c5f36 100644 --- a/drivers/net/tsi108_eth.h +++ b/drivers/net/tsi108_eth.h | |||
@@ -43,15 +43,6 @@ | |||
43 | in_be32((data->phyregs + (offset))) | 43 | in_be32((data->phyregs + (offset))) |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * PHY Configuration Options | ||
47 | * | ||
48 | * NOTE: Enable set of definitions corresponding to your board type | ||
49 | */ | ||
50 | #define PHY_MV88E 1 /* Marvel 88Exxxx PHY */ | ||
51 | #define PHY_BCM54XX 2 /* Broardcom BCM54xx PHY */ | ||
52 | #define TSI108_PHY_TYPE PHY_MV88E | ||
53 | |||
54 | /* | ||
55 | * TSI108 GIGE port registers | 46 | * TSI108 GIGE port registers |
56 | */ | 47 | */ |
57 | 48 | ||