diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 21:22:08 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 21:22:08 -0400 |
commit | b71a107c66ad952c9d35ec046a803efc89a80556 (patch) | |
tree | eb1f77af4f14974ba40a413d7679b3a451295a3d /drivers | |
parent | 4b337c5f245b6587ba844ac7bb13c313a2912f7b (diff) | |
parent | e7c5a4f292e0d1f4ba9a3a94b2c8e8b71e35b25a (diff) |
Merge commit 'gcl/merge' into next
Manual merge of:
drivers/net/fec_mpc52xx.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/pata_mpc52xx.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mpc.c | 2 | ||||
-rw-r--r-- | drivers/net/fec_mpc52xx.c | 2 | ||||
-rw-r--r-- | drivers/net/fec_mpc52xx_phy.c | 2 | ||||
-rw-r--r-- | drivers/serial/mpc52xx_uart.c | 5 | ||||
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 22 | ||||
-rw-r--r-- | drivers/video/xilinxfb.c | 59 | ||||
-rw-r--r-- | drivers/watchdog/mpc5200_wdt.c | 2 |
8 files changed, 39 insertions, 57 deletions
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index 68d27bc70d06..2bc2dbe30e8f 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -694,7 +694,7 @@ mpc52xx_ata_probe(struct of_device *op, const struct of_device_id *match) | |||
694 | struct bcom_task *dmatsk = NULL; | 694 | struct bcom_task *dmatsk = NULL; |
695 | 695 | ||
696 | /* Get ipb frequency */ | 696 | /* Get ipb frequency */ |
697 | ipb_freq = mpc52xx_find_ipb_freq(op->node); | 697 | ipb_freq = mpc5xxx_get_bus_frequency(op->node); |
698 | if (!ipb_freq) { | 698 | if (!ipb_freq) { |
699 | dev_err(&op->dev, "could not determine IPB bus frequency\n"); | 699 | dev_err(&op->dev, "could not determine IPB bus frequency\n"); |
700 | return -ENODEV; | 700 | return -ENODEV; |
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index dd778d7ae047..d325e86e3103 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -197,7 +197,7 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler) | |||
197 | return -EINVAL; | 197 | return -EINVAL; |
198 | 198 | ||
199 | /* Determine divider value */ | 199 | /* Determine divider value */ |
200 | divider = mpc52xx_find_ipb_freq(node) / clock; | 200 | divider = mpc5xxx_get_bus_frequency(node) / clock; |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * We want to choose an FDR/DFSR that generates an I2C bus speed that | 203 | * We want to choose an FDR/DFSR that generates an I2C bus speed that |
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index 7d443405bbe2..cc786333d95c 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -948,7 +948,7 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match) | |||
948 | /* Start with safe defaults for link connection */ | 948 | /* Start with safe defaults for link connection */ |
949 | priv->speed = 100; | 949 | priv->speed = 100; |
950 | priv->duplex = DUPLEX_HALF; | 950 | priv->duplex = DUPLEX_HALF; |
951 | priv->mdio_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1; | 951 | priv->mdio_speed = ((mpc5xxx_get_bus_frequency(op->node) >> 20) / 5) << 1; |
952 | 952 | ||
953 | /* The current speed preconfigures the speed of the MII link */ | 953 | /* The current speed preconfigures the speed of the MII link */ |
954 | prop = of_get_property(op->node, "current-speed", &prop_size); | 954 | prop = of_get_property(op->node, "current-speed", &prop_size); |
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c index fec9f245116b..31e6d62b785d 100644 --- a/drivers/net/fec_mpc52xx_phy.c +++ b/drivers/net/fec_mpc52xx_phy.c | |||
@@ -106,7 +106,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of, | |||
106 | 106 | ||
107 | /* set MII speed */ | 107 | /* set MII speed */ |
108 | out_be32(&priv->regs->mii_speed, | 108 | out_be32(&priv->regs->mii_speed, |
109 | ((mpc52xx_find_ipb_freq(of->node) >> 20) / 5) << 1); | 109 | ((mpc5xxx_get_bus_frequency(of->node) >> 20) / 5) << 1); |
110 | 110 | ||
111 | err = of_mdiobus_register(bus, np); | 111 | err = of_mdiobus_register(bus, np); |
112 | if (err) | 112 | if (err) |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index b3feb6198d57..abbd146c50d9 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -76,7 +76,6 @@ | |||
76 | #include <linux/of_platform.h> | 76 | #include <linux/of_platform.h> |
77 | 77 | ||
78 | #include <asm/mpc52xx.h> | 78 | #include <asm/mpc52xx.h> |
79 | #include <asm/mpc512x.h> | ||
80 | #include <asm/mpc52xx_psc.h> | 79 | #include <asm/mpc52xx_psc.h> |
81 | 80 | ||
82 | #if defined(CONFIG_SERIAL_MPC52xx_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | 81 | #if defined(CONFIG_SERIAL_MPC52xx_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) |
@@ -254,7 +253,7 @@ static unsigned long mpc52xx_getuartclk(void *p) | |||
254 | * but the generic serial code assumes 16 | 253 | * but the generic serial code assumes 16 |
255 | * so return ipb freq / 2 | 254 | * so return ipb freq / 2 |
256 | */ | 255 | */ |
257 | return mpc52xx_find_ipb_freq(p) / 2; | 256 | return mpc5xxx_get_bus_frequency(p) / 2; |
258 | } | 257 | } |
259 | 258 | ||
260 | static struct psc_ops mpc52xx_psc_ops = { | 259 | static struct psc_ops mpc52xx_psc_ops = { |
@@ -391,7 +390,7 @@ static void mpc512x_psc_cw_restore_ints(struct uart_port *port) | |||
391 | 390 | ||
392 | static unsigned long mpc512x_getuartclk(void *p) | 391 | static unsigned long mpc512x_getuartclk(void *p) |
393 | { | 392 | { |
394 | return mpc512x_find_ips_freq(p); | 393 | return mpc5xxx_get_bus_frequency(p); |
395 | } | 394 | } |
396 | 395 | ||
397 | static struct psc_ops mpc512x_psc_ops = { | 396 | static struct psc_ops mpc512x_psc_ops = { |
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 68c77a911595..e1901fdce774 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/types.h> | ||
16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
18 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
@@ -30,8 +31,7 @@ | |||
30 | 31 | ||
31 | struct mpc52xx_psc_spi { | 32 | struct mpc52xx_psc_spi { |
32 | /* fsl_spi_platform data */ | 33 | /* fsl_spi_platform data */ |
33 | void (*activate_cs)(u8, u8); | 34 | void (*cs_control)(struct spi_device *spi, bool on); |
34 | void (*deactivate_cs)(u8, u8); | ||
35 | u32 sysclk; | 35 | u32 sysclk; |
36 | 36 | ||
37 | /* driver internal data */ | 37 | /* driver internal data */ |
@@ -111,18 +111,16 @@ static void mpc52xx_psc_spi_activate_cs(struct spi_device *spi) | |||
111 | out_be16((u16 __iomem *)&psc->ccr, ccr); | 111 | out_be16((u16 __iomem *)&psc->ccr, ccr); |
112 | mps->bits_per_word = cs->bits_per_word; | 112 | mps->bits_per_word = cs->bits_per_word; |
113 | 113 | ||
114 | if (mps->activate_cs) | 114 | if (mps->cs_control) |
115 | mps->activate_cs(spi->chip_select, | 115 | mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0); |
116 | (spi->mode & SPI_CS_HIGH) ? 1 : 0); | ||
117 | } | 116 | } |
118 | 117 | ||
119 | static void mpc52xx_psc_spi_deactivate_cs(struct spi_device *spi) | 118 | static void mpc52xx_psc_spi_deactivate_cs(struct spi_device *spi) |
120 | { | 119 | { |
121 | struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); | 120 | struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); |
122 | 121 | ||
123 | if (mps->deactivate_cs) | 122 | if (mps->cs_control) |
124 | mps->deactivate_cs(spi->chip_select, | 123 | mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1); |
125 | (spi->mode & SPI_CS_HIGH) ? 1 : 0); | ||
126 | } | 124 | } |
127 | 125 | ||
128 | #define MPC52xx_PSC_BUFSIZE (MPC52xx_PSC_RFNUM_MASK + 1) | 126 | #define MPC52xx_PSC_BUFSIZE (MPC52xx_PSC_RFNUM_MASK + 1) |
@@ -388,15 +386,13 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
388 | mps->irq = irq; | 386 | mps->irq = irq; |
389 | if (pdata == NULL) { | 387 | if (pdata == NULL) { |
390 | dev_warn(dev, "probe called without platform data, no " | 388 | dev_warn(dev, "probe called without platform data, no " |
391 | "(de)activate_cs function will be called\n"); | 389 | "cs_control function will be called\n"); |
392 | mps->activate_cs = NULL; | 390 | mps->cs_control = NULL; |
393 | mps->deactivate_cs = NULL; | ||
394 | mps->sysclk = 0; | 391 | mps->sysclk = 0; |
395 | master->bus_num = bus_num; | 392 | master->bus_num = bus_num; |
396 | master->num_chipselect = 255; | 393 | master->num_chipselect = 255; |
397 | } else { | 394 | } else { |
398 | mps->activate_cs = pdata->activate_cs; | 395 | mps->cs_control = pdata->cs_control; |
399 | mps->deactivate_cs = pdata->deactivate_cs; | ||
400 | mps->sysclk = pdata->sysclk; | 396 | mps->sysclk = pdata->sysclk; |
401 | master->bus_num = pdata->bus_num; | 397 | master->bus_num = pdata->bus_num; |
402 | master->num_chipselect = pdata->max_chipselect; | 398 | master->num_chipselect = pdata->max_chipselect; |
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index 7a868bd16e0e..ed7c8d0ddccb 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c | |||
@@ -124,7 +124,6 @@ struct xilinxfb_drvdata { | |||
124 | registers */ | 124 | registers */ |
125 | 125 | ||
126 | dcr_host_t dcr_host; | 126 | dcr_host_t dcr_host; |
127 | unsigned int dcr_start; | ||
128 | unsigned int dcr_len; | 127 | unsigned int dcr_len; |
129 | 128 | ||
130 | void *fb_virt; /* virt. address of the frame buffer */ | 129 | void *fb_virt; /* virt. address of the frame buffer */ |
@@ -325,8 +324,8 @@ static int xilinxfb_assign(struct device *dev, | |||
325 | drvdata->regs); | 324 | drvdata->regs); |
326 | } | 325 | } |
327 | /* Put a banner in the log (for DEBUG) */ | 326 | /* Put a banner in the log (for DEBUG) */ |
328 | dev_dbg(dev, "fb: phys=%p, virt=%p, size=%x\n", | 327 | dev_dbg(dev, "fb: phys=%llx, virt=%p, size=%x\n", |
329 | (void *)drvdata->fb_phys, drvdata->fb_virt, fbsize); | 328 | (unsigned long long)drvdata->fb_phys, drvdata->fb_virt, fbsize); |
330 | 329 | ||
331 | return 0; /* success */ | 330 | return 0; /* success */ |
332 | 331 | ||
@@ -404,9 +403,7 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match) | |||
404 | u32 tft_access; | 403 | u32 tft_access; |
405 | struct xilinxfb_platform_data pdata; | 404 | struct xilinxfb_platform_data pdata; |
406 | struct resource res; | 405 | struct resource res; |
407 | int size, rc; | 406 | int size, rc, start; |
408 | int start = 0, len = 0; | ||
409 | dcr_host_t dcr_host; | ||
410 | struct xilinxfb_drvdata *drvdata; | 407 | struct xilinxfb_drvdata *drvdata; |
411 | 408 | ||
412 | /* Copy with the default pdata (not a ptr reference!) */ | 409 | /* Copy with the default pdata (not a ptr reference!) */ |
@@ -414,35 +411,39 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match) | |||
414 | 411 | ||
415 | dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match); | 412 | dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match); |
416 | 413 | ||
414 | /* Allocate the driver data region */ | ||
415 | drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); | ||
416 | if (!drvdata) { | ||
417 | dev_err(&op->dev, "Couldn't allocate device private record\n"); | ||
418 | return -ENOMEM; | ||
419 | } | ||
420 | |||
417 | /* | 421 | /* |
418 | * To check whether the core is connected directly to DCR or PLB | 422 | * To check whether the core is connected directly to DCR or PLB |
419 | * interface and initialize the tft_access accordingly. | 423 | * interface and initialize the tft_access accordingly. |
420 | */ | 424 | */ |
421 | p = (u32 *)of_get_property(op->node, "xlnx,dcr-splb-slave-if", NULL); | 425 | p = (u32 *)of_get_property(op->node, "xlnx,dcr-splb-slave-if", NULL); |
422 | 426 | tft_access = p ? *p : 0; | |
423 | if (p) | ||
424 | tft_access = *p; | ||
425 | else | ||
426 | tft_access = 0; /* For backward compatibility */ | ||
427 | 427 | ||
428 | /* | 428 | /* |
429 | * Fill the resource structure if its direct PLB interface | 429 | * Fill the resource structure if its direct PLB interface |
430 | * otherwise fill the dcr_host structure. | 430 | * otherwise fill the dcr_host structure. |
431 | */ | 431 | */ |
432 | if (tft_access) { | 432 | if (tft_access) { |
433 | drvdata->flags |= PLB_ACCESS_FLAG; | ||
433 | rc = of_address_to_resource(op->node, 0, &res); | 434 | rc = of_address_to_resource(op->node, 0, &res); |
434 | if (rc) { | 435 | if (rc) { |
435 | dev_err(&op->dev, "invalid address\n"); | 436 | dev_err(&op->dev, "invalid address\n"); |
436 | return -ENODEV; | 437 | goto err; |
437 | } | 438 | } |
438 | |||
439 | } else { | 439 | } else { |
440 | res.start = 0; | ||
440 | start = dcr_resource_start(op->node, 0); | 441 | start = dcr_resource_start(op->node, 0); |
441 | len = dcr_resource_len(op->node, 0); | 442 | drvdata->dcr_len = dcr_resource_len(op->node, 0); |
442 | dcr_host = dcr_map(op->node, start, len); | 443 | drvdata->dcr_host = dcr_map(op->node, start, drvdata->dcr_len); |
443 | if (!DCR_MAP_OK(dcr_host)) { | 444 | if (!DCR_MAP_OK(drvdata->dcr_host)) { |
444 | dev_err(&op->dev, "invalid address\n"); | 445 | dev_err(&op->dev, "invalid DCR address\n"); |
445 | return -ENODEV; | 446 | goto err; |
446 | } | 447 | } |
447 | } | 448 | } |
448 | 449 | ||
@@ -467,26 +468,12 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match) | |||
467 | if (of_find_property(op->node, "rotate-display", NULL)) | 468 | if (of_find_property(op->node, "rotate-display", NULL)) |
468 | pdata.rotate_screen = 1; | 469 | pdata.rotate_screen = 1; |
469 | 470 | ||
470 | /* Allocate the driver data region */ | ||
471 | drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); | ||
472 | if (!drvdata) { | ||
473 | dev_err(&op->dev, "Couldn't allocate device private record\n"); | ||
474 | return -ENOMEM; | ||
475 | } | ||
476 | dev_set_drvdata(&op->dev, drvdata); | 471 | dev_set_drvdata(&op->dev, drvdata); |
472 | return xilinxfb_assign(&op->dev, drvdata, res.start, &pdata); | ||
477 | 473 | ||
478 | if (tft_access) | 474 | err: |
479 | drvdata->flags |= PLB_ACCESS_FLAG; | 475 | kfree(drvdata); |
480 | 476 | return -ENODEV; | |
481 | /* Arguments are passed based on the interface */ | ||
482 | if (drvdata->flags & PLB_ACCESS_FLAG) { | ||
483 | return xilinxfb_assign(&op->dev, drvdata, res.start, &pdata); | ||
484 | } else { | ||
485 | drvdata->dcr_start = start; | ||
486 | drvdata->dcr_len = len; | ||
487 | drvdata->dcr_host = dcr_host; | ||
488 | return xilinxfb_assign(&op->dev, drvdata, 0, &pdata); | ||
489 | } | ||
490 | } | 477 | } |
491 | 478 | ||
492 | static int __devexit xilinxfb_of_remove(struct of_device *op) | 479 | static int __devexit xilinxfb_of_remove(struct of_device *op) |
diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wdt.c index 465fe36adad4..fa9c47ce0ae7 100644 --- a/drivers/watchdog/mpc5200_wdt.c +++ b/drivers/watchdog/mpc5200_wdt.c | |||
@@ -188,7 +188,7 @@ static int mpc5200_wdt_probe(struct of_device *op, | |||
188 | if (!wdt) | 188 | if (!wdt) |
189 | return -ENOMEM; | 189 | return -ENOMEM; |
190 | 190 | ||
191 | wdt->ipb_freq = mpc52xx_find_ipb_freq(op->node); | 191 | wdt->ipb_freq = mpc5xxx_get_bus_frequency(op->node); |
192 | 192 | ||
193 | err = of_address_to_resource(op->node, 0, &wdt->mem); | 193 | err = of_address_to_resource(op->node, 0, &wdt->mem); |
194 | if (err) | 194 | if (err) |