Ignore:
Timestamp:
Feb 23, 2021, 10:10:11 PM (4 years ago)
Author:
David Azarewicz
Message:

Add 64/48 bit LBA support.

File:
1 edited

Legend:

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

    r205 r207  
    7979  u32 version;
    8080
    81   DPRINTF(2,"AHCI global registers for adapter %d %d:%d:%d irq=%d addr=0x%x\n",
     81  dprintf(0,"AHCI global registers for adapter %d %d:%d:%d irq=%d addr=0x%x\n",
    8282      ad_no(ai),
    8383      PCI_BUS_FROM_BDF(ai->bus_dev_func), PCI_DEV_FROM_BDF(ai->bus_dev_func),
    8484      PCI_FUNC_FROM_BDF(ai->bus_dev_func), ai->irq, ai->mmio_phys);
    8585
    86   for (i = 0; i <= HOST_CAP2; i += sizeof(u32)) {
     86  for (i = 0; i <= HOST_CAP2; i += sizeof(u32))
     87  {
    8788    u32 val;
    8889
     
    9899    dprintf(0," %02x: %08lx", i, val);
    99100
    100     if (i == HOST_CAP) {
     101    if (i == HOST_CAP)
     102    {
    101103      dprintf(0," -");
    102104      if (val & HOST_CAP_64)         dprintf(0," 64bit");
     
    119121      dprintf(0," cmd_slots:%d", ((val >> 8) & 0x1f) + 1);
    120122      dprintf(0," ports:%d",     (val & 0x1f) + 1);
    121     } else if (i == HOST_CTL) {
     123    }
     124    else if (i == HOST_CTL)
     125    {
    122126      dprintf(0," -");
    123127      if (val & HOST_AHCI_EN)        dprintf(0," ahci_enabled");
    124128      if (val & HOST_IRQ_EN)         dprintf(0," irq_enabled");
    125129      if (val & HOST_RESET)          dprintf(0," resetting");
    126     } else if (i == HOST_CAP2) {
     130    }
     131    else if (i == HOST_CAP2)
     132    {
    127133      dprintf(0," -");
    128134      if (val & HOST_CAP2_BOH)       dprintf(0," boh");
     
    278284  }
    279285
    280   DUMP_HOST_REGS(2,ai,1);
     286  DUMP_HOST_REGS(6,ai,1);
    281287
    282288  return(0);
     
    529535  int i;
    530536
    531   DPRINTF(1,__func__": completing initialization of adapter #%d\n", ad_no(ai));
     537  DPRINTF(2,__func__": completing initialization of adapter #%d\n", ad_no(ai));
    532538
    533539  if (!ai->int_set)
     
    609615  /* pci_enable_int(ai->bus, ai->dev_func); */
    610616
    611   DPRINTF(1,__func__": done\n");
     617  DPRINTF(2,__func__": done\n");
    612618  return(0);
    613619}
     
    834840    {
    835841      /* this port seems to have a device attached and ready for commands */
    836       DPRINTF(1,__func__": port %d seems to be attached to a device; probing...\n", p);
     842      DPRINTF(2,__func__": port %d seems to be attached to a device; probing...\n", p);
    837843
    838844      #ifdef DAZ_NEW_CODE
     
    909915  TIMER Timer;
    910916
    911   DPRINTF(2,__func__": resetting port %d.%d\n", ad_no(ai), p);
    912   DUMP_PORT_REGS(2,ai,p);
     917  DPRINTF(3,__func__": resetting port %d.%d\n", ad_no(ai), p);
     918  DUMP_PORT_REGS(3,ai,p);
    913919
    914920  /* stop port engines (we don't care whether there is an error doing so) */
     
    944950
    945951  /* wait for communication to be re-established after port reset */
    946   DPRINTF(2,"Wait for communication...\n");
     952  DPRINTF(3,"Wait for communication...\n");
    947953  TimerInit(&Timer, 500);
    948954  while (((tmp = readl(port_mmio + PORT_SCR_STAT)) & 3) != 3)
     
    950956    if (TimerCheckAndBlock(&Timer))
    951957    {
    952       DPRINTF(0,"no device present after resetting port #%d (PORT_SCR_STAT = 0x%x)\n", p, tmp);
     958      DPRINTF(2,"no device present after resetting port #%d (PORT_SCR_STAT = 0x%x)\n", p, tmp);
    953959      return(-1);
    954960    }
     
    960966
    961967  /* start port so we can receive the COMRESET FIS */
    962   DPRINTF(2,__func__": starting port %d again\n", p);
     968  DPRINTF(3,__func__": starting port %d again\n", p);
    963969  ahci_start_port(ai, p, ei);
    964970
     
    17941800  }
    17951801
    1796   dprintf(0,"port #%d interrupt error status: 0x%08lx; restarting port\n", p, irq_stat);
     1802  #ifdef DEBUG
     1803  dprintf(0,"port #%d interrupt error status: 0x%08x; restarting port\n", p, irq_stat);
     1804  #else
     1805  if (!ai->ports[p].devs[0].atapi || D32g_DbgLevel)
     1806  {
     1807    dprintf(0,"port #%d interrupt error status: 0x%08x; restarting port\n", p, irq_stat);
     1808  }
     1809  #endif
    17971810
    17981811  /* Handle device-specific errors. Those errors typically involve restarting
Note: See TracChangeset for help on using the changeset viewer.