summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@linux.vnet.ibm.com>2007-05-08 07:26:22 +1000
committerPaul Mackerras <paulus@samba.org>2007-05-08 11:54:20 +1000
commitc1b78d05b3281d6f84284d421fc20eed8b8b78ce (patch)
treeb43b65f028cbec38752ed4357c7067d94e48f59b /arch
parent08390db07a012b972189629a30eb695cdcb0ec14 (diff)
downloadop-kernel-dev-c1b78d05b3281d6f84284d421fc20eed8b8b78ce.zip
op-kernel-dev-c1b78d05b3281d6f84284d421fc20eed8b8b78ce.tar.gz
[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 'arch')
-rw-r--r--arch/powerpc/sysdev/tsi108_dev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index 337039e..7d3b09b 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -107,8 +107,9 @@ static int __init tsi108_eth_of_init(void)
goto err;
}
- mac_addr = of_get_property(np, "address", NULL);
- memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
+ mac_addr = of_get_mac_address(np);
+ if (mac_addr)
+ memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
@@ -129,6 +130,8 @@ static int __init tsi108_eth_of_init(void)
tsi_eth_data.phyregs = res.start;
tsi_eth_data.phy = *phy_id;
tsi_eth_data.irq_num = irq_of_parse_and_map(np, 0);
+ if (of_device_is_compatible(phy, "bcm54xx"))
+ tsi_eth_data.phy_type = TSI108_PHY_BCM54XX;
of_node_put(phy);
ret =
platform_device_add_data(tsi_eth_dev, &tsi_eth_data,
OpenPOWER on IntegriCloud