Home | History | Annotate | Download | only in pci

Lines Matching defs:ahc

705 static int ahc_ext_scbram_present(struct ahc_softc *ahc);
706 static void ahc_scbram_config(struct ahc_softc *ahc, int enable,
708 static void ahc_probe_ext_scbram(struct ahc_softc *ahc);
760 struct ahc_softc *ahc = device_private(self);
785 ahc->sc_dev = self;
786 ahc_set_name(ahc, device_xname(ahc->sc_dev));
787 ahc->parent_dmat = pa->pa_dmat;
805 ahc->bd = bd;
807 ahc->description = entry->name;
809 error = entry->setup(ahc);
834 ahc_name(ahc), (u_long)memt, (u_long)memh, (u_long)iot,
851 ahc->tag = st;
852 ahc->bsh = sh;
854 ahc->chip |= AHC_PCI;
861 ahc_intr_enable(ahc, FALSE);
877 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
881 ahc_name(ahc));
900 if ((ahc->flags & AHC_DISABLE_PCI_PERR) != 0)
905 ahc->flags |= AHC_PAGESCBS;
906 error = ahc_softc_init(ahc);
910 ahc->bus_intr = ahc_pci_intr;
913 if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
914 ahc_pause(ahc);
915 if ((ahc->features & AHC_ULTRA2) != 0)
916 our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
918 our_id = ahc_inb(ahc, SCSIID) & OID;
919 sxfrctl1 = ahc_inb(ahc, SXFRCTL1) & STPWEN;
920 scsiseq = ahc_inb(ahc, SCSISEQ);
927 error = ahc_reset(ahc);
931 if ((ahc->features & AHC_DT) != 0) {
935 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
936 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
937 ahc_outb(ahc, OPTIONMODE,
939 ahc_outb(ahc, SFUNCT, sfunct);
942 ahc_outb(ahc, CRCCONTROL1, CRCVALCHKEN|CRCENDCHKEN|CRCREQCHKEN
947 aprint_error("%s: couldn't map interrupt\n", ahc_name(ahc));
948 ahc_free(ahc);
952 ahc->ih = pci_intr_establish_xname(pa->pa_pc, ih, IPL_BIO, ahc_intr,
953 ahc, device_xname(self));
954 if (ahc->ih == NULL) {
955 aprint_error_dev(ahc->sc_dev,
960 ahc_free(ahc);
964 aprint_normal("%s: interrupting at %s\n", ahc_name(ahc),
967 dscommand0 = ahc_inb(ahc, DSCOMMAND0);
969 if ((ahc->features & AHC_ULTRA2) != 0) {
982 if ((ahc->bugs & AHC_CACHETHEN_DIS_BUG) != 0)
985 if ((ahc->bugs & AHC_CACHETHEN_BUG) != 0)
988 ahc_outb(ahc, DSCOMMAND0, dscommand0);
990 ahc->pci_cachesize =
992 ahc->pci_cachesize *= 4;
994 if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0
995 && ahc->pci_cachesize == 4) {
997 ahc->pci_cachesize = 0;
1003 * Allow override for the SGI O2 though, which has two onboard ahc
1010 if (((ahc->features & AHC_ULTRA) != 0) && (!override_ultra)) {
1015 ahc->features &= ~AHC_ULTRA;
1018 ahc->seep_config = malloc(sizeof(*ahc->seep_config),
1022 ahc_check_extport(ahc, &sxfrctl1);
1027 sblkctl = ahc_inb(ahc, SBLKCTL);
1028 ahc_outb(ahc, SBLKCTL, (sblkctl & ~(DIAGLEDEN|DIAGLEDON)));
1030 if ((ahc->features & AHC_ULTRA2) != 0) {
1031 ahc_outb(ahc, DFF_THRSH, RD_DFTHRSH_MAX|WR_DFTHRSH_MAX);
1033 ahc_outb(ahc, DSPCISTATUS, DFTHRSH_100);
1036 if (ahc->flags & AHC_USEDEFAULTS) {
1043 if ((ahc->flags & AHC_NO_BIOS_INIT) == 0
1048 ahc_name(ahc));
1049 ahc->flags &= ~AHC_USEDEFAULTS;
1058 device_properties(ahc->sc_dev),
1064 ahc->flags |= AHC_USETARGETDEFAULTS;
1066 ahc->flags |= AHC_BIOS_ENABLED;
1075 ahc_outb(ahc, SCSICONF, our_id|ENSPCHK|RESET_SCSI);
1077 ahc->our_id = our_id;
1085 ahc_probe_ext_scbram(ahc);
1092 ahc->flags |= AHC_TERM_ENB_A;
1094 if (ahc_init(ahc))
1097 ahc_attach(ahc);
1102 ahc_free(ahc);
1149 ahc_ext_scbram_present(struct ahc_softc *ahc)
1156 chip = ahc->chip & AHC_CHIPID_MASK;
1157 devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
1160 if ((ahc->features & AHC_ULTRA2) != 0)
1161 ramps = (ahc_inb(ahc, DSCOMMAND0) & RAMPS) != 0;
1184 ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck,
1189 if (ahc->features & AHC_MULTI_FUNC) {
1194 ahc_outb(ahc, SCBBADDR, ahc->bd->func);
1197 ahc->flags &= ~AHC_LSCBS_ENABLED;
1199 ahc->flags |= AHC_LSCBS_ENABLED;
1200 devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
1201 if ((ahc->features & AHC_ULTRA2) != 0) {
1204 dscommand0 = ahc_inb(ahc, DSCOMMAND0);
1213 ahc_outb(ahc, DSCOMMAND0, dscommand0);
1233 pci_conf_write(ahc->bd->pc, ahc->bd->tag, DEVCONFIG, devconfig);
1242 ahc_probe_ext_scbram(struct ahc_softc *ahc)
1257 if (ahc_ext_scbram_present(ahc) == 0)
1263 ahc, /*enable*/TRUE, pcheck, fast, large);
1264 num_scbs = ahc_probe_scbs(ahc);
1276 ahc_outb(ahc, SEQCTL, 0);
1277 ahc_outb(ahc, CLRINT, CLRPARERR);
1278 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1281 ahc_scbram_config(ahc, enable, /*pcheck*/TRUE, fast, large);
1282 num_scbs = ahc_probe_scbs(ahc);
1283 if ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
1284 || (ahc_inb(ahc, ERROR) & MPARERR) == 0)
1288 ahc_outb(ahc, CLRINT, CLRPARERR);
1289 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1292 ahc_scbram_config(ahc, enable, pcheck, /*fast*/TRUE, large);
1293 test_num_scbs = ahc_probe_scbs(ahc);
1295 && ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
1296 || (ahc_inb(ahc, ERROR) & MPARERR) == 0))
1303 if ((ahc->features & AHC_LARGE_SCBS) != 0) {
1304 ahc_scbram_config(ahc, enable, pcheck, fast, /*large*/TRUE);
1305 test_num_scbs = ahc_probe_scbs(ahc);
1316 ahc->flags |= AHC_SCB_BTT;
1325 ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
1327 ahc_outb(ahc, CLRINT, CLRPARERR);
1328 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1331 ahc_name(ahc), fast ? "fast" : "slow",
1335 ahc_scbram_config(ahc, enable, pcheck, fast, large);
1344 ahc_pci_test_register_access(struct ahc_softc *ahc)
1357 cmd = pci_conf_read(ahc->bd->pc, ahc->bd->tag, PCIR_COMMAND);
1358 pci_conf_write(ahc->bd->pc, ahc->bd->tag, PCIR_COMMAND,
1369 hcntrl = ahc_inb(ahc, HCNTRL);
1380 ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
1381 while (ahc_is_paused(ahc) == 0)
1383 ahc_outb(ahc, SEQCTL, PERRORDIS);
1384 ahc_outb(ahc, SCBPTR, 0);
1385 ahc_outl(ahc, SCB_BASE, 0x5aa555aa);
1386 if (ahc_inl(ahc, SCB_BASE) != 0x5aa555aa)
1389 status1 = pci_conf_read(ahc->bd->pc, ahc->bd->tag,
1398 status1 = pci_conf_read(ahc->bd->pc, ahc->bd->tag,
1400 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1402 ahc_outb(ahc, CLRINT, CLRPARERR);
1403 ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
1404 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
1410 ahc_pci_intr(struct ahc_softc *ahc)
1415 error = ahc_inb(ahc, ERROR);
1419 status1 = pci_conf_read(ahc->bd->pc, ahc->bd->tag,
1423 ahc_name(ahc),
1424 ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
1428 "or write data phase\n", ahc_name(ahc));
1431 printf("%s: Signal System Error Detected\n", ahc_name(ahc));
1434 printf("%s: Received a Master Abort\n", ahc_name(ahc));
1437 printf("%s: Received a Target Abort\n", ahc_name(ahc));
1440 printf("%s: Signaled a Target Abort\n", ahc_name(ahc));
1444 ahc_name(ahc));
1448 pci_conf_write(ahc->bd->pc, ahc->bd->tag, PCI_COMMAND_STATUS_REG,
1453 "no status bits set\n", ahc_name(ahc));
1455 ahc_outb(ahc, CLRINT, CLRPARERR);
1458 ahc_unpause(ahc);
1462 ahc_aic785X_setup(struct ahc_softc *ahc)
1466 ahc->channel = 'A';
1467 ahc->chip = AHC_AIC7850;
1468 ahc->features = AHC_AIC7850_FE;
1469 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
1470 rev = PCI_REVISION(ahc->bd->class);
1472 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
1477 ahc_aic7860_setup(struct ahc_softc *ahc)
1481 ahc->channel = 'A';
1482 ahc->chip = AHC_AIC7860;
1483 ahc->features = AHC_AIC7860_FE;
1484 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
1485 rev = PCI_REVISION(ahc->bd->class);
1487 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
1492 ahc_apa1480_setup(struct ahc_softc *ahc)
1496 error = ahc_aic7860_setup(ahc);
1499 ahc->features |= AHC_REMOVABLE;
1504 ahc_aic7870_setup(struct ahc_softc *ahc)
1507 ahc->channel = 'A';
1508 ahc->chip = AHC_AIC7870;
1509 ahc->features = AHC_AIC7870_FE;
1510 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
1515 ahc_aha394X_setup(struct ahc_softc *ahc)
1519 error = ahc_aic7870_setup(ahc);
1521 error = ahc_aha394XX_setup(ahc);
1526 ahc_aha398X_setup(struct ahc_softc *ahc)
1530 error = ahc_aic7870_setup(ahc);
1532 error = ahc_aha398XX_setup(ahc);
1537 ahc_aha494X_setup(struct ahc_softc *ahc)
1541 error = ahc_aic7870_setup(ahc);
1543 error = ahc_aha494XX_setup(ahc);
1548 ahc_aic7880_setup(struct ahc_softc *ahc)
1552 ahc->channel = 'A';
1553 ahc->chip = AHC_AIC7880;
1554 ahc->features = AHC_AIC7880_FE;
1555 ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
1556 rev = PCI_REVISION(ahc->bd->class);
1558 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
1560 ahc->bugs |= AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
1566 ahc_aha2940Pro_setup(struct ahc_softc *ahc)
1569 ahc->flags |= AHC_INT50_SPEEDFLEX;
1570 return (ahc_aic7880_setup(ahc));
1574 ahc_aha394XU_setup(struct ahc_softc *ahc)
1578 error = ahc_aic7880_setup(ahc);
1580 error = ahc_aha394XX_setup(ahc);
1585 ahc_aha398XU_setup(struct ahc_softc *ahc)
1589 error = ahc_aic7880_setup(ahc);
1591 error = ahc_aha398XX_setup(ahc);
1596 ahc_aic7890_setup(struct ahc_softc *ahc)
1600 ahc->channel = 'A';
1601 ahc->chip = AHC_AIC7890;
1602 ahc->features = AHC_AIC7890_FE;
1603 ahc->flags |= AHC_NEWEEPROM_FMT;
1604 rev = PCI_REVISION(ahc->bd->class);
1606 ahc->bugs |= AHC_AUTOFLUSH_BUG|AHC_CACHETHEN_BUG;
1611 ahc_aic7892_setup(struct ahc_softc *ahc)
1614 ahc->channel = 'A';
1615 ahc->chip = AHC_AIC7892;
1616 ahc->features = AHC_AIC7892_FE;
1617 ahc->flags |= AHC_NEWEEPROM_FMT;
1618 ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
1623 ahc_aic7895_setup(struct ahc_softc *ahc)
1627 ahc->channel = (ahc->bd->func == 1) ? 'B' : 'A';
1631 rev = PCI_REVISION(ahc->bd->class);
1633 ahc->chip = AHC_AIC7895C;
1634 ahc->features = AHC_AIC7895C_FE;
1638 ahc->chip = AHC_AIC7895;
1639 ahc->features = AHC_AIC7895_FE;
1647 command = pci_conf_read(ahc->bd->pc, ahc->bd->tag,
1650 pci_conf_write(ahc->bd->pc, ahc->bd->tag,
1652 ahc->bugs |= AHC_PCI_MWI_BUG;
1658 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_PCI_2_1_RETRY_BUG
1668 pci_conf_write(ahc->bd->pc, ahc->bd->tag, CSIZE_LATTIME, 0);
1669 devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
1671 pci_conf_write(ahc->bd->pc, ahc->bd->tag, DEVCONFIG, devconfig);
1673 ahc->flags |= AHC_NEWEEPROM_FMT;
1678 ahc_aic7896_setup(struct ahc_softc *ahc)
1680 ahc->channel = (ahc->bd->func == 1) ? 'B' : 'A';
1681 ahc->chip = AHC_AIC7896;
1682 ahc->features = AHC_AIC7896_FE;
1683 ahc->flags |= AHC_NEWEEPROM_FMT;
1684 ahc->bugs |= AHC_CACHETHEN_DIS_BUG;
1689 ahc_aic7899_setup(struct ahc_softc *ahc)
1691 ahc->channel = (ahc->bd->func == 1) ? 'B' : 'A';
1692 ahc->chip = AHC_AIC7899;
1693 ahc->features = AHC_AIC7899_FE;
1694 ahc->flags |= AHC_NEWEEPROM_FMT;
1695 ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
1700 ahc_aha29160C_setup(struct ahc_softc *ahc)
1704 error = ahc_aic7899_setup(ahc);
1707 ahc->features |= AHC_REMOVABLE;
1712 ahc_raid_setup(struct ahc_softc *ahc)
1714 aprint_normal_dev(ahc->sc_dev, "RAID functionality unsupported\n");
1719 ahc_aha394XX_setup(struct ahc_softc *ahc)
1722 switch (ahc->bd->dev) {
1724 ahc->channel = 'A';
1727 ahc->channel = 'B';
1732 ahc->bd->dev);
1733 ahc->channel = 'A';
1739 ahc_aha398XX_setup(struct ahc_softc *ahc)
1742 switch (ahc->bd->dev) {
1744 ahc->channel = 'A';
1747 ahc->channel = 'B';
1750 ahc->channel = 'C';
1755 ahc->bd->dev);
1756 ahc->channel = 'A';
1759 ahc->flags |= AHC_LARGE_SEEPROM;
1764 ahc_aha494XX_setup(struct ahc_softc *ahc)
1767 switch (ahc->bd->dev) {
1769 ahc->channel = 'A';
1772 ahc->channel = 'B';
1775 ahc->channel = 'C';
1778 ahc->channel = 'D';
1783 ahc->bd->dev);
1784 ahc->channel = 'A';
1786 ahc->flags |= AHC_LARGE_SEEPROM;