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

Changeset c9d905f in mainline


Ignore:
Timestamp:
2017-09-30T13:16:18Z (4 years ago)
Author:
jenda@…>
Branches:
lfn, master
Children:
4d28d86
Parents:
e6b0dba
Message:

macros for handoff delay

Location:
uspace/drv/bus/usb/xhci
Files:
2 edited

Legend:

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

    re6b0dba rc9d905f  
    327327        usb_log_debug2("LEGSUP: bios: %x, os: %x", hc->legsup->sem_bios, hc->legsup->sem_os);
    328328        XHCI_REG_WR(hc->legsup, XHCI_LEGSUP_SEM_OS, 1);
    329         for (int i = 0; i<1001; i++) {
     329        for (int i = 0; i<=(XHCI_LEGSUP_BIOS_TIMEOUT_US/XHCI_LEGSUP_POLLING_DELAY_1MS); i++) {
    330330                usb_log_debug2("LEGSUP: elapsed: %i ms, bios: %x, os: %x", i,
    331331                        XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_BIOS),
     
    335335                        return EOK;
    336336                }
    337                 async_usleep(1000);
     337                async_usleep(XHCI_LEGSUP_POLLING_DELAY_1MS);
    338338        }
    339339        usb_log_error("BIOS did not release XHCI legacy hold!\n");
  • uspace/drv/bus/usb/xhci/hw_struct/regs.h

    re6b0dba rc9d905f  
    581581#define XHCI_LEGSUP_SEM_OS      sem_os, 8, FLAG, 0
    582582
     583#define XHCI_LEGSUP_POLLING_DELAY_1MS   1000
     584#define XHCI_LEGSUP_BIOS_TIMEOUT_US     1000000 /* 4.22.1 BIOS may take up to 1 second to release the device */
     585
    583586#endif
    584587/**
Note: See TracChangeset for help on using the changeset viewer.