?? usb-ohci-s3c2410.c
字號:
/* * linux/drivers/usb/usb-ohci-s3c2410.c * * OHCI r1.0 compatible, CPU embedded USB host controller * */#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 <linux/pci.h>#include <asm/hardware.h>#include <asm/irq.h>#include <asm/io.h>#define OHCI_HW_DRIVER 1#include "usb-ohci.h"/* * S3C2410 user's guide 俊 樂綽 1厘 樓府 汲疙俊 狼竅擱, * OHCI 齲券撈扼絆 茄促. * * UPLL 汲瀝苞 MISC 飯瘤膠磐俊輯 器飄 磷撈絆 混府絆 竅綽 巴闌 嘩岡瘤 富 巴. * * 弊府絆, s3c2410 俊輯 USB slave 甫 靜妨擱 host 器飄 竅唱甫 磷咯具 茄促綽 巴 * 鐳瘤 富 巴. * 竅瘤父, 撈犯霸 秦檔 slave 腳齲啊 root hub 率俊 林綽 康氫闌 阜闌 規過撈 絕促. * hub.c 甫 絆媚輯 root hub 撈絆, 1 host port 肺 config 沁闌 版快, * 滴 鍋擄 器飄甫 酒抗 媚促檔 焊瘤 臼檔廢 沁欄聰 曼絆且 巴. */int __devinithc_add_ohci(struct pci_dev *dev, int irq, void *membase, unsigned long flags, ohci_t **ohci, const char *name, const char *slot_name);extern void hc_remove_ohci(ohci_t *ohci);static ohci_t *s3c2410_ohci;static void __init s3c2410_ohci_configure(void){ unsigned long var;#if CONFIG_MAX_ROOT_PORTS < 2 /* 1 host port, 1 slave port*/ MISCCR &= ~MISCCR_USBPAD;#if 0 // confused - bushi /* wakeup port 0 */ MISCCR &= ~MISCCR_USB0_SUSPEND; /* sleep port 1 */ MISCCR |= MISCCR_USB1_SUSPEND;#endif#else /* 2 host port */ MISCCR |= MISCCR_USBPAD;#if 0 // confused - bushi /* wakeup port 0 */ MISCCR &= ~MISCCR_USB0_SUSPEND; /* wakeup port 1 */ MISCCR &= ~MISCCR_USB1_SUSPEND;#endif#endif var=FInsrt(0x78, fPLL_MDIV) | FInsrt(0x02, fPLL_PDIV) | FInsrt(0x03, fPLL_SDIV); while(var!=UPLLCON){ UPLLCON=var; /* UPLLCON */// UPLLCON = FInsrt(0x78, fPLL_MDIV) | FInsrt(0x02, fPLL_PDIV) // | FInsrt(0x03, fPLL_SDIV);// UPLLCON = FInsrt(0x38, fPLL_MDIV) | FInsrt(0x02, fPLL_PDIV) // | FInsrt(0x02, fPLL_SDIV); /* CLKCON */ CLKCON |= CLKCON_USBH; //laputa append begine -->// CLKSLOW &= ~(UCLK_ON | MPLL_OFF | SLOW_BIT); //laputa append end <-- udelay(11); }}static int __init s3c2410_ohci_init(void){ int ret; s3c2410_ohci_configure(); /* * Initialise the generic OHCI driver. */ // FIXME : io_p2v() ? ret = hc_add_ohci((struct pci_dev *)1, IRQ_USBH, (void *)(io_p2v(USBHOST_CTL_BASE)), 0, &s3c2410_ohci, "usb-ohci", "s3c2410"); return ret;}static void __exit s3c2410_ohci_exit(void){ hc_remove_ohci(s3c2410_ohci); /* * Stop the USB clock. */ CLKCON &= ~CLKCON_USBH;}module_init(s3c2410_ohci_init);module_exit(s3c2410_ohci_exit);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -