Changeset ba17f5b in mainline for uspace/drv/ohci/hc.c
- Timestamp:
- 2011-05-07T08:20:20Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd2394b
- Parents:
- 5f7b75a (diff), 6c6a95d2 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hc.c
r5f7b75a rba17f5b 45 45 #include "hcd_endpoint.h" 46 46 47 #define OHCI_USED_INTERRUPTS \ 48 (I_SO | I_WDH | I_UE | I_RHSC) 47 49 static int interrupt_emulator(hc_t *instance); 48 50 static void hc_gain_control(hc_t *instance); … … 285 287 { 286 288 assert(instance); 287 if ((status & ~IS_SF) == 0) /* ignore sof status */ 289 usb_log_debug("OHCI interrupt: %x.\n", status); 290 if ((status & ~I_SF) == 0) /* ignore sof status */ 288 291 return; 289 if (status & I S_RHSC)292 if (status & I_RHSC) 290 293 rh_interrupt(&instance->rh); 291 294 292 usb_log_debug("OHCI interrupt: %x.\n", status); 293 294 if (status & IS_WDH) { 295 296 if (status & I_WDH) { 295 297 fibril_mutex_lock(&instance->guard); 296 298 usb_log_debug2("HCCA: %p-%#" PRIx32 " (%p).\n", instance->hcca, … … 332 334 { 333 335 assert(instance); 336 usb_log_debug("Requesting OHCI control.\n"); 334 337 /* Turn off legacy emulation */ 335 338 volatile uint32_t *ohci_emulation_reg = … … 337 340 usb_log_debug("OHCI legacy register %p: %x.\n", 338 341 ohci_emulation_reg, *ohci_emulation_reg); 339 *ohci_emulation_reg = 0;342 *ohci_emulation_reg &= ~0x1; 340 343 341 344 /* Interrupt routing enabled => smm driver is active */ … … 421 424 instance->registers->control); 422 425 423 /* Disable interrupts */ 424 instance->registers->interrupt_disable = I_SF | I_OC; 425 usb_log_debug2("Disabling interrupts: %x.\n", 426 instance->registers->interrupt_disable); 427 instance->registers->interrupt_disable = I_MI; 426 /* Enable interrupts */ 427 instance->registers->interrupt_enable = OHCI_USED_INTERRUPTS; 428 428 usb_log_debug2("Enabled interrupts: %x.\n", 429 429 instance->registers->interrupt_enable); 430 instance->registers->interrupt_enable = I_MI; 430 431 431 432 /* Set periodic start to 90% */ … … 492 493 instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa); 493 494 495 /* Init interrupt code */ 496 instance->interrupt_code.cmds = instance->interrupt_commands; 497 { 498 /* Read status register */ 499 instance->interrupt_commands[0].cmd = CMD_MEM_READ_32; 500 instance->interrupt_commands[0].dstarg = 1; 501 instance->interrupt_commands[0].addr = 502 (void*)&instance->registers->interrupt_status; 503 504 /* Test whether we are the interrupt cause */ 505 instance->interrupt_commands[1].cmd = CMD_BTEST; 506 instance->interrupt_commands[1].value = 507 OHCI_USED_INTERRUPTS; 508 instance->interrupt_commands[1].srcarg = 1; 509 instance->interrupt_commands[1].dstarg = 2; 510 511 /* Predicate cleaning and accepting */ 512 instance->interrupt_commands[2].cmd = CMD_PREDICATE; 513 instance->interrupt_commands[2].value = 2; 514 instance->interrupt_commands[2].srcarg = 2; 515 516 /* Write clean status register */ 517 instance->interrupt_commands[3].cmd = CMD_MEM_WRITE_A_32; 518 instance->interrupt_commands[3].srcarg = 1; 519 instance->interrupt_commands[3].addr = 520 (void*)&instance->registers->interrupt_status; 521 522 /* Accept interrupt */ 523 instance->interrupt_commands[4].cmd = CMD_ACCEPT; 524 525 instance->interrupt_code.cmdcount = OHCI_NEEDED_IRQ_COMMANDS; 526 } 527 494 528 return EOK; 495 529 }
Note:
See TracChangeset
for help on using the changeset viewer.