diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-31 02:50:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 02:50:18 -0400 |
commit | 194dcdba5a11a0238aef7ed91f32df77cb31505b (patch) | |
tree | ad9b2e763d702ab59d176f3acc57dbb200afdad1 /arch/powerpc | |
parent | 19b8cba2e8539e3b8022316f94837d8f242b8f80 (diff) | |
parent | bdb59f949d663b7e943fb5f40b2557af4314abf9 (diff) |
Merge branch 'davem-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 01b884b25696..26ecb96f9731 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -223,6 +223,8 @@ static int gfar_mdio_of_init_one(struct device_node *np) | |||
223 | if (ret) | 223 | if (ret) |
224 | return ret; | 224 | return ret; |
225 | 225 | ||
226 | /* The gianfar device will try to use the same ID created below to find | ||
227 | * this bus, to coordinate register access (since they share). */ | ||
226 | mdio_dev = platform_device_register_simple("fsl-gianfar_mdio", | 228 | mdio_dev = platform_device_register_simple("fsl-gianfar_mdio", |
227 | res.start&0xfffff, &res, 1); | 229 | res.start&0xfffff, &res, 1); |
228 | if (IS_ERR(mdio_dev)) | 230 | if (IS_ERR(mdio_dev)) |
@@ -394,6 +396,30 @@ static int __init gfar_of_init(void) | |||
394 | of_node_put(mdio); | 396 | of_node_put(mdio); |
395 | } | 397 | } |
396 | 398 | ||
399 | /* Get MDIO bus controlled by this eTSEC, if any. Normally only | ||
400 | * eTSEC 1 will control an MDIO bus, not necessarily the same | ||
401 | * bus that its PHY is on ('mdio' above), so we can't just use | ||
402 | * that. What we do is look for a gianfar mdio device that has | ||
403 | * overlapping registers with this device. That's really the | ||
404 | * whole point, to find the device sharing our registers to | ||
405 | * coordinate access with it. | ||
406 | */ | ||
407 | for_each_compatible_node(mdio, NULL, "fsl,gianfar-mdio") { | ||
408 | if (of_address_to_resource(mdio, 0, &res)) | ||
409 | continue; | ||
410 | |||
411 | if (res.start >= r[0].start && res.end <= r[0].end) { | ||
412 | /* Get the ID the mdio bus platform device was | ||
413 | * registered with. gfar_data.bus_id is | ||
414 | * different because it's for finding a PHY, | ||
415 | * while this is for finding a MII bus. | ||
416 | */ | ||
417 | gfar_data.mdio_bus = res.start&0xfffff; | ||
418 | of_node_put(mdio); | ||
419 | break; | ||
420 | } | ||
421 | } | ||
422 | |||
397 | ret = | 423 | ret = |
398 | platform_device_add_data(gfar_dev, &gfar_data, | 424 | platform_device_add_data(gfar_dev, &gfar_data, |
399 | sizeof(struct | 425 | sizeof(struct |