Ignore:
Timestamp:
Sep 7, 2013, 5:52:45 PM (12 years ago)
Author:
David Azarewicz
Message:

Enhanced debug output
Fixed a long time PCI ID bug.

File:
1 edited

Legend:

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

    r169 r171  
    44 * Copyright (c) 2011 thi.guten Software Development
    55 * Copyright (c) 2011 Mensys B.V.
    6  * Portions copyright (c) 2013 David Azarewicz
     6 * Copyright (c) 2013 David Azarewicz
    77 *
    88 * Authors: Christian Mueller, Markus Thielen
     
    234234  }
    235235
    236 #if 0
    237   /* init_reset is set by default. This code is commented out to allow
    238    * unsetting init_reset by a command line switch
    239    */
    240236  if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 &&
    241       ai->pci->vendor == PCI_VENDOR_ID_INTEL) {
     237      ai->pci_vendor == PCI_VENDOR_ID_INTEL) {
    242238    /* Adapter is not in AHCI mode and the spec says a COMRESET is
    243239     * required when switching from SATA to AHCI mode and vice versa.
     
    245241    init_reset = 1;
    246242  }
    247 #endif
    248243
    249244  #ifdef DEBUG
     
    295290  }
    296291
    297   if (ai->pci->vendor == PCI_VENDOR_ID_JMICRON &&
    298       ai->pci->device == 0x2361 && ai->port_map != 1) {
     292  if (ai->pci_vendor == PCI_VENDOR_ID_JMICRON &&
     293      ai->pci_device == 0x2361 && ai->port_map != 1) {
    299294    dprintf("JMB361 has only one port, port_map 0x%lx -> 0x%lx\n", ai->port_map, 1);
    300295    ai->port_map = 1;
     
    353348
    354349  if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 &&
    355       ai->pci->vendor == PCI_VENDOR_ID_INTEL) {
     350      ai->pci_vendor == PCI_VENDOR_ID_INTEL) {
    356351
    357352    /* This BIOS apparently accesses the controller via SATA registers and
     
    455450    ahci_restore_initial_config(ai);
    456451
    457     if (ai->pci->vendor == PCI_VENDOR_ID_INTEL) {
     452    if (ai->pci_vendor == PCI_VENDOR_ID_INTEL) {
    458453      u32 tmp16 = 0;
    459454
     
    12431238    }
    12441239
     1240    /* 0x89 = BSY(0x80) | DRQ(0x08) | ERR(0x01) */
    12451241    if (rc) {
    12461242      dprintf(" timeout for IORB %Fp", iorb);
    12471243      iorb_seterr(iorb, IOERR_ADAPTER_TIMEOUT);
    1248     } else if (readl(port_mmio + PORT_SCR_ERR) != 0 ||
    1249                readl(port_mmio + PORT_TFDATA) & 0x89) {
     1244    } else if (readl(port_mmio + PORT_SCR_ERR) != 0 || readl(port_mmio + PORT_TFDATA) & 0x89) {
    12501245      dprintf(" polled cmd error for IORB %Fp", iorb);
    12511246      iorb_seterr(iorb, IOERR_DEVICE_NONSPECIFIC);
     
    13131308  while (readl(port_mmio + PORT_CMD_ISSUE) & 1) {
    13141309    rc = timer_check_and_block(&Timer);
    1315     if (rc) break;
    1316   }
    1317 
    1318   /* check error condition */
     1310    if (rc) {
     1311      dprintf(" Timeout", tmp);
     1312      break;
     1313    }
     1314  }
     1315
    13191316  if ((tmp = readl(port_mmio + PORT_SCR_ERR)) != 0) {
    13201317    dprintf(" SERR = 0x%08lx", tmp);
    13211318    rc = 1;
    13221319  }
     1320  /* 0x89 = BSY(0x80) | DRQ(0x08) | ERR(0x01) */
    13231321  if (((tmp = readl(port_mmio + PORT_TFDATA)) & 0x89) != 0) {
    13241322    dprintf(" TFDATA = 0x%08lx", tmp);
     
    18191817
    18201818  /* try to detect virtualbox environment to enable a hack for IRQ routing */
    1821   if (ai == ad_infos && ai->pci->vendor == 0x8086 && ai->pci->device == 0x2829 &&
     1819  if (ai == ad_infos && ai->pci_vendor == 0x8086 && ai->pci_device == 0x2829 &&
    18221820      !memcmp(ata_dev_name(id_buf), "VBOX HARDDISK", 13)) {
    18231821    /* running inside virtualbox */
Note: See TracChangeset for help on using the changeset viewer.