diff options
Diffstat (limited to 'arch')
52 files changed, 832 insertions, 55 deletions
diff --git a/arch/arm/configs/afeb9260_defconfig b/arch/arm/configs/afeb9260_defconfig index c285a9d777d9..a8dbc1e05253 100644 --- a/arch/arm/configs/afeb9260_defconfig +++ b/arch/arm/configs/afeb9260_defconfig | |||
@@ -79,7 +79,7 @@ CONFIG_USB_STORAGE=y | |||
79 | CONFIG_USB_GADGET=y | 79 | CONFIG_USB_GADGET=y |
80 | CONFIG_USB_ZERO=m | 80 | CONFIG_USB_ZERO=m |
81 | CONFIG_USB_GADGETFS=m | 81 | CONFIG_USB_GADGETFS=m |
82 | CONFIG_USB_FILE_STORAGE=m | 82 | CONFIG_USB_MASS_STORAGE=m |
83 | CONFIG_USB_G_SERIAL=m | 83 | CONFIG_USB_G_SERIAL=m |
84 | CONFIG_RTC_CLASS=y | 84 | CONFIG_RTC_CLASS=y |
85 | CONFIG_RTC_DEBUG=y | 85 | CONFIG_RTC_DEBUG=y |
diff --git a/arch/arm/configs/at91sam9260_defconfig b/arch/arm/configs/at91sam9260_defconfig index 505b3765f87e..0ea5d2c97fc4 100644 --- a/arch/arm/configs/at91sam9260_defconfig +++ b/arch/arm/configs/at91sam9260_defconfig | |||
@@ -75,7 +75,7 @@ CONFIG_USB_STORAGE_DEBUG=y | |||
75 | CONFIG_USB_GADGET=y | 75 | CONFIG_USB_GADGET=y |
76 | CONFIG_USB_ZERO=m | 76 | CONFIG_USB_ZERO=m |
77 | CONFIG_USB_GADGETFS=m | 77 | CONFIG_USB_GADGETFS=m |
78 | CONFIG_USB_FILE_STORAGE=m | 78 | CONFIG_USB_MASS_STORAGE=m |
79 | CONFIG_USB_G_SERIAL=m | 79 | CONFIG_USB_G_SERIAL=m |
80 | CONFIG_RTC_CLASS=y | 80 | CONFIG_RTC_CLASS=y |
81 | CONFIG_RTC_DRV_AT91SAM9=y | 81 | CONFIG_RTC_DRV_AT91SAM9=y |
diff --git a/arch/arm/configs/at91sam9261_defconfig b/arch/arm/configs/at91sam9261_defconfig index 1e8712ef062e..c87beb973b37 100644 --- a/arch/arm/configs/at91sam9261_defconfig +++ b/arch/arm/configs/at91sam9261_defconfig | |||
@@ -125,7 +125,7 @@ CONFIG_USB_GADGET=y | |||
125 | CONFIG_USB_ZERO=m | 125 | CONFIG_USB_ZERO=m |
126 | CONFIG_USB_ETH=m | 126 | CONFIG_USB_ETH=m |
127 | CONFIG_USB_GADGETFS=m | 127 | CONFIG_USB_GADGETFS=m |
128 | CONFIG_USB_FILE_STORAGE=m | 128 | CONFIG_USB_MASS_STORAGE=m |
129 | CONFIG_USB_G_SERIAL=m | 129 | CONFIG_USB_G_SERIAL=m |
130 | CONFIG_MMC=y | 130 | CONFIG_MMC=y |
131 | CONFIG_MMC_ATMELMCI=m | 131 | CONFIG_MMC_ATMELMCI=m |
diff --git a/arch/arm/configs/at91sam9263_defconfig b/arch/arm/configs/at91sam9263_defconfig index d2050cada82d..c5212f43eee6 100644 --- a/arch/arm/configs/at91sam9263_defconfig +++ b/arch/arm/configs/at91sam9263_defconfig | |||
@@ -133,7 +133,7 @@ CONFIG_USB_GADGET=y | |||
133 | CONFIG_USB_ZERO=m | 133 | CONFIG_USB_ZERO=m |
134 | CONFIG_USB_ETH=m | 134 | CONFIG_USB_ETH=m |
135 | CONFIG_USB_GADGETFS=m | 135 | CONFIG_USB_GADGETFS=m |
136 | CONFIG_USB_FILE_STORAGE=m | 136 | CONFIG_USB_MASS_STORAGE=m |
137 | CONFIG_USB_G_SERIAL=m | 137 | CONFIG_USB_G_SERIAL=m |
138 | CONFIG_MMC=y | 138 | CONFIG_MMC=y |
139 | CONFIG_SDIO_UART=m | 139 | CONFIG_SDIO_UART=m |
diff --git a/arch/arm/configs/at91sam9g20_defconfig b/arch/arm/configs/at91sam9g20_defconfig index e1b0e80b54a5..3b1881033ad8 100644 --- a/arch/arm/configs/at91sam9g20_defconfig +++ b/arch/arm/configs/at91sam9g20_defconfig | |||
@@ -96,7 +96,7 @@ CONFIG_USB_STORAGE=y | |||
96 | CONFIG_USB_GADGET=y | 96 | CONFIG_USB_GADGET=y |
97 | CONFIG_USB_ZERO=m | 97 | CONFIG_USB_ZERO=m |
98 | CONFIG_USB_GADGETFS=m | 98 | CONFIG_USB_GADGETFS=m |
99 | CONFIG_USB_FILE_STORAGE=m | 99 | CONFIG_USB_MASS_STORAGE=m |
100 | CONFIG_USB_G_SERIAL=m | 100 | CONFIG_USB_G_SERIAL=m |
101 | CONFIG_MMC=y | 101 | CONFIG_MMC=y |
102 | CONFIG_MMC_ATMELMCI=m | 102 | CONFIG_MMC_ATMELMCI=m |
diff --git a/arch/arm/configs/corgi_defconfig b/arch/arm/configs/corgi_defconfig index 4b8a25d9e686..1fd1d1de3220 100644 --- a/arch/arm/configs/corgi_defconfig +++ b/arch/arm/configs/corgi_defconfig | |||
@@ -218,7 +218,7 @@ CONFIG_USB_GADGET=y | |||
218 | CONFIG_USB_ZERO=m | 218 | CONFIG_USB_ZERO=m |
219 | CONFIG_USB_ETH=m | 219 | CONFIG_USB_ETH=m |
220 | CONFIG_USB_GADGETFS=m | 220 | CONFIG_USB_GADGETFS=m |
221 | CONFIG_USB_FILE_STORAGE=m | 221 | CONFIG_USB_MASS_STORAGE=m |
222 | CONFIG_USB_G_SERIAL=m | 222 | CONFIG_USB_G_SERIAL=m |
223 | CONFIG_MMC=y | 223 | CONFIG_MMC=y |
224 | CONFIG_MMC_PXA=y | 224 | CONFIG_MMC_PXA=y |
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig index 67b5abb6f857..4ea7c95719d2 100644 --- a/arch/arm/configs/davinci_all_defconfig +++ b/arch/arm/configs/davinci_all_defconfig | |||
@@ -144,7 +144,7 @@ CONFIG_USB_GADGET_DEBUG_FS=y | |||
144 | CONFIG_USB_ZERO=m | 144 | CONFIG_USB_ZERO=m |
145 | CONFIG_USB_ETH=m | 145 | CONFIG_USB_ETH=m |
146 | CONFIG_USB_GADGETFS=m | 146 | CONFIG_USB_GADGETFS=m |
147 | CONFIG_USB_FILE_STORAGE=m | 147 | CONFIG_USB_MASS_STORAGE=m |
148 | CONFIG_USB_G_SERIAL=m | 148 | CONFIG_USB_G_SERIAL=m |
149 | CONFIG_USB_G_PRINTER=m | 149 | CONFIG_USB_G_PRINTER=m |
150 | CONFIG_USB_CDC_COMPOSITE=m | 150 | CONFIG_USB_CDC_COMPOSITE=m |
diff --git a/arch/arm/configs/h7202_defconfig b/arch/arm/configs/h7202_defconfig index 69405a762423..e16d3f372e2a 100644 --- a/arch/arm/configs/h7202_defconfig +++ b/arch/arm/configs/h7202_defconfig | |||
@@ -34,8 +34,7 @@ CONFIG_FB_MODE_HELPERS=y | |||
34 | CONFIG_USB_GADGET=m | 34 | CONFIG_USB_GADGET=m |
35 | CONFIG_USB_ZERO=m | 35 | CONFIG_USB_ZERO=m |
36 | CONFIG_USB_GADGETFS=m | 36 | CONFIG_USB_GADGETFS=m |
37 | CONFIG_USB_FILE_STORAGE=m | 37 | CONFIG_USB_MASS_STORAGE=m |
38 | CONFIG_USB_FILE_STORAGE_TEST=y | ||
39 | CONFIG_USB_G_SERIAL=m | 38 | CONFIG_USB_G_SERIAL=m |
40 | CONFIG_EXT2_FS=y | 39 | CONFIG_EXT2_FS=y |
41 | CONFIG_TMPFS=y | 40 | CONFIG_TMPFS=y |
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig index a691ef4c6008..557dd291288b 100644 --- a/arch/arm/configs/magician_defconfig +++ b/arch/arm/configs/magician_defconfig | |||
@@ -136,7 +136,7 @@ CONFIG_USB_PXA27X=y | |||
136 | CONFIG_USB_ETH=m | 136 | CONFIG_USB_ETH=m |
137 | # CONFIG_USB_ETH_RNDIS is not set | 137 | # CONFIG_USB_ETH_RNDIS is not set |
138 | CONFIG_USB_GADGETFS=m | 138 | CONFIG_USB_GADGETFS=m |
139 | CONFIG_USB_FILE_STORAGE=m | 139 | CONFIG_USB_MASS_STORAGE=m |
140 | CONFIG_USB_G_SERIAL=m | 140 | CONFIG_USB_G_SERIAL=m |
141 | CONFIG_USB_CDC_COMPOSITE=m | 141 | CONFIG_USB_CDC_COMPOSITE=m |
142 | CONFIG_USB_GPIO_VBUS=y | 142 | CONFIG_USB_GPIO_VBUS=y |
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig index 00630e6af45c..a07948a87caa 100644 --- a/arch/arm/configs/mini2440_defconfig +++ b/arch/arm/configs/mini2440_defconfig | |||
@@ -240,7 +240,7 @@ CONFIG_USB_GADGET_S3C2410=y | |||
240 | CONFIG_USB_ZERO=m | 240 | CONFIG_USB_ZERO=m |
241 | CONFIG_USB_ETH=m | 241 | CONFIG_USB_ETH=m |
242 | CONFIG_USB_GADGETFS=m | 242 | CONFIG_USB_GADGETFS=m |
243 | CONFIG_USB_FILE_STORAGE=m | 243 | CONFIG_USB_MASS_STORAGE=m |
244 | CONFIG_USB_G_SERIAL=m | 244 | CONFIG_USB_G_SERIAL=m |
245 | CONFIG_USB_CDC_COMPOSITE=m | 245 | CONFIG_USB_CDC_COMPOSITE=m |
246 | CONFIG_MMC=y | 246 | CONFIG_MMC=y |
diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig index dde2a1af7b39..42eab9a2a0fd 100644 --- a/arch/arm/configs/omap1_defconfig +++ b/arch/arm/configs/omap1_defconfig | |||
@@ -214,8 +214,7 @@ CONFIG_USB_TEST=y | |||
214 | CONFIG_USB_GADGET=y | 214 | CONFIG_USB_GADGET=y |
215 | CONFIG_USB_ETH=m | 215 | CONFIG_USB_ETH=m |
216 | # CONFIG_USB_ETH_RNDIS is not set | 216 | # CONFIG_USB_ETH_RNDIS is not set |
217 | CONFIG_USB_FILE_STORAGE=m | 217 | CONFIG_USB_MASS_STORAGE=m |
218 | CONFIG_USB_FILE_STORAGE_TEST=y | ||
219 | CONFIG_MMC=y | 218 | CONFIG_MMC=y |
220 | CONFIG_MMC_SDHCI=y | 219 | CONFIG_MMC_SDHCI=y |
221 | CONFIG_MMC_SDHCI_PLTFM=y | 220 | CONFIG_MMC_SDHCI_PLTFM=y |
diff --git a/arch/arm/configs/prima2_defconfig b/arch/arm/configs/prima2_defconfig index 807d4e2acb17..6a936c7c078a 100644 --- a/arch/arm/configs/prima2_defconfig +++ b/arch/arm/configs/prima2_defconfig | |||
@@ -37,7 +37,6 @@ CONFIG_SPI_SIRF=y | |||
37 | CONFIG_SPI_SPIDEV=y | 37 | CONFIG_SPI_SPIDEV=y |
38 | # CONFIG_HWMON is not set | 38 | # CONFIG_HWMON is not set |
39 | CONFIG_USB_GADGET=y | 39 | CONFIG_USB_GADGET=y |
40 | CONFIG_USB_FILE_STORAGE=m | ||
41 | CONFIG_USB_MASS_STORAGE=m | 40 | CONFIG_USB_MASS_STORAGE=m |
42 | CONFIG_MMC=y | 41 | CONFIG_MMC=y |
43 | CONFIG_MMC_SDHCI=y | 42 | CONFIG_MMC_SDHCI=y |
diff --git a/arch/arm/configs/spitz_defconfig b/arch/arm/configs/spitz_defconfig index df77931a4326..2e0419d1b964 100644 --- a/arch/arm/configs/spitz_defconfig +++ b/arch/arm/configs/spitz_defconfig | |||
@@ -214,7 +214,7 @@ CONFIG_USB_GADGET_DUMMY_HCD=y | |||
214 | CONFIG_USB_ZERO=m | 214 | CONFIG_USB_ZERO=m |
215 | CONFIG_USB_ETH=m | 215 | CONFIG_USB_ETH=m |
216 | CONFIG_USB_GADGETFS=m | 216 | CONFIG_USB_GADGETFS=m |
217 | CONFIG_USB_FILE_STORAGE=m | 217 | CONFIG_USB_MASS_STORAGE=m |
218 | CONFIG_USB_G_SERIAL=m | 218 | CONFIG_USB_G_SERIAL=m |
219 | CONFIG_MMC=y | 219 | CONFIG_MMC=y |
220 | CONFIG_MMC_PXA=y | 220 | CONFIG_MMC_PXA=y |
diff --git a/arch/arm/configs/stamp9g20_defconfig b/arch/arm/configs/stamp9g20_defconfig index 52f1488591c7..b845f5519bcc 100644 --- a/arch/arm/configs/stamp9g20_defconfig +++ b/arch/arm/configs/stamp9g20_defconfig | |||
@@ -97,7 +97,7 @@ CONFIG_USB_STORAGE=y | |||
97 | CONFIG_USB_GADGET=m | 97 | CONFIG_USB_GADGET=m |
98 | CONFIG_USB_ZERO=m | 98 | CONFIG_USB_ZERO=m |
99 | CONFIG_USB_ETH=m | 99 | CONFIG_USB_ETH=m |
100 | CONFIG_USB_FILE_STORAGE=m | 100 | CONFIG_USB_MASS_STORAGE=m |
101 | CONFIG_USB_G_SERIAL=m | 101 | CONFIG_USB_G_SERIAL=m |
102 | CONFIG_MMC=y | 102 | CONFIG_MMC=y |
103 | CONFIG_MMC_ATMELMCI=y | 103 | CONFIG_MMC_ATMELMCI=y |
diff --git a/arch/arm/configs/viper_defconfig b/arch/arm/configs/viper_defconfig index 1d01ddd33122..d36e0d3c86ec 100644 --- a/arch/arm/configs/viper_defconfig +++ b/arch/arm/configs/viper_defconfig | |||
@@ -139,7 +139,7 @@ CONFIG_USB_SERIAL_MCT_U232=m | |||
139 | CONFIG_USB_GADGET=m | 139 | CONFIG_USB_GADGET=m |
140 | CONFIG_USB_ETH=m | 140 | CONFIG_USB_ETH=m |
141 | CONFIG_USB_GADGETFS=m | 141 | CONFIG_USB_GADGETFS=m |
142 | CONFIG_USB_FILE_STORAGE=m | 142 | CONFIG_USB_MASS_STORAGE=m |
143 | CONFIG_USB_G_SERIAL=m | 143 | CONFIG_USB_G_SERIAL=m |
144 | CONFIG_USB_G_PRINTER=m | 144 | CONFIG_USB_G_PRINTER=m |
145 | CONFIG_RTC_CLASS=y | 145 | CONFIG_RTC_CLASS=y |
diff --git a/arch/arm/configs/zeus_defconfig b/arch/arm/configs/zeus_defconfig index 547a3c1e59db..731d4f985310 100644 --- a/arch/arm/configs/zeus_defconfig +++ b/arch/arm/configs/zeus_defconfig | |||
@@ -143,7 +143,7 @@ CONFIG_USB_GADGET=m | |||
143 | CONFIG_USB_PXA27X=y | 143 | CONFIG_USB_PXA27X=y |
144 | CONFIG_USB_ETH=m | 144 | CONFIG_USB_ETH=m |
145 | CONFIG_USB_GADGETFS=m | 145 | CONFIG_USB_GADGETFS=m |
146 | CONFIG_USB_FILE_STORAGE=m | 146 | CONFIG_USB_MASS_STORAGE=m |
147 | CONFIG_USB_G_SERIAL=m | 147 | CONFIG_USB_G_SERIAL=m |
148 | CONFIG_USB_G_PRINTER=m | 148 | CONFIG_USB_G_PRINTER=m |
149 | CONFIG_MMC=y | 149 | CONFIG_MMC=y |
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c index 2c5fb4c7e509..ae305397003c 100644 --- a/arch/arm/mach-cns3xxx/cns3420vb.c +++ b/arch/arm/mach-cns3xxx/cns3420vb.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/mtd/mtd.h> | 24 | #include <linux/mtd/mtd.h> |
25 | #include <linux/mtd/physmap.h> | 25 | #include <linux/mtd/physmap.h> |
26 | #include <linux/mtd/partitions.h> | 26 | #include <linux/mtd/partitions.h> |
27 | #include <linux/usb/ehci_pdriver.h> | ||
28 | #include <linux/usb/ohci_pdriver.h> | ||
27 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
28 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
29 | #include <asm/hardware/gic.h> | 31 | #include <asm/hardware/gic.h> |
@@ -32,6 +34,7 @@ | |||
32 | #include <asm/mach/time.h> | 34 | #include <asm/mach/time.h> |
33 | #include <mach/cns3xxx.h> | 35 | #include <mach/cns3xxx.h> |
34 | #include <mach/irqs.h> | 36 | #include <mach/irqs.h> |
37 | #include <mach/pm.h> | ||
35 | #include "core.h" | 38 | #include "core.h" |
36 | #include "devices.h" | 39 | #include "devices.h" |
37 | 40 | ||
@@ -125,13 +128,52 @@ static struct resource cns3xxx_usb_ehci_resources[] = { | |||
125 | 128 | ||
126 | static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32); | 129 | static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32); |
127 | 130 | ||
131 | static int csn3xxx_usb_power_on(struct platform_device *pdev) | ||
132 | { | ||
133 | /* | ||
134 | * EHCI and OHCI share the same clock and power, | ||
135 | * resetting twice would cause the 1st controller been reset. | ||
136 | * Therefore only do power up at the first up device, and | ||
137 | * power down at the last down device. | ||
138 | * | ||
139 | * Set USB AHB INCR length to 16 | ||
140 | */ | ||
141 | if (atomic_inc_return(&usb_pwr_ref) == 1) { | ||
142 | cns3xxx_pwr_power_up(1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB); | ||
143 | cns3xxx_pwr_clk_en(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
144 | cns3xxx_pwr_soft_rst(1 << PM_SOFT_RST_REG_OFFST_USB_HOST); | ||
145 | __raw_writel((__raw_readl(MISC_CHIP_CONFIG_REG) | (0X2 << 24)), | ||
146 | MISC_CHIP_CONFIG_REG); | ||
147 | } | ||
148 | |||
149 | return 0; | ||
150 | } | ||
151 | |||
152 | static void csn3xxx_usb_power_off(struct platform_device *pdev) | ||
153 | { | ||
154 | /* | ||
155 | * EHCI and OHCI share the same clock and power, | ||
156 | * resetting twice would cause the 1st controller been reset. | ||
157 | * Therefore only do power up at the first up device, and | ||
158 | * power down at the last down device. | ||
159 | */ | ||
160 | if (atomic_dec_return(&usb_pwr_ref) == 0) | ||
161 | cns3xxx_pwr_clk_dis(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
162 | } | ||
163 | |||
164 | static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = { | ||
165 | .power_on = csn3xxx_usb_power_on, | ||
166 | .power_off = csn3xxx_usb_power_off, | ||
167 | }; | ||
168 | |||
128 | static struct platform_device cns3xxx_usb_ehci_device = { | 169 | static struct platform_device cns3xxx_usb_ehci_device = { |
129 | .name = "cns3xxx-ehci", | 170 | .name = "ehci-platform", |
130 | .num_resources = ARRAY_SIZE(cns3xxx_usb_ehci_resources), | 171 | .num_resources = ARRAY_SIZE(cns3xxx_usb_ehci_resources), |
131 | .resource = cns3xxx_usb_ehci_resources, | 172 | .resource = cns3xxx_usb_ehci_resources, |
132 | .dev = { | 173 | .dev = { |
133 | .dma_mask = &cns3xxx_usb_ehci_dma_mask, | 174 | .dma_mask = &cns3xxx_usb_ehci_dma_mask, |
134 | .coherent_dma_mask = DMA_BIT_MASK(32), | 175 | .coherent_dma_mask = DMA_BIT_MASK(32), |
176 | .platform_data = &cns3xxx_usb_ehci_pdata, | ||
135 | }, | 177 | }, |
136 | }; | 178 | }; |
137 | 179 | ||
@@ -149,13 +191,20 @@ static struct resource cns3xxx_usb_ohci_resources[] = { | |||
149 | 191 | ||
150 | static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32); | 192 | static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32); |
151 | 193 | ||
194 | static struct usb_ohci_pdata cns3xxx_usb_ohci_pdata = { | ||
195 | .num_ports = 1, | ||
196 | .power_on = csn3xxx_usb_power_on, | ||
197 | .power_off = csn3xxx_usb_power_off, | ||
198 | }; | ||
199 | |||
152 | static struct platform_device cns3xxx_usb_ohci_device = { | 200 | static struct platform_device cns3xxx_usb_ohci_device = { |
153 | .name = "cns3xxx-ohci", | 201 | .name = "ohci-platform", |
154 | .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources), | 202 | .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources), |
155 | .resource = cns3xxx_usb_ohci_resources, | 203 | .resource = cns3xxx_usb_ohci_resources, |
156 | .dev = { | 204 | .dev = { |
157 | .dma_mask = &cns3xxx_usb_ohci_dma_mask, | 205 | .dma_mask = &cns3xxx_usb_ohci_dma_mask, |
158 | .coherent_dma_mask = DMA_BIT_MASK(32), | 206 | .coherent_dma_mask = DMA_BIT_MASK(32), |
207 | .platform_data = &cns3xxx_usb_ohci_pdata, | ||
159 | }, | 208 | }, |
160 | }; | 209 | }; |
161 | 210 | ||
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig index a06bfccc2840..f4025db184ff 100644 --- a/arch/avr32/configs/atngw100_defconfig +++ b/arch/avr32/configs/atngw100_defconfig | |||
@@ -109,7 +109,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=350 | |||
109 | CONFIG_USB_ZERO=m | 109 | CONFIG_USB_ZERO=m |
110 | CONFIG_USB_ETH=m | 110 | CONFIG_USB_ETH=m |
111 | CONFIG_USB_GADGETFS=m | 111 | CONFIG_USB_GADGETFS=m |
112 | CONFIG_USB_FILE_STORAGE=m | 112 | CONFIG_USB_MASS_STORAGE=m |
113 | CONFIG_USB_G_SERIAL=m | 113 | CONFIG_USB_G_SERIAL=m |
114 | CONFIG_USB_CDC_COMPOSITE=m | 114 | CONFIG_USB_CDC_COMPOSITE=m |
115 | CONFIG_MMC=y | 115 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atngw100_evklcd100_defconfig b/arch/avr32/configs/atngw100_evklcd100_defconfig index d8f1fe80d210..c76a49b9e9d0 100644 --- a/arch/avr32/configs/atngw100_evklcd100_defconfig +++ b/arch/avr32/configs/atngw100_evklcd100_defconfig | |||
@@ -125,7 +125,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=350 | |||
125 | CONFIG_USB_ZERO=m | 125 | CONFIG_USB_ZERO=m |
126 | CONFIG_USB_ETH=m | 126 | CONFIG_USB_ETH=m |
127 | CONFIG_USB_GADGETFS=m | 127 | CONFIG_USB_GADGETFS=m |
128 | CONFIG_USB_FILE_STORAGE=m | 128 | CONFIG_USB_MASS_STORAGE=m |
129 | CONFIG_USB_G_SERIAL=m | 129 | CONFIG_USB_G_SERIAL=m |
130 | CONFIG_USB_CDC_COMPOSITE=m | 130 | CONFIG_USB_CDC_COMPOSITE=m |
131 | CONFIG_MMC=y | 131 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atngw100_evklcd101_defconfig b/arch/avr32/configs/atngw100_evklcd101_defconfig index d4c5b19ec950..2d8ab089a64e 100644 --- a/arch/avr32/configs/atngw100_evklcd101_defconfig +++ b/arch/avr32/configs/atngw100_evklcd101_defconfig | |||
@@ -124,7 +124,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=350 | |||
124 | CONFIG_USB_ZERO=m | 124 | CONFIG_USB_ZERO=m |
125 | CONFIG_USB_ETH=m | 125 | CONFIG_USB_ETH=m |
126 | CONFIG_USB_GADGETFS=m | 126 | CONFIG_USB_GADGETFS=m |
127 | CONFIG_USB_FILE_STORAGE=m | 127 | CONFIG_USB_MASS_STORAGE=m |
128 | CONFIG_USB_G_SERIAL=m | 128 | CONFIG_USB_G_SERIAL=m |
129 | CONFIG_USB_CDC_COMPOSITE=m | 129 | CONFIG_USB_CDC_COMPOSITE=m |
130 | CONFIG_MMC=y | 130 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atngw100_mrmt_defconfig b/arch/avr32/configs/atngw100_mrmt_defconfig index 77ca4f905d2c..b189e0cab04b 100644 --- a/arch/avr32/configs/atngw100_mrmt_defconfig +++ b/arch/avr32/configs/atngw100_mrmt_defconfig | |||
@@ -99,7 +99,7 @@ CONFIG_SND_ATMEL_AC97C=m | |||
99 | # CONFIG_SND_SPI is not set | 99 | # CONFIG_SND_SPI is not set |
100 | CONFIG_USB_GADGET=m | 100 | CONFIG_USB_GADGET=m |
101 | CONFIG_USB_GADGET_DEBUG_FILES=y | 101 | CONFIG_USB_GADGET_DEBUG_FILES=y |
102 | CONFIG_USB_FILE_STORAGE=m | 102 | CONFIG_USB_MASS_STORAGE=m |
103 | CONFIG_USB_G_SERIAL=m | 103 | CONFIG_USB_G_SERIAL=m |
104 | CONFIG_MMC=y | 104 | CONFIG_MMC=y |
105 | CONFIG_MMC_ATMELMCI=y | 105 | CONFIG_MMC_ATMELMCI=y |
diff --git a/arch/avr32/configs/atngw100mkii_defconfig b/arch/avr32/configs/atngw100mkii_defconfig index 6e0dca4d3131..2e4de42a53c4 100644 --- a/arch/avr32/configs/atngw100mkii_defconfig +++ b/arch/avr32/configs/atngw100mkii_defconfig | |||
@@ -111,7 +111,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=350 | |||
111 | CONFIG_USB_ZERO=m | 111 | CONFIG_USB_ZERO=m |
112 | CONFIG_USB_ETH=m | 112 | CONFIG_USB_ETH=m |
113 | CONFIG_USB_GADGETFS=m | 113 | CONFIG_USB_GADGETFS=m |
114 | CONFIG_USB_FILE_STORAGE=m | 114 | CONFIG_USB_MASS_STORAGE=m |
115 | CONFIG_USB_G_SERIAL=m | 115 | CONFIG_USB_G_SERIAL=m |
116 | CONFIG_USB_CDC_COMPOSITE=m | 116 | CONFIG_USB_CDC_COMPOSITE=m |
117 | CONFIG_MMC=y | 117 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig index 7f2a344a5fa8..fad3cd22dfd3 100644 --- a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig +++ b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig | |||
@@ -128,7 +128,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=350 | |||
128 | CONFIG_USB_ZERO=m | 128 | CONFIG_USB_ZERO=m |
129 | CONFIG_USB_ETH=m | 129 | CONFIG_USB_ETH=m |
130 | CONFIG_USB_GADGETFS=m | 130 | CONFIG_USB_GADGETFS=m |
131 | CONFIG_USB_FILE_STORAGE=m | 131 | CONFIG_USB_MASS_STORAGE=m |
132 | CONFIG_USB_G_SERIAL=m | 132 | CONFIG_USB_G_SERIAL=m |
133 | CONFIG_USB_CDC_COMPOSITE=m | 133 | CONFIG_USB_CDC_COMPOSITE=m |
134 | CONFIG_MMC=y | 134 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig index 085eeba88f67..29986230aaa5 100644 --- a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig +++ b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig | |||
@@ -127,7 +127,7 @@ CONFIG_USB_GADGET_VBUS_DRAW=350 | |||
127 | CONFIG_USB_ZERO=m | 127 | CONFIG_USB_ZERO=m |
128 | CONFIG_USB_ETH=m | 128 | CONFIG_USB_ETH=m |
129 | CONFIG_USB_GADGETFS=m | 129 | CONFIG_USB_GADGETFS=m |
130 | CONFIG_USB_FILE_STORAGE=m | 130 | CONFIG_USB_MASS_STORAGE=m |
131 | CONFIG_USB_G_SERIAL=m | 131 | CONFIG_USB_G_SERIAL=m |
132 | CONFIG_USB_CDC_COMPOSITE=m | 132 | CONFIG_USB_CDC_COMPOSITE=m |
133 | CONFIG_MMC=y | 133 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig index d1a887e64055..a582465e1cef 100644 --- a/arch/avr32/configs/atstk1002_defconfig +++ b/arch/avr32/configs/atstk1002_defconfig | |||
@@ -126,7 +126,7 @@ CONFIG_USB_GADGET=y | |||
126 | CONFIG_USB_ZERO=m | 126 | CONFIG_USB_ZERO=m |
127 | CONFIG_USB_ETH=m | 127 | CONFIG_USB_ETH=m |
128 | CONFIG_USB_GADGETFS=m | 128 | CONFIG_USB_GADGETFS=m |
129 | CONFIG_USB_FILE_STORAGE=m | 129 | CONFIG_USB_MASS_STORAGE=m |
130 | CONFIG_USB_G_SERIAL=m | 130 | CONFIG_USB_G_SERIAL=m |
131 | CONFIG_USB_CDC_COMPOSITE=m | 131 | CONFIG_USB_CDC_COMPOSITE=m |
132 | CONFIG_MMC=y | 132 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atstk1003_defconfig b/arch/avr32/configs/atstk1003_defconfig index 956f2819ad45..57a79df2ce5d 100644 --- a/arch/avr32/configs/atstk1003_defconfig +++ b/arch/avr32/configs/atstk1003_defconfig | |||
@@ -105,7 +105,7 @@ CONFIG_USB_GADGET=y | |||
105 | CONFIG_USB_ZERO=m | 105 | CONFIG_USB_ZERO=m |
106 | CONFIG_USB_ETH=m | 106 | CONFIG_USB_ETH=m |
107 | CONFIG_USB_GADGETFS=m | 107 | CONFIG_USB_GADGETFS=m |
108 | CONFIG_USB_FILE_STORAGE=m | 108 | CONFIG_USB_MASS_STORAGE=m |
109 | CONFIG_USB_G_SERIAL=m | 109 | CONFIG_USB_G_SERIAL=m |
110 | CONFIG_USB_CDC_COMPOSITE=m | 110 | CONFIG_USB_CDC_COMPOSITE=m |
111 | CONFIG_MMC=y | 111 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atstk1004_defconfig b/arch/avr32/configs/atstk1004_defconfig index 40c69f38c61a..1a49bd8c6340 100644 --- a/arch/avr32/configs/atstk1004_defconfig +++ b/arch/avr32/configs/atstk1004_defconfig | |||
@@ -104,7 +104,7 @@ CONFIG_USB_GADGET=y | |||
104 | CONFIG_USB_ZERO=m | 104 | CONFIG_USB_ZERO=m |
105 | CONFIG_USB_ETH=m | 105 | CONFIG_USB_ETH=m |
106 | CONFIG_USB_GADGETFS=m | 106 | CONFIG_USB_GADGETFS=m |
107 | CONFIG_USB_FILE_STORAGE=m | 107 | CONFIG_USB_MASS_STORAGE=m |
108 | CONFIG_USB_G_SERIAL=m | 108 | CONFIG_USB_G_SERIAL=m |
109 | CONFIG_USB_CDC_COMPOSITE=m | 109 | CONFIG_USB_CDC_COMPOSITE=m |
110 | CONFIG_MMC=y | 110 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/atstk1006_defconfig b/arch/avr32/configs/atstk1006_defconfig index 511eb8af356d..206a1b67f763 100644 --- a/arch/avr32/configs/atstk1006_defconfig +++ b/arch/avr32/configs/atstk1006_defconfig | |||
@@ -129,7 +129,7 @@ CONFIG_USB_GADGET=y | |||
129 | CONFIG_USB_ZERO=m | 129 | CONFIG_USB_ZERO=m |
130 | CONFIG_USB_ETH=m | 130 | CONFIG_USB_ETH=m |
131 | CONFIG_USB_GADGETFS=m | 131 | CONFIG_USB_GADGETFS=m |
132 | CONFIG_USB_FILE_STORAGE=m | 132 | CONFIG_USB_MASS_STORAGE=m |
133 | CONFIG_USB_G_SERIAL=m | 133 | CONFIG_USB_G_SERIAL=m |
134 | CONFIG_USB_CDC_COMPOSITE=m | 134 | CONFIG_USB_CDC_COMPOSITE=m |
135 | CONFIG_MMC=y | 135 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/favr-32_defconfig b/arch/avr32/configs/favr-32_defconfig index 19973b06170c..0421498d666b 100644 --- a/arch/avr32/configs/favr-32_defconfig +++ b/arch/avr32/configs/favr-32_defconfig | |||
@@ -117,7 +117,7 @@ CONFIG_USB_GADGET=y | |||
117 | CONFIG_USB_ZERO=m | 117 | CONFIG_USB_ZERO=m |
118 | CONFIG_USB_ETH=m | 118 | CONFIG_USB_ETH=m |
119 | CONFIG_USB_GADGETFS=m | 119 | CONFIG_USB_GADGETFS=m |
120 | CONFIG_USB_FILE_STORAGE=m | 120 | CONFIG_USB_MASS_STORAGE=m |
121 | CONFIG_USB_G_SERIAL=m | 121 | CONFIG_USB_G_SERIAL=m |
122 | CONFIG_USB_CDC_COMPOSITE=m | 122 | CONFIG_USB_CDC_COMPOSITE=m |
123 | CONFIG_MMC=y | 123 | CONFIG_MMC=y |
diff --git a/arch/avr32/configs/hammerhead_defconfig b/arch/avr32/configs/hammerhead_defconfig index 6f45681196d1..82f24eb251bd 100644 --- a/arch/avr32/configs/hammerhead_defconfig +++ b/arch/avr32/configs/hammerhead_defconfig | |||
@@ -127,7 +127,7 @@ CONFIG_USB_GADGET=y | |||
127 | CONFIG_USB_ZERO=m | 127 | CONFIG_USB_ZERO=m |
128 | CONFIG_USB_ETH=m | 128 | CONFIG_USB_ETH=m |
129 | CONFIG_USB_GADGETFS=m | 129 | CONFIG_USB_GADGETFS=m |
130 | CONFIG_USB_FILE_STORAGE=m | 130 | CONFIG_USB_MASS_STORAGE=m |
131 | CONFIG_USB_G_SERIAL=m | 131 | CONFIG_USB_G_SERIAL=m |
132 | CONFIG_MMC=m | 132 | CONFIG_MMC=m |
133 | CONFIG_MMC_ATMELMCI=m | 133 | CONFIG_MMC_ATMELMCI=m |
diff --git a/arch/blackfin/configs/CM-BF527_defconfig b/arch/blackfin/configs/CM-BF527_defconfig index c280a50e7943..f59c80ee78e3 100644 --- a/arch/blackfin/configs/CM-BF527_defconfig +++ b/arch/blackfin/configs/CM-BF527_defconfig | |||
@@ -106,7 +106,7 @@ CONFIG_MUSB_PIO_ONLY=y | |||
106 | CONFIG_USB_STORAGE=m | 106 | CONFIG_USB_STORAGE=m |
107 | CONFIG_USB_GADGET=m | 107 | CONFIG_USB_GADGET=m |
108 | CONFIG_USB_ETH=m | 108 | CONFIG_USB_ETH=m |
109 | CONFIG_USB_FILE_STORAGE=m | 109 | CONFIG_USB_MASS_STORAGE=m |
110 | CONFIG_USB_G_SERIAL=m | 110 | CONFIG_USB_G_SERIAL=m |
111 | CONFIG_USB_G_PRINTER=m | 111 | CONFIG_USB_G_PRINTER=m |
112 | CONFIG_RTC_CLASS=y | 112 | CONFIG_RTC_CLASS=y |
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig index 349922be01f3..e961483f1879 100644 --- a/arch/blackfin/configs/CM-BF548_defconfig +++ b/arch/blackfin/configs/CM-BF548_defconfig | |||
@@ -107,7 +107,7 @@ CONFIG_USB_ZERO=m | |||
107 | CONFIG_USB_ETH=m | 107 | CONFIG_USB_ETH=m |
108 | # CONFIG_USB_ETH_RNDIS is not set | 108 | # CONFIG_USB_ETH_RNDIS is not set |
109 | CONFIG_USB_GADGETFS=m | 109 | CONFIG_USB_GADGETFS=m |
110 | CONFIG_USB_FILE_STORAGE=m | 110 | CONFIG_USB_MASS_STORAGE=m |
111 | CONFIG_USB_G_SERIAL=m | 111 | CONFIG_USB_G_SERIAL=m |
112 | CONFIG_USB_G_PRINTER=m | 112 | CONFIG_USB_G_PRINTER=m |
113 | CONFIG_MMC=m | 113 | CONFIG_MMC=m |
diff --git a/arch/blackfin/configs/CM-BF561_defconfig b/arch/blackfin/configs/CM-BF561_defconfig index 0456deaa2d6f..24936b91a6ee 100644 --- a/arch/blackfin/configs/CM-BF561_defconfig +++ b/arch/blackfin/configs/CM-BF561_defconfig | |||
@@ -83,7 +83,7 @@ CONFIG_GPIOLIB=y | |||
83 | CONFIG_GPIO_SYSFS=y | 83 | CONFIG_GPIO_SYSFS=y |
84 | CONFIG_USB_GADGET=m | 84 | CONFIG_USB_GADGET=m |
85 | CONFIG_USB_ETH=m | 85 | CONFIG_USB_ETH=m |
86 | CONFIG_USB_FILE_STORAGE=m | 86 | CONFIG_USB_MASS_STORAGE=m |
87 | CONFIG_USB_G_SERIAL=m | 87 | CONFIG_USB_G_SERIAL=m |
88 | CONFIG_USB_G_PRINTER=m | 88 | CONFIG_USB_G_PRINTER=m |
89 | CONFIG_MMC=y | 89 | CONFIG_MMC=y |
diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile index 407ebc00e661..cb83d8d21aef 100644 --- a/arch/mips/alchemy/common/Makefile +++ b/arch/mips/alchemy/common/Makefile | |||
@@ -6,7 +6,7 @@ | |||
6 | # | 6 | # |
7 | 7 | ||
8 | obj-y += prom.o time.o clocks.o platform.o power.o setup.o \ | 8 | obj-y += prom.o time.o clocks.o platform.o power.o setup.o \ |
9 | sleeper.o dma.o dbdma.o vss.o irq.o | 9 | sleeper.o dma.o dbdma.o vss.o irq.o usb.o |
10 | 10 | ||
11 | # optional gpiolib support | 11 | # optional gpiolib support |
12 | ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),) | 12 | ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),) |
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index c0f3ce6dcb56..7af941d8e717 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/serial_8250.h> | 18 | #include <linux/serial_8250.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/usb/ehci_pdriver.h> | ||
21 | #include <linux/usb/ohci_pdriver.h> | ||
20 | 22 | ||
21 | #include <asm/mach-au1x00/au1000.h> | 23 | #include <asm/mach-au1x00/au1000.h> |
22 | #include <asm/mach-au1x00/au1xxx_dbdma.h> | 24 | #include <asm/mach-au1x00/au1xxx_dbdma.h> |
@@ -122,6 +124,53 @@ static void __init alchemy_setup_uarts(int ctype) | |||
122 | static u64 alchemy_ohci_dmamask = DMA_BIT_MASK(32); | 124 | static u64 alchemy_ohci_dmamask = DMA_BIT_MASK(32); |
123 | static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32); | 125 | static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32); |
124 | 126 | ||
127 | /* Power on callback for the ehci platform driver */ | ||
128 | static int alchemy_ehci_power_on(struct platform_device *pdev) | ||
129 | { | ||
130 | return alchemy_usb_control(ALCHEMY_USB_EHCI0, 1); | ||
131 | } | ||
132 | |||
133 | /* Power off/suspend callback for the ehci platform driver */ | ||
134 | static void alchemy_ehci_power_off(struct platform_device *pdev) | ||
135 | { | ||
136 | alchemy_usb_control(ALCHEMY_USB_EHCI0, 0); | ||
137 | } | ||
138 | |||
139 | static struct usb_ehci_pdata alchemy_ehci_pdata = { | ||
140 | .no_io_watchdog = 1, | ||
141 | .power_on = alchemy_ehci_power_on, | ||
142 | .power_off = alchemy_ehci_power_off, | ||
143 | .power_suspend = alchemy_ehci_power_off, | ||
144 | }; | ||
145 | |||
146 | /* Power on callback for the ohci platform driver */ | ||
147 | static int alchemy_ohci_power_on(struct platform_device *pdev) | ||
148 | { | ||
149 | int unit; | ||
150 | |||
151 | unit = (pdev->id == 1) ? | ||
152 | ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0; | ||
153 | |||
154 | return alchemy_usb_control(unit, 1); | ||
155 | } | ||
156 | |||
157 | /* Power off/suspend callback for the ohci platform driver */ | ||
158 | static void alchemy_ohci_power_off(struct platform_device *pdev) | ||
159 | { | ||
160 | int unit; | ||
161 | |||
162 | unit = (pdev->id == 1) ? | ||
163 | ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0; | ||
164 | |||
165 | alchemy_usb_control(unit, 0); | ||
166 | } | ||
167 | |||
168 | static struct usb_ohci_pdata alchemy_ohci_pdata = { | ||
169 | .power_on = alchemy_ohci_power_on, | ||
170 | .power_off = alchemy_ohci_power_off, | ||
171 | .power_suspend = alchemy_ohci_power_off, | ||
172 | }; | ||
173 | |||
125 | static unsigned long alchemy_ohci_data[][2] __initdata = { | 174 | static unsigned long alchemy_ohci_data[][2] __initdata = { |
126 | [ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT }, | 175 | [ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT }, |
127 | [ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT }, | 176 | [ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT }, |
@@ -169,9 +218,10 @@ static void __init alchemy_setup_usb(int ctype) | |||
169 | res[1].start = alchemy_ohci_data[ctype][1]; | 218 | res[1].start = alchemy_ohci_data[ctype][1]; |
170 | res[1].end = res[1].start; | 219 | res[1].end = res[1].start; |
171 | res[1].flags = IORESOURCE_IRQ; | 220 | res[1].flags = IORESOURCE_IRQ; |
172 | pdev->name = "au1xxx-ohci"; | 221 | pdev->name = "ohci-platform"; |
173 | pdev->id = 0; | 222 | pdev->id = 0; |
174 | pdev->dev.dma_mask = &alchemy_ohci_dmamask; | 223 | pdev->dev.dma_mask = &alchemy_ohci_dmamask; |
224 | pdev->dev.platform_data = &alchemy_ohci_pdata; | ||
175 | 225 | ||
176 | if (platform_device_register(pdev)) | 226 | if (platform_device_register(pdev)) |
177 | printk(KERN_INFO "Alchemy USB: cannot add OHCI0\n"); | 227 | printk(KERN_INFO "Alchemy USB: cannot add OHCI0\n"); |
@@ -188,9 +238,10 @@ static void __init alchemy_setup_usb(int ctype) | |||
188 | res[1].start = alchemy_ehci_data[ctype][1]; | 238 | res[1].start = alchemy_ehci_data[ctype][1]; |
189 | res[1].end = res[1].start; | 239 | res[1].end = res[1].start; |
190 | res[1].flags = IORESOURCE_IRQ; | 240 | res[1].flags = IORESOURCE_IRQ; |
191 | pdev->name = "au1xxx-ehci"; | 241 | pdev->name = "ehci-platform"; |
192 | pdev->id = 0; | 242 | pdev->id = 0; |
193 | pdev->dev.dma_mask = &alchemy_ehci_dmamask; | 243 | pdev->dev.dma_mask = &alchemy_ehci_dmamask; |
244 | pdev->dev.platform_data = &alchemy_ehci_pdata; | ||
194 | 245 | ||
195 | if (platform_device_register(pdev)) | 246 | if (platform_device_register(pdev)) |
196 | printk(KERN_INFO "Alchemy USB: cannot add EHCI0\n"); | 247 | printk(KERN_INFO "Alchemy USB: cannot add EHCI0\n"); |
@@ -207,9 +258,10 @@ static void __init alchemy_setup_usb(int ctype) | |||
207 | res[1].start = AU1300_USB_INT; | 258 | res[1].start = AU1300_USB_INT; |
208 | res[1].end = res[1].start; | 259 | res[1].end = res[1].start; |
209 | res[1].flags = IORESOURCE_IRQ; | 260 | res[1].flags = IORESOURCE_IRQ; |
210 | pdev->name = "au1xxx-ohci"; | 261 | pdev->name = "ohci-platform"; |
211 | pdev->id = 1; | 262 | pdev->id = 1; |
212 | pdev->dev.dma_mask = &alchemy_ohci_dmamask; | 263 | pdev->dev.dma_mask = &alchemy_ohci_dmamask; |
264 | pdev->dev.platform_data = &alchemy_ohci_pdata; | ||
213 | 265 | ||
214 | if (platform_device_register(pdev)) | 266 | if (platform_device_register(pdev)) |
215 | printk(KERN_INFO "Alchemy USB: cannot add OHCI1\n"); | 267 | printk(KERN_INFO "Alchemy USB: cannot add OHCI1\n"); |
diff --git a/arch/mips/alchemy/common/usb.c b/arch/mips/alchemy/common/usb.c new file mode 100644 index 000000000000..936af8359fb2 --- /dev/null +++ b/arch/mips/alchemy/common/usb.c | |||
@@ -0,0 +1,614 @@ | |||
1 | /* | ||
2 | * USB block power/access management abstraction. | ||
3 | * | ||
4 | * Au1000+: The OHCI block control register is at the far end of the OHCI memory | ||
5 | * area. Au1550 has OHCI on different base address. No need to handle | ||
6 | * UDC here. | ||
7 | * Au1200: one register to control access and clocks to O/EHCI, UDC and OTG | ||
8 | * as well as the PHY for EHCI and UDC. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/syscore_ops.h> | ||
17 | #include <asm/mach-au1x00/au1000.h> | ||
18 | |||
19 | /* control register offsets */ | ||
20 | #define AU1000_OHCICFG 0x7fffc | ||
21 | #define AU1550_OHCICFG 0x07ffc | ||
22 | #define AU1200_USBCFG 0x04 | ||
23 | |||
24 | /* Au1000 USB block config bits */ | ||
25 | #define USBHEN_RD (1 << 4) /* OHCI reset-done indicator */ | ||
26 | #define USBHEN_CE (1 << 3) /* OHCI block clock enable */ | ||
27 | #define USBHEN_E (1 << 2) /* OHCI block enable */ | ||
28 | #define USBHEN_C (1 << 1) /* OHCI block coherency bit */ | ||
29 | #define USBHEN_BE (1 << 0) /* OHCI Big-Endian */ | ||
30 | |||
31 | /* Au1200 USB config bits */ | ||
32 | #define USBCFG_PFEN (1 << 31) /* prefetch enable (undoc) */ | ||
33 | #define USBCFG_RDCOMB (1 << 30) /* read combining (undoc) */ | ||
34 | #define USBCFG_UNKNOWN (5 << 20) /* unknown, leave this way */ | ||
35 | #define USBCFG_SSD (1 << 23) /* serial short detect en */ | ||
36 | #define USBCFG_PPE (1 << 19) /* HS PHY PLL */ | ||
37 | #define USBCFG_UCE (1 << 18) /* UDC clock enable */ | ||
38 | #define USBCFG_ECE (1 << 17) /* EHCI clock enable */ | ||
39 | #define USBCFG_OCE (1 << 16) /* OHCI clock enable */ | ||
40 | #define USBCFG_FLA(x) (((x) & 0x3f) << 8) | ||
41 | #define USBCFG_UCAM (1 << 7) /* coherent access (undoc) */ | ||
42 | #define USBCFG_GME (1 << 6) /* OTG mem access */ | ||
43 | #define USBCFG_DBE (1 << 5) /* UDC busmaster enable */ | ||
44 | #define USBCFG_DME (1 << 4) /* UDC mem enable */ | ||
45 | #define USBCFG_EBE (1 << 3) /* EHCI busmaster enable */ | ||
46 | #define USBCFG_EME (1 << 2) /* EHCI mem enable */ | ||
47 | #define USBCFG_OBE (1 << 1) /* OHCI busmaster enable */ | ||
48 | #define USBCFG_OME (1 << 0) /* OHCI mem enable */ | ||
49 | #define USBCFG_INIT_AU1200 (USBCFG_PFEN | USBCFG_RDCOMB | USBCFG_UNKNOWN |\ | ||
50 | USBCFG_SSD | USBCFG_FLA(0x20) | USBCFG_UCAM | \ | ||
51 | USBCFG_GME | USBCFG_DBE | USBCFG_DME | \ | ||
52 | USBCFG_EBE | USBCFG_EME | USBCFG_OBE | \ | ||
53 | USBCFG_OME) | ||
54 | |||
55 | /* Au1300 USB config registers */ | ||
56 | #define USB_DWC_CTRL1 0x00 | ||
57 | #define USB_DWC_CTRL2 0x04 | ||
58 | #define USB_VBUS_TIMER 0x10 | ||
59 | #define USB_SBUS_CTRL 0x14 | ||
60 | #define USB_MSR_ERR 0x18 | ||
61 | #define USB_DWC_CTRL3 0x1C | ||
62 | #define USB_DWC_CTRL4 0x20 | ||
63 | #define USB_OTG_STATUS 0x28 | ||
64 | #define USB_DWC_CTRL5 0x2C | ||
65 | #define USB_DWC_CTRL6 0x30 | ||
66 | #define USB_DWC_CTRL7 0x34 | ||
67 | #define USB_PHY_STATUS 0xC0 | ||
68 | #define USB_INT_STATUS 0xC4 | ||
69 | #define USB_INT_ENABLE 0xC8 | ||
70 | |||
71 | #define USB_DWC_CTRL1_OTGD 0x04 /* set to DISable OTG */ | ||
72 | #define USB_DWC_CTRL1_HSTRS 0x02 /* set to ENable EHCI */ | ||
73 | #define USB_DWC_CTRL1_DCRS 0x01 /* set to ENable UDC */ | ||
74 | |||
75 | #define USB_DWC_CTRL2_PHY1RS 0x04 /* set to enable PHY1 */ | ||
76 | #define USB_DWC_CTRL2_PHY0RS 0x02 /* set to enable PHY0 */ | ||
77 | #define USB_DWC_CTRL2_PHYRS 0x01 /* set to enable PHY */ | ||
78 | |||
79 | #define USB_DWC_CTRL3_OHCI1_CKEN (1 << 19) | ||
80 | #define USB_DWC_CTRL3_OHCI0_CKEN (1 << 18) | ||
81 | #define USB_DWC_CTRL3_EHCI0_CKEN (1 << 17) | ||
82 | #define USB_DWC_CTRL3_OTG0_CKEN (1 << 16) | ||
83 | |||
84 | #define USB_SBUS_CTRL_SBCA 0x04 /* coherent access */ | ||
85 | |||
86 | #define USB_INTEN_FORCE 0x20 | ||
87 | #define USB_INTEN_PHY 0x10 | ||
88 | #define USB_INTEN_UDC 0x08 | ||
89 | #define USB_INTEN_EHCI 0x04 | ||
90 | #define USB_INTEN_OHCI1 0x02 | ||
91 | #define USB_INTEN_OHCI0 0x01 | ||
92 | |||
93 | static DEFINE_SPINLOCK(alchemy_usb_lock); | ||
94 | |||
95 | static inline void __au1300_usb_phyctl(void __iomem *base, int enable) | ||
96 | { | ||
97 | unsigned long r, s; | ||
98 | |||
99 | r = __raw_readl(base + USB_DWC_CTRL2); | ||
100 | s = __raw_readl(base + USB_DWC_CTRL3); | ||
101 | |||
102 | s &= USB_DWC_CTRL3_OHCI1_CKEN | USB_DWC_CTRL3_OHCI0_CKEN | | ||
103 | USB_DWC_CTRL3_EHCI0_CKEN | USB_DWC_CTRL3_OTG0_CKEN; | ||
104 | |||
105 | if (enable) { | ||
106 | /* simply enable all PHYs */ | ||
107 | r |= USB_DWC_CTRL2_PHY1RS | USB_DWC_CTRL2_PHY0RS | | ||
108 | USB_DWC_CTRL2_PHYRS; | ||
109 | __raw_writel(r, base + USB_DWC_CTRL2); | ||
110 | wmb(); | ||
111 | } else if (!s) { | ||
112 | /* no USB block active, do disable all PHYs */ | ||
113 | r &= ~(USB_DWC_CTRL2_PHY1RS | USB_DWC_CTRL2_PHY0RS | | ||
114 | USB_DWC_CTRL2_PHYRS); | ||
115 | __raw_writel(r, base + USB_DWC_CTRL2); | ||
116 | wmb(); | ||
117 | } | ||
118 | } | ||
119 | |||
120 | static inline void __au1300_ohci_control(void __iomem *base, int enable, int id) | ||
121 | { | ||
122 | unsigned long r; | ||
123 | |||
124 | if (enable) { | ||
125 | __raw_writel(1, base + USB_DWC_CTRL7); /* start OHCI clock */ | ||
126 | wmb(); | ||
127 | |||
128 | r = __raw_readl(base + USB_DWC_CTRL3); /* enable OHCI block */ | ||
129 | r |= (id == 0) ? USB_DWC_CTRL3_OHCI0_CKEN | ||
130 | : USB_DWC_CTRL3_OHCI1_CKEN; | ||
131 | __raw_writel(r, base + USB_DWC_CTRL3); | ||
132 | wmb(); | ||
133 | |||
134 | __au1300_usb_phyctl(base, enable); /* power up the PHYs */ | ||
135 | |||
136 | r = __raw_readl(base + USB_INT_ENABLE); | ||
137 | r |= (id == 0) ? USB_INTEN_OHCI0 : USB_INTEN_OHCI1; | ||
138 | __raw_writel(r, base + USB_INT_ENABLE); | ||
139 | wmb(); | ||
140 | |||
141 | /* reset the OHCI start clock bit */ | ||
142 | __raw_writel(0, base + USB_DWC_CTRL7); | ||
143 | wmb(); | ||
144 | } else { | ||
145 | r = __raw_readl(base + USB_INT_ENABLE); | ||
146 | r &= ~((id == 0) ? USB_INTEN_OHCI0 : USB_INTEN_OHCI1); | ||
147 | __raw_writel(r, base + USB_INT_ENABLE); | ||
148 | wmb(); | ||
149 | |||
150 | r = __raw_readl(base + USB_DWC_CTRL3); | ||
151 | r &= ~((id == 0) ? USB_DWC_CTRL3_OHCI0_CKEN | ||
152 | : USB_DWC_CTRL3_OHCI1_CKEN); | ||
153 | __raw_writel(r, base + USB_DWC_CTRL3); | ||
154 | wmb(); | ||
155 | |||
156 | __au1300_usb_phyctl(base, enable); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | static inline void __au1300_ehci_control(void __iomem *base, int enable) | ||
161 | { | ||
162 | unsigned long r; | ||
163 | |||
164 | if (enable) { | ||
165 | r = __raw_readl(base + USB_DWC_CTRL3); | ||
166 | r |= USB_DWC_CTRL3_EHCI0_CKEN; | ||
167 | __raw_writel(r, base + USB_DWC_CTRL3); | ||
168 | wmb(); | ||
169 | |||
170 | r = __raw_readl(base + USB_DWC_CTRL1); | ||
171 | r |= USB_DWC_CTRL1_HSTRS; | ||
172 | __raw_writel(r, base + USB_DWC_CTRL1); | ||
173 | wmb(); | ||
174 | |||
175 | __au1300_usb_phyctl(base, enable); | ||
176 | |||
177 | r = __raw_readl(base + USB_INT_ENABLE); | ||
178 | r |= USB_INTEN_EHCI; | ||
179 | __raw_writel(r, base + USB_INT_ENABLE); | ||
180 | wmb(); | ||
181 | } else { | ||
182 | r = __raw_readl(base + USB_INT_ENABLE); | ||
183 | r &= ~USB_INTEN_EHCI; | ||
184 | __raw_writel(r, base + USB_INT_ENABLE); | ||
185 | wmb(); | ||
186 | |||
187 | r = __raw_readl(base + USB_DWC_CTRL1); | ||
188 | r &= ~USB_DWC_CTRL1_HSTRS; | ||
189 | __raw_writel(r, base + USB_DWC_CTRL1); | ||
190 | wmb(); | ||
191 | |||
192 | r = __raw_readl(base + USB_DWC_CTRL3); | ||
193 | r &= ~USB_DWC_CTRL3_EHCI0_CKEN; | ||
194 | __raw_writel(r, base + USB_DWC_CTRL3); | ||
195 | wmb(); | ||
196 | |||
197 | __au1300_usb_phyctl(base, enable); | ||
198 | } | ||
199 | } | ||
200 | |||
201 | static inline void __au1300_udc_control(void __iomem *base, int enable) | ||
202 | { | ||
203 | unsigned long r; | ||
204 | |||
205 | if (enable) { | ||
206 | r = __raw_readl(base + USB_DWC_CTRL1); | ||
207 | r |= USB_DWC_CTRL1_DCRS; | ||
208 | __raw_writel(r, base + USB_DWC_CTRL1); | ||
209 | wmb(); | ||
210 | |||
211 | __au1300_usb_phyctl(base, enable); | ||
212 | |||
213 | r = __raw_readl(base + USB_INT_ENABLE); | ||
214 | r |= USB_INTEN_UDC; | ||
215 | __raw_writel(r, base + USB_INT_ENABLE); | ||
216 | wmb(); | ||
217 | } else { | ||
218 | r = __raw_readl(base + USB_INT_ENABLE); | ||
219 | r &= ~USB_INTEN_UDC; | ||
220 | __raw_writel(r, base + USB_INT_ENABLE); | ||
221 | wmb(); | ||
222 | |||
223 | r = __raw_readl(base + USB_DWC_CTRL1); | ||
224 | r &= ~USB_DWC_CTRL1_DCRS; | ||
225 | __raw_writel(r, base + USB_DWC_CTRL1); | ||
226 | wmb(); | ||
227 | |||
228 | __au1300_usb_phyctl(base, enable); | ||
229 | } | ||
230 | } | ||
231 | |||
232 | static inline void __au1300_otg_control(void __iomem *base, int enable) | ||
233 | { | ||
234 | unsigned long r; | ||
235 | if (enable) { | ||
236 | r = __raw_readl(base + USB_DWC_CTRL3); | ||
237 | r |= USB_DWC_CTRL3_OTG0_CKEN; | ||
238 | __raw_writel(r, base + USB_DWC_CTRL3); | ||
239 | wmb(); | ||
240 | |||
241 | r = __raw_readl(base + USB_DWC_CTRL1); | ||
242 | r &= ~USB_DWC_CTRL1_OTGD; | ||
243 | __raw_writel(r, base + USB_DWC_CTRL1); | ||
244 | wmb(); | ||
245 | |||
246 | __au1300_usb_phyctl(base, enable); | ||
247 | } else { | ||
248 | r = __raw_readl(base + USB_DWC_CTRL1); | ||
249 | r |= USB_DWC_CTRL1_OTGD; | ||
250 | __raw_writel(r, base + USB_DWC_CTRL1); | ||
251 | wmb(); | ||
252 | |||
253 | r = __raw_readl(base + USB_DWC_CTRL3); | ||
254 | r &= ~USB_DWC_CTRL3_OTG0_CKEN; | ||
255 | __raw_writel(r, base + USB_DWC_CTRL3); | ||
256 | wmb(); | ||
257 | |||
258 | __au1300_usb_phyctl(base, enable); | ||
259 | } | ||
260 | } | ||
261 | |||
262 | static inline int au1300_usb_control(int block, int enable) | ||
263 | { | ||
264 | void __iomem *base = | ||
265 | (void __iomem *)KSEG1ADDR(AU1300_USB_CTL_PHYS_ADDR); | ||
266 | int ret = 0; | ||
267 | |||
268 | switch (block) { | ||
269 | case ALCHEMY_USB_OHCI0: | ||
270 | __au1300_ohci_control(base, enable, 0); | ||
271 | break; | ||
272 | case ALCHEMY_USB_OHCI1: | ||
273 | __au1300_ohci_control(base, enable, 1); | ||
274 | break; | ||
275 | case ALCHEMY_USB_EHCI0: | ||
276 | __au1300_ehci_control(base, enable); | ||
277 | break; | ||
278 | case ALCHEMY_USB_UDC0: | ||
279 | __au1300_udc_control(base, enable); | ||
280 | break; | ||
281 | case ALCHEMY_USB_OTG0: | ||
282 | __au1300_otg_control(base, enable); | ||
283 | break; | ||
284 | default: | ||
285 | ret = -ENODEV; | ||
286 | } | ||
287 | return ret; | ||
288 | } | ||
289 | |||
290 | static inline void au1300_usb_init(void) | ||
291 | { | ||
292 | void __iomem *base = | ||
293 | (void __iomem *)KSEG1ADDR(AU1300_USB_CTL_PHYS_ADDR); | ||
294 | |||
295 | /* set some sane defaults. Note: we don't fiddle with DWC_CTRL4 | ||
296 | * here at all: Port 2 routing (EHCI or UDC) must be set either | ||
297 | * by boot firmware or platform init code; I can't autodetect | ||
298 | * a sane setting. | ||
299 | */ | ||
300 | __raw_writel(0, base + USB_INT_ENABLE); /* disable all USB irqs */ | ||
301 | wmb(); | ||
302 | __raw_writel(0, base + USB_DWC_CTRL3); /* disable all clocks */ | ||
303 | wmb(); | ||
304 | __raw_writel(~0, base + USB_MSR_ERR); /* clear all errors */ | ||
305 | wmb(); | ||
306 | __raw_writel(~0, base + USB_INT_STATUS); /* clear int status */ | ||
307 | wmb(); | ||
308 | /* set coherent access bit */ | ||
309 | __raw_writel(USB_SBUS_CTRL_SBCA, base + USB_SBUS_CTRL); | ||
310 | wmb(); | ||
311 | } | ||
312 | |||
313 | static inline void __au1200_ohci_control(void __iomem *base, int enable) | ||
314 | { | ||
315 | unsigned long r = __raw_readl(base + AU1200_USBCFG); | ||
316 | if (enable) { | ||
317 | __raw_writel(r | USBCFG_OCE, base + AU1200_USBCFG); | ||
318 | wmb(); | ||
319 | udelay(2000); | ||
320 | } else { | ||
321 | __raw_writel(r & ~USBCFG_OCE, base + AU1200_USBCFG); | ||
322 | wmb(); | ||
323 | udelay(1000); | ||
324 | } | ||
325 | } | ||
326 | |||
327 | static inline void __au1200_ehci_control(void __iomem *base, int enable) | ||
328 | { | ||
329 | unsigned long r = __raw_readl(base + AU1200_USBCFG); | ||
330 | if (enable) { | ||
331 | __raw_writel(r | USBCFG_ECE | USBCFG_PPE, base + AU1200_USBCFG); | ||
332 | wmb(); | ||
333 | udelay(1000); | ||
334 | } else { | ||
335 | if (!(r & USBCFG_UCE)) /* UDC also off? */ | ||
336 | r &= ~USBCFG_PPE; /* yes: disable HS PHY PLL */ | ||
337 | __raw_writel(r & ~USBCFG_ECE, base + AU1200_USBCFG); | ||
338 | wmb(); | ||
339 | udelay(1000); | ||
340 | } | ||
341 | } | ||
342 | |||
343 | static inline void __au1200_udc_control(void __iomem *base, int enable) | ||
344 | { | ||
345 | unsigned long r = __raw_readl(base + AU1200_USBCFG); | ||
346 | if (enable) { | ||
347 | __raw_writel(r | USBCFG_UCE | USBCFG_PPE, base + AU1200_USBCFG); | ||
348 | wmb(); | ||
349 | } else { | ||
350 | if (!(r & USBCFG_ECE)) /* EHCI also off? */ | ||
351 | r &= ~USBCFG_PPE; /* yes: disable HS PHY PLL */ | ||
352 | __raw_writel(r & ~USBCFG_UCE, base + AU1200_USBCFG); | ||
353 | wmb(); | ||
354 | } | ||
355 | } | ||
356 | |||
357 | static inline int au1200_coherency_bug(void) | ||
358 | { | ||
359 | #if defined(CONFIG_DMA_COHERENT) | ||
360 | /* Au1200 AB USB does not support coherent memory */ | ||
361 | if (!(read_c0_prid() & 0xff)) { | ||
362 | printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n"); | ||
363 | printk(KERN_INFO "Au1200 USB: update your board or re-configure" | ||
364 | " the kernel\n"); | ||
365 | return -ENODEV; | ||
366 | } | ||
367 | #endif | ||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | static inline int au1200_usb_control(int block, int enable) | ||
372 | { | ||
373 | void __iomem *base = | ||
374 | (void __iomem *)KSEG1ADDR(AU1200_USB_CTL_PHYS_ADDR); | ||
375 | int ret = 0; | ||
376 | |||
377 | switch (block) { | ||
378 | case ALCHEMY_USB_OHCI0: | ||
379 | ret = au1200_coherency_bug(); | ||
380 | if (ret && enable) | ||
381 | goto out; | ||
382 | __au1200_ohci_control(base, enable); | ||
383 | break; | ||
384 | case ALCHEMY_USB_UDC0: | ||
385 | __au1200_udc_control(base, enable); | ||
386 | break; | ||
387 | case ALCHEMY_USB_EHCI0: | ||
388 | ret = au1200_coherency_bug(); | ||
389 | if (ret && enable) | ||
390 | goto out; | ||
391 | __au1200_ehci_control(base, enable); | ||
392 | break; | ||
393 | default: | ||
394 | ret = -ENODEV; | ||
395 | } | ||
396 | out: | ||
397 | return ret; | ||
398 | } | ||
399 | |||
400 | |||
401 | /* initialize USB block(s) to a known working state */ | ||
402 | static inline void au1200_usb_init(void) | ||
403 | { | ||
404 | void __iomem *base = | ||
405 | (void __iomem *)KSEG1ADDR(AU1200_USB_CTL_PHYS_ADDR); | ||
406 | __raw_writel(USBCFG_INIT_AU1200, base + AU1200_USBCFG); | ||
407 | wmb(); | ||
408 | udelay(1000); | ||
409 | } | ||
410 | |||
411 | static inline void au1000_usb_init(unsigned long rb, int reg) | ||
412 | { | ||
413 | void __iomem *base = (void __iomem *)KSEG1ADDR(rb + reg); | ||
414 | unsigned long r = __raw_readl(base); | ||
415 | |||
416 | #if defined(__BIG_ENDIAN) | ||
417 | r |= USBHEN_BE; | ||
418 | #endif | ||
419 | r |= USBHEN_C; | ||
420 | |||
421 | __raw_writel(r, base); | ||
422 | wmb(); | ||
423 | udelay(1000); | ||
424 | } | ||
425 | |||
426 | |||
427 | static inline void __au1xx0_ohci_control(int enable, unsigned long rb, int creg) | ||
428 | { | ||
429 | void __iomem *base = (void __iomem *)KSEG1ADDR(rb); | ||
430 | unsigned long r = __raw_readl(base + creg); | ||
431 | |||
432 | if (enable) { | ||
433 | __raw_writel(r | USBHEN_CE, base + creg); | ||
434 | wmb(); | ||
435 | udelay(1000); | ||
436 | __raw_writel(r | USBHEN_CE | USBHEN_E, base + creg); | ||
437 | wmb(); | ||
438 | udelay(1000); | ||
439 | |||
440 | /* wait for reset complete (read reg twice: au1500 erratum) */ | ||
441 | while (__raw_readl(base + creg), | ||
442 | !(__raw_readl(base + creg) & USBHEN_RD)) | ||
443 | udelay(1000); | ||
444 | } else { | ||
445 | __raw_writel(r & ~(USBHEN_CE | USBHEN_E), base + creg); | ||
446 | wmb(); | ||
447 | } | ||
448 | } | ||
449 | |||
450 | static inline int au1000_usb_control(int block, int enable, unsigned long rb, | ||
451 | int creg) | ||
452 | { | ||
453 | int ret = 0; | ||
454 | |||
455 | switch (block) { | ||
456 | case ALCHEMY_USB_OHCI0: | ||
457 | __au1xx0_ohci_control(enable, rb, creg); | ||
458 | break; | ||
459 | default: | ||
460 | ret = -ENODEV; | ||
461 | } | ||
462 | return ret; | ||
463 | } | ||
464 | |||
465 | /* | ||
466 | * alchemy_usb_control - control Alchemy on-chip USB blocks | ||
467 | * @block: USB block to target | ||
468 | * @enable: set 1 to enable a block, 0 to disable | ||
469 | */ | ||
470 | int alchemy_usb_control(int block, int enable) | ||
471 | { | ||
472 | unsigned long flags; | ||
473 | int ret; | ||
474 | |||
475 | spin_lock_irqsave(&alchemy_usb_lock, flags); | ||
476 | switch (alchemy_get_cputype()) { | ||
477 | case ALCHEMY_CPU_AU1000: | ||
478 | case ALCHEMY_CPU_AU1500: | ||
479 | case ALCHEMY_CPU_AU1100: | ||
480 | ret = au1000_usb_control(block, enable, | ||
481 | AU1000_USB_OHCI_PHYS_ADDR, AU1000_OHCICFG); | ||
482 | break; | ||
483 | case ALCHEMY_CPU_AU1550: | ||
484 | ret = au1000_usb_control(block, enable, | ||
485 | AU1550_USB_OHCI_PHYS_ADDR, AU1550_OHCICFG); | ||
486 | break; | ||
487 | case ALCHEMY_CPU_AU1200: | ||
488 | ret = au1200_usb_control(block, enable); | ||
489 | break; | ||
490 | case ALCHEMY_CPU_AU1300: | ||
491 | ret = au1300_usb_control(block, enable); | ||
492 | break; | ||
493 | default: | ||
494 | ret = -ENODEV; | ||
495 | } | ||
496 | spin_unlock_irqrestore(&alchemy_usb_lock, flags); | ||
497 | return ret; | ||
498 | } | ||
499 | EXPORT_SYMBOL_GPL(alchemy_usb_control); | ||
500 | |||
501 | |||
502 | static unsigned long alchemy_usb_pmdata[2]; | ||
503 | |||
504 | static void au1000_usb_pm(unsigned long br, int creg, int susp) | ||
505 | { | ||
506 | void __iomem *base = (void __iomem *)KSEG1ADDR(br); | ||
507 | |||
508 | if (susp) { | ||
509 | alchemy_usb_pmdata[0] = __raw_readl(base + creg); | ||
510 | /* There appears to be some undocumented reset register.... */ | ||
511 | __raw_writel(0, base + 0x04); | ||
512 | wmb(); | ||
513 | __raw_writel(0, base + creg); | ||
514 | wmb(); | ||
515 | } else { | ||
516 | __raw_writel(alchemy_usb_pmdata[0], base + creg); | ||
517 | wmb(); | ||
518 | } | ||
519 | } | ||
520 | |||
521 | static void au1200_usb_pm(int susp) | ||
522 | { | ||
523 | void __iomem *base = | ||
524 | (void __iomem *)KSEG1ADDR(AU1200_USB_OTG_PHYS_ADDR); | ||
525 | if (susp) { | ||
526 | /* save OTG_CAP/MUX registers which indicate port routing */ | ||
527 | /* FIXME: write an OTG driver to do that */ | ||
528 | alchemy_usb_pmdata[0] = __raw_readl(base + 0x00); | ||
529 | alchemy_usb_pmdata[1] = __raw_readl(base + 0x04); | ||
530 | } else { | ||
531 | /* restore access to all MMIO areas */ | ||
532 | au1200_usb_init(); | ||
533 | |||
534 | /* restore OTG_CAP/MUX registers */ | ||
535 | __raw_writel(alchemy_usb_pmdata[0], base + 0x00); | ||
536 | __raw_writel(alchemy_usb_pmdata[1], base + 0x04); | ||
537 | wmb(); | ||
538 | } | ||
539 | } | ||
540 | |||
541 | static void au1300_usb_pm(int susp) | ||
542 | { | ||
543 | void __iomem *base = | ||
544 | (void __iomem *)KSEG1ADDR(AU1300_USB_CTL_PHYS_ADDR); | ||
545 | /* remember Port2 routing */ | ||
546 | if (susp) { | ||
547 | alchemy_usb_pmdata[0] = __raw_readl(base + USB_DWC_CTRL4); | ||
548 | } else { | ||
549 | au1300_usb_init(); | ||
550 | __raw_writel(alchemy_usb_pmdata[0], base + USB_DWC_CTRL4); | ||
551 | wmb(); | ||
552 | } | ||
553 | } | ||
554 | |||
555 | static void alchemy_usb_pm(int susp) | ||
556 | { | ||
557 | switch (alchemy_get_cputype()) { | ||
558 | case ALCHEMY_CPU_AU1000: | ||
559 | case ALCHEMY_CPU_AU1500: | ||
560 | case ALCHEMY_CPU_AU1100: | ||
561 | au1000_usb_pm(AU1000_USB_OHCI_PHYS_ADDR, AU1000_OHCICFG, susp); | ||
562 | break; | ||
563 | case ALCHEMY_CPU_AU1550: | ||
564 | au1000_usb_pm(AU1550_USB_OHCI_PHYS_ADDR, AU1550_OHCICFG, susp); | ||
565 | break; | ||
566 | case ALCHEMY_CPU_AU1200: | ||
567 | au1200_usb_pm(susp); | ||
568 | break; | ||
569 | case ALCHEMY_CPU_AU1300: | ||
570 | au1300_usb_pm(susp); | ||
571 | break; | ||
572 | } | ||
573 | } | ||
574 | |||
575 | static int alchemy_usb_suspend(void) | ||
576 | { | ||
577 | alchemy_usb_pm(1); | ||
578 | return 0; | ||
579 | } | ||
580 | |||
581 | static void alchemy_usb_resume(void) | ||
582 | { | ||
583 | alchemy_usb_pm(0); | ||
584 | } | ||
585 | |||
586 | static struct syscore_ops alchemy_usb_pm_ops = { | ||
587 | .suspend = alchemy_usb_suspend, | ||
588 | .resume = alchemy_usb_resume, | ||
589 | }; | ||
590 | |||
591 | static int __init alchemy_usb_init(void) | ||
592 | { | ||
593 | switch (alchemy_get_cputype()) { | ||
594 | case ALCHEMY_CPU_AU1000: | ||
595 | case ALCHEMY_CPU_AU1500: | ||
596 | case ALCHEMY_CPU_AU1100: | ||
597 | au1000_usb_init(AU1000_USB_OHCI_PHYS_ADDR, AU1000_OHCICFG); | ||
598 | break; | ||
599 | case ALCHEMY_CPU_AU1550: | ||
600 | au1000_usb_init(AU1550_USB_OHCI_PHYS_ADDR, AU1550_OHCICFG); | ||
601 | break; | ||
602 | case ALCHEMY_CPU_AU1200: | ||
603 | au1200_usb_init(); | ||
604 | break; | ||
605 | case ALCHEMY_CPU_AU1300: | ||
606 | au1300_usb_init(); | ||
607 | break; | ||
608 | } | ||
609 | |||
610 | register_syscore_ops(&alchemy_usb_pm_ops); | ||
611 | |||
612 | return 0; | ||
613 | } | ||
614 | arch_initcall(alchemy_usb_init); | ||
diff --git a/arch/mips/ath79/dev-usb.c b/arch/mips/ath79/dev-usb.c index 072bb9be2304..bd2bc108e1b5 100644 --- a/arch/mips/ath79/dev-usb.c +++ b/arch/mips/ath79/dev-usb.c | |||
@@ -50,13 +50,11 @@ static u64 ath79_ehci_dmamask = DMA_BIT_MASK(32); | |||
50 | 50 | ||
51 | static struct usb_ehci_pdata ath79_ehci_pdata_v1 = { | 51 | static struct usb_ehci_pdata ath79_ehci_pdata_v1 = { |
52 | .has_synopsys_hc_bug = 1, | 52 | .has_synopsys_hc_bug = 1, |
53 | .port_power_off = 1, | ||
54 | }; | 53 | }; |
55 | 54 | ||
56 | static struct usb_ehci_pdata ath79_ehci_pdata_v2 = { | 55 | static struct usb_ehci_pdata ath79_ehci_pdata_v2 = { |
57 | .caps_offset = 0x100, | 56 | .caps_offset = 0x100, |
58 | .has_tt = 1, | 57 | .has_tt = 1, |
59 | .port_power_off = 1, | ||
60 | }; | 58 | }; |
61 | 59 | ||
62 | static struct platform_device ath79_ehci_device = { | 60 | static struct platform_device ath79_ehci_device = { |
diff --git a/arch/mips/configs/bcm47xx_defconfig b/arch/mips/configs/bcm47xx_defconfig index b6fde2bb51b6..4ca8e5c99225 100644 --- a/arch/mips/configs/bcm47xx_defconfig +++ b/arch/mips/configs/bcm47xx_defconfig | |||
@@ -473,7 +473,7 @@ CONFIG_USB_GADGET_NET2280=y | |||
473 | CONFIG_USB_ZERO=m | 473 | CONFIG_USB_ZERO=m |
474 | CONFIG_USB_ETH=m | 474 | CONFIG_USB_ETH=m |
475 | CONFIG_USB_GADGETFS=m | 475 | CONFIG_USB_GADGETFS=m |
476 | CONFIG_USB_FILE_STORAGE=m | 476 | CONFIG_USB_MASS_STORAGE=m |
477 | CONFIG_USB_G_SERIAL=m | 477 | CONFIG_USB_G_SERIAL=m |
478 | CONFIG_USB_MIDI_GADGET=m | 478 | CONFIG_USB_MIDI_GADGET=m |
479 | CONFIG_LEDS_CLASS=y | 479 | CONFIG_LEDS_CLASS=y |
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig index 17a36c125172..face9d26e6d5 100644 --- a/arch/mips/configs/db1000_defconfig +++ b/arch/mips/configs/db1000_defconfig | |||
@@ -233,6 +233,7 @@ CONFIG_USB_EHCI_HCD=y | |||
233 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 233 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
234 | CONFIG_USB_EHCI_TT_NEWSCHED=y | 234 | CONFIG_USB_EHCI_TT_NEWSCHED=y |
235 | CONFIG_USB_OHCI_HCD=y | 235 | CONFIG_USB_OHCI_HCD=y |
236 | CONFIG_USB_OHCI_HCD_PLATFORM=y | ||
236 | CONFIG_USB_UHCI_HCD=y | 237 | CONFIG_USB_UHCI_HCD=y |
237 | CONFIG_USB_STORAGE=y | 238 | CONFIG_USB_STORAGE=y |
238 | CONFIG_NEW_LEDS=y | 239 | CONFIG_NEW_LEDS=y |
diff --git a/arch/mips/configs/db1235_defconfig b/arch/mips/configs/db1235_defconfig index c48998ffd198..14752dde7540 100644 --- a/arch/mips/configs/db1235_defconfig +++ b/arch/mips/configs/db1235_defconfig | |||
@@ -346,8 +346,10 @@ CONFIG_USB=y | |||
346 | CONFIG_USB_DYNAMIC_MINORS=y | 346 | CONFIG_USB_DYNAMIC_MINORS=y |
347 | CONFIG_USB_SUSPEND=y | 347 | CONFIG_USB_SUSPEND=y |
348 | CONFIG_USB_EHCI_HCD=y | 348 | CONFIG_USB_EHCI_HCD=y |
349 | CONFIG_USB_EHCI_HCD_PLATFORM=y | ||
349 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 350 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
350 | CONFIG_USB_OHCI_HCD=y | 351 | CONFIG_USB_OHCI_HCD=y |
352 | CONFIG_USB_OHCI_HCD_PLATFORM=y | ||
351 | CONFIG_USB_STORAGE=y | 353 | CONFIG_USB_STORAGE=y |
352 | CONFIG_MMC=y | 354 | CONFIG_MMC=y |
353 | CONFIG_MMC_CLKGATE=y | 355 | CONFIG_MMC_CLKGATE=y |
diff --git a/arch/mips/configs/gpr_defconfig b/arch/mips/configs/gpr_defconfig index 48a40aefaf58..fb64589015fc 100644 --- a/arch/mips/configs/gpr_defconfig +++ b/arch/mips/configs/gpr_defconfig | |||
@@ -291,6 +291,7 @@ CONFIG_USB_MON=y | |||
291 | CONFIG_USB_EHCI_HCD=y | 291 | CONFIG_USB_EHCI_HCD=y |
292 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 292 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
293 | CONFIG_USB_OHCI_HCD=y | 293 | CONFIG_USB_OHCI_HCD=y |
294 | CONFIG_USB_OHCI_HCD_PLATFORM=y | ||
294 | CONFIG_USB_STORAGE=m | 295 | CONFIG_USB_STORAGE=m |
295 | CONFIG_USB_LIBUSUAL=y | 296 | CONFIG_USB_LIBUSUAL=y |
296 | CONFIG_USB_SERIAL=y | 297 | CONFIG_USB_SERIAL=y |
diff --git a/arch/mips/configs/ls1b_defconfig b/arch/mips/configs/ls1b_defconfig index 80cff8bea8e8..7eb75543ca1a 100644 --- a/arch/mips/configs/ls1b_defconfig +++ b/arch/mips/configs/ls1b_defconfig | |||
@@ -76,6 +76,7 @@ CONFIG_HID_GENERIC=m | |||
76 | CONFIG_USB=y | 76 | CONFIG_USB=y |
77 | CONFIG_USB_ANNOUNCE_NEW_DEVICES=y | 77 | CONFIG_USB_ANNOUNCE_NEW_DEVICES=y |
78 | CONFIG_USB_EHCI_HCD=y | 78 | CONFIG_USB_EHCI_HCD=y |
79 | CONFIG_USB_EHCI_HCD_PLATFORM=y | ||
79 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | 80 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set |
80 | CONFIG_USB_STORAGE=m | 81 | CONFIG_USB_STORAGE=m |
81 | CONFIG_USB_SERIAL=m | 82 | CONFIG_USB_SERIAL=m |
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig index 46c61edcdf7b..9fa8f16068d8 100644 --- a/arch/mips/configs/mtx1_defconfig +++ b/arch/mips/configs/mtx1_defconfig | |||
@@ -581,6 +581,7 @@ CONFIG_USB_MON=m | |||
581 | CONFIG_USB_EHCI_HCD=m | 581 | CONFIG_USB_EHCI_HCD=m |
582 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 582 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
583 | CONFIG_USB_OHCI_HCD=m | 583 | CONFIG_USB_OHCI_HCD=m |
584 | CONFIG_USB_OHCI_HCD_PLATFORM=y | ||
584 | CONFIG_USB_UHCI_HCD=m | 585 | CONFIG_USB_UHCI_HCD=m |
585 | CONFIG_USB_U132_HCD=m | 586 | CONFIG_USB_U132_HCD=m |
586 | CONFIG_USB_SL811_HCD=m | 587 | CONFIG_USB_SL811_HCD=m |
@@ -661,7 +662,7 @@ CONFIG_USB_GADGET_NET2280=y | |||
661 | CONFIG_USB_ZERO=m | 662 | CONFIG_USB_ZERO=m |
662 | CONFIG_USB_ETH=m | 663 | CONFIG_USB_ETH=m |
663 | CONFIG_USB_GADGETFS=m | 664 | CONFIG_USB_GADGETFS=m |
664 | CONFIG_USB_FILE_STORAGE=m | 665 | CONFIG_USB_MASS_STORAGE=m |
665 | CONFIG_USB_G_SERIAL=m | 666 | CONFIG_USB_G_SERIAL=m |
666 | CONFIG_USB_MIDI_GADGET=m | 667 | CONFIG_USB_MIDI_GADGET=m |
667 | CONFIG_MMC=m | 668 | CONFIG_MMC=m |
diff --git a/arch/mips/loongson1/common/platform.c b/arch/mips/loongson1/common/platform.c index e92d59c4bd78..0412ad61e290 100644 --- a/arch/mips/loongson1/common/platform.c +++ b/arch/mips/loongson1/common/platform.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/phy.h> | 13 | #include <linux/phy.h> |
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/stmmac.h> | 15 | #include <linux/stmmac.h> |
16 | #include <linux/usb/ehci_pdriver.h> | ||
16 | #include <asm-generic/sizes.h> | 17 | #include <asm-generic/sizes.h> |
17 | 18 | ||
18 | #include <loongson1.h> | 19 | #include <loongson1.h> |
@@ -107,13 +108,17 @@ static struct resource ls1x_ehci_resources[] = { | |||
107 | }, | 108 | }, |
108 | }; | 109 | }; |
109 | 110 | ||
111 | static struct usb_ehci_pdata ls1x_ehci_pdata = { | ||
112 | }; | ||
113 | |||
110 | struct platform_device ls1x_ehci_device = { | 114 | struct platform_device ls1x_ehci_device = { |
111 | .name = "ls1x-ehci", | 115 | .name = "ehci-platform", |
112 | .id = -1, | 116 | .id = -1, |
113 | .num_resources = ARRAY_SIZE(ls1x_ehci_resources), | 117 | .num_resources = ARRAY_SIZE(ls1x_ehci_resources), |
114 | .resource = ls1x_ehci_resources, | 118 | .resource = ls1x_ehci_resources, |
115 | .dev = { | 119 | .dev = { |
116 | .dma_mask = &ls1x_ehci_dmamask, | 120 | .dma_mask = &ls1x_ehci_dmamask, |
121 | .platform_data = &ls1x_ehci_pdata, | ||
117 | }, | 122 | }, |
118 | }; | 123 | }; |
119 | 124 | ||
diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c index 71b44d82621d..507230eeb768 100644 --- a/arch/mips/netlogic/xlr/platform.c +++ b/arch/mips/netlogic/xlr/platform.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <linux/serial_8250.h> | 15 | #include <linux/serial_8250.h> |
16 | #include <linux/serial_reg.h> | 16 | #include <linux/serial_reg.h> |
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/usb/ehci_pdriver.h> | ||
19 | #include <linux/usb/ohci_pdriver.h> | ||
18 | 20 | ||
19 | #include <asm/netlogic/haldefs.h> | 21 | #include <asm/netlogic/haldefs.h> |
20 | #include <asm/netlogic/xlr/iomap.h> | 22 | #include <asm/netlogic/xlr/iomap.h> |
@@ -123,12 +125,18 @@ static u64 xls_usb_dmamask = ~(u32)0; | |||
123 | }, \ | 125 | }, \ |
124 | } | 126 | } |
125 | 127 | ||
128 | static struct usb_ehci_pdata xls_usb_ehci_pdata = { | ||
129 | .caps_offset = 0, | ||
130 | }; | ||
131 | |||
132 | static struct usb_ohci_pdata xls_usb_ohci_pdata; | ||
133 | |||
126 | static struct platform_device xls_usb_ehci_device = | 134 | static struct platform_device xls_usb_ehci_device = |
127 | USB_PLATFORM_DEV("ehci-xls", 0, PIC_USB_IRQ); | 135 | USB_PLATFORM_DEV("ehci-platform", 0, PIC_USB_IRQ); |
128 | static struct platform_device xls_usb_ohci_device_0 = | 136 | static struct platform_device xls_usb_ohci_device_0 = |
129 | USB_PLATFORM_DEV("ohci-xls-0", 1, PIC_USB_IRQ); | 137 | USB_PLATFORM_DEV("ohci-platform", 1, PIC_USB_IRQ); |
130 | static struct platform_device xls_usb_ohci_device_1 = | 138 | static struct platform_device xls_usb_ohci_device_1 = |
131 | USB_PLATFORM_DEV("ohci-xls-1", 2, PIC_USB_IRQ); | 139 | USB_PLATFORM_DEV("ohci-platform", 2, PIC_USB_IRQ); |
132 | 140 | ||
133 | static struct platform_device *xls_platform_devices[] = { | 141 | static struct platform_device *xls_platform_devices[] = { |
134 | &xls_usb_ehci_device, | 142 | &xls_usb_ehci_device, |
@@ -172,14 +180,17 @@ int xls_platform_usb_init(void) | |||
172 | memres = CPHYSADDR((unsigned long)usb_mmio); | 180 | memres = CPHYSADDR((unsigned long)usb_mmio); |
173 | xls_usb_ehci_device.resource[0].start = memres; | 181 | xls_usb_ehci_device.resource[0].start = memres; |
174 | xls_usb_ehci_device.resource[0].end = memres + 0x400 - 1; | 182 | xls_usb_ehci_device.resource[0].end = memres + 0x400 - 1; |
183 | xls_usb_ehci_device.dev.platform_data = &xls_usb_ehci_pdata; | ||
175 | 184 | ||
176 | memres += 0x400; | 185 | memres += 0x400; |
177 | xls_usb_ohci_device_0.resource[0].start = memres; | 186 | xls_usb_ohci_device_0.resource[0].start = memres; |
178 | xls_usb_ohci_device_0.resource[0].end = memres + 0x400 - 1; | 187 | xls_usb_ohci_device_0.resource[0].end = memres + 0x400 - 1; |
188 | xls_usb_ohci_device_0.dev.platform_data = &xls_usb_ohci_pdata; | ||
179 | 189 | ||
180 | memres += 0x400; | 190 | memres += 0x400; |
181 | xls_usb_ohci_device_1.resource[0].start = memres; | 191 | xls_usb_ohci_device_1.resource[0].start = memres; |
182 | xls_usb_ohci_device_1.resource[0].end = memres + 0x400 - 1; | 192 | xls_usb_ohci_device_1.resource[0].end = memres + 0x400 - 1; |
193 | xls_usb_ohci_device_1.dev.platform_data = &xls_usb_ohci_pdata; | ||
183 | 194 | ||
184 | return platform_add_devices(xls_platform_devices, | 195 | return platform_add_devices(xls_platform_devices, |
185 | ARRAY_SIZE(xls_platform_devices)); | 196 | ARRAY_SIZE(xls_platform_devices)); |
diff --git a/arch/mips/pnx8550/common/platform.c b/arch/mips/pnx8550/common/platform.c index 5264cc09a27b..0a8faeaa7b70 100644 --- a/arch/mips/pnx8550/common/platform.c +++ b/arch/mips/pnx8550/common/platform.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/serial.h> | 20 | #include <linux/serial.h> |
21 | #include <linux/serial_pnx8xxx.h> | 21 | #include <linux/serial_pnx8xxx.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/usb/ohci_pdriver.h> | ||
23 | 24 | ||
24 | #include <int.h> | 25 | #include <int.h> |
25 | #include <usb.h> | 26 | #include <usb.h> |
@@ -96,12 +97,40 @@ static u64 ohci_dmamask = DMA_BIT_MASK(32); | |||
96 | 97 | ||
97 | static u64 uart_dmamask = DMA_BIT_MASK(32); | 98 | static u64 uart_dmamask = DMA_BIT_MASK(32); |
98 | 99 | ||
100 | static int pnx8550_usb_ohci_power_on(struct platform_device *pdev) | ||
101 | { | ||
102 | /* | ||
103 | * Set register CLK48CTL to enable and 48MHz | ||
104 | */ | ||
105 | outl(0x00000003, PCI_BASE | 0x0004770c); | ||
106 | |||
107 | /* | ||
108 | * Set register CLK12CTL to enable and 48MHz | ||
109 | */ | ||
110 | outl(0x00000003, PCI_BASE | 0x00047710); | ||
111 | |||
112 | udelay(100); | ||
113 | |||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | static void pnx8550_usb_ohci_power_off(struct platform_device *pdev) | ||
118 | { | ||
119 | udelay(10); | ||
120 | } | ||
121 | |||
122 | static struct usb_ohci_pdata pnx8550_usb_ohci_pdata = { | ||
123 | .power_on = pnx8550_usb_ohci_power_on, | ||
124 | .power_off = pnx8550_usb_ohci_power_off, | ||
125 | }; | ||
126 | |||
99 | static struct platform_device pnx8550_usb_ohci_device = { | 127 | static struct platform_device pnx8550_usb_ohci_device = { |
100 | .name = "pnx8550-ohci", | 128 | .name = "ohci-platform", |
101 | .id = -1, | 129 | .id = -1, |
102 | .dev = { | 130 | .dev = { |
103 | .dma_mask = &ohci_dmamask, | 131 | .dma_mask = &ohci_dmamask, |
104 | .coherent_dma_mask = DMA_BIT_MASK(32), | 132 | .coherent_dma_mask = DMA_BIT_MASK(32), |
133 | .platform_data = &pnx8550_usb_ohci_pdata, | ||
105 | }, | 134 | }, |
106 | .num_resources = ARRAY_SIZE(pnx8550_usb_ohci_resources), | 135 | .num_resources = ARRAY_SIZE(pnx8550_usb_ohci_resources), |
107 | .resource = pnx8550_usb_ohci_resources, | 136 | .resource = pnx8550_usb_ohci_resources, |
diff --git a/arch/sh/configs/ecovec24_defconfig b/arch/sh/configs/ecovec24_defconfig index 911e30c9abfd..c6c2becdc8ab 100644 --- a/arch/sh/configs/ecovec24_defconfig +++ b/arch/sh/configs/ecovec24_defconfig | |||
@@ -112,7 +112,7 @@ CONFIG_USB_MON=y | |||
112 | CONFIG_USB_R8A66597_HCD=y | 112 | CONFIG_USB_R8A66597_HCD=y |
113 | CONFIG_USB_STORAGE=y | 113 | CONFIG_USB_STORAGE=y |
114 | CONFIG_USB_GADGET=y | 114 | CONFIG_USB_GADGET=y |
115 | CONFIG_USB_FILE_STORAGE=m | 115 | CONFIG_USB_MASS_STORAGE=m |
116 | CONFIG_MMC=y | 116 | CONFIG_MMC=y |
117 | CONFIG_MMC_SPI=y | 117 | CONFIG_MMC_SPI=y |
118 | CONFIG_MMC_SDHI=y | 118 | CONFIG_MMC_SDHI=y |
diff --git a/arch/sh/configs/se7724_defconfig b/arch/sh/configs/se7724_defconfig index ed35093e3758..1faa788aecae 100644 --- a/arch/sh/configs/se7724_defconfig +++ b/arch/sh/configs/se7724_defconfig | |||
@@ -109,7 +109,7 @@ CONFIG_USB_STORAGE=y | |||
109 | CONFIG_USB_GADGET=y | 109 | CONFIG_USB_GADGET=y |
110 | CONFIG_USB_ETH=m | 110 | CONFIG_USB_ETH=m |
111 | CONFIG_USB_GADGETFS=m | 111 | CONFIG_USB_GADGETFS=m |
112 | CONFIG_USB_FILE_STORAGE=m | 112 | CONFIG_USB_MASS_STORAGE=m |
113 | CONFIG_USB_G_SERIAL=m | 113 | CONFIG_USB_G_SERIAL=m |
114 | CONFIG_MMC=y | 114 | CONFIG_MMC=y |
115 | CONFIG_MMC_SPI=y | 115 | CONFIG_MMC_SPI=y |
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index 0c2f1b2c2e19..42d991f632b1 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/serial_sci.h> | 20 | #include <linux/serial_sci.h> |
21 | #include <linux/sh_timer.h> | 21 | #include <linux/sh_timer.h> |
22 | #include <linux/sh_intc.h> | 22 | #include <linux/sh_intc.h> |
23 | #include <linux/usb/ohci_pdriver.h> | ||
23 | #include <asm/rtc.h> | 24 | #include <asm/rtc.h> |
24 | #include <cpu/serial.h> | 25 | #include <cpu/serial.h> |
25 | 26 | ||
@@ -103,12 +104,15 @@ static struct resource usb_ohci_resources[] = { | |||
103 | 104 | ||
104 | static u64 usb_ohci_dma_mask = 0xffffffffUL; | 105 | static u64 usb_ohci_dma_mask = 0xffffffffUL; |
105 | 106 | ||
107 | static struct usb_ohci_pdata usb_ohci_pdata; | ||
108 | |||
106 | static struct platform_device usb_ohci_device = { | 109 | static struct platform_device usb_ohci_device = { |
107 | .name = "sh_ohci", | 110 | .name = "ohci-platform", |
108 | .id = -1, | 111 | .id = -1, |
109 | .dev = { | 112 | .dev = { |
110 | .dma_mask = &usb_ohci_dma_mask, | 113 | .dma_mask = &usb_ohci_dma_mask, |
111 | .coherent_dma_mask = 0xffffffff, | 114 | .coherent_dma_mask = 0xffffffff, |
115 | .platform_data = &usb_ohci_pdata, | ||
112 | }, | 116 | }, |
113 | .num_resources = ARRAY_SIZE(usb_ohci_resources), | 117 | .num_resources = ARRAY_SIZE(usb_ohci_resources), |
114 | .resource = usb_ohci_resources, | 118 | .resource = usb_ohci_resources, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index 4a2f357f4df8..9079a0f9ea9b 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/sh_timer.h> | 19 | #include <linux/sh_timer.h> |
20 | #include <linux/sh_dma.h> | 20 | #include <linux/sh_dma.h> |
21 | #include <linux/sh_intc.h> | 21 | #include <linux/sh_intc.h> |
22 | #include <linux/usb/ohci_pdriver.h> | ||
22 | #include <cpu/dma-register.h> | 23 | #include <cpu/dma-register.h> |
23 | #include <cpu/sh7757.h> | 24 | #include <cpu/sh7757.h> |
24 | 25 | ||
@@ -750,12 +751,15 @@ static struct resource usb_ohci_resources[] = { | |||
750 | }, | 751 | }, |
751 | }; | 752 | }; |
752 | 753 | ||
754 | static struct usb_ohci_pdata usb_ohci_pdata; | ||
755 | |||
753 | static struct platform_device usb_ohci_device = { | 756 | static struct platform_device usb_ohci_device = { |
754 | .name = "sh_ohci", | 757 | .name = "ohci-platform", |
755 | .id = -1, | 758 | .id = -1, |
756 | .dev = { | 759 | .dev = { |
757 | .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, | 760 | .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, |
758 | .coherent_dma_mask = DMA_BIT_MASK(32), | 761 | .coherent_dma_mask = DMA_BIT_MASK(32), |
762 | .platform_data = &usb_ohci_pdata, | ||
759 | }, | 763 | }, |
760 | .num_resources = ARRAY_SIZE(usb_ohci_resources), | 764 | .num_resources = ARRAY_SIZE(usb_ohci_resources), |
761 | .resource = usb_ohci_resources, | 765 | .resource = usb_ohci_resources, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c index bd0a8fbe610f..1686acaaf45a 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/sh_intc.h> | 16 | #include <linux/sh_intc.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/serial_sci.h> | 18 | #include <linux/serial_sci.h> |
19 | #include <linux/usb/ohci_pdriver.h> | ||
19 | 20 | ||
20 | static struct plat_sci_port scif0_platform_data = { | 21 | static struct plat_sci_port scif0_platform_data = { |
21 | .mapbase = 0xffe00000, | 22 | .mapbase = 0xffe00000, |
@@ -106,12 +107,15 @@ static struct resource usb_ohci_resources[] = { | |||
106 | 107 | ||
107 | static u64 usb_ohci_dma_mask = 0xffffffffUL; | 108 | static u64 usb_ohci_dma_mask = 0xffffffffUL; |
108 | 109 | ||
110 | static struct usb_ohci_pdata usb_ohci_pdata; | ||
111 | |||
109 | static struct platform_device usb_ohci_device = { | 112 | static struct platform_device usb_ohci_device = { |
110 | .name = "sh_ohci", | 113 | .name = "ohci-platform", |
111 | .id = -1, | 114 | .id = -1, |
112 | .dev = { | 115 | .dev = { |
113 | .dma_mask = &usb_ohci_dma_mask, | 116 | .dma_mask = &usb_ohci_dma_mask, |
114 | .coherent_dma_mask = 0xffffffff, | 117 | .coherent_dma_mask = 0xffffffff, |
118 | .platform_data = &usb_ohci_pdata, | ||
115 | }, | 119 | }, |
116 | .num_resources = ARRAY_SIZE(usb_ohci_resources), | 120 | .num_resources = ARRAY_SIZE(usb_ohci_resources), |
117 | .resource = usb_ohci_resources, | 121 | .resource = usb_ohci_resources, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c index 2e6952f87848..ab52d4d4484d 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/sh_timer.h> | 23 | #include <linux/sh_timer.h> |
24 | #include <linux/sh_dma.h> | 24 | #include <linux/sh_dma.h> |
25 | #include <linux/sh_intc.h> | 25 | #include <linux/sh_intc.h> |
26 | #include <linux/usb/ohci_pdriver.h> | ||
26 | #include <cpu/dma-register.h> | 27 | #include <cpu/dma-register.h> |
27 | #include <asm/mmzone.h> | 28 | #include <asm/mmzone.h> |
28 | 29 | ||
@@ -583,12 +584,15 @@ static struct resource usb_ohci_resources[] = { | |||
583 | }, | 584 | }, |
584 | }; | 585 | }; |
585 | 586 | ||
587 | static struct usb_ohci_pdata usb_ohci_pdata; | ||
588 | |||
586 | static struct platform_device usb_ohci_device = { | 589 | static struct platform_device usb_ohci_device = { |
587 | .name = "sh_ohci", | 590 | .name = "ohci-platform", |
588 | .id = -1, | 591 | .id = -1, |
589 | .dev = { | 592 | .dev = { |
590 | .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, | 593 | .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, |
591 | .coherent_dma_mask = DMA_BIT_MASK(32), | 594 | .coherent_dma_mask = DMA_BIT_MASK(32), |
595 | .platform_data = &usb_ohci_pdata, | ||
592 | }, | 596 | }, |
593 | .num_resources = ARRAY_SIZE(usb_ohci_resources), | 597 | .num_resources = ARRAY_SIZE(usb_ohci_resources), |
594 | .resource = usb_ohci_resources, | 598 | .resource = usb_ohci_resources, |