xhci-dbg.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /*
  2. * xHCI host controller driver
  3. *
  4. * Copyright (C) 2008 Intel Corp.
  5. *
  6. * Author: Sarah Sharp
  7. * Some code borrowed from the Linux EHCI driver.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  15. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  16. * for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software Foundation,
  20. * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. #include "xhci.h"
  23. #define XHCI_INIT_VALUE 0x0
  24. /* Add verbose debugging later, just print everything for now */
  25. void xhci_dbg_regs(struct xhci_hcd *xhci)
  26. {
  27. u32 temp;
  28. xhci_dbg(xhci, "// xHCI capability registers at %p:\n",
  29. xhci->cap_regs);
  30. temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);
  31. xhci_dbg(xhci, "// @%p = 0x%x (CAPLENGTH AND HCIVERSION)\n",
  32. &xhci->cap_regs->hc_capbase, temp);
  33. xhci_dbg(xhci, "// CAPLENGTH: 0x%x\n",
  34. (unsigned int) HC_LENGTH(temp));
  35. #if 0
  36. xhci_dbg(xhci, "// HCIVERSION: 0x%x\n",
  37. (unsigned int) HC_VERSION(temp));
  38. #endif
  39. xhci_dbg(xhci, "// xHCI operational registers at %p:\n", xhci->op_regs);
  40. temp = xhci_readl(xhci, &xhci->cap_regs->run_regs_off);
  41. xhci_dbg(xhci, "// @%p = 0x%x RTSOFF\n",
  42. &xhci->cap_regs->run_regs_off,
  43. (unsigned int) temp & RTSOFF_MASK);
  44. xhci_dbg(xhci, "// xHCI runtime registers at %p:\n", xhci->run_regs);
  45. temp = xhci_readl(xhci, &xhci->cap_regs->db_off);
  46. xhci_dbg(xhci, "// @%p = 0x%x DBOFF\n", &xhci->cap_regs->db_off, temp);
  47. xhci_dbg(xhci, "// Doorbell array at %p:\n", xhci->dba);
  48. }
  49. static void xhci_print_cap_regs(struct xhci_hcd *xhci)
  50. {
  51. u32 temp;
  52. xhci_dbg(xhci, "xHCI capability registers at %p:\n", xhci->cap_regs);
  53. temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);
  54. xhci_dbg(xhci, "CAPLENGTH AND HCIVERSION 0x%x:\n",
  55. (unsigned int) temp);
  56. xhci_dbg(xhci, "CAPLENGTH: 0x%x\n",
  57. (unsigned int) HC_LENGTH(temp));
  58. xhci_dbg(xhci, "HCIVERSION: 0x%x\n",
  59. (unsigned int) HC_VERSION(temp));
  60. temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params1);
  61. xhci_dbg(xhci, "HCSPARAMS 1: 0x%x\n",
  62. (unsigned int) temp);
  63. xhci_dbg(xhci, " Max device slots: %u\n",
  64. (unsigned int) HCS_MAX_SLOTS(temp));
  65. xhci_dbg(xhci, " Max interrupters: %u\n",
  66. (unsigned int) HCS_MAX_INTRS(temp));
  67. xhci_dbg(xhci, " Max ports: %u\n",
  68. (unsigned int) HCS_MAX_PORTS(temp));
  69. temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params2);
  70. xhci_dbg(xhci, "HCSPARAMS 2: 0x%x\n",
  71. (unsigned int) temp);
  72. xhci_dbg(xhci, " Isoc scheduling threshold: %u\n",
  73. (unsigned int) HCS_IST(temp));
  74. xhci_dbg(xhci, " Maximum allowed segments in event ring: %u\n",
  75. (unsigned int) HCS_ERST_MAX(temp));
  76. temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params3);
  77. xhci_dbg(xhci, "HCSPARAMS 3 0x%x:\n",
  78. (unsigned int) temp);
  79. xhci_dbg(xhci, " Worst case U1 device exit latency: %u\n",
  80. (unsigned int) HCS_U1_LATENCY(temp));
  81. xhci_dbg(xhci, " Worst case U2 device exit latency: %u\n",
  82. (unsigned int) HCS_U2_LATENCY(temp));
  83. temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
  84. xhci_dbg(xhci, "HCC PARAMS 0x%x:\n", (unsigned int) temp);
  85. xhci_dbg(xhci, " HC generates %s bit addresses\n",
  86. HCC_64BIT_ADDR(temp) ? "64" : "32");
  87. /* FIXME */
  88. xhci_dbg(xhci, " FIXME: more HCCPARAMS debugging\n");
  89. temp = xhci_readl(xhci, &xhci->cap_regs->run_regs_off);
  90. xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK);
  91. }
  92. static void xhci_print_command_reg(struct xhci_hcd *xhci)
  93. {
  94. u32 temp;
  95. temp = xhci_readl(xhci, &xhci->op_regs->command);
  96. xhci_dbg(xhci, "USBCMD 0x%x:\n", temp);
  97. xhci_dbg(xhci, " HC is %s\n",
  98. (temp & CMD_RUN) ? "running" : "being stopped");
  99. xhci_dbg(xhci, " HC has %sfinished hard reset\n",
  100. (temp & CMD_RESET) ? "not " : "");
  101. xhci_dbg(xhci, " Event Interrupts %s\n",
  102. (temp & CMD_EIE) ? "enabled " : "disabled");
  103. xhci_dbg(xhci, " Host System Error Interrupts %s\n",
  104. (temp & CMD_EIE) ? "enabled " : "disabled");
  105. xhci_dbg(xhci, " HC has %sfinished light reset\n",
  106. (temp & CMD_LRESET) ? "not " : "");
  107. }
  108. static void xhci_print_status(struct xhci_hcd *xhci)
  109. {
  110. u32 temp;
  111. temp = xhci_readl(xhci, &xhci->op_regs->status);
  112. xhci_dbg(xhci, "USBSTS 0x%x:\n", temp);
  113. xhci_dbg(xhci, " Event ring is %sempty\n",
  114. (temp & STS_EINT) ? "not " : "");
  115. xhci_dbg(xhci, " %sHost System Error\n",
  116. (temp & STS_FATAL) ? "WARNING: " : "No ");
  117. xhci_dbg(xhci, " HC is %s\n",
  118. (temp & STS_HALT) ? "halted" : "running");
  119. }
  120. static void xhci_print_op_regs(struct xhci_hcd *xhci)
  121. {
  122. xhci_dbg(xhci, "xHCI operational registers at %p:\n", xhci->op_regs);
  123. xhci_print_command_reg(xhci);
  124. xhci_print_status(xhci);
  125. }
  126. static void xhci_print_ports(struct xhci_hcd *xhci)
  127. {
  128. u32 __iomem *addr;
  129. int i, j;
  130. int ports;
  131. char *names[NUM_PORT_REGS] = {
  132. "status",
  133. "power",
  134. "link",
  135. "reserved",
  136. };
  137. ports = HCS_MAX_PORTS(xhci->hcs_params1);
  138. addr = &xhci->op_regs->port_status_base;
  139. for (i = 0; i < ports; i++) {
  140. for (j = 0; j < NUM_PORT_REGS; ++j) {
  141. xhci_dbg(xhci, "%p port %s reg = 0x%x\n",
  142. addr, names[j],
  143. (unsigned int) xhci_readl(xhci, addr));
  144. addr++;
  145. }
  146. }
  147. }
  148. void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num)
  149. {
  150. void *addr;
  151. u32 temp;
  152. u64 temp_64;
  153. addr = &ir_set->irq_pending;
  154. temp = xhci_readl(xhci, addr);
  155. if (temp == XHCI_INIT_VALUE)
  156. return;
  157. xhci_dbg(xhci, " %p: ir_set[%i]\n", ir_set, set_num);
  158. xhci_dbg(xhci, " %p: ir_set.pending = 0x%x\n", addr,
  159. (unsigned int)temp);
  160. addr = &ir_set->irq_control;
  161. temp = xhci_readl(xhci, addr);
  162. xhci_dbg(xhci, " %p: ir_set.control = 0x%x\n", addr,
  163. (unsigned int)temp);
  164. addr = &ir_set->erst_size;
  165. temp = xhci_readl(xhci, addr);
  166. xhci_dbg(xhci, " %p: ir_set.erst_size = 0x%x\n", addr,
  167. (unsigned int)temp);
  168. addr = &ir_set->rsvd;
  169. temp = xhci_readl(xhci, addr);
  170. if (temp != XHCI_INIT_VALUE)
  171. xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n",
  172. addr, (unsigned int)temp);
  173. addr = &ir_set->erst_base;
  174. temp_64 = xhci_read_64(xhci, addr);
  175. xhci_dbg(xhci, " %p: ir_set.erst_base = @%08llx\n",
  176. addr, temp_64);
  177. addr = &ir_set->erst_dequeue;
  178. temp_64 = xhci_read_64(xhci, addr);
  179. xhci_dbg(xhci, " %p: ir_set.erst_dequeue = @%08llx\n",
  180. addr, temp_64);
  181. }
  182. void xhci_print_run_regs(struct xhci_hcd *xhci)
  183. {
  184. u32 temp;
  185. int i;
  186. xhci_dbg(xhci, "xHCI runtime registers at %p:\n", xhci->run_regs);
  187. temp = xhci_readl(xhci, &xhci->run_regs->microframe_index);
  188. xhci_dbg(xhci, " %p: Microframe index = 0x%x\n",
  189. &xhci->run_regs->microframe_index,
  190. (unsigned int) temp);
  191. for (i = 0; i < 7; ++i) {
  192. temp = xhci_readl(xhci, &xhci->run_regs->rsvd[i]);
  193. if (temp != XHCI_INIT_VALUE)
  194. xhci_dbg(xhci, " WARN: %p: Rsvd[%i] = 0x%x\n",
  195. &xhci->run_regs->rsvd[i],
  196. i, (unsigned int) temp);
  197. }
  198. }
  199. void xhci_print_registers(struct xhci_hcd *xhci)
  200. {
  201. xhci_print_cap_regs(xhci);
  202. xhci_print_op_regs(xhci);
  203. xhci_print_ports(xhci);
  204. }
  205. void xhci_print_trb_offsets(struct xhci_hcd *xhci, union xhci_trb *trb)
  206. {
  207. int i;
  208. for (i = 0; i < 4; ++i)
  209. xhci_dbg(xhci, "Offset 0x%x = 0x%x\n",
  210. i*4, trb->generic.field[i]);
  211. }
  212. /**
  213. * Debug a transfer request block (TRB).
  214. */
  215. void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
  216. {
  217. u64 address;
  218. u32 type = xhci_readl(xhci, &trb->link.control) & TRB_TYPE_BITMASK;
  219. switch (type) {
  220. case TRB_TYPE(TRB_LINK):
  221. xhci_dbg(xhci, "Link TRB:\n");
  222. xhci_print_trb_offsets(xhci, trb);
  223. address = trb->link.segment_ptr;
  224. xhci_dbg(xhci, "Next ring segment DMA address = 0x%llx\n", address);
  225. xhci_dbg(xhci, "Interrupter target = 0x%x\n",
  226. GET_INTR_TARGET(trb->link.intr_target));
  227. xhci_dbg(xhci, "Cycle bit = %u\n",
  228. (unsigned int) (trb->link.control & TRB_CYCLE));
  229. xhci_dbg(xhci, "Toggle cycle bit = %u\n",
  230. (unsigned int) (trb->link.control & LINK_TOGGLE));
  231. xhci_dbg(xhci, "No Snoop bit = %u\n",
  232. (unsigned int) (trb->link.control & TRB_NO_SNOOP));
  233. break;
  234. case TRB_TYPE(TRB_TRANSFER):
  235. address = trb->trans_event.buffer;
  236. /*
  237. * FIXME: look at flags to figure out if it's an address or if
  238. * the data is directly in the buffer field.
  239. */
  240. xhci_dbg(xhci, "DMA address or buffer contents= %llu\n", address);
  241. break;
  242. case TRB_TYPE(TRB_COMPLETION):
  243. address = trb->event_cmd.cmd_trb;
  244. xhci_dbg(xhci, "Command TRB pointer = %llu\n", address);
  245. xhci_dbg(xhci, "Completion status = %u\n",
  246. (unsigned int) GET_COMP_CODE(trb->event_cmd.status));
  247. xhci_dbg(xhci, "Flags = 0x%x\n", (unsigned int) trb->event_cmd.flags);
  248. break;
  249. default:
  250. xhci_dbg(xhci, "Unknown TRB with TRB type ID %u\n",
  251. (unsigned int) type>>10);
  252. xhci_print_trb_offsets(xhci, trb);
  253. break;
  254. }
  255. }
  256. /**
  257. * Debug a segment with an xHCI ring.
  258. *
  259. * @return The Link TRB of the segment, or NULL if there is no Link TRB
  260. * (which is a bug, since all segments must have a Link TRB).
  261. *
  262. * Prints out all TRBs in the segment, even those after the Link TRB.
  263. *
  264. * XXX: should we print out TRBs that the HC owns? As long as we don't
  265. * write, that should be fine... We shouldn't expect that the memory pointed to
  266. * by the TRB is valid at all. Do we care about ones the HC owns? Probably,
  267. * for HC debugging.
  268. */
  269. void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
  270. {
  271. int i;
  272. u32 addr = (u32) seg->dma;
  273. union xhci_trb *trb = seg->trbs;
  274. for (i = 0; i < TRBS_PER_SEGMENT; ++i) {
  275. trb = &seg->trbs[i];
  276. xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", addr,
  277. lower_32_bits(trb->link.segment_ptr),
  278. upper_32_bits(trb->link.segment_ptr),
  279. (unsigned int) trb->link.intr_target,
  280. (unsigned int) trb->link.control);
  281. addr += sizeof(*trb);
  282. }
  283. }
  284. void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring)
  285. {
  286. xhci_dbg(xhci, "Ring deq = %p (virt), 0x%llx (dma)\n",
  287. ring->dequeue,
  288. (unsigned long long)xhci_trb_virt_to_dma(ring->deq_seg,
  289. ring->dequeue));
  290. xhci_dbg(xhci, "Ring deq updated %u times\n",
  291. ring->deq_updates);
  292. xhci_dbg(xhci, "Ring enq = %p (virt), 0x%llx (dma)\n",
  293. ring->enqueue,
  294. (unsigned long long)xhci_trb_virt_to_dma(ring->enq_seg,
  295. ring->enqueue));
  296. xhci_dbg(xhci, "Ring enq updated %u times\n",
  297. ring->enq_updates);
  298. }
  299. /**
  300. * Debugging for an xHCI ring, which is a queue broken into multiple segments.
  301. *
  302. * Print out each segment in the ring. Check that the DMA address in
  303. * each link segment actually matches the segment's stored DMA address.
  304. * Check that the link end bit is only set at the end of the ring.
  305. * Check that the dequeue and enqueue pointers point to real data in this ring
  306. * (not some other ring).
  307. */
  308. void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring)
  309. {
  310. /* FIXME: Throw an error if any segment doesn't have a Link TRB */
  311. struct xhci_segment *seg;
  312. struct xhci_segment *first_seg = ring->first_seg;
  313. xhci_debug_segment(xhci, first_seg);
  314. if (!ring->enq_updates && !ring->deq_updates) {
  315. xhci_dbg(xhci, " Ring has not been updated\n");
  316. return;
  317. }
  318. for (seg = first_seg->next; seg != first_seg; seg = seg->next)
  319. xhci_debug_segment(xhci, seg);
  320. }
  321. void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
  322. {
  323. u32 addr = (u32) erst->erst_dma_addr;
  324. int i;
  325. struct xhci_erst_entry *entry;
  326. for (i = 0; i < erst->num_entries; ++i) {
  327. entry = &erst->entries[i];
  328. xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n",
  329. (unsigned int) addr,
  330. lower_32_bits(entry->seg_addr),
  331. upper_32_bits(entry->seg_addr),
  332. (unsigned int) entry->seg_size,
  333. (unsigned int) entry->rsvd);
  334. addr += sizeof(*entry);
  335. }
  336. }
  337. void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci)
  338. {
  339. u64 val;
  340. val = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
  341. xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = @%08x\n",
  342. lower_32_bits(val));
  343. xhci_dbg(xhci, "// xHC command ring deq ptr high bits = @%08x\n",
  344. upper_32_bits(val));
  345. }
  346. /* Print the last 32 bytes for 64-byte contexts */
  347. static void dbg_rsvd64(struct xhci_hcd *xhci, u64 *ctx, dma_addr_t dma)
  348. {
  349. int i;
  350. for (i = 0; i < 4; ++i) {
  351. xhci_dbg(xhci, "@%p (virt) @%08llx "
  352. "(dma) %#08llx - rsvd64[%d]\n",
  353. &ctx[4 + i], (unsigned long long)dma,
  354. ctx[4 + i], i);
  355. dma += 8;
  356. }
  357. }
  358. void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx)
  359. {
  360. /* Fields are 32 bits wide, DMA addresses are in bytes */
  361. int field_size = 32 / 8;
  362. int i;
  363. struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
  364. dma_addr_t dma = ctx->dma +
  365. ((unsigned long)slot_ctx - (unsigned long)ctx->bytes);
  366. int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
  367. xhci_dbg(xhci, "Slot Context:\n");
  368. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n",
  369. &slot_ctx->dev_info,
  370. (unsigned long long)dma, slot_ctx->dev_info);
  371. dma += field_size;
  372. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n",
  373. &slot_ctx->dev_info2,
  374. (unsigned long long)dma, slot_ctx->dev_info2);
  375. dma += field_size;
  376. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n",
  377. &slot_ctx->tt_info,
  378. (unsigned long long)dma, slot_ctx->tt_info);
  379. dma += field_size;
  380. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n",
  381. &slot_ctx->dev_state,
  382. (unsigned long long)dma, slot_ctx->dev_state);
  383. dma += field_size;
  384. for (i = 0; i < 4; ++i) {
  385. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
  386. &slot_ctx->reserved[i], (unsigned long long)dma,
  387. slot_ctx->reserved[i], i);
  388. dma += field_size;
  389. }
  390. if (csz)
  391. dbg_rsvd64(xhci, (u64 *)slot_ctx, dma);
  392. }
  393. void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
  394. struct xhci_container_ctx *ctx,
  395. unsigned int last_ep)
  396. {
  397. int i, j;
  398. int last_ep_ctx = 31;
  399. /* Fields are 32 bits wide, DMA addresses are in bytes */
  400. int field_size = 32 / 8;
  401. int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
  402. if (last_ep < 31)
  403. last_ep_ctx = last_ep + 1;
  404. for (i = 0; i < last_ep_ctx; ++i) {
  405. struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, ctx, i);
  406. dma_addr_t dma = ctx->dma +
  407. ((unsigned long)ep_ctx - (unsigned long)ctx->bytes);
  408. xhci_dbg(xhci, "Endpoint %02d Context:\n", i);
  409. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n",
  410. &ep_ctx->ep_info,
  411. (unsigned long long)dma, ep_ctx->ep_info);
  412. dma += field_size;
  413. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n",
  414. &ep_ctx->ep_info2,
  415. (unsigned long long)dma, ep_ctx->ep_info2);
  416. dma += field_size;
  417. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08llx - deq\n",
  418. &ep_ctx->deq,
  419. (unsigned long long)dma, ep_ctx->deq);
  420. dma += 2*field_size;
  421. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n",
  422. &ep_ctx->tx_info,
  423. (unsigned long long)dma, ep_ctx->tx_info);
  424. dma += field_size;
  425. for (j = 0; j < 3; ++j) {
  426. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
  427. &ep_ctx->reserved[j],
  428. (unsigned long long)dma,
  429. ep_ctx->reserved[j], j);
  430. dma += field_size;
  431. }
  432. if (csz)
  433. dbg_rsvd64(xhci, (u64 *)ep_ctx, dma);
  434. }
  435. }
  436. void xhci_dbg_ctx(struct xhci_hcd *xhci,
  437. struct xhci_container_ctx *ctx,
  438. unsigned int last_ep)
  439. {
  440. int i;
  441. /* Fields are 32 bits wide, DMA addresses are in bytes */
  442. int field_size = 32 / 8;
  443. struct xhci_slot_ctx *slot_ctx;
  444. dma_addr_t dma = ctx->dma;
  445. int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
  446. if (ctx->type == XHCI_CTX_TYPE_INPUT) {
  447. struct xhci_input_control_ctx *ctrl_ctx =
  448. xhci_get_input_control_ctx(xhci, ctx);
  449. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n",
  450. &ctrl_ctx->drop_flags, (unsigned long long)dma,
  451. ctrl_ctx->drop_flags);
  452. dma += field_size;
  453. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
  454. &ctrl_ctx->add_flags, (unsigned long long)dma,
  455. ctrl_ctx->add_flags);
  456. dma += field_size;
  457. for (i = 0; i < 6; ++i) {
  458. xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd2[%d]\n",
  459. &ctrl_ctx->rsvd2[i], (unsigned long long)dma,
  460. ctrl_ctx->rsvd2[i], i);
  461. dma += field_size;
  462. }
  463. if (csz)
  464. dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma);
  465. }
  466. slot_ctx = xhci_get_slot_ctx(xhci, ctx);
  467. xhci_dbg_slot_ctx(xhci, ctx);
  468. xhci_dbg_ep_ctx(xhci, ctx, last_ep);
  469. }