Changeset 35 for trunk


Ignore:
Timestamp:
Nov 4, 2010, 4:23:33 PM (15 years ago)
Author:
markus
Message:

working on interrupts, bug not found so far

Location:
trunk/src/os2ahci
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ahci.c

    r34 r35  
    368368
    369369  if (ctl & HOST_AHCI_EN) {
    370     /* AHCI mode already enbled */
     370    /* AHCI mode already enabled */
    371371    return(0);
    372372  }
     
    441441      /* start/reset port; if no device is attached, this is expected to fail */
    442442      if (init_reset) {
    443         ddprintf("resetting port #%d\n", p);
     443        ddprintf("init-resetting port #%d\n", p);
    444444        rc = ahci_reset_port(ai, p, 0);
    445445      } else {
     
    459459                                AP_VADDR, (void _far *) id_buf, 512,
    460460                                AP_END);
    461 
    462461      if (rc != 0 || id_buf[ATA_ID_CONFIG] & (1U << 15)) {
    463462        /* this might be an ATAPI device; run IDENTIFY_PACKET_DEVICE */
     
    471470        ddphex(id_buf, 512, "ATA_IDENTIFY(_PACKET) results:\n");
    472471        ahci_setup_device(ai, p, 0, id_buf);
     472
    473473      } else {
    474474        /* no device attached to this port */
     
    546546  }
    547547
     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
    548552  /* enable adapter-level interrupts */
    549553  writel(ai->mmio + HOST_CTL, HOST_IRQ_EN);
     
    586590  /* clear pending port IRQs */
    587591  tmp = readl(port_mmio + PORT_IRQ_STAT);
     592  ddprintf("PORT_IRQ_STAT was 0x%lx\n", tmp);
    588593  if (tmp) {
    589594    writel(port_mmio + PORT_IRQ_STAT, tmp);
     
    10241029
    10251030/******************************************************************************
     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 */
     1036int 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/******************************************************************************
    10261044 * Execute polled ATA/ATAPI command. This function will block until the command
    10271045 * has completed or the timeout has expired, thus it should only be used during
     
    10811099 *
    10821100 * 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 IRQ
     1101 * shared IRQs but we won't be preempted by another interrupt on the same
    10841102 * IRQ level until we indicated EOI. We'll keep it this way, only requesting
    10851103 * the driver-level spinlock when actually changing the driver state (IORB
     
    14201438  } else {
    14211439    /* 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 {
    14231444      ai->ports[p].devs[d].ncq_max = id_buf[ATA_ID_QUEUE_DEPTH] & 0x001fU;
    14241445    }
     1446
    14251447    if (id_buf[ATA_ID_CFS_ENABLE_2] & 0x0400U) {
    14261448      ai->ports[p].devs[d].lba48   = 1;
  • trunk/src/os2ahci/os2ahci.c

    r34 r35  
    190190      case 'r':
    191191        /* reset ports during initialization */
    192         init_reset = 1;
     192        init_reset = 1;
    193193        break;
    194194
  • trunk/src/os2ahci/os2ahci.def

    r34 r35  
    11library os2ahci
    2 Description '$@#thi.guten (www.thiguten.de):1.00.20101021#@OS/2 AHCI Adapter Device Driver'
     2Description '$@#thi.guten (www.thiguten.de):1.00.20101104#@OS/2 AHCI Adapter Device Driver'
    33protmode
    44
  • trunk/src/os2ahci/os2ahci.h

    r33 r35  
    406406extern int     ahci_exec_polled_cmd         (AD_INFO *ai, int p, int d,
    407407                                             int timeout, int cmd, ...);
     408extern int     ahci_set_dev_idle            (AD_INFO *ai, int p, int idle);
    408409
    409410extern int     ahci_intr                    (u16 irq);
Note: See TracChangeset for help on using the changeset viewer.