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