Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3eb0c85 in mainline


Ignore:
Timestamp:
2014-02-02T00:36:35Z (8 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
8e7c9fe
Parents:
1412b7ee
Message:

ehci: Cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/hc.c

    r1412b7ee r3eb0c85  
    350350{
    351351        assert(instance);
    352         /* Turn of the HC if it's running, Reseting a running device is
     352        /* Turn off the HC if it's running, Reseting a running device is
    353353         * undefined */
    354354        if (!(EHCI_RD(instance->registers->usbsts) & USB_STS_HC_HALTED_FLAG)) {
     
    377377        /* Use the lowest 4G segment */
    378378        EHCI_WR(instance->registers->ctrldssegment, 0);
    379         /* Set periodic list */
     379
     380        /* Enable periodic list */
    380381        assert(instance->periodic_list_base);
    381382        const uintptr_t phys_base =
     
    393394        EHCI_SET(instance->registers->usbcmd, USB_CMD_ASYNC_SCHEDULE_FLAG);
    394395
    395         /* start hc and get all ports */
     396        /* Start hc and get all ports */
    396397        EHCI_SET(instance->registers->usbcmd, USB_CMD_RUN_FLAG);
    397398        EHCI_SET(instance->registers->configflag, USB_CONFIG_FLAG_FLAG);
    398 #if 0
    399         /*
    400          * TURN OFF EHCI FOR NOW
    401          */
    402         usb_log_debug("USBCMD value: %x.\n",
    403             EHCI_RD(instance->registers->usbcmd));
    404         if (EHCI_RD(instance->registers->usbcmd) & USB_CMD_RUN_FLAG) {
    405                 /* disable all interrupts */
    406                 EHCI_WR(instance->registers->usbintr, 0);
    407                 /* ack all interrupts */
    408                 EHCI_WR(instance->registers->usbsts, 0x3f);
    409                 /* release RH ports */
    410                 EHCI_WR(instance->registers->configflag, 0);
    411                 EHCI_WR(instance->registers->usbcmd, 0);
    412                 /* Wait until hc is halted */
    413                 while ((EHCI_RD(instance->registers->usbsts) & USB_STS_HC_HALTED_FLAG) == 0);
    414                 usb_log_info("EHCI turned off.\n");
    415         } else {
    416                 usb_log_info("EHCI was not running.\n");
    417         }
    418 #endif
     399
    419400        usb_log_debug("Registers: \n"
    420401            "\t USBCMD(%p): %x(0x00080000 = at least 1ms between interrupts)\n"
Note: See TracChangeset for help on using the changeset viewer.