Lines Matching refs:base
98 static inline void __au1300_usb_phyctl(void __iomem *base, int enable) in __au1300_usb_phyctl() argument
102 r = __raw_readl(base + USB_DWC_CTRL2); in __au1300_usb_phyctl()
103 s = __raw_readl(base + USB_DWC_CTRL3); in __au1300_usb_phyctl()
112 __raw_writel(r, base + USB_DWC_CTRL2); in __au1300_usb_phyctl()
118 __raw_writel(r, base + USB_DWC_CTRL2); in __au1300_usb_phyctl()
123 static inline void __au1300_ohci_control(void __iomem *base, int enable, int id) in __au1300_ohci_control() argument
128 __raw_writel(1, base + USB_DWC_CTRL7); /* start OHCI clock */ in __au1300_ohci_control()
131 r = __raw_readl(base + USB_DWC_CTRL3); /* enable OHCI block */ in __au1300_ohci_control()
134 __raw_writel(r, base + USB_DWC_CTRL3); in __au1300_ohci_control()
137 __au1300_usb_phyctl(base, enable); /* power up the PHYs */ in __au1300_ohci_control()
139 r = __raw_readl(base + USB_INT_ENABLE); in __au1300_ohci_control()
141 __raw_writel(r, base + USB_INT_ENABLE); in __au1300_ohci_control()
145 __raw_writel(0, base + USB_DWC_CTRL7); in __au1300_ohci_control()
148 r = __raw_readl(base + USB_INT_ENABLE); in __au1300_ohci_control()
150 __raw_writel(r, base + USB_INT_ENABLE); in __au1300_ohci_control()
153 r = __raw_readl(base + USB_DWC_CTRL3); in __au1300_ohci_control()
156 __raw_writel(r, base + USB_DWC_CTRL3); in __au1300_ohci_control()
159 __au1300_usb_phyctl(base, enable); in __au1300_ohci_control()
163 static inline void __au1300_ehci_control(void __iomem *base, int enable) in __au1300_ehci_control() argument
168 r = __raw_readl(base + USB_DWC_CTRL3); in __au1300_ehci_control()
170 __raw_writel(r, base + USB_DWC_CTRL3); in __au1300_ehci_control()
173 r = __raw_readl(base + USB_DWC_CTRL1); in __au1300_ehci_control()
175 __raw_writel(r, base + USB_DWC_CTRL1); in __au1300_ehci_control()
178 __au1300_usb_phyctl(base, enable); in __au1300_ehci_control()
180 r = __raw_readl(base + USB_INT_ENABLE); in __au1300_ehci_control()
182 __raw_writel(r, base + USB_INT_ENABLE); in __au1300_ehci_control()
185 r = __raw_readl(base + USB_INT_ENABLE); in __au1300_ehci_control()
187 __raw_writel(r, base + USB_INT_ENABLE); in __au1300_ehci_control()
190 r = __raw_readl(base + USB_DWC_CTRL1); in __au1300_ehci_control()
192 __raw_writel(r, base + USB_DWC_CTRL1); in __au1300_ehci_control()
195 r = __raw_readl(base + USB_DWC_CTRL3); in __au1300_ehci_control()
197 __raw_writel(r, base + USB_DWC_CTRL3); in __au1300_ehci_control()
200 __au1300_usb_phyctl(base, enable); in __au1300_ehci_control()
204 static inline void __au1300_udc_control(void __iomem *base, int enable) in __au1300_udc_control() argument
209 r = __raw_readl(base + USB_DWC_CTRL1); in __au1300_udc_control()
211 __raw_writel(r, base + USB_DWC_CTRL1); in __au1300_udc_control()
214 __au1300_usb_phyctl(base, enable); in __au1300_udc_control()
216 r = __raw_readl(base + USB_INT_ENABLE); in __au1300_udc_control()
218 __raw_writel(r, base + USB_INT_ENABLE); in __au1300_udc_control()
221 r = __raw_readl(base + USB_INT_ENABLE); in __au1300_udc_control()
223 __raw_writel(r, base + USB_INT_ENABLE); in __au1300_udc_control()
226 r = __raw_readl(base + USB_DWC_CTRL1); in __au1300_udc_control()
228 __raw_writel(r, base + USB_DWC_CTRL1); in __au1300_udc_control()
231 __au1300_usb_phyctl(base, enable); in __au1300_udc_control()
235 static inline void __au1300_otg_control(void __iomem *base, int enable) in __au1300_otg_control() argument
239 r = __raw_readl(base + USB_DWC_CTRL3); in __au1300_otg_control()
241 __raw_writel(r, base + USB_DWC_CTRL3); in __au1300_otg_control()
244 r = __raw_readl(base + USB_DWC_CTRL1); in __au1300_otg_control()
246 __raw_writel(r, base + USB_DWC_CTRL1); in __au1300_otg_control()
249 __au1300_usb_phyctl(base, enable); in __au1300_otg_control()
251 r = __raw_readl(base + USB_DWC_CTRL1); in __au1300_otg_control()
253 __raw_writel(r, base + USB_DWC_CTRL1); in __au1300_otg_control()
256 r = __raw_readl(base + USB_DWC_CTRL3); in __au1300_otg_control()
258 __raw_writel(r, base + USB_DWC_CTRL3); in __au1300_otg_control()
261 __au1300_usb_phyctl(base, enable); in __au1300_otg_control()
267 void __iomem *base = in au1300_usb_control() local
273 __au1300_ohci_control(base, enable, 0); in au1300_usb_control()
276 __au1300_ohci_control(base, enable, 1); in au1300_usb_control()
279 __au1300_ehci_control(base, enable); in au1300_usb_control()
282 __au1300_udc_control(base, enable); in au1300_usb_control()
285 __au1300_otg_control(base, enable); in au1300_usb_control()
295 void __iomem *base = in au1300_usb_init() local
303 __raw_writel(0, base + USB_INT_ENABLE); /* disable all USB irqs */ in au1300_usb_init()
305 __raw_writel(0, base + USB_DWC_CTRL3); /* disable all clocks */ in au1300_usb_init()
307 __raw_writel(~0, base + USB_MSR_ERR); /* clear all errors */ in au1300_usb_init()
309 __raw_writel(~0, base + USB_INT_STATUS); /* clear int status */ in au1300_usb_init()
312 __raw_writel(USB_SBUS_CTRL_SBCA, base + USB_SBUS_CTRL); in au1300_usb_init()
316 static inline void __au1200_ohci_control(void __iomem *base, int enable) in __au1200_ohci_control() argument
318 unsigned long r = __raw_readl(base + AU1200_USBCFG); in __au1200_ohci_control()
320 __raw_writel(r | USBCFG_OCE, base + AU1200_USBCFG); in __au1200_ohci_control()
324 __raw_writel(r & ~USBCFG_OCE, base + AU1200_USBCFG); in __au1200_ohci_control()
330 static inline void __au1200_ehci_control(void __iomem *base, int enable) in __au1200_ehci_control() argument
332 unsigned long r = __raw_readl(base + AU1200_USBCFG); in __au1200_ehci_control()
334 __raw_writel(r | USBCFG_ECE | USBCFG_PPE, base + AU1200_USBCFG); in __au1200_ehci_control()
340 __raw_writel(r & ~USBCFG_ECE, base + AU1200_USBCFG); in __au1200_ehci_control()
346 static inline void __au1200_udc_control(void __iomem *base, int enable) in __au1200_udc_control() argument
348 unsigned long r = __raw_readl(base + AU1200_USBCFG); in __au1200_udc_control()
350 __raw_writel(r | USBCFG_UCE | USBCFG_PPE, base + AU1200_USBCFG); in __au1200_udc_control()
355 __raw_writel(r & ~USBCFG_UCE, base + AU1200_USBCFG); in __au1200_udc_control()
362 void __iomem *base = in au1200_usb_control() local
367 __au1200_ohci_control(base, enable); in au1200_usb_control()
370 __au1200_udc_control(base, enable); in au1200_usb_control()
373 __au1200_ehci_control(base, enable); in au1200_usb_control()
385 void __iomem *base = in au1200_usb_init() local
387 __raw_writel(USBCFG_INIT_AU1200, base + AU1200_USBCFG); in au1200_usb_init()
394 void __iomem *base = (void __iomem *)KSEG1ADDR(rb + reg); in au1000_usb_init() local
395 unsigned long r = __raw_readl(base); in au1000_usb_init()
417 __raw_writel(r, base); in au1000_usb_init()
427 void __iomem *base = (void __iomem *)KSEG1ADDR(rb); in __au1xx0_ohci_control() local
428 unsigned long r = __raw_readl(base + creg); in __au1xx0_ohci_control()
438 __raw_writel(r | USBHEN_CE, base + creg); in __au1xx0_ohci_control()
441 __raw_writel(r | USBHEN_CE | USBHEN_E, base + creg); in __au1xx0_ohci_control()
446 while (__raw_readl(base + creg), in __au1xx0_ohci_control()
447 !(__raw_readl(base + creg) & USBHEN_RD)) in __au1xx0_ohci_control()
450 __raw_writel(r & ~(USBHEN_CE | USBHEN_E), base + creg); in __au1xx0_ohci_control()
514 void __iomem *base = (void __iomem *)KSEG1ADDR(br); in au1000_usb_pm() local
517 alchemy_usb_pmdata[0] = __raw_readl(base + creg); in au1000_usb_pm()
519 __raw_writel(0, base + 0x04); in au1000_usb_pm()
521 __raw_writel(0, base + creg); in au1000_usb_pm()
524 __raw_writel(alchemy_usb_pmdata[0], base + creg); in au1000_usb_pm()
531 void __iomem *base = in au1200_usb_pm() local
536 alchemy_usb_pmdata[0] = __raw_readl(base + 0x00); in au1200_usb_pm()
537 alchemy_usb_pmdata[1] = __raw_readl(base + 0x04); in au1200_usb_pm()
543 __raw_writel(alchemy_usb_pmdata[0], base + 0x00); in au1200_usb_pm()
544 __raw_writel(alchemy_usb_pmdata[1], base + 0x04); in au1200_usb_pm()
551 void __iomem *base = in au1300_usb_pm() local
555 alchemy_usb_pmdata[0] = __raw_readl(base + USB_DWC_CTRL4); in au1300_usb_pm()
558 __raw_writel(alchemy_usb_pmdata[0], base + USB_DWC_CTRL4); in au1300_usb_pm()