From: Bernhard Urban Date: Thu, 17 Sep 2009 23:10:53 +0000 (+0200) Subject: so, the HC clears CLF (ControlListFilled bit of the register "Command Status") immedi... X-Git-Tag: firstresponse~23 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=commitdiff_plain;h=8dbf7ef007d1d42b4b7482c41abe0c1f2b6266a6 so, the HC clears CLF (ControlListFilled bit of the register "Command Status") immediately after setting it. the ohci specs says: "This bit is used to indicate whether there are any TDs on the Control list. It is set by HCD whenever it adds a TD to an ED in the Control list." [so far so good] "When HC begins to process the head of the Control list, it checks CLF. As long as ControlListFilled is 0, HC will not start processing the Control list. If CLF is 1, HC will start processing the Control list and will set ControlListFilled to 0. If HC finds a TD on the list, then HC will set ControlListFilled to 1 causing the Control list processing to continue. If no TD is found on the Control list, and if the HCD does not set ControlListFilled, then ControlListFilled will still be 0 when HC completes processing the Control list and Control list processing will stop." What does it mean for us? HC don't find the TD? --- diff --git a/usb/host/ohci.c b/usb/host/ohci.c index a33bd42..db1b8be 100644 --- a/usb/host/ohci.c +++ b/usb/host/ohci.c @@ -160,7 +160,9 @@ u8 hcdi_enqueue(usb_transfer_descriptor *td) { "===========================\n"); sync_before_read(&hcca_oh0, 256); printf("done head (nach sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head)); - printf("HCCA->frame_no: %d\nhcca->hccapad1: %d\n", ((ACCESS_LE(hcca_oh0.frame_no) & 0xffff0000)>>16), ACCESS_LE(hcca_oh0.frame_no)&0xffff ); + printf("HCCA->frame_no: %d\nhcca->hccapad1: %d\n", + ((ACCESS_LE(hcca_oh0.frame_no) & 0xffff0000)>>16), + ACCESS_LE(hcca_oh0.frame_no)&0xffff ); if(hcca_oh0.done_head) printf("WWWWWWWWOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOTTTTTTTTTTTT\n"); struct general_td *tmptd = allocate_general_td(td->actlen); @@ -218,8 +220,10 @@ u8 hcdi_enqueue(usb_transfer_descriptor *td) { u32 current = read32(OHCI0_HC_CTRL_CURRENT_ED); printf("current: 0x%08X\n", current); while(!current) { - udelay(10); + udelay(1000000); current = read32(OHCI0_HC_CTRL_CURRENT_ED); + printf("OHCI_CTRL_CLE: 0x%08X || ", read32(OHCI0_HC_CONTROL)&OHCI_CTRL_CLE); + printf("OHCI_CLF: 0x%08X\n", read32(OHCI0_HC_COMMAND_STATUS)&OHCI_CLF); } udelay(20000);