Changeset e6b0dba in mainline


Ignore:
Timestamp:
2017-09-30T13:07:10Z (7 years ago)
Author:
jenda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c9d905f
Parents:
cc9ac7c
Message:

BIOS handover

File:
1 edited

Legend:

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

    rcc9ac7c re6b0dba  
    323323                return EOK;
    324324
    325         /*
    326          * TODO: Implement handoff from BIOS, section 4.22.1
    327          * QEMU does not support this, so we have to test on real HW.
    328          */
     325        /* Section 4.22.1 */
     326        /* TODO: Test this with USB3-aware BIOS */
     327        usb_log_debug2("LEGSUP: bios: %x, os: %x", hc->legsup->sem_bios, hc->legsup->sem_os);
     328        XHCI_REG_WR(hc->legsup, XHCI_LEGSUP_SEM_OS, 1);
     329        for (int i = 0; i<1001; i++) {
     330                usb_log_debug2("LEGSUP: elapsed: %i ms, bios: %x, os: %x", i,
     331                        XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_BIOS),
     332                        XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_OS));
     333                if (XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_BIOS) == 0) {
     334                        assert(XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_OS) == 1);
     335                        return EOK;
     336                }
     337                async_usleep(1000);
     338        }
     339        usb_log_error("BIOS did not release XHCI legacy hold!\n");
     340
    329341        return ENOTSUP;
    330342}
Note: See TracChangeset for help on using the changeset viewer.