Changes in uspace/drv/ohci/hc.c [3e4f2e0:c8eddf4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hc.c
r3e4f2e0 rc8eddf4 40 40 #include <usb/usb.h> 41 41 #include <usb/ddfiface.h> 42 #include <usb/usbdevice.h> 42 43 43 44 #include "hc.h" … … 48 49 static int interrupt_emulator(hc_t *instance); 49 50 static void hc_gain_control(hc_t *instance); 51 static void hc_init_hw(hc_t *instance); 50 52 static int hc_init_transfer_lists(hc_t *instance); 51 53 static int hc_init_memory(hc_t *instance); … … 90 92 usb_log_error("Failed add root hub match-id.\n"); 91 93 } 92 ret = ddf_fun_bind(hub_fun);93 94 return ret; 94 95 } 95 96 /*----------------------------------------------------------------------------*/ 96 int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts) 97 int hc_init(hc_t *instance, ddf_fun_t *fun, ddf_dev_t *dev, 98 uintptr_t regs, size_t reg_size, bool interrupts) 97 99 { 98 100 assert(instance); … … 109 111 ret, str_error(ret)); 110 112 111 list_initialize(&instance->pending_batches);112 113 usb_device_keeper_init(&instance->manager); 113 114 ret = usb_endpoint_manager_init(&instance->ep_manager, … … 116 117 str_error(ret)); 117 118 119 hc_gain_control(instance); 118 120 ret = hc_init_memory(instance); 119 121 CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures: %s.\n", 120 122 str_error(ret)); 121 #undef CHECK_RET_RETURN 122 123 124 // hc_init_hw(instance); 125 hc_gain_control(instance); 123 hc_init_hw(instance); 126 124 fibril_mutex_initialize(&instance->guard); 127 125 … … 134 132 } 135 133 134 list_initialize(&instance->pending_batches); 135 #undef CHECK_RET_RETURN 136 136 return EOK; 137 137 } … … 287 287 { 288 288 assert(instance); 289 usb_log_debug("OHCI (%p) interrupt: %x.\n", instance, status);289 usb_log_debug("OHCI interrupt: %x.\n", status); 290 290 if ((status & ~I_SF) == 0) /* ignore sof status */ 291 291 return; … … 339 339 (uint32_t*)((char*)instance->registers + 0x100); 340 340 usb_log_debug("OHCI legacy register %p: %x.\n", 341 ohci_emulation_reg, *ohci_emulation_reg); 342 /* Do not change A20 state */ 343 *ohci_emulation_reg &= 0x100; 344 usb_log_debug("OHCI legacy register %p: %x.\n", 345 ohci_emulation_reg, *ohci_emulation_reg); 341 ohci_emulation_reg, *ohci_emulation_reg); 342 *ohci_emulation_reg &= ~0x1; 346 343 347 344 /* Interrupt routing enabled => smm driver is active */ … … 353 350 } 354 351 usb_log_info("SMM driver: Ownership taken.\n"); 355 instance->registers->control &= (C_HCFS_RESET << C_HCFS_SHIFT);356 async_usleep(50000);357 352 return; 358 353 } … … 380 375 } 381 376 /*----------------------------------------------------------------------------*/ 382 void hc_ start_hw(hc_t *instance)377 void hc_init_hw(hc_t *instance) 383 378 { 384 379 /* OHCI guide page 42 */ … … 479 474 { 480 475 assert(instance); 481 482 bzero(&instance->rh, sizeof(instance->rh));483 476 /* Init queues */ 484 477 hc_init_transfer_lists(instance);
Note:
See TracChangeset
for help on using the changeset viewer.