- Timestamp:
- Nov 4, 2010, 4:23:33 PM (15 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r34 r35 368 368 369 369 if (ctl & HOST_AHCI_EN) { 370 /* AHCI mode already en bled */370 /* AHCI mode already enabled */ 371 371 return(0); 372 372 } … … 441 441 /* start/reset port; if no device is attached, this is expected to fail */ 442 442 if (init_reset) { 443 ddprintf(" resetting port #%d\n", p);443 ddprintf("init-resetting port #%d\n", p); 444 444 rc = ahci_reset_port(ai, p, 0); 445 445 } else { … … 459 459 AP_VADDR, (void _far *) id_buf, 512, 460 460 AP_END); 461 462 461 if (rc != 0 || id_buf[ATA_ID_CONFIG] & (1U << 15)) { 463 462 /* this might be an ATAPI device; run IDENTIFY_PACKET_DEVICE */ … … 471 470 ddphex(id_buf, 512, "ATA_IDENTIFY(_PACKET) results:\n"); 472 471 ahci_setup_device(ai, p, 0, id_buf); 472 473 473 } else { 474 474 /* no device attached to this port */ … … 546 546 } 547 547 548 /* clear any pending adapter-level interrupts */ 549 writel(ai->mmio + HOST_IRQ_STAT, readl(ai->mmio + HOST_IRQ_STAT)); 550 readl(ai->mmio + HOST_IRQ_STAT); /* flush */ 551 548 552 /* enable adapter-level interrupts */ 549 553 writel(ai->mmio + HOST_CTL, HOST_IRQ_EN); … … 586 590 /* clear pending port IRQs */ 587 591 tmp = readl(port_mmio + PORT_IRQ_STAT); 592 ddprintf("PORT_IRQ_STAT was 0x%lx\n", tmp); 588 593 if (tmp) { 589 594 writel(port_mmio + PORT_IRQ_STAT, tmp); … … 1024 1029 1025 1030 /****************************************************************************** 1031 * set device into IDLE mode (spin down); this was used during 1032 * debugging/testing and is still there since it does not hurt... 1033 * If 'idle' is != 0, the idle timeout is set to 5 seconds, otherwise it 1034 * is turned off. 1035 */ 1036 int ahci_set_dev_idle(AD_INFO *ai, int p, int idle) 1037 { 1038 ddprintf("sending IDLE=%d command to port %d\n", idle, p); 1039 return ahci_exec_polled_cmd(ai, p, 0, 500, ATA_CMD_IDLE, AP_COUNT, 1040 idle ? 1 : 0, AP_END); 1041 } 1042 1043 /****************************************************************************** 1026 1044 * Execute polled ATA/ATAPI command. This function will block until the command 1027 1045 * has completed or the timeout has expired, thus it should only be used during … … 1081 1099 * 1082 1100 * On entry, OS/2 will have processor interrupts enabled because we're using 1083 * shared IRQs but we won't be preempted by another interrupt on the same IRQ1101 * shared IRQs but we won't be preempted by another interrupt on the same 1084 1102 * IRQ level until we indicated EOI. We'll keep it this way, only requesting 1085 1103 * the driver-level spinlock when actually changing the driver state (IORB … … 1420 1438 } else { 1421 1439 /* complete ATA-specific device information */ 1422 if (!disable_ncq[ad_no(ai)][p]) { 1440 if (disable_ncq[ad_no(ai)][p]) { 1441 /* MT: set ncq_max to 1 if NCQ is disabled for this port */ 1442 ai->ports[p].devs[d].ncq_max = 1; 1443 } else { 1423 1444 ai->ports[p].devs[d].ncq_max = id_buf[ATA_ID_QUEUE_DEPTH] & 0x001fU; 1424 1445 } 1446 1425 1447 if (id_buf[ATA_ID_CFS_ENABLE_2] & 0x0400U) { 1426 1448 ai->ports[p].devs[d].lba48 = 1; -
trunk/src/os2ahci/os2ahci.c
r34 r35 190 190 case 'r': 191 191 /* reset ports during initialization */ 192 192 init_reset = 1; 193 193 break; 194 194 -
trunk/src/os2ahci/os2ahci.def
r34 r35 1 1 library os2ahci 2 Description '$@#thi.guten (www.thiguten.de):1.00.20101 021#@OS/2 AHCI Adapter Device Driver'2 Description '$@#thi.guten (www.thiguten.de):1.00.20101104#@OS/2 AHCI Adapter Device Driver' 3 3 protmode 4 4 -
trunk/src/os2ahci/os2ahci.h
r33 r35 406 406 extern int ahci_exec_polled_cmd (AD_INFO *ai, int p, int d, 407 407 int timeout, int cmd, ...); 408 extern int ahci_set_dev_idle (AD_INFO *ai, int p, int idle); 408 409 409 410 extern int ahci_intr (u16 irq);
Note:
See TracChangeset
for help on using the changeset viewer.