Lines Matching refs:ehci
21 #define ehci_dbg(ehci, fmt, args...) \ argument
22 dev_dbg (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
23 #define ehci_err(ehci, fmt, args...) \ argument
24 dev_err (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
25 #define ehci_info(ehci, fmt, args...) \ argument
26 dev_info (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
27 #define ehci_warn(ehci, fmt, args...) \ argument
28 dev_warn (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
35 # define ehci_vdbg(ehci, fmt, args...) do { } while (0) argument
44 static void dbg_hcs_params (struct ehci_hcd *ehci, char *label) in dbg_hcs_params() argument
46 u32 params = ehci_readl(ehci, &ehci->caps->hcs_params); in dbg_hcs_params()
48 ehci_dbg (ehci, in dbg_hcs_params()
67 byte = readb (&ehci->caps->portroute[(i>>1)]); in dbg_hcs_params()
72 ehci_dbg (ehci, "%s portroute %s\n", in dbg_hcs_params()
78 static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {} in dbg_hcs_params() argument
88 static void dbg_hcc_params (struct ehci_hcd *ehci, char *label) in dbg_hcc_params() argument
90 u32 params = ehci_readl(ehci, &ehci->caps->hcc_params); in dbg_hcc_params()
93 ehci_dbg (ehci, in dbg_hcc_params()
100 ehci_dbg (ehci, in dbg_hcc_params()
112 static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {} in dbg_hcc_params() argument
119 dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) in dbg_qtd() argument
121 ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, in dbg_qtd()
122 hc32_to_cpup(ehci, &qtd->hw_next), in dbg_qtd()
123 hc32_to_cpup(ehci, &qtd->hw_alt_next), in dbg_qtd()
124 hc32_to_cpup(ehci, &qtd->hw_token), in dbg_qtd()
125 hc32_to_cpup(ehci, &qtd->hw_buf [0])); in dbg_qtd()
127 ehci_dbg(ehci, " p1=%08x p2=%08x p3=%08x p4=%08x\n", in dbg_qtd()
128 hc32_to_cpup(ehci, &qtd->hw_buf[1]), in dbg_qtd()
129 hc32_to_cpup(ehci, &qtd->hw_buf[2]), in dbg_qtd()
130 hc32_to_cpup(ehci, &qtd->hw_buf[3]), in dbg_qtd()
131 hc32_to_cpup(ehci, &qtd->hw_buf[4])); in dbg_qtd()
135 dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) in dbg_qh() argument
137 ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, in dbg_qh()
140 dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next); in dbg_qh()
144 dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) in dbg_itd() argument
146 ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n", in dbg_itd()
147 label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next), in dbg_itd()
149 ehci_dbg (ehci, in dbg_itd()
151 hc32_to_cpu(ehci, itd->hw_transaction[0]), in dbg_itd()
152 hc32_to_cpu(ehci, itd->hw_transaction[1]), in dbg_itd()
153 hc32_to_cpu(ehci, itd->hw_transaction[2]), in dbg_itd()
154 hc32_to_cpu(ehci, itd->hw_transaction[3]), in dbg_itd()
155 hc32_to_cpu(ehci, itd->hw_transaction[4]), in dbg_itd()
156 hc32_to_cpu(ehci, itd->hw_transaction[5]), in dbg_itd()
157 hc32_to_cpu(ehci, itd->hw_transaction[6]), in dbg_itd()
158 hc32_to_cpu(ehci, itd->hw_transaction[7])); in dbg_itd()
159 ehci_dbg (ehci, in dbg_itd()
161 hc32_to_cpu(ehci, itd->hw_bufp[0]), in dbg_itd()
162 hc32_to_cpu(ehci, itd->hw_bufp[1]), in dbg_itd()
163 hc32_to_cpu(ehci, itd->hw_bufp[2]), in dbg_itd()
164 hc32_to_cpu(ehci, itd->hw_bufp[3]), in dbg_itd()
165 hc32_to_cpu(ehci, itd->hw_bufp[4]), in dbg_itd()
166 hc32_to_cpu(ehci, itd->hw_bufp[5]), in dbg_itd()
167 hc32_to_cpu(ehci, itd->hw_bufp[6])); in dbg_itd()
168 ehci_dbg (ehci, " index: %d %d %d %d %d %d %d %d\n", in dbg_itd()
175 dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) in dbg_sitd() argument
177 ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n", in dbg_sitd()
178 label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next), in dbg_sitd()
180 ehci_dbg (ehci, in dbg_sitd()
182 hc32_to_cpu(ehci, sitd->hw_fullspeed_ep), in dbg_sitd()
183 hc32_to_cpu(ehci, sitd->hw_uframe), in dbg_sitd()
184 hc32_to_cpu(ehci, sitd->hw_results), in dbg_sitd()
185 hc32_to_cpu(ehci, sitd->hw_buf[0]), in dbg_sitd()
186 hc32_to_cpu(ehci, sitd->hw_buf[1])); in dbg_sitd()
277 dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) in dbg_qh() argument
299 #define dbg_status(ehci, label, status) { \ argument
302 ehci_dbg (ehci, "%s\n", _buf); \
305 #define dbg_cmd(ehci, label, command) { \ argument
308 ehci_dbg (ehci, "%s\n", _buf); \
311 #define dbg_port(ehci, label, port, status) { \ argument
314 ehci_dbg (ehci, "%s\n", _buf); \
373 static inline char token_mark(struct ehci_hcd *ehci, __hc32 token) in token_mark() argument
375 __u32 v = hc32_to_cpu(ehci, token); in token_mark()
388 struct ehci_hcd *ehci, in qh_lines() argument
402 __le32 list_end = EHCI_LIST_END(ehci); in qh_lines()
407 mark = token_mark(ehci, qh->hw_token); in qh_lines()
409 if ((qh->hw_alt_next & QTD_MASK(ehci)) in qh_lines()
410 == ehci->async->hw_alt_next) in qh_lines()
416 scratch = hc32_to_cpup(ehci, &qh->hw_info1); in qh_lines()
417 hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &qh->hw_current) : 0; in qh_lines()
423 scratch, hc32_to_cpup(ehci, &qh->hw_info2), in qh_lines()
424 hc32_to_cpup(ehci, &qh->hw_token), mark, in qh_lines()
425 (cpu_to_hc32(ehci, QTD_TOGGLE) & qh->hw_token) in qh_lines()
427 (hc32_to_cpup(ehci, &qh->hw_alt_next) >> 1) & 0x0f); in qh_lines()
434 scratch = hc32_to_cpup(ehci, &td->hw_token); in qh_lines()
438 else if (qh->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) in qh_lines()
441 if (td->hw_alt_next == ehci->async->hw_alt_next) in qh_lines()
480 struct ehci_hcd *ehci; in fill_async_buffer() local
487 ehci = hcd_to_ehci (hcd); in fill_async_buffer()
497 spin_lock_irqsave (&ehci->lock, flags); in fill_async_buffer()
498 for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh) in fill_async_buffer()
499 qh_lines (ehci, qh, &next, &size); in fill_async_buffer()
500 if (ehci->reclaim && size > 0) { in fill_async_buffer()
505 for (qh = ehci->reclaim; size > 0 && qh; qh = qh->reclaim) in fill_async_buffer()
506 qh_lines (ehci, qh, &next, &size); in fill_async_buffer()
508 spin_unlock_irqrestore (&ehci->lock, flags); in fill_async_buffer()
517 struct ehci_hcd *ehci; in fill_periodic_buffer() local
530 ehci = hcd_to_ehci (hcd); in fill_periodic_buffer()
534 temp = scnprintf (next, size, "size = %d\n", ehci->periodic_size); in fill_periodic_buffer()
541 spin_lock_irqsave (&ehci->lock, flags); in fill_periodic_buffer()
542 for (i = 0; i < ehci->periodic_size; i++) { in fill_periodic_buffer()
543 p = ehci->pshadow [i]; in fill_periodic_buffer()
546 tag = Q_NEXT_TYPE(ehci, ehci->periodic [i]); in fill_periodic_buffer()
553 switch (hc32_to_cpu(ehci, tag)) { in fill_periodic_buffer()
557 hc32_to_cpup(ehci, in fill_periodic_buffer()
578 u32 scratch = hc32_to_cpup(ehci, in fill_periodic_buffer()
590 ehci, in fill_periodic_buffer()
612 tag = Q_NEXT_TYPE(ehci, p.qh->hw_next); in fill_periodic_buffer()
620 tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next); in fill_periodic_buffer()
626 tag = Q_NEXT_TYPE(ehci, p.itd->hw_next); in fill_periodic_buffer()
633 hc32_to_cpup(ehci, &p.sitd->hw_uframe) in fill_periodic_buffer()
636 tag = Q_NEXT_TYPE(ehci, p.sitd->hw_next); in fill_periodic_buffer()
648 spin_unlock_irqrestore (&ehci->lock, flags); in fill_periodic_buffer()
658 struct ehci_hcd *ehci; in fill_registers_buffer() local
666 ehci = hcd_to_ehci (hcd); in fill_registers_buffer()
670 spin_lock_irqsave (&ehci->lock, flags); in fill_registers_buffer()
684 i = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase)); in fill_registers_buffer()
703 pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller); in fill_registers_buffer()
704 offset = HCC_EXT_CAPS(ehci_readl(ehci, in fill_registers_buffer()
705 &ehci->caps->hcc_params)); in fill_registers_buffer()
736 i = ehci_readl(ehci, &ehci->caps->hcs_params); in fill_registers_buffer()
741 i = ehci_readl(ehci, &ehci->caps->hcc_params); in fill_registers_buffer()
748 ehci_readl(ehci, &ehci->regs->status)); in fill_registers_buffer()
754 ehci_readl(ehci, &ehci->regs->command)); in fill_registers_buffer()
760 ehci_readl(ehci, &ehci->regs->intr_enable)); in fill_registers_buffer()
766 ehci_readl(ehci, &ehci->regs->frame_index)); in fill_registers_buffer()
770 for (i = 1; i <= HCS_N_PORTS (ehci->hcs_params); i++) { in fill_registers_buffer()
772 ehci_readl(ehci, in fill_registers_buffer()
773 &ehci->regs->port_status[i - 1])); in fill_registers_buffer()
777 if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) { in fill_registers_buffer()
780 ehci_readl(ehci, in fill_registers_buffer()
781 &ehci->debug->control)); in fill_registers_buffer()
787 if (ehci->reclaim) { in fill_registers_buffer()
788 temp = scnprintf(next, size, "reclaim qh %p\n", ehci->reclaim); in fill_registers_buffer()
796 ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim, in fill_registers_buffer()
797 ehci->stats.lost_iaa); in fill_registers_buffer()
802 ehci->stats.complete, ehci->stats.unlink); in fill_registers_buffer()
808 spin_unlock_irqrestore (&ehci->lock, flags); in fill_registers_buffer()
916 static inline void create_debug_files (struct ehci_hcd *ehci) in create_debug_files() argument
918 struct usb_bus *bus = &ehci_to_hcd(ehci)->self; in create_debug_files()
920 ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root); in create_debug_files()
921 if (!ehci->debug_dir) in create_debug_files()
924 ehci->debug_async = debugfs_create_file("async", S_IRUGO, in create_debug_files()
925 ehci->debug_dir, bus, in create_debug_files()
927 if (!ehci->debug_async) in create_debug_files()
930 ehci->debug_periodic = debugfs_create_file("periodic", S_IRUGO, in create_debug_files()
931 ehci->debug_dir, bus, in create_debug_files()
933 if (!ehci->debug_periodic) in create_debug_files()
936 ehci->debug_registers = debugfs_create_file("registers", S_IRUGO, in create_debug_files()
937 ehci->debug_dir, bus, in create_debug_files()
939 if (!ehci->debug_registers) in create_debug_files()
944 debugfs_remove(ehci->debug_periodic); in create_debug_files()
946 debugfs_remove(ehci->debug_async); in create_debug_files()
948 debugfs_remove(ehci->debug_dir); in create_debug_files()
950 ehci->debug_periodic = NULL; in create_debug_files()
951 ehci->debug_async = NULL; in create_debug_files()
952 ehci->debug_dir = NULL; in create_debug_files()
955 static inline void remove_debug_files (struct ehci_hcd *ehci) in remove_debug_files() argument
957 debugfs_remove(ehci->debug_registers); in remove_debug_files()
958 debugfs_remove(ehci->debug_periodic); in remove_debug_files()
959 debugfs_remove(ehci->debug_async); in remove_debug_files()
960 debugfs_remove(ehci->debug_dir); in remove_debug_files()