Ignore:
Timestamp:
Feb 18, 2011, 10:09:10 PM (14 years ago)
Author:
chris
Message:
  • APM support
  • Generic IOCTL interface for adapter passthrough commands (ATA and ATAPI)
  • Fixes to ATAPI sense data handling
  • Cosmetic changes to debug reporting
  • Fixed missing interrupt enable flag for PIO transfer completions
  • Added command line switch /I to ignore specific adapters
File:
1 edited

Legend:

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

    r75 r76  
    591591
    592592  dprintf("resetting port %d.%d\n", ad_no(ai), p);
     593  ddprintf(" PORT_CMD_ISSUE = 0x%lx\n", readl(port_mmio + PORT_CMD_ISSUE));
     594  ddprintf(" PORT_SCR_ACT   = 0x%lx\n", readl(port_mmio + PORT_SCR_ACT));
     595  ddprintf(" PORT_SCR_ERR   = 0x%lx\n", readl(port_mmio + PORT_SCR_ERR));
     596  ddprintf(" PORT_TFDATA    = 0x%lx\n", readl(port_mmio + PORT_TFDATA));
     597  ddprintf(" PORT_IRQ_STAT  = 0x%lx\n", readl(port_mmio + PORT_IRQ_STAT));
     598  ddprintf(" PORT_IRQ_MASK  = 0x%lx\n", readl(port_mmio + PORT_IRQ_MASK));
     599  ddprintf(" HOST_IRQ_STAT  = 0x%lx\n", readl(ai->mmio + HOST_IRQ_STAT));
    593600
    594601  /* stop port engines (we don't care whether there is an error doing so) */
     
    597604  /* clear SError */
    598605  tmp = readl(port_mmio + PORT_SCR_ERR);
    599   ddprintf(" PORT_SCR_ERR  = 0x%lx\n", tmp);
    600606  writel(port_mmio + PORT_SCR_ERR, tmp);
    601607
    602608  /* clear pending port IRQs */
    603609  tmp = readl(port_mmio + PORT_IRQ_STAT);
    604   ddprintf("PORT_IRQ_STAT was 0x%lx\n", tmp);
    605610  if (tmp) {
    606611    writel(port_mmio + PORT_IRQ_STAT, tmp);
    607612  }
    608   ddprintf(" PORT_IRQ_STAT = 0x%lx\n", tmp);
    609   ddprintf(" PORT_IRQ_MASK = 0x%lx\n", readl(port_mmio + PORT_IRQ_MASK));
    610   ddprintf(" HOST_IRQ_STAT = 0x%lx\n", readl(ai->mmio + HOST_IRQ_STAT));
    611613  writel(ai->mmio + HOST_IRQ_STAT, 1UL << p);
    612614
     
    701703                                      PORT_IRQ_UNK_FIS |
    702704                                      PORT_IRQ_SDB_FIS |
     705                                      PORT_IRQ_DMAS_FIS |
     706                                      PORT_IRQ_PIOS_FIS |
    703707                                      PORT_IRQ_D2H_REG_FIS);
    704708  } else {
     
    759763
    760764  /* disable port interrupts */
    761   writel(port_mmio + PORT_IRQ_MASK, PORT_IRQ_TF_ERR);
     765  writel(port_mmio + PORT_IRQ_MASK, 0);
    762766
    763767  /* disable FIS reception */
     
    839843
    840844  return((timeout <= 0) ? -1 : 0);
     845}
     846
     847/******************************************************************************
     848 * Determine whether a port is busy executing commands.
     849 */
     850ahci_port_busy(AD_INFO *ai, int p)
     851{
     852  u8 _far *port_mmio = port_base(ai, p);
     853
     854  return(readl(port_mmio + PORT_SCR_ACT) != 0 ||
     855         readl(port_mmio + PORT_CMD_ISSUE) != 0);
    841856}
    842857
     
    931946        ADD_StartTimerMS(&aws->timer, timeout, (PFN) timeout_callback, iorb, 0);
    932947
    933         /* update IORB */
     948        /* issue command to hardware */
     949        *cmds |= (1UL << port->cmd_slot);
    934950        aws->queued_hw = 1;
    935951        aws->cmd_slot = port->cmd_slot;
    936952
    937         /* issue command to hardware */
    938953        ddprintf("issuing command on slot %d\n", port->cmd_slot);
    939         *cmds |= (1UL << port->cmd_slot);
    940954        if (aws->is_ncq) {
    941955          writel(port_mmio + PORT_SCR_ACT, (1UL << port->cmd_slot));
     
    14231437
    14241438/******************************************************************************
    1425  * Execute ATA command.
     1439 * Execute ATA command. Please note that this is allowed for both ATA and
     1440 * ATAPI devices because ATAPI devices will process some ATA commands as well.
    14261441 */
    14271442void ahci_execute_ata(IORBH _far *iorb)
     
    14331448  dphex(((IORB_ADAPTER_PASSTHRU _far *) iorb)->pControllerCmd,
    14341449        ((IORB_ADAPTER_PASSTHRU _far *) iorb)->ControllerCmdLen,
    1435         "ahci_execute_cdb(%d.%d.%d): ", a, p, d);
    1436 
    1437   if (ad_infos[a].ports[p].devs[d].atapi) {
    1438     iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
    1439     iorb_done(iorb);
    1440   } else {
    1441     ahci_exec_iorb(iorb, 0, ata_execute_ata);
    1442   }
     1450        "ahci_execute_ata(%d.%d.%d): ", a, p, d);
     1451
     1452  ahci_exec_iorb(iorb, 0, ata_execute_ata);
    14431453}
    14441454
Note: See TracChangeset for help on using the changeset viewer.