From: Bernhard Urban Date: Thu, 17 Sep 2009 20:07:14 +0000 (+0200) Subject: some debugoutputstuff and few changes X-Git-Tag: firstresponse~26 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=commitdiff_plain;h=f9935091a024bfad92e99a37e0f5b887e66b8b2c some debugoutputstuff and few changes --- diff --git a/usb/host/ohci.c b/usb/host/ohci.c index 777eaac..d50c7dd 100644 --- a/usb/host/ohci.c +++ b/usb/host/ohci.c @@ -155,22 +155,14 @@ u8 hcdi_enqueue(usb_transfer_descriptor *td) { control_quirk(); printf( "===========================\n" - "===========================\n" - "done head (vor sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head)); + "===========================\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 after %d seconds: %d\n", 0, ACCESS_LE(hcca_oh0.frame_no)); - printf("HCCA->frame_no WITHOUT conversion macro: %d\n", hcca_oh0.frame_no); - if(!first) { - first = 1; - udelay(1000000); - sync_before_read(&hcca_oh0, 256); - printf("HCCA->frame_no after %d seconds: %d\n", 1, ACCESS_LE(hcca_oh0.frame_no)); - printf("HCCA->frame_no WITHOUT conversion macro: %d\n", hcca_oh0.frame_no); - } + 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); - (void) memcpy((void*) (phys_to_virt(ACCESS_LE(tmptd->cbp))), td->buffer, td->actlen); /* throws dsi exception after some time :X */ + (void) memcpy((void*) (phys_to_virt(ACCESS_LE(tmptd->cbp))), td->buffer, td->actlen); tmptd->flags &= ACCESS_LE(~OHCI_TD_DIRECTION_PID_MASK); switch(td->pid) { @@ -192,16 +184,13 @@ u8 hcdi_enqueue(usb_transfer_descriptor *td) { printf("tmptd hexump (before):\n"); hexdump(tmptd, sizeof(struct general_td)); printf("tmptd-cbp hexump (before):\n"); - hexdump((void*) (phys_to_virt(ACCESS_LE(tmptd->cbp))), td->actlen); + hexdump((void*) phys_to_virt(ACCESS_LE(tmptd->cbp)), td->actlen); - sync_after_write((void*) ACCESS_LE(tmptd->cbp), td->actlen); + sync_after_write((void*) phys_to_virt(ACCESS_LE(tmptd->cbp)), td->actlen); sync_after_write(tmptd, sizeof(struct general_td)); struct endpoint_descriptor *dummyconfig = allocate_endpoint(); - u32 current2 = read32(OHCI0_HC_CTRL_CURRENT_ED); - printf("current2: 0x%08X\n", current2); - #define ED_MASK2 ~0 /*((u32)~0x0f) */ #define ED_MASK ((u32)~0x0f) printf("tmpdt & ED_MASK: 0x%08X\n", virt_to_phys((void*) ((u32)tmptd & ED_MASK))); @@ -229,34 +218,24 @@ u8 hcdi_enqueue(usb_transfer_descriptor *td) { current = read32(OHCI0_HC_CTRL_CURRENT_ED); } - udelay(2000); - udelay(2000); - udelay(2000); + udelay(20000); current = read32(OHCI0_HC_CTRL_CURRENT_ED); printf("current: 0x%08X\n", current); printf("+++++++++++++++++++++++++++++\n"); - udelay(2000); - udelay(2000); - udelay(2000); - udelay(2000); - udelay(2000); - udelay(2000); - udelay(2000); - udelay(2000); + udelay(20000); sync_before_read(tmptd, sizeof(struct general_td)); printf("tmptd hexump (after):\n"); hexdump(tmptd, sizeof(struct general_td)); - sync_before_read((void*) ACCESS_LE(tmptd->cbp), td->actlen); + sync_before_read((void*) phys_to_virt(ACCESS_LE(tmptd->cbp)), td->actlen); printf("tmptd-cbp hexump (after):\n"); - hexdump((void*) (phys_to_virt(ACCESS_LE(tmptd->cbp))), td->actlen); + hexdump((void*) phys_to_virt(ACCESS_LE(tmptd->cbp)), td->actlen); - printf("done head (vor sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head)); sync_before_read(&hcca_oh0, 256); printf("done head (nach sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head)); - free(tmptd); + //free(tmptd); return 0; } @@ -357,8 +336,10 @@ void hcdi_irq() flags &= read32(OHCI0_HC_INT_ENABLE); /* nothing to do? */ - if (flags == 0) + if (flags == 0) { + printf("OHCI Interrupt occured: but not for you! WTF?!\n"); return; + } printf("OHCI Interrupt occured: "); /* UnrecoverableError */