📄 usb-ohci-ep93xx.c
字号:
/* * linux/drivers/usb/usb-ohci-ep93xx.c * * The outline of this code was taken from Brad Parkers <brad@heeltoe.com> * original OHCI driver modifications, and reworked into a cleaner form * by Russell King <rmk@arm.linux.org.uk>. */#include <linux/module.h>#include <linux/init.h>#include <linux/sched.h>#include <linux/ioport.h>#include <linux/interrupt.h>#include <linux/slab.h>#include <linux/usb.h>#include <asm/hardware.h>#include <asm/irq.h>#include <asm/io.h>#include <asm/pci.h>#if defined(CONFIG_ARCH_EP93XX)extern struct pci_pool *pci_pool_create(const char *name, struct pci_dev *dev, size_t size, size_t align, size_t allocation, int flags);extern void pci_pool_destroy(struct pci_pool *pool);extern void *pci_pool_alloc(struct pci_pool *pool, int flags, dma_addr_t *handle);extern void pci_pool_free(struct pci_pool *pool, void *vaddr, dma_addr_t addr);#endif#include "usb-ohci.h"int __devinithc_add_ohci(struct pci_dev *dev, int irq, void *membase, unsigned long flags, const char *name, const char *slot_name);extern void hc_remove_ohci(ohci_t *ohci);static ohci_t *ep93xx_ohci;static void __init ep93xx_ohci_configure(void){#if defined(CONFIG_ARCH_EDB9312) || defined(CONFIG_ARCH_EDB9315) unsigned int uiPBDR, uiPBDDR;#endif /* * Configure the power sense and control lines. Place the USB * host controller in reset. */#if defined(CONFIG_ARCH_EDB9312) || defined(CONFIG_ARCH_EDB9315) /* * For EDB9315 boards, turn on USB by clearing EGPIO9. */ uiPBDR = inl(GPIO_PBDR) & 0xfd; outl( uiPBDR, GPIO_PBDR ); uiPBDDR = inl(GPIO_PBDDR) | 0x02; outl( uiPBDDR, GPIO_PBDDR );#endif /* * Now, carefully enable the USB clock, and take * the USB host controller out of reset. */ writel (readl ((void *)SYSCON_PWRCNT) | (1<< 28),(void *)SYSCON_PWRCNT);}static int __init ep93xx_ohci_init(void){ int ret; /* * Only support USB on rev D1 and later chips. */ if((inl(SYSCON_CHIPID) >> 28) <= 3) return -EBUSY; ep93xx_ohci_configure(); /* * Initialise the generic OHCI driver. */ ret = hc_add_ohci((struct pci_dev *)1, IRQ_USH, (void *)USB_BASE, 0, "usb-ohci", "ep93xx"); return ret;}static void __exit ep93xx_ohci_exit(void){ hc_remove_ohci(ep93xx_ohci); /* * Put the USB host controller into reset. */ /* * Stop the USB clock. */}module_init(ep93xx_ohci_init);module_exit(ep93xx_ohci_exit);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -