📄 1024.usb.patch
字号:
+ } /* pass ownership to the completion handler */ urb->complete (urb); }+/*tango2 EHCI needs*/ EXPORT_SYMBOL (usb_hcd_giveback_urb);+EXPORT_SYMBOL (hcd_alloc_dev);+EXPORT_SYMBOL (hcd_get_frame_number);+EXPORT_SYMBOL (tango2_hcd_submit_urb);+EXPORT_SYMBOL (hcd_unlink_urb);+EXPORT_SYMBOL (hcd_free_dev);+EXPORT_SYMBOL (hcd_irq);diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/drivers/usb/host/Config.in linuxmips-2.4.30/drivers/usb/host/Config.in--- linuxmips-2.4.30.ref/drivers/usb/host/Config.in 2003-11-16 17:07:42.000000000 -0800+++ linuxmips-2.4.30/drivers/usb/host/Config.in 2007-06-20 14:13:23.000000000 -0700@@ -2,16 +2,24 @@ # USB Host Controller Drivers # comment 'USB Host Controller Drivers'-dep_tristate ' EHCI HCD (USB 2.0) support (EXPERIMENTAL)' CONFIG_USB_EHCI_HCD $CONFIG_USB $CONFIG_EXPERIMENTAL+dep_tristate ' EHCI HCD (USB 2.0) support (EXPERIMENTAL)' CONFIG_USB_EHCI_HCD $CONFIG_USB $CONFIG_EXPERIMENTAL $CONFIG_PCI++if [ "$CONFIG_TANGO2_ES6" = "y" ]; then+ dep_tristate ' TANGO2 integrated EHCI HCD (USB 2.0) support' CONFIG_TANGO2_EHCI_HCD $CONFIG_USB $CONFIG_EXPERIMENTAL+fi+ if [ "$CONFIG_USB_UHCI_ALT" != "y" ]; then- dep_tristate ' UHCI (Intel PIIX4, VIA, ...) support' CONFIG_USB_UHCI $CONFIG_USB+ dep_tristate ' UHCI (Intel PIIX4, VIA, ...) support' CONFIG_USB_UHCI $CONFIG_USB $CONFIG_PCI fi if [ "$CONFIG_USB_UHCI" != "y" ]; then- dep_tristate ' UHCI Alternate Driver (JE) support' CONFIG_USB_UHCI_ALT $CONFIG_USB+ dep_tristate ' UHCI Alternate Driver (JE) support' CONFIG_USB_UHCI_ALT $CONFIG_USB $CONFIG_PCI else define_bool CONFIG_USB_UHCI_ALT n fi-dep_tristate ' OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support' CONFIG_USB_OHCI $CONFIG_USB+dep_tristate ' OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support' CONFIG_USB_OHCI $CONFIG_USB $CONFIG_PCI+if [ "$CONFIG_TANGO2_ES6" = "y" ]; then+ dep_tristate ' TANGO2 integrated OHCI support (EXPERIMENTAL)' CONFIG_TANGO2_OHCI $CONFIG_USB $CONFIG_EXPERIMENTAL+fi if [ "$CONFIG_ARM" = "y" -o "$CONFIG_X86" = "y" -a "$CONFIG_X86_64" != "y" ]; then # Cypress embedded USB controller on StrongARM or on x86 in PC/104 dep_tristate ' SL811HS Alternate (x86, StrongARM, isosynchronous mode)' CONFIG_USB_SL811HS_ALT $CONFIG_USB $CONFIG_EXPERIMENTALdiff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/drivers/usb/host/Makefile linuxmips-2.4.30/drivers/usb/host/Makefile--- linuxmips-2.4.30.ref/drivers/usb/host/Makefile 2003-11-16 17:07:42.000000000 -0800+++ linuxmips-2.4.30/drivers/usb/host/Makefile 2007-06-20 14:13:23.000000000 -0700@@ -6,9 +6,11 @@ O_TARGET := obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o+obj-$(CONFIG_TANGO2_EHCI_HCD) += tango2-ehci-hcd.o obj-$(CONFIG_USB_UHCI_ALT) += uhci.o obj-$(CONFIG_USB_UHCI) += usb-uhci.o obj-$(CONFIG_USB_OHCI) += usb-ohci.o+obj-$(CONFIG_TANGO2_OHCI) += tango2-usb-ohci.o obj-$(CONFIG_USB_SL811HS_ALT) += sl811.o obj-$(CONFIG_USB_SL811HS) += hc_sl811.o diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/drivers/usb/host/tango2-ehci-dbg.c linuxmips-2.4.30/drivers/usb/host/tango2-ehci-dbg.c--- linuxmips-2.4.30.ref/drivers/usb/host/tango2-ehci-dbg.c 1969-12-31 16:00:00.000000000 -0800+++ linuxmips-2.4.30/drivers/usb/host/tango2-ehci-dbg.c 2007-06-20 14:13:23.000000000 -0700@@ -0,0 +1,685 @@+/*+ * Copyright (c) 2001-2002 by David Brownell+ * + * This program is free software; you can redistribute it and/or modify it+ * under the terms of the GNU General Public License as published by the+ * Free Software Foundation; either version 2 of the License, or (at your+ * option) any later version.+ *+ * This program is distributed in the hope that it will be useful, but+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License+ * for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with this program; if not, write to the Free Software Foundation,+ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.+ */++/* this file is part of ehci-hcd.c */++#ifdef DEBUG+#define ehci_dbg(ehci, fmt, args...) \+ printk(KERN_DEBUG "%s: " fmt , hcd_name ,## args )+#else+#define ehci_dbg(ehci, fmt, args...) do { } while (0)+#endif++#define ehci_err(ehci, fmt, args...) \+ printk(KERN_ERR "%s: " fmt , hcd_name , ## args )+#define ehci_info(ehci, fmt, args...) \+ printk(KERN_INFO "%s: " fmt , hcd_name , ## args )+#define ehci_warn(ehci, fmt, args...) \+ printk(KERN_WARNING "%s: " fmt , hcd_name , ## args )+++#ifdef EHCI_VERBOSE_DEBUG+# define vdbg dbg+# define ehci_vdbg ehci_dbg+#else+# define vdbg(fmt,args...) do { } while (0)+# define ehci_vdbg(ehci, fmt, args...) do { } while (0)+#endif++#ifdef DEBUG++/* check the values in the HCSPARAMS register+ * (host controller _Structural_ parameters)+ * see EHCI spec, Table 2-4 for each value+ */+static void dbg_hcs_params (struct ehci_hcd *ehci, char *label)+{+ u32 params = readl (&ehci->caps->hcs_params);++ ehci_dbg (ehci,+ "%s hcs_params 0x%x dbg=%d%s cc=%d pcc=%d%s%s ports=%d\n",+ label, params,+ HCS_DEBUG_PORT (params),+ HCS_INDICATOR (params) ? " ind" : "",+ HCS_N_CC (params),+ HCS_N_PCC (params),+ HCS_PORTROUTED (params) ? "" : " ordered",+ HCS_PPC (params) ? "" : " !ppc",+ HCS_N_PORTS (params)+ );+ /* Port routing, per EHCI 0.95 Spec, Section 2.2.5 */+ if (HCS_PORTROUTED (params)) {+ int i;+ char buf [46], tmp [7], byte;++ buf[0] = 0;+ for (i = 0; i < HCS_N_PORTS (params); i++) {+ // FIXME MIPS won't readb() ...+ byte = readb (&ehci->caps->portroute[(i>>1)]);+ sprintf(tmp, "%d ", + ((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf)));+ strcat(buf, tmp);+ }+ ehci_dbg (ehci, "%s portroute %s\n",+ label, buf);+ }+}+#else++static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {}++#endif++#ifdef DEBUG++/* check the values in the HCCPARAMS register+ * (host controller _Capability_ parameters)+ * see EHCI Spec, Table 2-5 for each value+ * */+static void dbg_hcc_params (struct ehci_hcd *ehci, char *label)+{+ u32 params = readl (&ehci->caps->hcc_params);++ if (HCC_ISOC_CACHE (params)) {+ ehci_dbg (ehci,+ "%s hcc_params %04x caching frame %s%s%s\n",+ label, params,+ HCC_PGM_FRAMELISTLEN (params) ? "256/512/1024" : "1024",+ HCC_CANPARK (params) ? " park" : "",+ HCC_64BIT_ADDR (params) ? " 64 bit addr" : "");+ } else {+ ehci_dbg (ehci,+ "%s hcc_params %04x thresh %d uframes %s%s%s\n",+ label,+ params,+ HCC_ISOC_THRES (params),+ HCC_PGM_FRAMELISTLEN (params) ? "256/512/1024" : "1024",+ HCC_CANPARK (params) ? " park" : "",+ HCC_64BIT_ADDR (params) ? " 64 bit addr" : "");+ }+}+#else++static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {}++#endif++#ifdef DEBUG++static void __attribute__((__unused__))+dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)+{+ ehci_dbg (ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,+ cpu_to_le32p (&qtd->hw_next),+ cpu_to_le32p (&qtd->hw_alt_next),+ cpu_to_le32p (&qtd->hw_token),+ cpu_to_le32p (&qtd->hw_buf [0]));+ if (qtd->hw_buf [1])+ ehci_dbg (ehci, " p1=%08x p2=%08x p3=%08x p4=%08x\n",+ cpu_to_le32p (&qtd->hw_buf [1]),+ cpu_to_le32p (&qtd->hw_buf [2]),+ cpu_to_le32p (&qtd->hw_buf [3]),+ cpu_to_le32p (&qtd->hw_buf [4]));+}++static void __attribute__((__unused__))+dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)+{+ ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,+ qh, qh->hw_next, qh->hw_info1, qh->hw_info2,+ qh->hw_current);+ dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next);+}++static void __attribute__((__unused__))+dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) +{+ ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n",+ label, itd->frame, itd, le32_to_cpu(itd->hw_next), itd->urb);+ ehci_dbg (ehci,+ " trans: %08x %08x %08x %08x %08x %08x %08x %08x\n", + le32_to_cpu(itd->hw_transaction[0]),+ le32_to_cpu(itd->hw_transaction[1]),+ le32_to_cpu(itd->hw_transaction[2]),+ le32_to_cpu(itd->hw_transaction[3]),+ le32_to_cpu(itd->hw_transaction[4]),+ le32_to_cpu(itd->hw_transaction[5]),+ le32_to_cpu(itd->hw_transaction[6]),+ le32_to_cpu(itd->hw_transaction[7]));+ ehci_dbg (ehci,+ " buf: %08x %08x %08x %08x %08x %08x %08x\n", + le32_to_cpu(itd->hw_bufp[0]),+ le32_to_cpu(itd->hw_bufp[1]),+ le32_to_cpu(itd->hw_bufp[2]),+ le32_to_cpu(itd->hw_bufp[3]),+ le32_to_cpu(itd->hw_bufp[4]),+ le32_to_cpu(itd->hw_bufp[5]),+ le32_to_cpu(itd->hw_bufp[6]));+ ehci_dbg (ehci, " index: %d %d %d %d %d %d %d %d\n",+ itd->index[0], itd->index[1], itd->index[2],+ itd->index[3], itd->index[4], itd->index[5],+ itd->index[6], itd->index[7]);+}++static int __attribute__((__unused__))+dbg_status_buf (char *buf, unsigned len, char *label, u32 status)+{+ return snprintf (buf, len,+ "%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s",+ label, label [0] ? " " : "", status,+ (status & STS_ASS) ? " Async" : "",+ (status & STS_PSS) ? " Periodic" : "",+ (status & STS_RECL) ? " Recl" : "",+ (status & STS_HALT) ? " Halt" : "",+ (status & STS_IAA) ? " IAA" : "",+ (status & STS_FATAL) ? " FATAL" : "",+ (status & STS_FLR) ? " FLR" : "",+ (status & STS_PCD) ? " PCD" : "",+ (status & STS_ERR) ? " ERR" : "",+ (status & STS_INT) ? " INT" : ""+ );+}++static int __attribute__((__unused__))+dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)+{+ return snprintf (buf, len,+ "%s%sintrenable %02x%s%s%s%s%s%s",+ label, label [0] ? " " : "", enable,+ (enable & STS_IAA) ? " IAA" : "",+ (enable & STS_FATAL) ? " FATAL" : "",+ (enable & STS_FLR) ? " FLR" : "",+ (enable & STS_PCD) ? " PCD" : "",+ (enable & STS_ERR) ? " ERR" : "",+ (enable & STS_INT) ? " INT" : ""+ );+}++static const char *const fls_strings [] =+ { "1024", "512", "256", "??" };++static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command)+{+ return snprintf (buf, len,+ "%s%scommand %06x %s=%d ithresh=%d%s%s%s%s period=%s%s %s",+ label, label [0] ? " " : "", command,+ (command & CMD_PARK) ? "park" : "(park)",+ CMD_PARK_CNT (command),+ (command >> 16) & 0x3f,+ (command & CMD_LRESET) ? " LReset" : "",+ (command & CMD_IAAD) ? " IAAD" : "",+ (command & CMD_ASE) ? " Async" : "",+ (command & CMD_PSE) ? " Periodic" : "",+ fls_strings [(command >> 2) & 0x3],+ (command & CMD_RESET) ? " Reset" : "",+ (command & CMD_RUN) ? "RUN" : "HALT"+ );+}++static int+dbg_port_buf (char *buf, unsigned len, char *label, int port, u32 status)+{+ char *sig;++ /* signaling state */+ switch (status & (3 << 10)) {+ case 0 << 10: sig = "se0"; break;+ case 1 << 10: sig = "k"; break; /* low speed */+ case 2 << 10: sig = "j"; break;+ default: sig = "?"; break;+ }++ return snprintf (buf, len,+ "%s%sport %d status %06x%s%s sig=%s %s%s%s%s%s%s%s%s%s",+ label, label [0] ? " " : "", port, status,+ (status & PORT_POWER) ? " POWER" : "",+ (status & PORT_OWNER) ? " OWNER" : "",+ sig,+ (status & PORT_RESET) ? " RESET" : "",+ (status & PORT_SUSPEND) ? " SUSPEND" : "",+ (status & PORT_RESUME) ? " RESUME" : "",+ (status & PORT_OCC) ? " OCC" : "",+ (status & PORT_OC) ? " OC" : "",+ (status & PORT_PEC) ? " PEC" : "",+ (status & PORT_PE) ? " PE" : "",+ (status & PORT_CSC) ? " CSC" : "",+ (status & PORT_CONNECT) ? " CONNECT" : ""+ );+}++#else+static inline void __attribute__((__unused__))+dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)+{}++static inline int __attribute__((__unused__))+dbg_status_buf (char *buf, unsigned len, char *label, u32 status)+{ return 0; }++static inline int __attribute__((__unused__))+dbg_command_buf (char *buf, unsigned len, char *label, u32 command)+{ return 0; }++static inline int __attribute__((__unused__))+dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)+{ return 0; }++static inline int __attribute__((__unused__))+dbg_port_buf (char *buf, unsigned len, char *label, int port, u32 status)+{ return 0; }++#endif /* DEBUG */++/* functions have the "wrong" filename when they're output... */+#define dbg_status(ehci, label, status) { \+ char _buf [80]; \+ dbg_status_buf (_buf, sizeof _buf, label, status); \+ ehci_dbg (ehci, "%s\n", _buf); \+}++#define dbg_cmd(ehci, label, command) { \+ char _buf [80]; \+ dbg_command_buf (_buf, sizeof _buf, label, command); \+ ehci_dbg (ehci, "%s\n", _buf); \+}++#define dbg_port(ehci, label, port, status) { \+ char _buf [80]; \+ dbg_port_buf (_buf, sizeof _buf, label, port, status); \+ ehci_dbg (ehci, "%s\n", _buf); \+}++/*-------------------------------------------------------------------------*/++#ifdef STUB_DEBUG_FILES++static inline void create_debug_files (struct ehci_hcd *bus) { }+static inline void remove_debug_files (struct ehci_hcd *bus) { }++#else++/* troubleshooting help: expose state in driverfs */++#define speed_char(info1) ({ char tmp; \+ switch (info1 & (3 << 12)) { \+ case 0 << 12: tmp = 'f'; break; \+ case 1 << 12: tmp = 'l'; break; \+ case 2 << 12: tmp = 'h'; break; \+ default: tmp = '?'; break; \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -