aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-16 20:24:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-16 20:24:53 -0400
commit492b057c426e4aa747484958e18e9da29003985d (patch)
tree34e08c24618688d8bcc190523028b5f94cce0c0b /arch/powerpc
parent313485175da221c388f6a8ecf4c30062ba9bea17 (diff)
parent300df7dc89cc276377fc020704e34875d5c473b6 (diff)
Merge commit 'origin/master' into next
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/configs/ppc6xx_defconfig2
-rw-r--r--arch/powerpc/include/asm/qe.h2
-rw-r--r--arch/powerpc/platforms/82xx/ep8248e.c9
-rw-r--r--arch/powerpc/platforms/pasemi/gpio_mdio.c32
4 files changed, 11 insertions, 34 deletions
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index 7d044dfd9236..12dc7c409616 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -1808,7 +1808,7 @@ CONFIG_PCF8575=m
1808CONFIG_SENSORS_PCA9539=m 1808CONFIG_SENSORS_PCA9539=m
1809CONFIG_SENSORS_PCF8591=m 1809CONFIG_SENSORS_PCF8591=m
1810# CONFIG_TPS65010 is not set 1810# CONFIG_TPS65010 is not set
1811CONFIG_SENSORS_MAX6875=m 1811CONFIG_EEPROM_MAX6875=m
1812CONFIG_SENSORS_TSL2550=m 1812CONFIG_SENSORS_TSL2550=m
1813CONFIG_MCU_MPC8349EMITX=m 1813CONFIG_MCU_MPC8349EMITX=m
1814# CONFIG_I2C_DEBUG_CORE is not set 1814# CONFIG_I2C_DEBUG_CORE is not set
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index e0faf332c9c9..157c5ca581c8 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -675,6 +675,8 @@ struct ucc_slow_pram {
675#define UCC_GETH_UPSMR_RMM 0x00001000 675#define UCC_GETH_UPSMR_RMM 0x00001000
676#define UCC_GETH_UPSMR_CAM 0x00000400 676#define UCC_GETH_UPSMR_CAM 0x00000400
677#define UCC_GETH_UPSMR_BRO 0x00000200 677#define UCC_GETH_UPSMR_BRO 0x00000200
678#define UCC_GETH_UPSMR_SMM 0x00000080
679#define UCC_GETH_UPSMR_SGMM 0x00000020
678 680
679/* UCC Transmit On Demand Register (UTODR) */ 681/* UCC Transmit On Demand Register (UTODR) */
680#define UCC_SLOW_TOD 0x8000 682#define UCC_SLOW_TOD 0x8000
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index 0eb6d7f62241..51fcae41f08a 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -14,6 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/fsl_devices.h> 15#include <linux/fsl_devices.h>
16#include <linux/mdio-bitbang.h> 16#include <linux/mdio-bitbang.h>
17#include <linux/of_mdio.h>
17#include <linux/of_platform.h> 18#include <linux/of_platform.h>
18 19
19#include <asm/io.h> 20#include <asm/io.h>
@@ -115,7 +116,7 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
115 struct mii_bus *bus; 116 struct mii_bus *bus;
116 struct resource res; 117 struct resource res;
117 struct device_node *node; 118 struct device_node *node;
118 int ret, i; 119 int ret;
119 120
120 node = of_get_parent(ofdev->node); 121 node = of_get_parent(ofdev->node);
121 of_node_put(node); 122 of_node_put(node);
@@ -130,17 +131,13 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
130 if (!bus) 131 if (!bus)
131 return -ENOMEM; 132 return -ENOMEM;
132 133
133 bus->phy_mask = 0;
134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); 134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
135 135
136 for (i = 0; i < PHY_MAX_ADDR; i++)
137 bus->irq[i] = -1;
138
139 bus->name = "ep8248e-mdio-bitbang"; 136 bus->name = "ep8248e-mdio-bitbang";
140 bus->parent = &ofdev->dev; 137 bus->parent = &ofdev->dev;
141 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); 138 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
142 139
143 return mdiobus_register(bus); 140 return of_mdiobus_register(bus, ofdev->node);
144} 141}
145 142
146static int ep8248e_mdio_remove(struct of_device *ofdev) 143static int ep8248e_mdio_remove(struct of_device *ofdev)
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index 75cc165d5bee..3bf546797cbb 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -29,7 +29,7 @@
29#include <linux/ioport.h> 29#include <linux/ioport.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/phy.h> 31#include <linux/phy.h>
32#include <linux/platform_device.h> 32#include <linux/of_mdio.h>
33#include <linux/of_platform.h> 33#include <linux/of_platform.h>
34 34
35#define DELAY 1 35#define DELAY 1
@@ -39,6 +39,7 @@ static void __iomem *gpio_regs;
39struct gpio_priv { 39struct gpio_priv {
40 int mdc_pin; 40 int mdc_pin;
41 int mdio_pin; 41 int mdio_pin;
42 int mdio_irqs[PHY_MAX_ADDR];
42}; 43};
43 44
44#define MDC_PIN(bus) (((struct gpio_priv *)bus->priv)->mdc_pin) 45#define MDC_PIN(bus) (((struct gpio_priv *)bus->priv)->mdc_pin)
@@ -218,12 +219,11 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
218 const struct of_device_id *match) 219 const struct of_device_id *match)
219{ 220{
220 struct device *dev = &ofdev->dev; 221 struct device *dev = &ofdev->dev;
221 struct device_node *phy_dn, *np = ofdev->node; 222 struct device_node *np = ofdev->node;
222 struct mii_bus *new_bus; 223 struct mii_bus *new_bus;
223 struct gpio_priv *priv; 224 struct gpio_priv *priv;
224 const unsigned int *prop; 225 const unsigned int *prop;
225 int err; 226 int err;
226 int i;
227 227
228 err = -ENOMEM; 228 err = -ENOMEM;
229 priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL); 229 priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
@@ -244,27 +244,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
244 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", *prop); 244 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", *prop);
245 new_bus->priv = priv; 245 new_bus->priv = priv;
246 246
247 new_bus->phy_mask = 0; 247 new_bus->irq = priv->mdio_irqs;
248
249 new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
250
251 if (!new_bus->irq)
252 goto out_free_bus;
253
254 for (i = 0; i < PHY_MAX_ADDR; i++)
255 new_bus->irq[i] = NO_IRQ;
256
257 for (phy_dn = of_get_next_child(np, NULL);
258 phy_dn != NULL;
259 phy_dn = of_get_next_child(np, phy_dn)) {
260 const unsigned int *ip, *regp;
261
262 ip = of_get_property(phy_dn, "interrupts", NULL);
263 regp = of_get_property(phy_dn, "reg", NULL);
264 if (!ip || !regp || *regp >= PHY_MAX_ADDR)
265 continue;
266 new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
267 }
268 248
269 prop = of_get_property(np, "mdc-pin", NULL); 249 prop = of_get_property(np, "mdc-pin", NULL);
270 priv->mdc_pin = *prop; 250 priv->mdc_pin = *prop;
@@ -275,7 +255,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
275 new_bus->parent = dev; 255 new_bus->parent = dev;
276 dev_set_drvdata(dev, new_bus); 256 dev_set_drvdata(dev, new_bus);
277 257
278 err = mdiobus_register(new_bus); 258 err = of_mdiobus_register(new_bus, np);
279 259
280 if (err != 0) { 260 if (err != 0) {
281 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n", 261 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
@@ -286,8 +266,6 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
286 return 0; 266 return 0;
287 267
288out_free_irq: 268out_free_irq:
289 kfree(new_bus->irq);
290out_free_bus:
291 kfree(new_bus); 269 kfree(new_bus);
292out_free_priv: 270out_free_priv:
293 kfree(priv); 271 kfree(priv);