Lines Matching refs:ohci

103 static u32 roothub_a (struct ohci *hc)  in roothub_a()
105 static inline u32 roothub_b (struct ohci *hc) in roothub_b()
107 static inline u32 roothub_status (struct ohci *hc) in roothub_status()
109 static u32 roothub_portstatus (struct ohci *hc, int i) in roothub_portstatus()
191 void ep_print_int_eds (ohci_t *ohci, char * str) { in ep_print_int_eds() argument
196 ed_p = &(ohci->hcca->int_table [i]); in ep_print_int_eds()
378 ohci_t *ohci; in sohci_submit_job() local
383 ohci = &gohci; in sohci_submit_job()
387 if (ohci->disabled) { in sohci_submit_job()
441 ep_link (ohci, ed); in sohci_submit_job()
456 ohci_t *ohci = &gohci; in sohci_get_current_frame_number() local
458 return m16_swap (ohci->hcca->frame_no); in sohci_get_current_frame_number()
468 static int ep_link (ohci_t *ohci, ed_t *edi) in ep_link() argument
477 if (ohci->ed_controltail == NULL) { in ep_link()
478 writel ((long)ed, &ohci->regs->ed_controlhead); in ep_link()
480 ohci->ed_controltail->hwNextED = m32_swap (ed); in ep_link()
482 ed->ed_prev = ohci->ed_controltail; in ep_link()
483 if (!ohci->ed_controltail && !ohci->ed_rm_list[0] && in ep_link()
484 !ohci->ed_rm_list[1] && !ohci->sleeping) { in ep_link()
485 ohci->hc_control |= OHCI_CTRL_CLE; in ep_link()
486 writel (ohci->hc_control, &ohci->regs->control); in ep_link()
488 ohci->ed_controltail = edi; in ep_link()
493 if (ohci->ed_bulktail == NULL) { in ep_link()
494 writel ((long)ed, &ohci->regs->ed_bulkhead); in ep_link()
496 ohci->ed_bulktail->hwNextED = m32_swap (ed); in ep_link()
498 ed->ed_prev = ohci->ed_bulktail; in ep_link()
499 if (!ohci->ed_bulktail && !ohci->ed_rm_list[0] && in ep_link()
500 !ohci->ed_rm_list[1] && !ohci->sleeping) { in ep_link()
501 ohci->hc_control |= OHCI_CTRL_BLE; in ep_link()
502 writel (ohci->hc_control, &ohci->regs->control); in ep_link()
504 ohci->ed_bulktail = edi; in ep_link()
517 static int ep_unlink (ohci_t *ohci, ed_t *ed) in ep_unlink() argument
525 ohci->hc_control &= ~OHCI_CTRL_CLE; in ep_unlink()
526 writel (ohci->hc_control, &ohci->regs->control); in ep_unlink()
528 writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_controlhead); in ep_unlink()
532 if (ohci->ed_controltail == ed) { in ep_unlink()
533 ohci->ed_controltail = ed->ed_prev; in ep_unlink()
542 ohci->hc_control &= ~OHCI_CTRL_BLE; in ep_unlink()
543 writel (ohci->hc_control, &ohci->regs->control); in ep_unlink()
545 writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_bulkhead); in ep_unlink()
549 if (ohci->ed_bulktail == ed) { in ep_unlink()
550 ohci->ed_bulktail = ed->ed_prev; in ep_unlink()
611 static void td_fill (ohci_t *ohci, unsigned int info, in td_fill() argument
667 ohci_t *ohci = &gohci; in td_submit_job() local
693 td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, 4096, dev, cnt, urb); in td_submit_job()
698 td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, data_len, dev, cnt, urb); in td_submit_job()
701 if (!ohci->sleeping) in td_submit_job()
702 writel (OHCI_BLF, &ohci->regs->cmdstatus); /* start bulk list */ in td_submit_job()
707 td_fill (ohci, info, kseg_to_phys(setup), 8, dev, cnt++, urb); in td_submit_job()
712 td_fill (ohci, info, data, data_len, dev, cnt++, urb); in td_submit_job()
716 td_fill (ohci, info, data, 0, dev, cnt++, urb); in td_submit_job()
717 if (!ohci->sleeping) in td_submit_job()
718 writel (OHCI_CLF, &ohci->regs->cmdstatus); /* start Control list */ in td_submit_job()
758 static td_t * dl_reverse_done_list (ohci_t *ohci) in dl_reverse_done_list() argument
765 td_list_hc = m32_swap (ohci->hcca->done_head) & 0xfffffff0; in dl_reverse_done_list()
766 ohci->hcca->done_head = 0; in dl_reverse_done_list()
796 static int dl_done_list (ohci_t *ohci, td_t *td_list) in dl_done_list() argument
829 ep_unlink (ohci, ed); in dl_done_list()
1246 static int hc_reset (ohci_t *ohci) in hc_reset() argument
1251 if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { /* SMM owns the HC */ in hc_reset()
1252 writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */ in hc_reset()
1254 while (readl (&ohci->regs->control) & OHCI_CTRL_IR) { in hc_reset()
1264 writel (OHCI_INTR_MIE, &ohci->regs->intrdisable); in hc_reset()
1267 ohci->slot_name, in hc_reset()
1268 readl (&ohci->regs->control)); in hc_reset()
1271 writel (0, &ohci->regs->control); in hc_reset()
1274 writel (OHCI_HCR, &ohci->regs->cmdstatus); in hc_reset()
1275 while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) { in hc_reset()
1291 static int hc_start (ohci_t * ohci) in hc_start() argument
1296 ohci->disabled = 1; in hc_start()
1301 writel (0, &ohci->regs->ed_controlhead); in hc_start()
1302 writel (0, &ohci->regs->ed_bulkhead); in hc_start()
1304 writel ((__u32)ohci->hcca, &ohci->regs->hcca); /* a reset clears this */ in hc_start()
1307 writel ((fminterval * 9) / 10, &ohci->regs->periodicstart); in hc_start()
1309 writel (fminterval, &ohci->regs->fminterval); in hc_start()
1310 writel (0x628, &ohci->regs->lsthresh); in hc_start()
1313 ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER; in hc_start()
1314 ohci->disabled = 0; in hc_start()
1315 writel (ohci->hc_control, &ohci->regs->control); in hc_start()
1321 writel (mask, &ohci->regs->intrdisable); in hc_start()
1324 writel (mask, &ohci->regs->intrstatus); in hc_start()
1327 writel (mask, &ohci->regs->intrenable); in hc_start()
1331 writel ((roothub_a (ohci) | RH_A_NPS) & ~RH_A_PSM, in hc_start()
1332 &ohci->regs->roothub.a); in hc_start()
1333 writel (RH_HS_LPSC, &ohci->regs->roothub.status); in hc_start()
1337 mdelay ((roothub_a (ohci) >> 23) & 0x1fe); in hc_start()
1340 ohci->rh.devnum = 0; in hc_start()
1352 ohci_t *ohci = &gohci; in hc_interrupt() local
1353 struct ohci_regs *regs = ohci->regs; in hc_interrupt()
1357 if ((ohci->hcca->done_head != 0) && !(m32_swap (ohci->hcca->done_head) & 0x01)) { in hc_interrupt()
1370 ohci->disabled++; in hc_interrupt()
1372 ohci->slot_name); in hc_interrupt()
1376 ohci_dump (ohci, 1); in hc_interrupt()
1384 hc_reset (ohci); in hc_interrupt()
1403 unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1; in hc_interrupt()
1406 if (ohci->ed_rm_list[frame] != NULL) in hc_interrupt()
1421 static void hc_release_ohci (ohci_t *ohci) in hc_release_ohci() argument
1423 dbg ("USB HC release ohci usb-%s", ohci->slot_name); in hc_release_ohci()
1425 if (!ohci->disabled) in hc_release_ohci()
1426 hc_reset (ohci); in hc_release_ohci()