Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ehci-hcd/pci.c

    r8855939 r4125b7d  
    5454
    5555#define CMD_OFFSET 0x0
    56 #define STS_OFFSET 0x4
    57 #define CFG_OFFSET 0x40
     56#define CONFIGFLAG_OFFSET 0x40
    5857
    5958#define USBCMD_RUN 1
     
    187186        CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to read PCI config space.\n",
    188187            ret);
    189         usb_log_info("Register space BAR at %p:%" PRIxn ".\n",
    190             (void *) address, value);
     188        usb_log_info("Register space BAR at %p:%" PRIxn ".\n", (void *) address, value);
    191189
    192190        /* clear lower byte, it's not part of the BASE address */
     
    265263         * It would prevent pre-OS code from interfering. */
    266264        ret = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
    267            IPC_M_CONFIG_SPACE_WRITE_32, eecp + USBLEGCTLSTS_OFFSET,
    268            0xe0000000);
     265           IPC_M_CONFIG_SPACE_WRITE_32, eecp + USBLEGCTLSTS_OFFSET, 0);
    269266        CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) zero USBLEGCTLSTS.\n", ret);
     267        usb_log_debug("Zeroed USBLEGCTLSTS register.\n");
    270268
    271269        /* Read again Legacy Support and Control register */
     
    292290        volatile uint32_t *usbcmd =
    293291            (uint32_t*)((uint8_t*)registers + operation_offset + CMD_OFFSET);
    294         volatile uint32_t *usbsts =
    295             (uint32_t*)((uint8_t*)registers + operation_offset + STS_OFFSET);
    296292        volatile uint32_t *usbconfigured =
    297             (uint32_t*)((uint8_t*)registers + operation_offset + CFG_OFFSET);
     293            (uint32_t*)((uint8_t*)registers + operation_offset
     294            + CONFIGFLAG_OFFSET);
    298295        usb_log_debug("USBCMD value: %x.\n", *usbcmd);
    299296        if (*usbcmd & USBCMD_RUN) {
    300297                *usbcmd = 0;
    301                 while (!(*usbsts & (1 << 12))); /*wait until hc is halted */
    302298                *usbconfigured = 0;
    303299                usb_log_info("EHCI turned off.\n");
     
    305301                usb_log_info("EHCI was not running.\n");
    306302        }
    307         usb_log_debug("Registers: %x(0x00080000):%x(0x00001000):%x(0x0).\n",
    308             *usbcmd, *usbsts, *usbconfigured);
    309303
    310304        async_hangup(parent_phone);
Note: See TracChangeset for help on using the changeset viewer.