[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>
This commit is contained in:
committed by
Paul Mackerras
parent
08390db07a
commit
c1b78d05b3
@@ -82,6 +82,7 @@ struct tsi108_prv_data {
|
||||
unsigned int phy; /* Index of PHY for this interface */
|
||||
unsigned int irq_num;
|
||||
unsigned int id;
|
||||
unsigned int phy_type;
|
||||
|
||||
struct timer_list timer;/* Timer that triggers the check phy function */
|
||||
unsigned int rxtail; /* Next entry in rxring to read */
|
||||
@@ -1256,11 +1257,11 @@ static void tsi108_init_phy(struct net_device *dev)
|
||||
if (i == 0)
|
||||
printk(KERN_ERR "%s function time out \n", __FUNCTION__);
|
||||
|
||||
#if (TSI108_PHY_TYPE == PHY_BCM54XX) /* Broadcom BCM54xx PHY */
|
||||
tsi108_write_mii(data, 0x09, 0x0300);
|
||||
tsi108_write_mii(data, 0x10, 0x1020);
|
||||
tsi108_write_mii(data, 0x1c, 0x8c00);
|
||||
#endif
|
||||
if (data->phy_type == TSI108_PHY_BCM54XX) {
|
||||
tsi108_write_mii(data, 0x09, 0x0300);
|
||||
tsi108_write_mii(data, 0x10, 0x1020);
|
||||
tsi108_write_mii(data, 0x1c, 0x8c00);
|
||||
}
|
||||
|
||||
tsi108_write_mii(data,
|
||||
MII_BMCR,
|
||||
@@ -1587,6 +1588,7 @@ tsi108_init_one(struct platform_device *pdev)
|
||||
data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if);
|
||||
|
||||
data->phy = einfo->phy;
|
||||
data->phy_type = einfo->phy_type;
|
||||
data->irq_num = einfo->irq_num;
|
||||
data->id = pdev->id;
|
||||
dev->open = tsi108_open;
|
||||
|
Reference in New Issue
Block a user