aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-01-30 18:50:17 -0500
committerPaul Mackerras <paulus@samba.org>2008-01-30 18:50:17 -0500
commit4eece4ccf997c0e6d8fdad3d842e37b16b8d705f (patch)
treeb8ddfaa3401a6af36ab06829b1b0c31e0ff2fb38 /drivers
parentcda13dd164f91df79ba797ab84848352b03de115 (diff)
parent4fb4c5582475452d3bf7c5072ef2d15ee06f7723 (diff)
Merge branch 'for-2.6.25' of git://git.secretlab.ca/git/linux-2.6-mpc52xx
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_mpc52xx.c6
-rw-r--r--drivers/net/fec_mpc52xx.c6
-rw-r--r--drivers/net/fec_mpc52xx_phy.c8
-rw-r--r--drivers/serial/mpc52xx_uart.c4
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c82
-rw-r--r--drivers/usb/host/ohci-ppc-of.c2
6 files changed, 17 insertions, 91 deletions
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 50c56e2814c1..1a7ca37168b2 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -494,10 +494,8 @@ mpc52xx_ata_resume(struct of_device *op)
494 494
495 495
496static struct of_device_id mpc52xx_ata_of_match[] = { 496static struct of_device_id mpc52xx_ata_of_match[] = {
497 { 497 { .compatible = "fsl,mpc5200-ata", },
498 .type = "ata", 498 { .compatible = "mpc5200-ata", },
499 .compatible = "mpc5200-ata",
500 },
501 {}, 499 {},
502}; 500};
503 501
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index f91ee700e605..58b71e60204e 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -1057,10 +1057,8 @@ static int mpc52xx_fec_of_resume(struct of_device *op)
1057#endif 1057#endif
1058 1058
1059static struct of_device_id mpc52xx_fec_match[] = { 1059static struct of_device_id mpc52xx_fec_match[] = {
1060 { 1060 { .type = "network", .compatible = "fsl,mpc5200-fec", },
1061 .type = "network", 1061 { .type = "network", .compatible = "mpc5200-fec", },
1062 .compatible = "mpc5200-fec",
1063 },
1064 { } 1062 { }
1065}; 1063};
1066 1064
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c
index ba6e8b218e0a..1837584c4504 100644
--- a/drivers/net/fec_mpc52xx_phy.c
+++ b/drivers/net/fec_mpc52xx_phy.c
@@ -177,11 +177,9 @@ static int mpc52xx_fec_mdio_remove(struct of_device *of)
177 177
178 178
179static struct of_device_id mpc52xx_fec_mdio_match[] = { 179static struct of_device_id mpc52xx_fec_mdio_match[] = {
180 { 180 { .compatible = "fsl,mpc5200b-mdio", },
181 .type = "mdio", 181 { .compatible = "mpc5200b-fec-phy", },
182 .compatible = "mpc5200b-fec-phy", 182 {}
183 },
184 {},
185}; 183};
186 184
187struct of_platform_driver mpc52xx_fec_mdio_driver = { 185struct of_platform_driver mpc52xx_fec_mdio_driver = {
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 1e3721a0eef7..3c4d29e59b2c 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -130,7 +130,9 @@ static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
130 130
131#if defined(CONFIG_PPC_MERGE) 131#if defined(CONFIG_PPC_MERGE)
132static struct of_device_id mpc52xx_uart_of_match[] = { 132static struct of_device_id mpc52xx_uart_of_match[] = {
133 { .type = "serial", .compatible = "mpc5200-psc-uart", }, 133 { .type = "serial", .compatible = "fsl,mpc5200-psc-uart", },
134 { .type = "serial", .compatible = "mpc5200-psc-uart", }, /* lite5200 */
135 { .type = "serial", .compatible = "mpc5200-serial", }, /* efika */
134 {}, 136 {},
135}; 137};
136#endif 138#endif
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index d398c93195e6..253ed5682a6d 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -330,80 +330,13 @@ static void mpc52xx_psc_spi_cleanup(struct spi_device *spi)
330 330
331static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps) 331static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
332{ 332{
333 struct device_node *np;
334 struct mpc52xx_cdm __iomem *cdm;
335 struct mpc52xx_gpio __iomem *gpio;
336 struct mpc52xx_psc __iomem *psc = mps->psc; 333 struct mpc52xx_psc __iomem *psc = mps->psc;
337 u32 ul;
338 u32 mclken_div; 334 u32 mclken_div;
339 int ret = 0; 335 int ret = 0;
340 336
341#if defined(CONFIG_PPC_MERGE)
342 np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
343 cdm = of_iomap(np, 0);
344 of_node_put(np);
345 np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
346 gpio = of_iomap(np, 0);
347 of_node_put(np);
348#else
349 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
350 gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
351#endif
352 if (!cdm || !gpio) {
353 printk(KERN_ERR "Error mapping CDM/GPIO\n");
354 ret = -EFAULT;
355 goto unmap_regs;
356 }
357
358 /* default sysclk is 512MHz */ 337 /* default sysclk is 512MHz */
359 mclken_div = 0x8000 | 338 mclken_div = (mps->sysclk ? mps->sysclk : 512000000) / MCLK;
360 (((mps->sysclk ? mps->sysclk : 512000000) / MCLK) & 0x1FF); 339 mpc52xx_set_psc_clkdiv(psc_id, mclken_div);
361
362 switch (psc_id) {
363 case 1:
364 ul = in_be32(&gpio->port_config);
365 ul &= 0xFFFFFFF8;
366 ul |= 0x00000006;
367 out_be32(&gpio->port_config, ul);
368 out_be16(&cdm->mclken_div_psc1, mclken_div);
369 ul = in_be32(&cdm->clk_enables);
370 ul |= 0x00000020;
371 out_be32(&cdm->clk_enables, ul);
372 break;
373 case 2:
374 ul = in_be32(&gpio->port_config);
375 ul &= 0xFFFFFF8F;
376 ul |= 0x00000060;
377 out_be32(&gpio->port_config, ul);
378 out_be16(&cdm->mclken_div_psc2, mclken_div);
379 ul = in_be32(&cdm->clk_enables);
380 ul |= 0x00000040;
381 out_be32(&cdm->clk_enables, ul);
382 break;
383 case 3:
384 ul = in_be32(&gpio->port_config);
385 ul &= 0xFFFFF0FF;
386 ul |= 0x00000600;
387 out_be32(&gpio->port_config, ul);
388 out_be16(&cdm->mclken_div_psc3, mclken_div);
389 ul = in_be32(&cdm->clk_enables);
390 ul |= 0x00000080;
391 out_be32(&cdm->clk_enables, ul);
392 break;
393 case 6:
394 ul = in_be32(&gpio->port_config);
395 ul &= 0xFF8FFFFF;
396 ul |= 0x00700000;
397 out_be32(&gpio->port_config, ul);
398 out_be16(&cdm->mclken_div_psc6, mclken_div);
399 ul = in_be32(&cdm->clk_enables);
400 ul |= 0x00000010;
401 out_be32(&cdm->clk_enables, ul);
402 break;
403 default:
404 ret = -EINVAL;
405 goto unmap_regs;
406 }
407 340
408 /* Reset the PSC into a known state */ 341 /* Reset the PSC into a known state */
409 out_8(&psc->command, MPC52xx_PSC_RST_RX); 342 out_8(&psc->command, MPC52xx_PSC_RST_RX);
@@ -427,12 +360,6 @@ static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
427 360
428 mps->bits_per_word = 8; 361 mps->bits_per_word = 8;
429 362
430unmap_regs:
431 if (cdm)
432 iounmap(cdm);
433 if (gpio)
434 iounmap(gpio);
435
436 return ret; 363 return ret;
437} 364}
438 365
@@ -628,8 +555,9 @@ static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op)
628} 555}
629 556
630static struct of_device_id mpc52xx_psc_spi_of_match[] = { 557static struct of_device_id mpc52xx_psc_spi_of_match[] = {
631 { .type = "spi", .compatible = "mpc5200-psc-spi", }, 558 { .compatible = "fsl,mpc5200-psc-spi", },
632 {}, 559 { .compatible = "mpc5200-psc-spi", }, /* old */
560 {}
633}; 561};
634 562
635MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); 563MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c
index 0c3e6b790b7b..a67252791223 100644
--- a/drivers/usb/host/ohci-ppc-of.c
+++ b/drivers/usb/host/ohci-ppc-of.c
@@ -136,6 +136,8 @@ ohci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
136 ohci = hcd_to_ohci(hcd); 136 ohci = hcd_to_ohci(hcd);
137 if (is_bigendian) { 137 if (is_bigendian) {
138 ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC; 138 ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC;
139 if (of_device_is_compatible(dn, "fsl,mpc5200-ohci"))
140 ohci->flags |= OHCI_QUIRK_FRAME_NO;
139 if (of_device_is_compatible(dn, "mpc5200-ohci")) 141 if (of_device_is_compatible(dn, "mpc5200-ohci"))
140 ohci->flags |= OHCI_QUIRK_FRAME_NO; 142 ohci->flags |= OHCI_QUIRK_FRAME_NO;
141 } 143 }