aic7xxx_pci.c (70693) | aic7xxx_pci.c (71390) |
---|---|
1/* 2 * Product specific probe and attach routines for: 3 * 3940, 2940, aic7895, aic7890, aic7880, 4 * aic7870, aic7860 and aic7850 SCSI controllers 5 * 6 * Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 Justin T. Gibbs 7 * All rights reserved. 8 * --- 16 unchanged lines hidden (view full) --- 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/* 2 * Product specific probe and attach routines for: 3 * 3940, 2940, aic7895, aic7890, aic7880, 4 * aic7870, aic7860 and aic7850 SCSI controllers 5 * 6 * Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 Justin T. Gibbs 7 * All rights reserved. 8 * --- 16 unchanged lines hidden (view full) --- 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $Id: //depot/src/aic7xxx/aic7xxx_pci.c#10 $ | 33 * $Id: //depot/src/aic7xxx/aic7xxx_pci.c#12 $ |
34 * | 34 * |
35 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx_pci.c 70693 2001-01-05 19:15:37Z gibbs $ | 35 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx_pci.c 71390 2001-01-22 21:03:48Z gibbs $ |
36 */ 37 38#ifdef __linux__ 39#include "aic7xxx_linux.h" 40#include "aic7xxx_inline.h" 41#include "aic7xxx_93cx6.h" 42#endif 43 --- 135 unchanged lines hidden (view full) --- 179 */ 180#define SUBID_9005_CARD_SCSIWIDTH_MASK 0x2000 181#define SUBID_9005_CARD_PCIWIDTH_MASK 0x4000 182#define SUBID_9005_CARD_SEDIFF_MASK 0x8000 183 184static ahc_device_setup_t ahc_aic7850_setup; 185static ahc_device_setup_t ahc_aic7855_setup; 186static ahc_device_setup_t ahc_aic7860_setup; | 36 */ 37 38#ifdef __linux__ 39#include "aic7xxx_linux.h" 40#include "aic7xxx_inline.h" 41#include "aic7xxx_93cx6.h" 42#endif 43 --- 135 unchanged lines hidden (view full) --- 179 */ 180#define SUBID_9005_CARD_SCSIWIDTH_MASK 0x2000 181#define SUBID_9005_CARD_PCIWIDTH_MASK 0x4000 182#define SUBID_9005_CARD_SEDIFF_MASK 0x8000 183 184static ahc_device_setup_t ahc_aic7850_setup; 185static ahc_device_setup_t ahc_aic7855_setup; 186static ahc_device_setup_t ahc_aic7860_setup; |
187static ahc_device_setup_t ahc_apa1480_setup; |
|
187static ahc_device_setup_t ahc_aic7870_setup; 188static ahc_device_setup_t ahc_aha394X_setup; 189static ahc_device_setup_t ahc_aha494X_setup; 190static ahc_device_setup_t ahc_aha398X_setup; 191static ahc_device_setup_t ahc_aic7880_setup; | 188static ahc_device_setup_t ahc_aic7870_setup; 189static ahc_device_setup_t ahc_aha394X_setup; 190static ahc_device_setup_t ahc_aha494X_setup; 191static ahc_device_setup_t ahc_aha398X_setup; 192static ahc_device_setup_t ahc_aic7880_setup; |
192static ahc_device_setup_t ahc_2940Pro_setup; | 193static ahc_device_setup_t ahc_aha2940Pro_setup; |
193static ahc_device_setup_t ahc_aha394XU_setup; 194static ahc_device_setup_t ahc_aha398XU_setup; 195static ahc_device_setup_t ahc_aic7890_setup; 196static ahc_device_setup_t ahc_aic7892_setup; 197static ahc_device_setup_t ahc_aic7895_setup; 198static ahc_device_setup_t ahc_aic7896_setup; 199static ahc_device_setup_t ahc_aic7899_setup; | 194static ahc_device_setup_t ahc_aha394XU_setup; 195static ahc_device_setup_t ahc_aha398XU_setup; 196static ahc_device_setup_t ahc_aic7890_setup; 197static ahc_device_setup_t ahc_aic7892_setup; 198static ahc_device_setup_t ahc_aic7895_setup; 199static ahc_device_setup_t ahc_aic7896_setup; 200static ahc_device_setup_t ahc_aic7899_setup; |
201static ahc_device_setup_t ahc_aha29160C_setup; |
|
200static ahc_device_setup_t ahc_raid_setup; 201static ahc_device_setup_t ahc_aha394XX_setup; 202static ahc_device_setup_t ahc_aha494XX_setup; 203static ahc_device_setup_t ahc_aha398XX_setup; 204 205struct ahc_pci_identity ahc_pci_ident_table [] = 206{ 207 /* aic7850 based controllers */ --- 9 unchanged lines hidden (view full) --- 217 ID_ALL_MASK, 218 "Adaptec 2930CU SCSI adapter", 219 ahc_aic7860_setup 220 }, 221 { 222 ID_AHA_1480A & ID_DEV_VENDOR_MASK, 223 ID_DEV_VENDOR_MASK, 224 "Adaptec 1480A Ultra SCSI adapter", | 202static ahc_device_setup_t ahc_raid_setup; 203static ahc_device_setup_t ahc_aha394XX_setup; 204static ahc_device_setup_t ahc_aha494XX_setup; 205static ahc_device_setup_t ahc_aha398XX_setup; 206 207struct ahc_pci_identity ahc_pci_ident_table [] = 208{ 209 /* aic7850 based controllers */ --- 9 unchanged lines hidden (view full) --- 219 ID_ALL_MASK, 220 "Adaptec 2930CU SCSI adapter", 221 ahc_aic7860_setup 222 }, 223 { 224 ID_AHA_1480A & ID_DEV_VENDOR_MASK, 225 ID_DEV_VENDOR_MASK, 226 "Adaptec 1480A Ultra SCSI adapter", |
225 ahc_aic7860_setup | 227 ahc_apa1480_setup |
226 }, 227 { 228 ID_AHA_2940AU_0 & ID_DEV_VENDOR_MASK, 229 ID_DEV_VENDOR_MASK, 230 "Adaptec 2940A Ultra SCSI adapter", 231 ahc_aic7860_setup 232 }, 233 { --- 91 unchanged lines hidden (view full) --- 325 ID_DEV_VENDOR_MASK, 326 "Adaptec 2930 Ultra SCSI adapter", 327 ahc_aic7880_setup 328 }, 329 { 330 ID_AHA_2940U_PRO & ID_DEV_VENDOR_MASK, 331 ID_DEV_VENDOR_MASK, 332 "Adaptec 2940 Pro Ultra SCSI adapter", | 228 }, 229 { 230 ID_AHA_2940AU_0 & ID_DEV_VENDOR_MASK, 231 ID_DEV_VENDOR_MASK, 232 "Adaptec 2940A Ultra SCSI adapter", 233 ahc_aic7860_setup 234 }, 235 { --- 91 unchanged lines hidden (view full) --- 327 ID_DEV_VENDOR_MASK, 328 "Adaptec 2930 Ultra SCSI adapter", 329 ahc_aic7880_setup 330 }, 331 { 332 ID_AHA_2940U_PRO & ID_DEV_VENDOR_MASK, 333 ID_DEV_VENDOR_MASK, 334 "Adaptec 2940 Pro Ultra SCSI adapter", |
333 ahc_2940Pro_setup | 335 ahc_aha2940Pro_setup |
334 }, 335 { 336 ID_AHA_2940U_CN & ID_DEV_VENDOR_MASK, 337 ID_DEV_VENDOR_MASK, 338 "Adaptec 2940/CN Ultra SCSI adapter", 339 ahc_aic7880_setup 340 }, 341 /* aic7890 based controllers */ --- 51 unchanged lines hidden (view full) --- 393 ID_ALL_MASK, 394 "Adaptec 29160N Ultra160 SCSI adapter", 395 ahc_aic7892_setup 396 }, 397 { 398 ID_AHA_29160C, 399 ID_ALL_MASK, 400 "Adaptec 29160C Ultra160 SCSI adapter", | 336 }, 337 { 338 ID_AHA_2940U_CN & ID_DEV_VENDOR_MASK, 339 ID_DEV_VENDOR_MASK, 340 "Adaptec 2940/CN Ultra SCSI adapter", 341 ahc_aic7880_setup 342 }, 343 /* aic7890 based controllers */ --- 51 unchanged lines hidden (view full) --- 395 ID_ALL_MASK, 396 "Adaptec 29160N Ultra160 SCSI adapter", 397 ahc_aic7892_setup 398 }, 399 { 400 ID_AHA_29160C, 401 ID_ALL_MASK, 402 "Adaptec 29160C Ultra160 SCSI adapter", |
401 ahc_aic7892_setup | 403 ahc_aha29160C_setup |
402 }, 403 { 404 ID_AHA_29160B, 405 ID_ALL_MASK, 406 "Adaptec 29160B Ultra160 SCSI adapter", 407 ahc_aic7892_setup 408 }, 409 { --- 902 unchanged lines hidden (view full) --- 1312 int internal50_present; 1313 int internal68_present; 1314 int externalcable_present; 1315 int eeprom_present; 1316 int enableSEC_low; 1317 int enableSEC_high; 1318 int enablePRI_low; 1319 int enablePRI_high; | 404 }, 405 { 406 ID_AHA_29160B, 407 ID_ALL_MASK, 408 "Adaptec 29160B Ultra160 SCSI adapter", 409 ahc_aic7892_setup 410 }, 411 { --- 902 unchanged lines hidden (view full) --- 1314 int internal50_present; 1315 int internal68_present; 1316 int externalcable_present; 1317 int eeprom_present; 1318 int enableSEC_low; 1319 int enableSEC_high; 1320 int enablePRI_low; 1321 int enablePRI_high; |
1322 int sum; |
|
1320 1321 enableSEC_low = 0; 1322 enableSEC_high = 0; 1323 enablePRI_low = 0; 1324 enablePRI_high = 0; 1325 if ((ahc->features & AHC_NEW_TERMCTL) != 0) { 1326 ahc_new_term_detect(ahc, &enableSEC_low, 1327 &enableSEC_high, --- 28 unchanged lines hidden (view full) --- 1356 &internal68_present, 1357 &externalcable_present, 1358 &eeprom_present); 1359 } 1360 1361 if ((ahc->features & AHC_WIDE) == 0) 1362 internal68_present = 0; 1363 | 1323 1324 enableSEC_low = 0; 1325 enableSEC_high = 0; 1326 enablePRI_low = 0; 1327 enablePRI_high = 0; 1328 if ((ahc->features & AHC_NEW_TERMCTL) != 0) { 1329 ahc_new_term_detect(ahc, &enableSEC_low, 1330 &enableSEC_high, --- 28 unchanged lines hidden (view full) --- 1359 &internal68_present, 1360 &externalcable_present, 1361 &eeprom_present); 1362 } 1363 1364 if ((ahc->features & AHC_WIDE) == 0) 1365 internal68_present = 0; 1366 |
1364 if (bootverbose) { 1365 if ((ahc->features & AHC_ULTRA2) == 0) { 1366 printf("%s: internal 50 cable %s present, " 1367 "internal 68 cable %s present\n", 1368 ahc_name(ahc), 1369 internal50_present ? "is":"not", 1370 internal68_present ? "is":"not"); | 1367 if (bootverbose 1368 && (ahc->features & AHC_ULTRA2) == 0) { 1369 printf("%s: internal 50 cable %s present", 1370 ahc_name(ahc), 1371 internal50_present ? "is":"not"); |
1371 | 1372 |
1372 printf("%s: external cable %s present\n", 1373 ahc_name(ahc), 1374 externalcable_present ? "is":"not"); 1375 } | 1373 if ((ahc->features & AHC_WIDE) != 0) 1374 printf(", internal 68 cable %s present", 1375 internal68_present ? "is":"not"); 1376 printf("\n%s: external cable %s present\n", 1377 ahc_name(ahc), 1378 externalcable_present ? "is":"not"); 1379 } 1380 if (bootverbose) |
1376 printf("%s: BIOS eeprom %s present\n", 1377 ahc_name(ahc), eeprom_present ? "is" : "not"); | 1381 printf("%s: BIOS eeprom %s present\n", 1382 ahc_name(ahc), eeprom_present ? "is" : "not"); |
1378 } | |
1379 1380 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) { 1381 /* 1382 * The 50 pin connector is a separate bus, 1383 * so force it to always be terminated. 1384 * In the future, perform current sensing 1385 * to determine if we are in the middle of 1386 * a properly terminated bus. --- 5 unchanged lines hidden (view full) --- 1392 * Now set the termination based on what 1393 * we found. 1394 * Flash Enable = BRDDAT7 1395 * Secondary High Term Enable = BRDDAT6 1396 * Secondary Low Term Enable = BRDDAT5 (7890) 1397 * Primary High Term Enable = BRDDAT4 (7890) 1398 */ 1399 if ((ahc->features & AHC_ULTRA2) == 0 | 1383 1384 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) { 1385 /* 1386 * The 50 pin connector is a separate bus, 1387 * so force it to always be terminated. 1388 * In the future, perform current sensing 1389 * to determine if we are in the middle of 1390 * a properly terminated bus. --- 5 unchanged lines hidden (view full) --- 1396 * Now set the termination based on what 1397 * we found. 1398 * Flash Enable = BRDDAT7 1399 * Secondary High Term Enable = BRDDAT6 1400 * Secondary Low Term Enable = BRDDAT5 (7890) 1401 * Primary High Term Enable = BRDDAT4 (7890) 1402 */ 1403 if ((ahc->features & AHC_ULTRA2) == 0 |
1400 && (internal50_present != 0) 1401 && (internal68_present != 0) 1402 && (externalcable_present != 0)) { | 1404 && (internal50_present != 0) 1405 && (internal68_present != 0) 1406 && (externalcable_present != 0)) { |
1403 printf("%s: Illegal cable configuration!!. " 1404 "Only two connectors on the " 1405 "adapter may be used at a " 1406 "time!\n", ahc_name(ahc)); 1407 } 1408 1409 if ((ahc->features & AHC_WIDE) != 0 1410 && ((externalcable_present == 0) --- 7 unchanged lines hidden (view full) --- 1418 else 1419 printf("%s: %sHigh byte termination " 1420 "Enabled\n", ahc_name(ahc), 1421 enableSEC_high ? "Secondary " 1422 : ""); 1423 } 1424 } 1425 | 1407 printf("%s: Illegal cable configuration!!. " 1408 "Only two connectors on the " 1409 "adapter may be used at a " 1410 "time!\n", ahc_name(ahc)); 1411 } 1412 1413 if ((ahc->features & AHC_WIDE) != 0 1414 && ((externalcable_present == 0) --- 7 unchanged lines hidden (view full) --- 1422 else 1423 printf("%s: %sHigh byte termination " 1424 "Enabled\n", ahc_name(ahc), 1425 enableSEC_high ? "Secondary " 1426 : ""); 1427 } 1428 } 1429 |
1426 if (((internal50_present ? 1 : 0) 1427 + (internal68_present ? 1 : 0) 1428 + (externalcable_present ? 1 : 0)) <= 1 1429 || (enableSEC_low != 0)) { | 1430 sum = internal50_present + internal68_present 1431 + externalcable_present; 1432 if (sum < 2 || (enableSEC_low != 0)) { |
1430 if ((ahc->features & AHC_ULTRA2) != 0) 1431 brddat |= BRDDAT5; 1432 else 1433 *sxfrctl1 |= STPWEN; 1434 if (bootverbose) { 1435 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) 1436 printf("%s: 50 pin termination " 1437 "Enabled\n", ahc_name(ahc)); --- 34 unchanged lines hidden (view full) --- 1472 1473 if (bootverbose) 1474 printf("%s: %sLow byte termination Enabled\n", 1475 ahc_name(ahc), 1476 (ahc->features & AHC_ULTRA2) ? "Primary " 1477 : ""); 1478 } 1479 | 1433 if ((ahc->features & AHC_ULTRA2) != 0) 1434 brddat |= BRDDAT5; 1435 else 1436 *sxfrctl1 |= STPWEN; 1437 if (bootverbose) { 1438 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) 1439 printf("%s: 50 pin termination " 1440 "Enabled\n", ahc_name(ahc)); --- 34 unchanged lines hidden (view full) --- 1475 1476 if (bootverbose) 1477 printf("%s: %sLow byte termination Enabled\n", 1478 ahc_name(ahc), 1479 (ahc->features & AHC_ULTRA2) ? "Primary " 1480 : ""); 1481 } 1482 |
1480 if ((adapter_control & CFWSTERM) != 0) { | 1483 if ((adapter_control & CFWSTERM) != 0 1484 && (ahc->features & AHC_WIDE) != 0) { |
1481 brddat |= BRDDAT6; 1482 if (bootverbose) 1483 printf("%s: %sHigh byte termination Enabled\n", 1484 ahc_name(ahc), 1485 (ahc->features & AHC_ULTRA2) 1486 ? "Secondary " : ""); 1487 } 1488 1489 /* 1490 * Setup STPWEN before setting up the rest of 1491 * the termination per the tech note on the U160 cards. 1492 */ 1493 ahc_outb(ahc, SXFRCTL1, *sxfrctl1); 1494 | 1485 brddat |= BRDDAT6; 1486 if (bootverbose) 1487 printf("%s: %sHigh byte termination Enabled\n", 1488 ahc_name(ahc), 1489 (ahc->features & AHC_ULTRA2) 1490 ? "Secondary " : ""); 1491 } 1492 1493 /* 1494 * Setup STPWEN before setting up the rest of 1495 * the termination per the tech note on the U160 cards. 1496 */ 1497 ahc_outb(ahc, SXFRCTL1, *sxfrctl1); 1498 |
1495 write_brdctl(ahc, brddat); | 1499 if ((ahc->features & AHC_WIDE) != 0) 1500 write_brdctl(ahc, brddat); |
1496 } 1497 SEEPROM_OUTB(sd, sd->sd_MS); /* Clear CS */ 1498} 1499 1500static void 1501ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low, 1502 int *enableSEC_high, int *enablePRI_low, 1503 int *enablePRI_high, int *eeprom_present) --- 32 unchanged lines hidden (view full) --- 1536 write_brdctl(ahc, 0); 1537 1538 /* 1539 * Now read the state of the internal 1540 * connectors. BRDDAT6 is INT50 and 1541 * BRDDAT7 is INT68. 1542 */ 1543 brdctl = read_brdctl(ahc); | 1501 } 1502 SEEPROM_OUTB(sd, sd->sd_MS); /* Clear CS */ 1503} 1504 1505static void 1506ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low, 1507 int *enableSEC_high, int *enablePRI_low, 1508 int *enablePRI_high, int *eeprom_present) --- 32 unchanged lines hidden (view full) --- 1541 write_brdctl(ahc, 0); 1542 1543 /* 1544 * Now read the state of the internal 1545 * connectors. BRDDAT6 is INT50 and 1546 * BRDDAT7 is INT68. 1547 */ 1548 brdctl = read_brdctl(ahc); |
1544 *internal50_present = !(brdctl & BRDDAT6); 1545 *internal68_present = !(brdctl & BRDDAT7); | 1549 *internal50_present = (brdctl & BRDDAT6) ? 0 : 1; 1550 *internal68_present = (brdctl & BRDDAT7) ? 0 : 1; |
1546 1547 /* 1548 * Set the rom bank to 1 and determine 1549 * the other signals. 1550 */ 1551 write_brdctl(ahc, BRDDAT5); 1552 1553 /* 1554 * Now read the state of the external 1555 * connectors. BRDDAT6 is EXT68 and 1556 * BRDDAT7 is EPROMPS. 1557 */ 1558 brdctl = read_brdctl(ahc); | 1551 1552 /* 1553 * Set the rom bank to 1 and determine 1554 * the other signals. 1555 */ 1556 write_brdctl(ahc, BRDDAT5); 1557 1558 /* 1559 * Now read the state of the external 1560 * connectors. BRDDAT6 is EXT68 and 1561 * BRDDAT7 is EPROMPS. 1562 */ 1563 brdctl = read_brdctl(ahc); |
1559 *externalcable_present = !(brdctl & BRDDAT6); 1560 *eeprom_present = brdctl & BRDDAT7; | 1564 *externalcable_present = (brdctl & BRDDAT6) ? 0 : 1; 1565 *eeprom_present = (brdctl & BRDDAT7) ? 1 : 0; |
1561} 1562 1563static void 1564aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present, 1565 int *externalcable_present, int *eeprom_present) 1566{ 1567 uint8_t brdctl; 1568 1569 ahc_outb(ahc, BRDCTL, BRDRW|BRDCS); 1570 ahc_outb(ahc, BRDCTL, 0); 1571 brdctl = ahc_inb(ahc, BRDCTL); | 1566} 1567 1568static void 1569aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present, 1570 int *externalcable_present, int *eeprom_present) 1571{ 1572 uint8_t brdctl; 1573 1574 ahc_outb(ahc, BRDCTL, BRDRW|BRDCS); 1575 ahc_outb(ahc, BRDCTL, 0); 1576 brdctl = ahc_inb(ahc, BRDCTL); |
1572 *internal50_present = !(brdctl & BRDDAT5); 1573 *externalcable_present = !(brdctl & BRDDAT6); | 1577 *internal50_present = (brdctl & BRDDAT5) ? 0 : 1; 1578 *externalcable_present = (brdctl & BRDDAT6) ? 0 : 1; |
1574 | 1579 |
1575 *eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) != 0; | 1580 *eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) ? 1 : 0; |
1576} 1577 1578static int 1579acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd) 1580{ 1581 int wait; 1582 1583 if ((ahc->features & AHC_SPIOCAP) != 0 --- 36 unchanged lines hidden (view full) --- 1620 if (ahc->channel == 'B') 1621 brdctl |= BRDCS; 1622 } else if ((ahc->features & AHC_ULTRA2) != 0) { 1623 brdctl = 0; 1624 } else { 1625 brdctl = BRDSTB|BRDCS; 1626 } 1627 ahc_outb(ahc, BRDCTL, brdctl); | 1581} 1582 1583static int 1584acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd) 1585{ 1586 int wait; 1587 1588 if ((ahc->features & AHC_SPIOCAP) != 0 --- 36 unchanged lines hidden (view full) --- 1625 if (ahc->channel == 'B') 1626 brdctl |= BRDCS; 1627 } else if ((ahc->features & AHC_ULTRA2) != 0) { 1628 brdctl = 0; 1629 } else { 1630 brdctl = BRDSTB|BRDCS; 1631 } 1632 ahc_outb(ahc, BRDCTL, brdctl); |
1628 ahc_delay(20); | 1633 ahc_flush_device_writes(ahc); |
1629 brdctl |= value; 1630 ahc_outb(ahc, BRDCTL, brdctl); | 1634 brdctl |= value; 1635 ahc_outb(ahc, BRDCTL, brdctl); |
1631 ahc_delay(20); | 1636 ahc_flush_device_writes(ahc); |
1632 if ((ahc->features & AHC_ULTRA2) != 0) 1633 brdctl |= BRDSTB_ULTRA2; 1634 else 1635 brdctl &= ~BRDSTB; 1636 ahc_outb(ahc, BRDCTL, brdctl); | 1637 if ((ahc->features & AHC_ULTRA2) != 0) 1638 brdctl |= BRDSTB_ULTRA2; 1639 else 1640 brdctl &= ~BRDSTB; 1641 ahc_outb(ahc, BRDCTL, brdctl); |
1637 ahc_delay(20); | 1642 ahc_flush_device_writes(ahc); |
1638 if ((ahc->features & AHC_ULTRA2) != 0) 1639 brdctl = 0; 1640 else 1641 brdctl &= ~BRDCS; 1642 ahc_outb(ahc, BRDCTL, brdctl); 1643} 1644 1645static uint8_t --- 8 unchanged lines hidden (view full) --- 1654 if (ahc->channel == 'B') 1655 brdctl |= BRDCS; 1656 } else if ((ahc->features & AHC_ULTRA2) != 0) { 1657 brdctl = BRDRW_ULTRA2; 1658 } else { 1659 brdctl = BRDRW|BRDCS; 1660 } 1661 ahc_outb(ahc, BRDCTL, brdctl); | 1643 if ((ahc->features & AHC_ULTRA2) != 0) 1644 brdctl = 0; 1645 else 1646 brdctl &= ~BRDCS; 1647 ahc_outb(ahc, BRDCTL, brdctl); 1648} 1649 1650static uint8_t --- 8 unchanged lines hidden (view full) --- 1659 if (ahc->channel == 'B') 1660 brdctl |= BRDCS; 1661 } else if ((ahc->features & AHC_ULTRA2) != 0) { 1662 brdctl = BRDRW_ULTRA2; 1663 } else { 1664 brdctl = BRDRW|BRDCS; 1665 } 1666 ahc_outb(ahc, BRDCTL, brdctl); |
1662 ahc_delay(20); | 1667 ahc_flush_device_writes(ahc); |
1663 value = ahc_inb(ahc, BRDCTL); 1664 ahc_outb(ahc, BRDCTL, 0); 1665 return (value); 1666} 1667 1668#define DPE 0x80 1669#define SSE 0x40 1670#define RMA 0x20 --- 86 unchanged lines hidden (view full) --- 1757 | AHC_PCI_MWI_BUG; 1758 rev = ahc_pci_read_config(pci, PCIR_REVID, /*bytes*/1); 1759 if (rev >= 1) 1760 probe_config->bugs |= AHC_PCI_2_1_RETRY_BUG; 1761 return (0); 1762} 1763 1764static int | 1668 value = ahc_inb(ahc, BRDCTL); 1669 ahc_outb(ahc, BRDCTL, 0); 1670 return (value); 1671} 1672 1673#define DPE 0x80 1674#define SSE 0x40 1675#define RMA 0x20 --- 86 unchanged lines hidden (view full) --- 1762 | AHC_PCI_MWI_BUG; 1763 rev = ahc_pci_read_config(pci, PCIR_REVID, /*bytes*/1); 1764 if (rev >= 1) 1765 probe_config->bugs |= AHC_PCI_2_1_RETRY_BUG; 1766 return (0); 1767} 1768 1769static int |
1770ahc_apa1480_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) 1771{ 1772 int error; 1773 1774 error = ahc_aic7860_setup(pci, probe_config); 1775 if (error != 0) 1776 return (error); 1777 probe_config->features |= AHC_REMOVABLE; 1778 return (0); 1779} 1780 1781static int |
|
1765ahc_aic7870_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) 1766{ 1767 probe_config->channel = 'A'; 1768 probe_config->chip = AHC_AIC7870; 1769 probe_config->features = AHC_AIC7870_FE; 1770 probe_config->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG 1771 | AHC_PCI_MWI_BUG; 1772 return (0); --- 46 unchanged lines hidden (view full) --- 1819 probe_config->bugs |= AHC_PCI_2_1_RETRY_BUG; 1820 } else { 1821 probe_config->bugs |= AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG; 1822 } 1823 return (0); 1824} 1825 1826static int | 1782ahc_aic7870_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) 1783{ 1784 probe_config->channel = 'A'; 1785 probe_config->chip = AHC_AIC7870; 1786 probe_config->features = AHC_AIC7870_FE; 1787 probe_config->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG 1788 | AHC_PCI_MWI_BUG; 1789 return (0); --- 46 unchanged lines hidden (view full) --- 1836 probe_config->bugs |= AHC_PCI_2_1_RETRY_BUG; 1837 } else { 1838 probe_config->bugs |= AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG; 1839 } 1840 return (0); 1841} 1842 1843static int |
1827ahc_2940Pro_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) | 1844ahc_aha2940Pro_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) |
1828{ 1829 int error; 1830 1831 probe_config->flags |= AHC_INT50_SPEEDFLEX; 1832 error = ahc_aic7880_setup(pci, probe_config); 1833 return (0); 1834} 1835 --- 116 unchanged lines hidden (view full) --- 1952 probe_config->chip = AHC_AIC7899; 1953 probe_config->features = AHC_AIC7899_FE; 1954 probe_config->flags |= AHC_NEWEEPROM_FMT; 1955 probe_config->bugs |= AHC_SCBCHAN_UPLOAD_BUG; 1956 return (0); 1957} 1958 1959static int | 1845{ 1846 int error; 1847 1848 probe_config->flags |= AHC_INT50_SPEEDFLEX; 1849 error = ahc_aic7880_setup(pci, probe_config); 1850 return (0); 1851} 1852 --- 116 unchanged lines hidden (view full) --- 1969 probe_config->chip = AHC_AIC7899; 1970 probe_config->features = AHC_AIC7899_FE; 1971 probe_config->flags |= AHC_NEWEEPROM_FMT; 1972 probe_config->bugs |= AHC_SCBCHAN_UPLOAD_BUG; 1973 return (0); 1974} 1975 1976static int |
1977ahc_aha29160C_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) 1978{ 1979 int error; 1980 1981 error = ahc_aic7899_setup(pci, probe_config); 1982 if (error != 0) 1983 return (error); 1984 probe_config->features |= AHC_REMOVABLE; 1985 return (0); 1986} 1987 1988static int |
|
1960ahc_raid_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) 1961{ 1962 printf("RAID functionality unsupported\n"); 1963 return (ENXIO); 1964} 1965 1966static int 1967ahc_aha394XX_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) --- 66 unchanged lines hidden --- | 1989ahc_raid_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) 1990{ 1991 printf("RAID functionality unsupported\n"); 1992 return (ENXIO); 1993} 1994 1995static int 1996ahc_aha394XX_setup(ahc_dev_softc_t pci, struct ahc_probe_config *probe_config) --- 66 unchanged lines hidden --- |