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

Changeset 6fb003e in mainline for uspace/drv/ohci/hc.c


Ignore:
Timestamp:
2011-05-07T13:40:03Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
02804e1, 1866945
Parents:
bc02b83 (diff), 7ab7c7f6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Fixed: OHCI: use devices are not detected at startup time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/hc.c

    rbc02b83 r6fb003e  
    4949static int interrupt_emulator(hc_t *instance);
    5050static void hc_gain_control(hc_t *instance);
    51 static void hc_init_hw(hc_t *instance);
    5251static int hc_init_transfer_lists(hc_t *instance);
    5352static int hc_init_memory(hc_t *instance);
     
    9291                usb_log_error("Failed add root hub match-id.\n");
    9392        }
     93        ret = ddf_fun_bind(hub_fun);
    9494        return ret;
    9595}
     
    111111            ret, str_error(ret));
    112112
     113        list_initialize(&instance->pending_batches);
    113114        usb_device_keeper_init(&instance->manager);
    114115        ret = usb_endpoint_manager_init(&instance->ep_manager,
     
    117118            str_error(ret));
    118119
    119         hc_gain_control(instance);
    120120        ret = hc_init_memory(instance);
    121121        CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures: %s.\n",
    122122            str_error(ret));
    123         hc_init_hw(instance);
     123#undef CHECK_RET_RETURN
     124
     125
     126//      hc_init_hw(instance);
     127        hc_gain_control(instance);
    124128        fibril_mutex_initialize(&instance->guard);
    125129
     
    132136        }
    133137
    134         list_initialize(&instance->pending_batches);
    135 #undef CHECK_RET_RETURN
    136138        return EOK;
    137139}
     
    287289{
    288290        assert(instance);
    289         usb_log_debug("OHCI interrupt: %x.\n", status);
     291        usb_log_debug("OHCI(%p) interrupt: %x.\n", instance, status);
    290292        if ((status & ~I_SF) == 0) /* ignore sof status */
    291293                return;
     
    339341            (uint32_t*)((char*)instance->registers + 0x100);
    340342        usb_log_debug("OHCI legacy register %p: %x.\n",
    341                 ohci_emulation_reg, *ohci_emulation_reg);
    342         *ohci_emulation_reg &= ~0x1;
     343            ohci_emulation_reg, *ohci_emulation_reg);
     344        /* Do not change A20 state */
     345        *ohci_emulation_reg &= 0x100;
     346        usb_log_debug("OHCI legacy register %p: %x.\n",
     347            ohci_emulation_reg, *ohci_emulation_reg);
    343348
    344349        /* Interrupt routing enabled => smm driver is active */
     
    350355                }
    351356                usb_log_info("SMM driver: Ownership taken.\n");
     357                instance->registers->control &= (C_HCFS_RESET << C_HCFS_SHIFT);
     358                async_usleep(50000);
    352359                return;
    353360        }
     
    375382}
    376383/*----------------------------------------------------------------------------*/
    377 void hc_init_hw(hc_t *instance)
     384void hc_start_hw(hc_t *instance)
    378385{
    379386        /* OHCI guide page 42 */
     
    474481{
    475482        assert(instance);
     483
     484        bzero(&instance->rh, sizeof(instance->rh));
    476485        /* Init queues */
    477486        hc_init_transfer_lists(instance);
Note: See TracChangeset for help on using the changeset viewer.