Changeset d1984e0 in mainline


Ignore:
Timestamp:
2011-01-28T15:47:39Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
54229db
Parents:
a8e96683
Message:

Added UHCI command register values

HC is started on initialization.

Location:
uspace/drv/uhci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/uhci.c

    ra8e96683 rd1984e0  
    5555
    5656        uhci_print_verbose("Initializing frame list.\n");
    57         instance->frame_list =
    58           memallign32(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT, 4096);
     57        instance->frame_list = get_page();
     58//        memalign32(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT, 4096);
    5959        if (instance->frame_list == NULL) {
    6060                uhci_print_error("Failed to allocate frame list pointer.\n");
     
    7979        instance->cleaner = fibril_create(uhci_clean_finished, instance);
    8080        fibril_add_ready(instance->cleaner);
     81
     82        uhci_print_verbose("Starting UHCI HC.\n");
     83        uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
     84        cmd |= UHCI_CMD_RUN_STOP | UHCI_CMD_CONFIGURE;
     85        pio_write_16(&instance->registers->usbcmd, cmd);
    8186
    8287        device->driver_data = instance;
     
    177182
    178183        while(1) {
    179                 uhci_print_verbose("Running cleaning fibril on %p.\n", instance);
     184                uhci_print_verbose("Running cleaning fibril on: %p.\n", instance);
    180185                /* iterate all transfer queues */
    181                 usb_transfer_type_t i = USB_TRANSFER_BULK;
    182                 for (; i > USB_TRANSFER_ISOCHRONOUS; --i) {
     186                int i = 1;
     187                for (; i < TRANSFER_QUEUES; ++i) {
    183188                        /* Remove inactive transfers from the top of the queue
    184189                         * TODO: should I reach queue head or is this enough? */
     190                        uhci_print_verbose("Running cleaning fibril on queue: %p.\n",
     191                                &instance->transfers[i]);
    185192                        while (instance->transfers[i].first &&
    186193                         !(instance->transfers[i].first->status & TD_STATUS_ERROR_ACTIVE)) {
  • uspace/drv/uhci/uhci.h

    ra8e96683 rd1984e0  
    4646typedef struct uhci_regs {
    4747        uint16_t usbcmd;
    48 #define USB_CMD_
     48#define UHCI_CMD_MAX_PACKET (1 << 7)
     49#define UHCI_CMD_CONFIGURE  (1 << 6)
     50#define UHCI_CMD_DEBUG  (1 << 5)
     51#define UHCI_CMD_FORCE_GLOBAL_RESUME  (1 << 4)
     52#define UHCI_CMD_FORCE_GLOBAL_SUSPEND  (1 << 3)
     53#define UHCI_CMD_GLOBAL_RESET  (1 << 2)
     54#define UHCI_CMD_HCRESET  (1 << 1)
     55#define UHCI_CMD_RUN_STOP  (1 << 0)
     56
    4957        uint16_t usbsts;
    5058        uint16_t usbintr;
Note: See TracChangeset for help on using the changeset viewer.