-static void dbg_op_state() {
- switch (read32(OHCI0_HC_CONTROL) & OHCI_CTRL_HCFS) {
- case OHCI_USB_SUSPEND:
- printf("ohci-- OHCI_USB_SUSPEND\n");
- break;
- case OHCI_USB_RESET:
- printf("ohci-- OHCI_USB_RESET\n");
- break;
- case OHCI_USB_OPER:
- printf("ohci-- OHCI_USB_OPER\n");
- break;
- case OHCI_USB_RESUME:
- printf("ohci-- OHCI_USB_RESUME\n");
- break;
- }
+static void dbg_op_state()
+{
+ switch (read32(OHCI0_HC_CONTROL) & OHCI_CTRL_HCFS) {
+ case OHCI_USB_SUSPEND:
+ printf("ohci-- OHCI_USB_SUSPEND\n");
+ break;
+ case OHCI_USB_RESET:
+ printf("ohci-- OHCI_USB_RESET\n");
+ break;
+ case OHCI_USB_OPER:
+ printf("ohci-- OHCI_USB_OPER\n");
+ break;
+ case OHCI_USB_RESUME:
+ printf("ohci-- OHCI_USB_RESUME\n");
+ break;
+ }
- u32 fmint = read32(OHCI0_HC_FM_INTERVAL) & 0x3fff;
- if(fmint != FI)
- printf("ohci-- fminterval delta: %d\n", fmint - FI);
- fmint |= FSMP (fmint) << 16;
-
- /* enable interrupts of both usb host controllers */
- set32(EHCI_CTL, EHCI_CTL_OH0INTE | EHCI_CTL_OH1INTE | 0xe0000);
-
- /* reset HC */
- write32(OHCI0_HC_COMMAND_STATUS, OHCI_HCR);
-
- /* wait max. 30us */
- u32 ts = 30;
- while ((read32(OHCI0_HC_COMMAND_STATUS) & OHCI_HCR) != 0) {
- if(--ts == 0) {
- printf("ohci-- FAILED");
- return;
- }
- udelay(1);
- }
-
- /* disable interrupts; 2ms timelimit here!
- now we're in the SUSPEND state ... must go OPERATIONAL
- within 2msec else HC enters RESUME */
-
- u32 cookie = irq_kill();
-
- /* Tell the controller where the control and bulk lists are
- * The lists are empty now. */
- write32(OHCI0_HC_CTRL_HEAD_ED, 0);
- write32(OHCI0_HC_BULK_HEAD_ED, 0);
-
- /* set hcca adress */
- sync_after_write(&hcca_oh0, 256);
- write32(OHCI0_HC_HCCA, virt_to_phys(&hcca_oh0));
-
- /* set periodicstart */
+ u32 fmint = read32(OHCI0_HC_FM_INTERVAL) & 0x3fff;
+ if(fmint != FI)
+ printf("ohci-- fminterval delta: %d\n", fmint - FI);
+ fmint |= FSMP (fmint) << 16;
+
+ /* enable interrupts of both usb host controllers */
+ set32(EHCI_CTL, EHCI_CTL_OH0INTE | EHCI_CTL_OH1INTE | 0xe0000);
+
+ /* reset HC */
+ write32(OHCI0_HC_COMMAND_STATUS, OHCI_HCR);
+
+ /* wait max. 30us */
+ u32 ts = 30;
+ while ((read32(OHCI0_HC_COMMAND_STATUS) & OHCI_HCR) != 0) {
+ if(--ts == 0) {
+ printf("ohci-- FAILED");
+ return;
+ }
+ udelay(1);
+ }
+
+ /* disable interrupts; 2ms timelimit here!
+ now we're in the SUSPEND state ... must go OPERATIONAL
+ within 2msec else HC enters RESUME */
+
+ u32 cookie = irq_kill();
+
+ /* Tell the controller where the control and bulk lists are
+ * The lists are empty now. */
+ write32(OHCI0_HC_CTRL_HEAD_ED, 0);
+ write32(OHCI0_HC_BULK_HEAD_ED, 0);
+
+ /* set hcca adress */
+ sync_after_write(&hcca_oh0, 256);
+ write32(OHCI0_HC_HCCA, virt_to_phys(&hcca_oh0));
+
+ /* set periodicstart */
- write32(OHCI0_HC_FM_INTERVAL, fmint | (fit ^ FIT));
- write32(OHCI0_HC_PERIODIC_START, ((9*fmInterval)/10)&0x3fff);
+ write32(OHCI0_HC_FM_INTERVAL, fmint | (fit ^ FIT));
+ write32(OHCI0_HC_PERIODIC_START, ((9*fmInterval)/10)&0x3fff);
- /* testing bla */
- if ((read32(OHCI0_HC_FM_INTERVAL) & 0x3fff0000) == 0 || !read32(OHCI0_HC_PERIODIC_START)) {
- printf("ohci-- w00t, fail!! see ohci-hcd.c:669\n");
- }
-
- /* start HC operations */
- write32(OHCI0_HC_CONTROL, OHCI_CONTROL_INIT | OHCI_USB_OPER);
+ /* testing bla */
+ if ((read32(OHCI0_HC_FM_INTERVAL) & 0x3fff0000) == 0 || !read32(OHCI0_HC_PERIODIC_START)) {
+ printf("ohci-- w00t, fail!! see ohci-hcd.c:669\n");
+ }
+
+ /* start HC operations */
+ write32(OHCI0_HC_CONTROL, OHCI_CONTROL_INIT | OHCI_USB_OPER);
- /* wake on ConnectStatusChange, matching external hubs */
- set32(OHCI0_HC_RH_STATUS, RH_HS_DRWE);
+ /* wake on ConnectStatusChange, matching external hubs */
+ set32(OHCI0_HC_RH_STATUS, RH_HS_DRWE);
- /* Choose the interrupts we care about now, others later on demand */
- write32(OHCI0_HC_INT_STATUS, ~0);
- write32(OHCI0_HC_INT_ENABLE, OHCI_INTR_INIT);
+ /* Choose the interrupts we care about now, others later on demand */
+ write32(OHCI0_HC_INT_STATUS, ~0);
+ write32(OHCI0_HC_INT_ENABLE, OHCI_INTR_INIT);