diff options
-rw-r--r-- | arch/powerpc/boot/dts/sequoia.dts | 1 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/rgmii.c | 20 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/rgmii.h | 5 |
3 files changed, 15 insertions, 11 deletions
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts index 8833dfe2e8b4..3d0dfaecc7b6 100644 --- a/arch/powerpc/boot/dts/sequoia.dts +++ b/arch/powerpc/boot/dts/sequoia.dts | |||
@@ -245,6 +245,7 @@ | |||
245 | device_type = "rgmii-interface"; | 245 | device_type = "rgmii-interface"; |
246 | compatible = "ibm,rgmii-440epx", "ibm,rgmii"; | 246 | compatible = "ibm,rgmii-440epx", "ibm,rgmii"; |
247 | reg = <ef601000 8>; | 247 | reg = <ef601000 8>; |
248 | has-mdio; | ||
248 | }; | 249 | }; |
249 | 250 | ||
250 | EMAC0: ethernet@ef600e00 { | 251 | EMAC0: ethernet@ef600e00 { |
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c index de416951a435..328726978587 100644 --- a/drivers/net/ibm_newemac/rgmii.c +++ b/drivers/net/ibm_newemac/rgmii.c | |||
@@ -140,7 +140,7 @@ void rgmii_get_mdio(struct of_device *ofdev, int input) | |||
140 | 140 | ||
141 | RGMII_DBG2(dev, "get_mdio(%d)" NL, input); | 141 | RGMII_DBG2(dev, "get_mdio(%d)" NL, input); |
142 | 142 | ||
143 | if (dev->type != RGMII_AXON) | 143 | if (!(dev->flags & EMAC_RGMII_FLAG_HAS_MDIO)) |
144 | return; | 144 | return; |
145 | 145 | ||
146 | mutex_lock(&dev->lock); | 146 | mutex_lock(&dev->lock); |
@@ -161,7 +161,7 @@ void rgmii_put_mdio(struct of_device *ofdev, int input) | |||
161 | 161 | ||
162 | RGMII_DBG2(dev, "put_mdio(%d)" NL, input); | 162 | RGMII_DBG2(dev, "put_mdio(%d)" NL, input); |
163 | 163 | ||
164 | if (dev->type != RGMII_AXON) | 164 | if (!(dev->flags & EMAC_RGMII_FLAG_HAS_MDIO)) |
165 | return; | 165 | return; |
166 | 166 | ||
167 | fer = in_be32(&p->fer); | 167 | fer = in_be32(&p->fer); |
@@ -250,11 +250,13 @@ static int __devinit rgmii_probe(struct of_device *ofdev, | |||
250 | goto err_free; | 250 | goto err_free; |
251 | } | 251 | } |
252 | 252 | ||
253 | /* Check for RGMII type */ | 253 | /* Check for RGMII flags */ |
254 | if (of_get_property(ofdev->node, "has-mdio", NULL)) | ||
255 | dev->flags |= EMAC_RGMII_FLAG_HAS_MDIO; | ||
256 | |||
257 | /* CAB lacks the right properties, fix this up */ | ||
254 | if (of_device_is_compatible(ofdev->node, "ibm,rgmii-axon")) | 258 | if (of_device_is_compatible(ofdev->node, "ibm,rgmii-axon")) |
255 | dev->type = RGMII_AXON; | 259 | dev->flags |= EMAC_RGMII_FLAG_HAS_MDIO; |
256 | else | ||
257 | dev->type = RGMII_STANDARD; | ||
258 | 260 | ||
259 | DBG2(dev, " Boot FER = 0x%08x, SSR = 0x%08x\n", | 261 | DBG2(dev, " Boot FER = 0x%08x, SSR = 0x%08x\n", |
260 | in_be32(&dev->base->fer), in_be32(&dev->base->ssr)); | 262 | in_be32(&dev->base->fer), in_be32(&dev->base->ssr)); |
@@ -263,9 +265,9 @@ static int __devinit rgmii_probe(struct of_device *ofdev, | |||
263 | out_be32(&dev->base->fer, 0); | 265 | out_be32(&dev->base->fer, 0); |
264 | 266 | ||
265 | printk(KERN_INFO | 267 | printk(KERN_INFO |
266 | "RGMII %s %s initialized\n", | 268 | "RGMII %s initialized with%s MDIO support\n", |
267 | dev->type == RGMII_STANDARD ? "standard" : "axon", | 269 | ofdev->node->full_name, |
268 | ofdev->node->full_name); | 270 | (dev->flags & EMAC_RGMII_FLAG_HAS_MDIO) ? "" : "out"); |
269 | 271 | ||
270 | wmb(); | 272 | wmb(); |
271 | dev_set_drvdata(&ofdev->dev, dev); | 273 | dev_set_drvdata(&ofdev->dev, dev); |
diff --git a/drivers/net/ibm_newemac/rgmii.h b/drivers/net/ibm_newemac/rgmii.h index 57806833121e..44a0f201064d 100644 --- a/drivers/net/ibm_newemac/rgmii.h +++ b/drivers/net/ibm_newemac/rgmii.h | |||
@@ -35,8 +35,9 @@ struct rgmii_regs { | |||
35 | struct rgmii_instance { | 35 | struct rgmii_instance { |
36 | struct rgmii_regs __iomem *base; | 36 | struct rgmii_regs __iomem *base; |
37 | 37 | ||
38 | /* Type of RGMII bridge */ | 38 | /* RGMII bridge flags */ |
39 | int type; | 39 | int flags; |
40 | #define EMAC_RGMII_FLAG_HAS_MDIO 0x00000001 | ||
40 | 41 | ||
41 | /* Only one EMAC whacks us at a time */ | 42 | /* Only one EMAC whacks us at a time */ |
42 | struct mutex lock; | 43 | struct mutex lock; |