diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/sata_mv.c | 31 | ||||
-rw-r--r-- | drivers/i2c/busses/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/orion_nand.c | 2 | ||||
-rw-r--r-- | drivers/net/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/arm/at91_ether.c | 4 | ||||
-rw-r--r-- | drivers/pci/setup-bus.c | 5 | ||||
-rw-r--r-- | drivers/serial/imx.c | 111 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 37 |
10 files changed, 126 insertions, 72 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 6ebebde8454a..83584b6e1ba5 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -74,6 +74,7 @@ | |||
74 | #include <linux/device.h> | 74 | #include <linux/device.h> |
75 | #include <linux/platform_device.h> | 75 | #include <linux/platform_device.h> |
76 | #include <linux/ata_platform.h> | 76 | #include <linux/ata_platform.h> |
77 | #include <linux/mbus.h> | ||
77 | #include <scsi/scsi_host.h> | 78 | #include <scsi/scsi_host.h> |
78 | #include <scsi/scsi_cmnd.h> | 79 | #include <scsi/scsi_cmnd.h> |
79 | #include <scsi/scsi_device.h> | 80 | #include <scsi/scsi_device.h> |
@@ -352,6 +353,9 @@ enum { | |||
352 | #define IS_GEN_IIE(hpriv) ((hpriv)->hp_flags & MV_HP_GEN_IIE) | 353 | #define IS_GEN_IIE(hpriv) ((hpriv)->hp_flags & MV_HP_GEN_IIE) |
353 | #define HAS_PCI(host) (!((host)->ports[0]->flags & MV_FLAG_SOC)) | 354 | #define HAS_PCI(host) (!((host)->ports[0]->flags & MV_FLAG_SOC)) |
354 | 355 | ||
356 | #define WINDOW_CTRL(i) (0x20030 + ((i) << 4)) | ||
357 | #define WINDOW_BASE(i) (0x20034 + ((i) << 4)) | ||
358 | |||
355 | enum { | 359 | enum { |
356 | /* DMA boundary 0xffff is required by the s/g splitting | 360 | /* DMA boundary 0xffff is required by the s/g splitting |
357 | * we need on /length/ in mv_fill-sg(). | 361 | * we need on /length/ in mv_fill-sg(). |
@@ -2897,6 +2901,27 @@ static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev) | |||
2897 | return 0; | 2901 | return 0; |
2898 | } | 2902 | } |
2899 | 2903 | ||
2904 | static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, | ||
2905 | struct mbus_dram_target_info *dram) | ||
2906 | { | ||
2907 | int i; | ||
2908 | |||
2909 | for (i = 0; i < 4; i++) { | ||
2910 | writel(0, hpriv->base + WINDOW_CTRL(i)); | ||
2911 | writel(0, hpriv->base + WINDOW_BASE(i)); | ||
2912 | } | ||
2913 | |||
2914 | for (i = 0; i < dram->num_cs; i++) { | ||
2915 | struct mbus_dram_window *cs = dram->cs + i; | ||
2916 | |||
2917 | writel(((cs->size - 1) & 0xffff0000) | | ||
2918 | (cs->mbus_attr << 8) | | ||
2919 | (dram->mbus_dram_target_id << 4) | 1, | ||
2920 | hpriv->base + WINDOW_CTRL(i)); | ||
2921 | writel(cs->base, hpriv->base + WINDOW_BASE(i)); | ||
2922 | } | ||
2923 | } | ||
2924 | |||
2900 | /** | 2925 | /** |
2901 | * mv_platform_probe - handle a positive probe of an soc Marvell | 2926 | * mv_platform_probe - handle a positive probe of an soc Marvell |
2902 | * host | 2927 | * host |
@@ -2951,6 +2976,12 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
2951 | res->end - res->start + 1); | 2976 | res->end - res->start + 1); |
2952 | hpriv->base -= MV_SATAHC0_REG_BASE; | 2977 | hpriv->base -= MV_SATAHC0_REG_BASE; |
2953 | 2978 | ||
2979 | /* | ||
2980 | * (Re-)program MBUS remapping windows if we are asked to. | ||
2981 | */ | ||
2982 | if (mv_platform_data->dram != NULL) | ||
2983 | mv_conf_mbus_windows(hpriv, mv_platform_data->dram); | ||
2984 | |||
2954 | rc = mv_create_dma_pools(hpriv, &pdev->dev); | 2985 | rc = mv_create_dma_pools(hpriv, &pdev->dev); |
2955 | if (rc) | 2986 | if (rc) |
2956 | return rc; | 2987 | return rc; |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 5fa9c3c67e0c..b04c99580d0d 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -645,7 +645,7 @@ config I2C_PCA_ISA | |||
645 | 645 | ||
646 | config I2C_MV64XXX | 646 | config I2C_MV64XXX |
647 | tristate "Marvell mv64xxx I2C Controller" | 647 | tristate "Marvell mv64xxx I2C Controller" |
648 | depends on (MV64X60 || ARCH_ORION) && EXPERIMENTAL | 648 | depends on (MV64X60 || PLAT_ORION) && EXPERIMENTAL |
649 | help | 649 | help |
650 | If you say yes to this option, support will be included for the | 650 | If you say yes to this option, support will be included for the |
651 | built-in I2C interface on the Marvell 64xxx line of host bridges. | 651 | built-in I2C interface on the Marvell 64xxx line of host bridges. |
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 4a3c6759492b..959fb86cda01 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -314,7 +314,7 @@ config MTD_ALAUDA | |||
314 | 314 | ||
315 | config MTD_NAND_ORION | 315 | config MTD_NAND_ORION |
316 | tristate "NAND Flash support for Marvell Orion SoC" | 316 | tristate "NAND Flash support for Marvell Orion SoC" |
317 | depends on ARCH_ORION && MTD_NAND | 317 | depends on PLAT_ORION && MTD_NAND |
318 | help | 318 | help |
319 | This enables the NAND flash controller on Orion machines. | 319 | This enables the NAND flash controller on Orion machines. |
320 | 320 | ||
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 9162cca0182b..ec5ad28b237e 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <linux/mtd/partitions.h> | 18 | #include <linux/mtd/partitions.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | #include <asm/sizes.h> | 20 | #include <asm/sizes.h> |
21 | #include <asm/arch/platform.h> | ||
22 | #include <asm/arch/hardware.h> | 21 | #include <asm/arch/hardware.h> |
22 | #include <asm/plat-orion/orion_nand.h> | ||
23 | 23 | ||
24 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 24 | #ifdef CONFIG_MTD_CMDLINE_PARTS |
25 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 25 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index fe7b5ec09708..124d29f5fa0c 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2415,7 +2415,7 @@ config UGETH_TX_ON_DEMAND | |||
2415 | 2415 | ||
2416 | config MV643XX_ETH | 2416 | config MV643XX_ETH |
2417 | tristate "Marvell Discovery (643XX) and Orion ethernet support" | 2417 | tristate "Marvell Discovery (643XX) and Orion ethernet support" |
2418 | depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || ARCH_ORION | 2418 | depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || PLAT_ORION |
2419 | select MII | 2419 | select MII |
2420 | help | 2420 | help |
2421 | This driver supports the gigabit ethernet MACs in the | 2421 | This driver supports the gigabit ethernet MACs in the |
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 0ae0d83e5d22..978e20a1791b 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -1043,7 +1043,9 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1043 | } else if (machine_is_csb337()) { | 1043 | } else if (machine_is_csb337()) { |
1044 | /* mix link activity status into LED2 link state */ | 1044 | /* mix link activity status into LED2 link state */ |
1045 | write_phy(phy_address, MII_LEDCTRL_REG, 0x0d22); | 1045 | write_phy(phy_address, MII_LEDCTRL_REG, 0x0d22); |
1046 | } | 1046 | } else if (machine_is_ecbat91()) |
1047 | write_phy(phy_address, MII_LEDCTRL_REG, 0x156A); | ||
1048 | |||
1047 | disable_mdi(); | 1049 | disable_mdi(); |
1048 | spin_unlock_irq(&lp->lock); | 1050 | spin_unlock_irq(&lp->lock); |
1049 | 1051 | ||
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 125e7b7f34ff..f7cb8e0758b4 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -486,12 +486,7 @@ void __ref pci_bus_size_bridges(struct pci_bus *bus) | |||
486 | break; | 486 | break; |
487 | 487 | ||
488 | case PCI_CLASS_BRIDGE_PCI: | 488 | case PCI_CLASS_BRIDGE_PCI: |
489 | /* don't size subtractive decoding (transparent) | ||
490 | * PCI-to-PCI bridges */ | ||
491 | if (bus->self->transparent) | ||
492 | break; | ||
493 | pci_bridge_check_ranges(bus); | 489 | pci_bridge_check_ranges(bus); |
494 | /* fall through */ | ||
495 | default: | 490 | default: |
496 | pbus_size_io(bus); | 491 | pbus_size_io(bus); |
497 | /* If the bridge supports prefetchable range, size it | 492 | /* If the bridge supports prefetchable range, size it |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 56af1f566a4c..cf29a2d0ba4c 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -166,15 +166,6 @@ | |||
166 | #define SERIAL_IMX_MAJOR 204 | 166 | #define SERIAL_IMX_MAJOR 204 |
167 | #define MINOR_START 41 | 167 | #define MINOR_START 41 |
168 | 168 | ||
169 | #define NR_PORTS 2 | ||
170 | |||
171 | #define IMX_ISR_PASS_LIMIT 256 | ||
172 | |||
173 | /* | ||
174 | * This is the size of our serial port register set. | ||
175 | */ | ||
176 | #define UART_PORT_SIZE 0x100 | ||
177 | |||
178 | /* | 169 | /* |
179 | * This determines how often we check the modem status signals | 170 | * This determines how often we check the modem status signals |
180 | * for any change. They generally aren't connected to an IRQ | 171 | * for any change. They generally aren't connected to an IRQ |
@@ -358,66 +349,60 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) | |||
358 | struct tty_struct *tty = sport->port.info->tty; | 349 | struct tty_struct *tty = sport->port.info->tty; |
359 | unsigned long flags, temp; | 350 | unsigned long flags, temp; |
360 | 351 | ||
361 | rx = readl(sport->port.membase + URXD0); | ||
362 | spin_lock_irqsave(&sport->port.lock,flags); | 352 | spin_lock_irqsave(&sport->port.lock,flags); |
363 | 353 | ||
364 | do { | 354 | while (readl(sport->port.membase + USR2) & USR2_RDR) { |
365 | flg = TTY_NORMAL; | 355 | flg = TTY_NORMAL; |
366 | sport->port.icount.rx++; | 356 | sport->port.icount.rx++; |
367 | 357 | ||
358 | rx = readl(sport->port.membase + URXD0); | ||
359 | |||
368 | temp = readl(sport->port.membase + USR2); | 360 | temp = readl(sport->port.membase + USR2); |
369 | if( temp & USR2_BRCD ) { | 361 | if (temp & USR2_BRCD) { |
370 | writel(temp | USR2_BRCD, sport->port.membase + USR2); | 362 | writel(temp | USR2_BRCD, sport->port.membase + USR2); |
371 | if(uart_handle_break(&sport->port)) | 363 | if (uart_handle_break(&sport->port)) |
372 | goto ignore_char; | 364 | continue; |
373 | } | 365 | } |
374 | 366 | ||
375 | if (uart_handle_sysrq_char | 367 | if (uart_handle_sysrq_char |
376 | (&sport->port, (unsigned char)rx)) | 368 | (&sport->port, (unsigned char)rx)) |
377 | goto ignore_char; | 369 | continue; |
370 | |||
371 | if (rx & (URXD_PRERR | URXD_OVRRUN | URXD_FRMERR) ) { | ||
372 | if (rx & URXD_PRERR) | ||
373 | sport->port.icount.parity++; | ||
374 | else if (rx & URXD_FRMERR) | ||
375 | sport->port.icount.frame++; | ||
376 | if (rx & URXD_OVRRUN) | ||
377 | sport->port.icount.overrun++; | ||
378 | |||
379 | if (rx & sport->port.ignore_status_mask) { | ||
380 | if (++ignored > 100) | ||
381 | goto out; | ||
382 | continue; | ||
383 | } | ||
384 | |||
385 | rx &= sport->port.read_status_mask; | ||
386 | |||
387 | if (rx & URXD_PRERR) | ||
388 | flg = TTY_PARITY; | ||
389 | else if (rx & URXD_FRMERR) | ||
390 | flg = TTY_FRAME; | ||
391 | if (rx & URXD_OVRRUN) | ||
392 | flg = TTY_OVERRUN; | ||
378 | 393 | ||
379 | if( rx & (URXD_PRERR | URXD_OVRRUN | URXD_FRMERR) ) | 394 | #ifdef SUPPORT_SYSRQ |
380 | goto handle_error; | 395 | sport->port.sysrq = 0; |
396 | #endif | ||
397 | } | ||
381 | 398 | ||
382 | error_return: | ||
383 | tty_insert_flip_char(tty, rx, flg); | 399 | tty_insert_flip_char(tty, rx, flg); |
384 | 400 | } | |
385 | ignore_char: | ||
386 | rx = readl(sport->port.membase + URXD0); | ||
387 | } while(rx & URXD_CHARRDY); | ||
388 | 401 | ||
389 | out: | 402 | out: |
390 | spin_unlock_irqrestore(&sport->port.lock,flags); | 403 | spin_unlock_irqrestore(&sport->port.lock,flags); |
391 | tty_flip_buffer_push(tty); | 404 | tty_flip_buffer_push(tty); |
392 | return IRQ_HANDLED; | 405 | return IRQ_HANDLED; |
393 | |||
394 | handle_error: | ||
395 | if (rx & URXD_PRERR) | ||
396 | sport->port.icount.parity++; | ||
397 | else if (rx & URXD_FRMERR) | ||
398 | sport->port.icount.frame++; | ||
399 | if (rx & URXD_OVRRUN) | ||
400 | sport->port.icount.overrun++; | ||
401 | |||
402 | if (rx & sport->port.ignore_status_mask) { | ||
403 | if (++ignored > 100) | ||
404 | goto out; | ||
405 | goto ignore_char; | ||
406 | } | ||
407 | |||
408 | rx &= sport->port.read_status_mask; | ||
409 | |||
410 | if (rx & URXD_PRERR) | ||
411 | flg = TTY_PARITY; | ||
412 | else if (rx & URXD_FRMERR) | ||
413 | flg = TTY_FRAME; | ||
414 | if (rx & URXD_OVRRUN) | ||
415 | flg = TTY_OVERRUN; | ||
416 | |||
417 | #ifdef SUPPORT_SYSRQ | ||
418 | sport->port.sysrq = 0; | ||
419 | #endif | ||
420 | goto error_return; | ||
421 | } | 406 | } |
422 | 407 | ||
423 | /* | 408 | /* |
@@ -546,7 +531,7 @@ static int imx_startup(struct uart_port *port) | |||
546 | writel(USR1_RTSD, sport->port.membase + USR1); | 531 | writel(USR1_RTSD, sport->port.membase + USR1); |
547 | 532 | ||
548 | temp = readl(sport->port.membase + UCR1); | 533 | temp = readl(sport->port.membase + UCR1); |
549 | temp |= (UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN); | 534 | temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN; |
550 | writel(temp, sport->port.membase + UCR1); | 535 | writel(temp, sport->port.membase + UCR1); |
551 | 536 | ||
552 | temp = readl(sport->port.membase + UCR2); | 537 | temp = readl(sport->port.membase + UCR2); |
@@ -731,9 +716,11 @@ static const char *imx_type(struct uart_port *port) | |||
731 | */ | 716 | */ |
732 | static void imx_release_port(struct uart_port *port) | 717 | static void imx_release_port(struct uart_port *port) |
733 | { | 718 | { |
734 | struct imx_port *sport = (struct imx_port *)port; | 719 | struct platform_device *pdev = to_platform_device(port->dev); |
720 | struct resource *mmres; | ||
735 | 721 | ||
736 | release_mem_region(sport->port.mapbase, UART_PORT_SIZE); | 722 | mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
723 | release_mem_region(mmres->start, mmres->end - mmres->start + 1); | ||
737 | } | 724 | } |
738 | 725 | ||
739 | /* | 726 | /* |
@@ -741,10 +728,18 @@ static void imx_release_port(struct uart_port *port) | |||
741 | */ | 728 | */ |
742 | static int imx_request_port(struct uart_port *port) | 729 | static int imx_request_port(struct uart_port *port) |
743 | { | 730 | { |
744 | struct imx_port *sport = (struct imx_port *)port; | 731 | struct platform_device *pdev = to_platform_device(port->dev); |
732 | struct resource *mmres; | ||
733 | void *ret; | ||
734 | |||
735 | mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
736 | if (!mmres) | ||
737 | return -ENODEV; | ||
738 | |||
739 | ret = request_mem_region(mmres->start, mmres->end - mmres->start + 1, | ||
740 | "imx-uart"); | ||
745 | 741 | ||
746 | return request_mem_region(sport->port.mapbase, UART_PORT_SIZE, | 742 | return ret ? 0 : -EBUSY; |
747 | "imx-uart") != NULL ? 0 : -EBUSY; | ||
748 | } | 743 | } |
749 | 744 | ||
750 | /* | 745 | /* |
@@ -815,7 +810,7 @@ static struct imx_port imx_ports[] = { | |||
815 | .type = PORT_IMX, | 810 | .type = PORT_IMX, |
816 | .iotype = UPIO_MEM, | 811 | .iotype = UPIO_MEM, |
817 | .membase = (void *)IMX_UART1_BASE, | 812 | .membase = (void *)IMX_UART1_BASE, |
818 | .mapbase = IMX_UART1_BASE, /* FIXME */ | 813 | .mapbase = 0x00206000, |
819 | .irq = UART1_MINT_RX, | 814 | .irq = UART1_MINT_RX, |
820 | .uartclk = 16000000, | 815 | .uartclk = 16000000, |
821 | .fifosize = 32, | 816 | .fifosize = 32, |
@@ -831,7 +826,7 @@ static struct imx_port imx_ports[] = { | |||
831 | .type = PORT_IMX, | 826 | .type = PORT_IMX, |
832 | .iotype = UPIO_MEM, | 827 | .iotype = UPIO_MEM, |
833 | .membase = (void *)IMX_UART2_BASE, | 828 | .membase = (void *)IMX_UART2_BASE, |
834 | .mapbase = IMX_UART2_BASE, /* FIXME */ | 829 | .mapbase = 0x00207000, |
835 | .irq = UART2_MINT_RX, | 830 | .irq = UART2_MINT_RX, |
836 | .uartclk = 16000000, | 831 | .uartclk = 16000000, |
837 | .fifosize = 32, | 832 | .fifosize = 32, |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 46ee7f4c0912..85074cb36f38 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1033,7 +1033,7 @@ MODULE_LICENSE ("GPL"); | |||
1033 | #define OF_PLATFORM_DRIVER ehci_hcd_ppc_of_driver | 1033 | #define OF_PLATFORM_DRIVER ehci_hcd_ppc_of_driver |
1034 | #endif | 1034 | #endif |
1035 | 1035 | ||
1036 | #ifdef CONFIG_ARCH_ORION | 1036 | #ifdef CONFIG_PLAT_ORION |
1037 | #include "ehci-orion.c" | 1037 | #include "ehci-orion.c" |
1038 | #define PLATFORM_DRIVER ehci_orion_driver | 1038 | #define PLATFORM_DRIVER ehci_orion_driver |
1039 | #endif | 1039 | #endif |
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index e129981f139f..d187d0313742 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -11,15 +11,18 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <asm/arch/orion.h> | 14 | #include <linux/mbus.h> |
15 | #include <asm/plat-orion/ehci-orion.h> | ||
15 | 16 | ||
16 | #define rdl(off) __raw_readl(hcd->regs + (off)) | 17 | #define rdl(off) __raw_readl(hcd->regs + (off)) |
17 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) | 18 | #define wrl(off, val) __raw_writel((val), hcd->regs + (off)) |
18 | 19 | ||
19 | #define USB_CAUSE 0x310 | ||
20 | #define USB_MASK 0x314 | ||
21 | #define USB_CMD 0x140 | 20 | #define USB_CMD 0x140 |
22 | #define USB_MODE 0x1a8 | 21 | #define USB_MODE 0x1a8 |
22 | #define USB_CAUSE 0x310 | ||
23 | #define USB_MASK 0x314 | ||
24 | #define USB_WINDOW_CTRL(i) (0x320 + ((i) << 4)) | ||
25 | #define USB_WINDOW_BASE(i) (0x324 + ((i) << 4)) | ||
23 | #define USB_IPG 0x360 | 26 | #define USB_IPG 0x360 |
24 | #define USB_PHY_PWR_CTRL 0x400 | 27 | #define USB_PHY_PWR_CTRL 0x400 |
25 | #define USB_PHY_TX_CTRL 0x420 | 28 | #define USB_PHY_TX_CTRL 0x420 |
@@ -162,8 +165,30 @@ static const struct hc_driver ehci_orion_hc_driver = { | |||
162 | .bus_resume = ehci_bus_resume, | 165 | .bus_resume = ehci_bus_resume, |
163 | }; | 166 | }; |
164 | 167 | ||
168 | static void __init | ||
169 | ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, | ||
170 | struct mbus_dram_target_info *dram) | ||
171 | { | ||
172 | int i; | ||
173 | |||
174 | for (i = 0; i < 4; i++) { | ||
175 | wrl(USB_WINDOW_CTRL(i), 0); | ||
176 | wrl(USB_WINDOW_BASE(i), 0); | ||
177 | } | ||
178 | |||
179 | for (i = 0; i < dram->num_cs; i++) { | ||
180 | struct mbus_dram_window *cs = dram->cs + i; | ||
181 | |||
182 | wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) | | ||
183 | (cs->mbus_attr << 8) | | ||
184 | (dram->mbus_dram_target_id << 4) | 1); | ||
185 | wrl(USB_WINDOW_BASE(i), cs->base); | ||
186 | } | ||
187 | } | ||
188 | |||
165 | static int __init ehci_orion_drv_probe(struct platform_device *pdev) | 189 | static int __init ehci_orion_drv_probe(struct platform_device *pdev) |
166 | { | 190 | { |
191 | struct orion_ehci_data *pd = pdev->dev.platform_data; | ||
167 | struct resource *res; | 192 | struct resource *res; |
168 | struct usb_hcd *hcd; | 193 | struct usb_hcd *hcd; |
169 | struct ehci_hcd *ehci; | 194 | struct ehci_hcd *ehci; |
@@ -227,6 +252,12 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev) | |||
227 | ehci->sbrn = 0x20; | 252 | ehci->sbrn = 0x20; |
228 | 253 | ||
229 | /* | 254 | /* |
255 | * (Re-)program MBUS remapping windows if we are asked to. | ||
256 | */ | ||
257 | if (pd != NULL && pd->dram != NULL) | ||
258 | ehci_orion_conf_mbus_windows(hcd, pd->dram); | ||
259 | |||
260 | /* | ||
230 | * setup Orion USB controller | 261 | * setup Orion USB controller |
231 | */ | 262 | */ |
232 | orion_usb_setup(hcd); | 263 | orion_usb_setup(hcd); |