15 #include <mach/irqs.h>
16 #include <mach/devices.h>
17 #include <mach/cputype.h>
18 #include <mach/regs-usb.h>
24 struct resource res[2 + MAX_RESOURCE_DMA];
25 int i,
ret = 0, nres = 0;
33 memset(res, 0,
sizeof(res));
35 if (desc->
start != -1ul && desc->
size > 0) {
50 if (desc->
dma[i] == 0)
75 #if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET)
81 static unsigned int u2o_get(
void __iomem *base,
unsigned int offset)
93 writel_relaxed(reg, base + offset);
97 static void u2o_clear(
void __iomem *base,
unsigned int offset,
104 writel_relaxed(reg, base + offset);
108 static void u2o_write(
void __iomem *base,
unsigned int offset,
111 writel_relaxed(value, base + offset);
115 #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV)
117 #if defined(CONFIG_CPU_PXA910) || defined(CONFIG_CPU_PXA168)
120 static int phy_init_cnt;
122 static int usb_phy_init_internal(
void __iomem *base)
203 static int usb_phy_deinit_internal(
void __iomem *base)
205 pr_info(
"Deinit usb phy!!!\n");
222 if (phy_init_cnt++ == 0)
223 usb_phy_init_internal(phy_reg);
233 if (--phy_init_cnt == 0)
234 usb_phy_deinit_internal(phy_reg);
241 #ifdef CONFIG_USB_SUPPORT
242 static u64 usb_dma_mask = ~(
u32)0;
244 #ifdef CONFIG_USB_MV_UDC
245 struct resource pxa168_u2o_resources[] = {
270 .resource = pxa168_u2o_resources,
271 .num_resources =
ARRAY_SIZE(pxa168_u2o_resources),
273 .dma_mask = &usb_dma_mask,
274 .coherent_dma_mask = 0xffffffff,
279 #ifdef CONFIG_USB_EHCI_MV_U2O
280 struct resource pxa168_u2oehci_resources[] = {
303 .name =
"pxa-u2oehci",
306 .dma_mask = &usb_dma_mask,
307 .coherent_dma_mask = 0xffffffff,
310 .num_resources =
ARRAY_SIZE(pxa168_u2oehci_resources),
311 .resource = pxa168_u2oehci_resources,
315 #if defined(CONFIG_USB_MV_OTG)
316 struct resource pxa168_u2ootg_resources[] = {
342 .dma_mask = &usb_dma_mask,
343 .coherent_dma_mask = 0xffffffff,
346 .num_resources =
ARRAY_SIZE(pxa168_u2ootg_resources),
347 .resource = pxa168_u2ootg_resources,