Lines Matching defs:ahc

599 static int ahc_ext_scbram_present(struct ahc_softc *ahc);
600 static void ahc_scbram_config(struct ahc_softc *ahc, int enable,
602 static void ahc_probe_ext_scbram(struct ahc_softc *ahc);
603 static void check_extport(struct ahc_softc *ahc, u_int *sxfrctl1);
604 static void ahc_parse_pci_eeprom(struct ahc_softc *ahc,
606 static void configure_termination(struct ahc_softc *ahc,
611 static void ahc_new_term_detect(struct ahc_softc *ahc,
617 static void aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
621 static void aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
624 static void write_brdctl(struct ahc_softc *ahc, uint8_t value);
625 static uint8_t read_brdctl(struct ahc_softc *ahc);
626 static void ahc_pci_intr(struct ahc_softc *ahc);
627 static int ahc_pci_chip_init(struct ahc_softc *ahc);
705 ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
717 error = entry->setup(ahc);
720 ahc->chip |= AHC_PCI;
721 ahc->description = entry->name;
723 pci_set_power_state(ahc->dev_softc, AHC_POWER_STATE_D0);
725 error = ahc_pci_map_registers(ahc);
735 ahc_intr_enable(ahc, FALSE);
737 devconfig = ahc_pci_read_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4);
745 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
749 ahc_name(ahc));
756 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
759 command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/2);
762 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, /*bytes*/2);
765 ahc->flags |= AHC_PAGESCBS;
767 error = ahc_softc_init(ahc);
779 if ((ahc->flags & AHC_DISABLE_PCI_PERR) != 0)
780 ahc->seqctl |= FAILDIS;
782 ahc->bus_intr = ahc_pci_intr;
783 ahc->bus_chip_init = ahc_pci_chip_init;
786 if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
787 ahc_pause(ahc);
788 if ((ahc->features & AHC_ULTRA2) != 0)
789 our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
791 our_id = ahc_inb(ahc, SCSIID) & OID;
792 sxfrctl1 = ahc_inb(ahc, SXFRCTL1) & STPWEN;
793 scsiseq = ahc_inb(ahc, SCSISEQ);
800 error = ahc_reset(ahc, /*reinit*/FALSE);
804 if ((ahc->features & AHC_DT) != 0) {
808 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
809 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
810 ahc_outb(ahc, OPTIONMODE,
812 ahc_outb(ahc, SFUNCT, sfunct);
815 ahc_outb(ahc, CRCCONTROL1, CRCVALCHKEN|CRCENDCHKEN|CRCREQCHKEN
819 dscommand0 = ahc_inb(ahc, DSCOMMAND0);
821 if ((ahc->features & AHC_ULTRA2) != 0) {
834 if ((ahc->bugs & AHC_CACHETHEN_DIS_BUG) != 0)
837 if ((ahc->bugs & AHC_CACHETHEN_BUG) != 0)
840 ahc_outb(ahc, DSCOMMAND0, dscommand0);
842 ahc->pci_cachesize =
843 ahc_pci_read_config(ahc->dev_softc, CSIZE_LATTIME,
845 ahc->pci_cachesize *= 4;
847 if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0
848 && ahc->pci_cachesize == 4) {
850 ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
852 ahc->pci_cachesize = 0;
859 if ((ahc->features & AHC_ULTRA) != 0) {
862 devconfig = ahc_pci_read_config(ahc->dev_softc,
865 ahc->features &= ~AHC_ULTRA;
869 check_extport(ahc, &sxfrctl1);
874 sblkctl = ahc_inb(ahc, SBLKCTL);
875 ahc_outb(ahc, SBLKCTL, (sblkctl & ~(DIAGLEDEN|DIAGLEDON)));
877 if ((ahc->features & AHC_ULTRA2) != 0) {
878 ahc_outb(ahc, DFF_THRSH, RD_DFTHRSH_MAX|WR_DFTHRSH_MAX);
880 ahc_outb(ahc, DSPCISTATUS, DFTHRSH_100);
883 if (ahc->flags & AHC_USEDEFAULTS) {
890 if ((ahc->flags & AHC_NO_BIOS_INIT) == 0
893 ahc_name(ahc));
894 ahc->flags &= ~AHC_USEDEFAULTS;
895 ahc->flags |= AHC_BIOS_ENABLED;
904 ahc_outb(ahc, SCSICONF, our_id|ENSPCHK|RESET_SCSI);
906 ahc->our_id = our_id;
914 ahc_probe_ext_scbram(ahc);
921 ahc->flags |= AHC_TERM_ENB_A;
927 ahc->bus_softc.pci_softc.devconfig =
928 ahc_pci_read_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4);
929 ahc->bus_softc.pci_softc.command =
930 ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1);
931 ahc->bus_softc.pci_softc.csize_lattime =
932 ahc_pci_read_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1);
933 ahc->bus_softc.pci_softc.dscommand0 = ahc_inb(ahc, DSCOMMAND0);
934 ahc->bus_softc.pci_softc.dspcistatus = ahc_inb(ahc, DSPCISTATUS);
935 if ((ahc->features & AHC_DT) != 0) {
938 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
939 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
940 ahc->bus_softc.pci_softc.optionmode = ahc_inb(ahc, OPTIONMODE);
941 ahc->bus_softc.pci_softc.targcrccnt = ahc_inw(ahc, TARGCRCCNT);
942 ahc_outb(ahc, SFUNCT, sfunct);
943 ahc->bus_softc.pci_softc.crccontrol1 =
944 ahc_inb(ahc, CRCCONTROL1);
946 if ((ahc->features & AHC_MULTI_FUNC) != 0)
947 ahc->bus_softc.pci_softc.scbbaddr = ahc_inb(ahc, SCBBADDR);
949 if ((ahc->features & AHC_ULTRA2) != 0)
950 ahc->bus_softc.pci_softc.dff_thrsh = ahc_inb(ahc, DFF_THRSH);
953 error = ahc_init(ahc);
956 ahc->init_level++;
961 return ahc_pci_map_int(ahc);
969 ahc_ext_scbram_present(struct ahc_softc *ahc)
976 chip = ahc->chip & AHC_CHIPID_MASK;
977 devconfig = ahc_pci_read_config(ahc->dev_softc,
981 if ((ahc->features & AHC_ULTRA2) != 0)
982 ramps = (ahc_inb(ahc, DSCOMMAND0) & RAMPS) != 0;
1005 ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck,
1010 if (ahc->features & AHC_MULTI_FUNC) {
1015 ahc_outb(ahc, SCBBADDR, ahc_get_pci_function(ahc->dev_softc));
1018 ahc->flags &= ~AHC_LSCBS_ENABLED;
1020 ahc->flags |= AHC_LSCBS_ENABLED;
1021 devconfig = ahc_pci_read_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4);
1022 if ((ahc->features & AHC_ULTRA2) != 0) {
1025 dscommand0 = ahc_inb(ahc, DSCOMMAND0);
1034 ahc_outb(ahc, DSCOMMAND0, dscommand0);
1054 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
1063 ahc_probe_ext_scbram(struct ahc_softc *ahc)
1078 if (ahc_ext_scbram_present(ahc) == 0)
1084 ahc_scbram_config(ahc, /*enable*/TRUE, pcheck, fast, large);
1085 num_scbs = ahc_probe_scbs(ahc);
1097 ahc_outb(ahc, SEQCTL, 0);
1098 ahc_outb(ahc, CLRINT, CLRPARERR);
1099 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1102 ahc_scbram_config(ahc, enable, /*pcheck*/TRUE, fast, large);
1103 num_scbs = ahc_probe_scbs(ahc);
1104 if ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
1105 || (ahc_inb(ahc, ERROR) & MPARERR) == 0)
1109 ahc_outb(ahc, CLRINT, CLRPARERR);
1110 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1113 ahc_scbram_config(ahc, enable, pcheck, /*fast*/TRUE, large);
1114 test_num_scbs = ahc_probe_scbs(ahc);
1116 && ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
1117 || (ahc_inb(ahc, ERROR) & MPARERR) == 0))
1124 if ((ahc->features & AHC_LARGE_SCBS) != 0) {
1125 ahc_scbram_config(ahc, enable, pcheck, fast, /*large*/TRUE);
1126 test_num_scbs = ahc_probe_scbs(ahc);
1137 ahc->flags |= AHC_SCB_BTT;
1146 ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
1148 ahc_outb(ahc, CLRINT, CLRPARERR);
1149 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1152 ahc_name(ahc), fast ? "fast" : "slow",
1156 ahc_scbram_config(ahc, enable, pcheck, fast, large);
1164 ahc_pci_test_register_access(struct ahc_softc *ahc)
1177 cmd = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/2);
1178 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
1189 hcntrl = ahc_inb(ahc, HCNTRL);
1200 ahc->flags |= AHC_NO_BIOS_INIT;
1212 ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
1213 while (ahc_is_paused(ahc) == 0)
1217 status1 = ahc_pci_read_config(ahc->dev_softc,
1219 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1221 ahc_outb(ahc, CLRINT, CLRPARERR);
1223 ahc_outb(ahc, SEQCTL, PERRORDIS);
1224 ahc_outb(ahc, SCBPTR, 0);
1225 ahc_outl(ahc, SCB_BASE, 0x5aa555aa);
1226 if (ahc_inl(ahc, SCB_BASE) != 0x5aa555aa)
1229 status1 = ahc_pci_read_config(ahc->dev_softc,
1238 status1 = ahc_pci_read_config(ahc->dev_softc,
1240 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1242 ahc_outb(ahc, CLRINT, CLRPARERR);
1243 ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
1244 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
1253 check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
1260 sd.sd_ahc = ahc;
1264 sc = ahc->seep_config;
1272 if (ahc->flags & AHC_LARGE_SEEPROM)
1284 have_seeprom = ahc_acquire_seeprom(ahc, &sd);
1288 printk("%s: Reading SEEPROM...", ahc_name(ahc));
1293 start_addr = 32 * (ahc->channel - 'A');
1317 ahc->flags |= AHC_LARGE_SEEPROM;
1328 ahc_outb(ahc, SCBPTR, 2);
1329 if (ahc_inb(ahc, SCB_BASE) == 'A'
1330 && ahc_inb(ahc, SCB_BASE + 1) == 'D'
1331 && ahc_inb(ahc, SCB_BASE + 2) == 'P'
1332 && ahc_inb(ahc, SCB_BASE + 3) == 'T') {
1341 *sc_data = ahc_inb(ahc, SRAM_BASE + j)
1342 | ahc_inb(ahc, SRAM_BASE + j + 1) << 8;
1346 ahc->flags |= AHC_SCB_CONFIG_USED;
1352 ahc_outb(ahc, CLRINT, CLRPARERR);
1353 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1358 printk("%s: No SEEPROM available.\n", ahc_name(ahc));
1359 ahc->flags |= AHC_USEDEFAULTS;
1360 kfree(ahc->seep_config);
1361 ahc->seep_config = NULL;
1364 ahc_parse_pci_eeprom(ahc, sc);
1380 if ((ahc->features & AHC_SPIOCAP) != 0) {
1381 if ((ahc_inb(ahc, SPIOCAP) & SSPIOCPS) == 0)
1386 ahc->flags |= AHC_HAS_TERM_LOGIC;
1387 ahc_acquire_seeprom(ahc, &sd);
1388 configure_termination(ahc, &sd, sc->adapter_control, sxfrctl1);
1396 ahc_name(ahc),
1402 ahc_parse_pci_eeprom(struct ahc_softc *ahc, struct seeprom_config *sc)
1423 ahc->flags |= AHC_NEWEEPROM_FMT;
1436 if ((ahc->flags & AHC_NEWEEPROM_FMT) != 0) {
1448 if ((ahc->features & AHC_ULTRA2) != 0) {
1455 ahc_outb(ahc, TARG_OFFSET + i, offset);
1473 ahc_outb(ahc, TARG_SCSIRATE + i, scsirate);
1475 ahc->our_id = sc->brtime_id & CFSCSIID;
1477 scsi_conf = (ahc->our_id & 0x7);
1483 ahc->flags |= (sc->adapter_control & CFBOOTCHAN) >> CFBOOTCHANSHIFT;
1486 ahc->flags |= AHC_EXTENDED_TRANS_A;
1489 ahc->flags |= AHC_BIOS_ENABLED;
1490 if (ahc->features & AHC_ULTRA
1491 && (ahc->flags & AHC_NEWEEPROM_FMT) == 0) {
1503 devconfig = ahc_pci_read_config(ahc->dev_softc,
1508 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
1512 ahc_outb(ahc, SCSICONF, scsi_conf);
1513 ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
1514 ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
1515 ahc_outb(ahc, ULTRA_ENB, ultraenb & 0xff);
1516 ahc_outb(ahc, ULTRA_ENB + 1, (ultraenb >> 8) & 0xff);
1520 configure_termination(struct ahc_softc *ahc,
1542 || (ahc->features & AHC_NEW_TERMCTL) != 0) {
1557 if ((ahc->features & AHC_NEW_TERMCTL) != 0) {
1558 ahc_new_term_detect(ahc, &enableSEC_low,
1566 ahc_name(ahc));
1574 ahc_name(ahc));
1582 } else if ((ahc->features & AHC_SPIOCAP) != 0) {
1583 aic785X_cable_detect(ahc, &internal50_present,
1589 aic787X_cable_detect(ahc, &internal50_present,
1595 if ((ahc->features & AHC_WIDE) == 0)
1599 && (ahc->features & AHC_ULTRA2) == 0) {
1601 ahc_name(ahc),
1604 if ((ahc->features & AHC_WIDE) != 0)
1608 ahc_name(ahc),
1613 ahc_name(ahc), eeprom_present ? "is" : "not");
1615 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) {
1634 if ((ahc->features & AHC_ULTRA2) == 0
1641 "time!\n", ahc_name(ahc));
1653 if ((ahc->features & AHC_WIDE) != 0
1659 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
1661 "Enabled\n", ahc_name(ahc));
1664 "Enabled\n", ahc_name(ahc),
1673 if ((ahc->features & AHC_ULTRA2) != 0)
1678 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
1680 "Enabled\n", ahc_name(ahc));
1683 "Enabled\n", ahc_name(ahc),
1693 "Enabled\n", ahc_name(ahc));
1700 ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
1707 ahc_name(ahc));
1710 write_brdctl(ahc, brddat);
1718 ahc_name(ahc),
1719 (ahc->features & AHC_ULTRA2) ? "Primary "
1724 && (ahc->features & AHC_WIDE) != 0) {
1728 ahc_name(ahc),
1729 (ahc->features & AHC_ULTRA2)
1737 ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
1739 if ((ahc->features & AHC_WIDE) != 0)
1740 write_brdctl(ahc, brddat);
1746 ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low,
1759 brdctl = read_brdctl(ahc);
1768 aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
1781 write_brdctl(ahc, 0);
1788 brdctl = read_brdctl(ahc);
1796 write_brdctl(ahc, BRDDAT5);
1803 brdctl = read_brdctl(ahc);
1809 aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
1815 spiocap = ahc_inb(ahc, SPIOCAP);
1818 ahc_outb(ahc, SPIOCAP, spiocap);
1819 ahc_outb(ahc, BRDCTL, BRDRW|BRDCS);
1820 ahc_flush_device_writes(ahc);
1822 ahc_outb(ahc, BRDCTL, 0);
1823 ahc_flush_device_writes(ahc);
1825 brdctl = ahc_inb(ahc, BRDCTL);
1828 *eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) ? 1 : 0;
1832 ahc_acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd)
1836 if ((ahc->features & AHC_SPIOCAP) != 0
1837 && (ahc_inb(ahc, SPIOCAP) & SEEPROM) == 0)
1867 write_brdctl(struct ahc_softc *ahc, uint8_t value)
1871 if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
1873 if (ahc->channel == 'B')
1875 } else if ((ahc->features & AHC_ULTRA2) != 0) {
1880 ahc_outb(ahc, BRDCTL, brdctl);
1881 ahc_flush_device_writes(ahc);
1883 ahc_outb(ahc, BRDCTL, brdctl);
1884 ahc_flush_device_writes(ahc);
1885 if ((ahc->features & AHC_ULTRA2) != 0)
1889 ahc_outb(ahc, BRDCTL, brdctl);
1890 ahc_flush_device_writes(ahc);
1891 if ((ahc->features & AHC_ULTRA2) != 0)
1895 ahc_outb(ahc, BRDCTL, brdctl);
1899 read_brdctl(struct ahc_softc *ahc)
1904 if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
1906 if (ahc->channel == 'B')
1908 } else if ((ahc->features & AHC_ULTRA2) != 0) {
1913 ahc_outb(ahc, BRDCTL, brdctl);
1914 ahc_flush_device_writes(ahc);
1915 value = ahc_inb(ahc, BRDCTL);
1916 ahc_outb(ahc, BRDCTL, 0);
1921 ahc_pci_intr(struct ahc_softc *ahc)
1926 error = ahc_inb(ahc, ERROR);
1930 status1 = ahc_pci_read_config(ahc->dev_softc,
1934 ahc_name(ahc),
1935 ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
1938 ahc->pci_target_perr_count++;
1940 "or write data phase\n", ahc_name(ahc));
1943 printk("%s: Signal System Error Detected\n", ahc_name(ahc));
1946 printk("%s: Received a Master Abort\n", ahc_name(ahc));
1949 printk("%s: Received a Target Abort\n", ahc_name(ahc));
1952 printk("%s: Signaled a Target Abort\n", ahc_name(ahc));
1956 ahc_name(ahc));
1960 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1965 "no status bits set\n", ahc_name(ahc));
1967 ahc_outb(ahc, CLRINT, CLRPARERR);
1970 if (ahc->pci_target_perr_count > AHC_PCI_TARGET_PERR_THRESH) {
1978 ahc_name(ahc), ahc_name(ahc), ahc_name(ahc),
1979 ahc_name(ahc), ahc_name(ahc), ahc_name(ahc));
1980 ahc->seqctl |= FAILDIS;
1981 ahc_outb(ahc, SEQCTL, ahc->seqctl);
1983 ahc_unpause(ahc);
1987 ahc_pci_chip_init(struct ahc_softc *ahc)
1989 ahc_outb(ahc, DSCOMMAND0, ahc->bus_softc.pci_softc.dscommand0);
1990 ahc_outb(ahc, DSPCISTATUS, ahc->bus_softc.pci_softc.dspcistatus);
1991 if ((ahc->features & AHC_DT) != 0) {
1994 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
1995 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
1996 ahc_outb(ahc, OPTIONMODE, ahc->bus_softc.pci_softc.optionmode);
1997 ahc_outw(ahc, TARGCRCCNT, ahc->bus_softc.pci_softc.targcrccnt);
1998 ahc_outb(ahc, SFUNCT, sfunct);
1999 ahc_outb(ahc, CRCCONTROL1,
2000 ahc->bus_softc.pci_softc.crccontrol1);
2002 if ((ahc->features & AHC_MULTI_FUNC) != 0)
2003 ahc_outb(ahc, SCBBADDR, ahc->bus_softc.pci_softc.scbbaddr);
2005 if ((ahc->features & AHC_ULTRA2) != 0)
2006 ahc_outb(ahc, DFF_THRSH, ahc->bus_softc.pci_softc.dff_thrsh);
2008 return (ahc_chip_init(ahc));
2013 ahc_pci_resume(struct ahc_softc *ahc)
2021 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
2022 ahc->bus_softc.pci_softc.devconfig, /*bytes*/4);
2023 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
2024 ahc->bus_softc.pci_softc.command, /*bytes*/1);
2025 ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
2026 ahc->bus_softc.pci_softc.csize_lattime, /*bytes*/1);
2027 if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) {
2031 sd.sd_ahc = ahc;
2036 ahc_acquire_seeprom(ahc, &sd);
2037 configure_termination(ahc, &sd,
2038 ahc->seep_config->adapter_control,
2046 ahc_aic785X_setup(struct ahc_softc *ahc)
2051 pci = ahc->dev_softc;
2052 ahc->channel = 'A';
2053 ahc->chip = AHC_AIC7850;
2054 ahc->features = AHC_AIC7850_FE;
2055 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2058 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
2059 ahc->instruction_ram_size = 512;
2064 ahc_aic7860_setup(struct ahc_softc *ahc)
2069 pci = ahc->dev_softc;
2070 ahc->channel = 'A';
2071 ahc->chip = AHC_AIC7860;
2072 ahc->features = AHC_AIC7860_FE;
2073 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2076 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
2077 ahc->instruction_ram_size = 512;
2082 ahc_apa1480_setup(struct ahc_softc *ahc)
2086 error = ahc_aic7860_setup(ahc);
2089 ahc->features |= AHC_REMOVABLE;
2094 ahc_aic7870_setup(struct ahc_softc *ahc)
2097 ahc->channel = 'A';
2098 ahc->chip = AHC_AIC7870;
2099 ahc->features = AHC_AIC7870_FE;
2100 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2101 ahc->instruction_ram_size = 512;
2106 ahc_aic7870h_setup(struct ahc_softc *ahc)
2108 int error = ahc_aic7870_setup(ahc);
2110 ahc->features |= AHC_HVD;
2116 ahc_aha394X_setup(struct ahc_softc *ahc)
2120 error = ahc_aic7870_setup(ahc);
2122 error = ahc_aha394XX_setup(ahc);
2127 ahc_aha394Xh_setup(struct ahc_softc *ahc)
2129 int error = ahc_aha394X_setup(ahc);
2131 ahc->features |= AHC_HVD;
2137 ahc_aha398X_setup(struct ahc_softc *ahc)
2141 error = ahc_aic7870_setup(ahc);
2143 error = ahc_aha398XX_setup(ahc);
2148 ahc_aha494X_setup(struct ahc_softc *ahc)
2152 error = ahc_aic7870_setup(ahc);
2154 error = ahc_aha494XX_setup(ahc);
2159 ahc_aha494Xh_setup(struct ahc_softc *ahc)
2161 int error = ahc_aha494X_setup(ahc);
2163 ahc->features |= AHC_HVD;
2169 ahc_aic7880_setup(struct ahc_softc *ahc)
2174 pci = ahc->dev_softc;
2175 ahc->channel = 'A';
2176 ahc->chip = AHC_AIC7880;
2177 ahc->features = AHC_AIC7880_FE;
2178 ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
2181 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
2183 ahc->bugs |= AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2185 ahc->instruction_ram_size = 512;
2190 ahc_aic7880h_setup(struct ahc_softc *ahc)
2192 int error = ahc_aic7880_setup(ahc);
2194 ahc->features |= AHC_HVD;
2201 ahc_aha2940Pro_setup(struct ahc_softc *ahc)
2204 ahc->flags |= AHC_INT50_SPEEDFLEX;
2205 return (ahc_aic7880_setup(ahc));
2209 ahc_aha394XU_setup(struct ahc_softc *ahc)
2213 error = ahc_aic7880_setup(ahc);
2215 error = ahc_aha394XX_setup(ahc);
2220 ahc_aha394XUh_setup(struct ahc_softc *ahc)
2222 int error = ahc_aha394XU_setup(ahc);
2224 ahc->features |= AHC_HVD;
2230 ahc_aha398XU_setup(struct ahc_softc *ahc)
2234 error = ahc_aic7880_setup(ahc);
2236 error = ahc_aha398XX_setup(ahc);
2241 ahc_aic7890_setup(struct ahc_softc *ahc)
2246 pci = ahc->dev_softc;
2247 ahc->channel = 'A';
2248 ahc->chip = AHC_AIC7890;
2249 ahc->features = AHC_AIC7890_FE;
2250 ahc->flags |= AHC_NEWEEPROM_FMT;
2253 ahc->bugs |= AHC_AUTOFLUSH_BUG|AHC_CACHETHEN_BUG;
2254 ahc->instruction_ram_size = 768;
2259 ahc_aic7892_setup(struct ahc_softc *ahc)
2262 ahc->channel = 'A';
2263 ahc->chip = AHC_AIC7892;
2264 ahc->features = AHC_AIC7892_FE;
2265 ahc->flags |= AHC_NEWEEPROM_FMT;
2266 ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
2267 ahc->instruction_ram_size = 1024;
2272 ahc_aic7895_setup(struct ahc_softc *ahc)
2277 pci = ahc->dev_softc;
2278 ahc->channel = ahc_get_pci_function(pci) == 1 ? 'B' : 'A';
2284 ahc->chip = AHC_AIC7895C;
2285 ahc->features = AHC_AIC7895C_FE;
2289 ahc->chip = AHC_AIC7895;
2290 ahc->features = AHC_AIC7895_FE;
2301 ahc->bugs |= AHC_PCI_MWI_BUG;
2307 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_PCI_2_1_RETRY_BUG
2322 ahc->flags |= AHC_NEWEEPROM_FMT;
2323 ahc->instruction_ram_size = 512;
2328 ahc_aic7895h_setup(struct ahc_softc *ahc)
2330 int error = ahc_aic7895_setup(ahc);
2332 ahc->features |= AHC_HVD;
2338 ahc_aic7896_setup(struct ahc_softc *ahc)
2342 pci = ahc->dev_softc;
2343 ahc->channel = ahc_get_pci_function(pci) == 1 ? 'B' : 'A';
2344 ahc->chip = AHC_AIC7896;
2345 ahc->features = AHC_AIC7896_FE;
2346 ahc->flags |= AHC_NEWEEPROM_FMT;
2347 ahc->bugs |= AHC_CACHETHEN_DIS_BUG;
2348 ahc->instruction_ram_size = 768;
2353 ahc_aic7899_setup(struct ahc_softc *ahc)
2357 pci = ahc->dev_softc;
2358 ahc->channel = ahc_get_pci_function(pci) == 1 ? 'B' : 'A';
2359 ahc->chip = AHC_AIC7899;
2360 ahc->features = AHC_AIC7899_FE;
2361 ahc->flags |= AHC_NEWEEPROM_FMT;
2362 ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
2363 ahc->instruction_ram_size = 1024;
2368 ahc_aha29160C_setup(struct ahc_softc *ahc)
2372 error = ahc_aic7899_setup(ahc);
2375 ahc->features |= AHC_REMOVABLE;
2380 ahc_raid_setup(struct ahc_softc *ahc)
2387 ahc_aha394XX_setup(struct ahc_softc *ahc)
2391 pci = ahc->dev_softc;
2394 ahc->channel = 'A';
2397 ahc->channel = 'B';
2403 ahc->channel = 'A';
2409 ahc_aha398XX_setup(struct ahc_softc *ahc)
2413 pci = ahc->dev_softc;
2416 ahc->channel = 'A';
2419 ahc->channel = 'B';
2422 ahc->channel = 'C';
2428 ahc->channel = 'A';
2431 ahc->flags |= AHC_LARGE_SEEPROM;
2436 ahc_aha494XX_setup(struct ahc_softc *ahc)
2440 pci = ahc->dev_softc;
2443 ahc->channel = 'A';
2446 ahc->channel = 'B';
2449 ahc->channel = 'C';
2452 ahc->channel = 'D';
2458 ahc->channel = 'A';
2460 ahc->flags |= AHC_LARGE_SEEPROM;