- /* spin until the controller is done with the control list */
- u32 current = read32(OHCI0_HC_CTRL_CURRENT_ED);
- printf("current: 0x%08X\n", current);
- while(!current) {
- udelay(2);
- current = read32(OHCI0_HC_CTRL_CURRENT_ED);
+ printf("wait: %d\n", wait);
+ udelay(1000000);
+#else
+ while(!read32(OHCI0_HC_CTRL_CURRENT_ED)) {
+ }
+ udelay(100000);
+ u32 current = read32(OHCI0_HC_CTRL_CURRENT_ED);
+ printf("current: 0x%08X\n", current);
+ printf("+++++++++++++++++++++++++++++\n");
+ udelay(100000);
+#endif
+
+ sync_before_read(&hcca_oh0, sizeof(hcca_oh0));
+ struct general_td *n = phys_to_virt(LE(hcca_oh0.done_head) & ~1);
+ printf("done_head: 0x%08X\n", n);
+#if 1
+ struct general_td *prev = 0, *next = 0;
+ /* reverse done queue */
+ while(virt_to_phys(n)) {
+ printf("n: 0x%08X\n", n);
+ printf("next: 0x%08X\n", next);
+ printf("prev: 0x%08X\n", prev);
+ next = n;
+
+ sync_before_read((void*) n, sizeof(struct general_td));
+
+ n = (struct general_td*) phys_to_virt(LE(next->nexttd));
+ next->nexttd = (u32) prev;
+ prev = next;