Changeset 171 for trunk/src/os2ahci/ahci.c
- Timestamp:
- Sep 7, 2013, 5:52:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r169 r171 4 4 * Copyright (c) 2011 thi.guten Software Development 5 5 * Copyright (c) 2011 Mensys B.V. 6 * Portions copyright (c) 2013 David Azarewicz6 * Copyright (c) 2013 David Azarewicz 7 7 * 8 8 * Authors: Christian Mueller, Markus Thielen … … 234 234 } 235 235 236 #if 0237 /* init_reset is set by default. This code is commented out to allow238 * unsetting init_reset by a command line switch239 */240 236 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) { 242 238 /* Adapter is not in AHCI mode and the spec says a COMRESET is 243 239 * required when switching from SATA to AHCI mode and vice versa. … … 245 241 init_reset = 1; 246 242 } 247 #endif248 243 249 244 #ifdef DEBUG … … 295 290 } 296 291 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) { 299 294 dprintf("JMB361 has only one port, port_map 0x%lx -> 0x%lx\n", ai->port_map, 1); 300 295 ai->port_map = 1; … … 353 348 354 349 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) { 356 351 357 352 /* This BIOS apparently accesses the controller via SATA registers and … … 455 450 ahci_restore_initial_config(ai); 456 451 457 if (ai->pci ->vendor == PCI_VENDOR_ID_INTEL) {452 if (ai->pci_vendor == PCI_VENDOR_ID_INTEL) { 458 453 u32 tmp16 = 0; 459 454 … … 1243 1238 } 1244 1239 1240 /* 0x89 = BSY(0x80) | DRQ(0x08) | ERR(0x01) */ 1245 1241 if (rc) { 1246 1242 dprintf(" timeout for IORB %Fp", iorb); 1247 1243 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) { 1250 1245 dprintf(" polled cmd error for IORB %Fp", iorb); 1251 1246 iorb_seterr(iorb, IOERR_DEVICE_NONSPECIFIC); … … 1313 1308 while (readl(port_mmio + PORT_CMD_ISSUE) & 1) { 1314 1309 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 1319 1316 if ((tmp = readl(port_mmio + PORT_SCR_ERR)) != 0) { 1320 1317 dprintf(" SERR = 0x%08lx", tmp); 1321 1318 rc = 1; 1322 1319 } 1320 /* 0x89 = BSY(0x80) | DRQ(0x08) | ERR(0x01) */ 1323 1321 if (((tmp = readl(port_mmio + PORT_TFDATA)) & 0x89) != 0) { 1324 1322 dprintf(" TFDATA = 0x%08lx", tmp); … … 1819 1817 1820 1818 /* 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 && 1822 1820 !memcmp(ata_dev_name(id_buf), "VBOX HARDDISK", 13)) { 1823 1821 /* running inside virtualbox */
Note:
See TracChangeset
for help on using the changeset viewer.