• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/aic7xxx/

Lines Matching defs:ahc

602 static int ahc_ext_scbram_present(struct ahc_softc *ahc);
603 static void ahc_scbram_config(struct ahc_softc *ahc, int enable,
605 static void ahc_probe_ext_scbram(struct ahc_softc *ahc);
606 static void check_extport(struct ahc_softc *ahc, u_int *sxfrctl1);
607 static void ahc_parse_pci_eeprom(struct ahc_softc *ahc,
609 static void configure_termination(struct ahc_softc *ahc,
614 static void ahc_new_term_detect(struct ahc_softc *ahc,
620 static void aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
624 static void aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
627 static void write_brdctl(struct ahc_softc *ahc, uint8_t value);
628 static uint8_t read_brdctl(struct ahc_softc *ahc);
629 static void ahc_pci_intr(struct ahc_softc *ahc);
630 static int ahc_pci_chip_init(struct ahc_softc *ahc);
708 ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
720 error = entry->setup(ahc);
723 ahc->chip |= AHC_PCI;
724 ahc->description = entry->name;
726 pci_set_power_state(ahc->dev_softc, AHC_POWER_STATE_D0);
728 error = ahc_pci_map_registers(ahc);
738 ahc_intr_enable(ahc, FALSE);
740 devconfig = ahc_pci_read_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4);
748 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
752 ahc_name(ahc));
759 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
762 command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/2);
765 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, /*bytes*/2);
768 ahc->flags |= AHC_PAGESCBS;
770 error = ahc_softc_init(ahc);
774 if ((ahc->flags & AHC_DISABLE_PCI_PERR) != 0)
775 ahc->seqctl |= FAILDIS;
777 ahc->bus_intr = ahc_pci_intr;
778 ahc->bus_chip_init = ahc_pci_chip_init;
781 if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
782 ahc_pause(ahc);
783 if ((ahc->features & AHC_ULTRA2) != 0)
784 our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
786 our_id = ahc_inb(ahc, SCSIID) & OID;
787 sxfrctl1 = ahc_inb(ahc, SXFRCTL1) & STPWEN;
788 scsiseq = ahc_inb(ahc, SCSISEQ);
795 error = ahc_reset(ahc, /*reinit*/FALSE);
799 if ((ahc->features & AHC_DT) != 0) {
803 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
804 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
805 ahc_outb(ahc, OPTIONMODE,
807 ahc_outb(ahc, SFUNCT, sfunct);
810 ahc_outb(ahc, CRCCONTROL1, CRCVALCHKEN|CRCENDCHKEN|CRCREQCHKEN
814 dscommand0 = ahc_inb(ahc, DSCOMMAND0);
816 if ((ahc->features & AHC_ULTRA2) != 0) {
829 if ((ahc->bugs & AHC_CACHETHEN_DIS_BUG) != 0)
832 if ((ahc->bugs & AHC_CACHETHEN_BUG) != 0)
835 ahc_outb(ahc, DSCOMMAND0, dscommand0);
837 ahc->pci_cachesize =
838 ahc_pci_read_config(ahc->dev_softc, CSIZE_LATTIME,
840 ahc->pci_cachesize *= 4;
842 if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0
843 && ahc->pci_cachesize == 4) {
845 ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
847 ahc->pci_cachesize = 0;
854 if ((ahc->features & AHC_ULTRA) != 0) {
857 devconfig = ahc_pci_read_config(ahc->dev_softc,
860 ahc->features &= ~AHC_ULTRA;
864 check_extport(ahc, &sxfrctl1);
869 sblkctl = ahc_inb(ahc, SBLKCTL);
870 ahc_outb(ahc, SBLKCTL, (sblkctl & ~(DIAGLEDEN|DIAGLEDON)));
872 if ((ahc->features & AHC_ULTRA2) != 0) {
873 ahc_outb(ahc, DFF_THRSH, RD_DFTHRSH_MAX|WR_DFTHRSH_MAX);
875 ahc_outb(ahc, DSPCISTATUS, DFTHRSH_100);
878 if (ahc->flags & AHC_USEDEFAULTS) {
885 if ((ahc->flags & AHC_NO_BIOS_INIT) == 0
888 ahc_name(ahc));
889 ahc->flags &= ~AHC_USEDEFAULTS;
890 ahc->flags |= AHC_BIOS_ENABLED;
899 ahc_outb(ahc, SCSICONF, our_id|ENSPCHK|RESET_SCSI);
901 ahc->our_id = our_id;
909 ahc_probe_ext_scbram(ahc);
916 ahc->flags |= AHC_TERM_ENB_A;
922 ahc->bus_softc.pci_softc.devconfig =
923 ahc_pci_read_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4);
924 ahc->bus_softc.pci_softc.command =
925 ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1);
926 ahc->bus_softc.pci_softc.csize_lattime =
927 ahc_pci_read_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1);
928 ahc->bus_softc.pci_softc.dscommand0 = ahc_inb(ahc, DSCOMMAND0);
929 ahc->bus_softc.pci_softc.dspcistatus = ahc_inb(ahc, DSPCISTATUS);
930 if ((ahc->features & AHC_DT) != 0) {
933 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
934 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
935 ahc->bus_softc.pci_softc.optionmode = ahc_inb(ahc, OPTIONMODE);
936 ahc->bus_softc.pci_softc.targcrccnt = ahc_inw(ahc, TARGCRCCNT);
937 ahc_outb(ahc, SFUNCT, sfunct);
938 ahc->bus_softc.pci_softc.crccontrol1 =
939 ahc_inb(ahc, CRCCONTROL1);
941 if ((ahc->features & AHC_MULTI_FUNC) != 0)
942 ahc->bus_softc.pci_softc.scbbaddr = ahc_inb(ahc, SCBBADDR);
944 if ((ahc->features & AHC_ULTRA2) != 0)
945 ahc->bus_softc.pci_softc.dff_thrsh = ahc_inb(ahc, DFF_THRSH);
948 error = ahc_init(ahc);
951 ahc->init_level++;
956 return ahc_pci_map_int(ahc);
964 ahc_ext_scbram_present(struct ahc_softc *ahc)
971 chip = ahc->chip & AHC_CHIPID_MASK;
972 devconfig = ahc_pci_read_config(ahc->dev_softc,
976 if ((ahc->features & AHC_ULTRA2) != 0)
977 ramps = (ahc_inb(ahc, DSCOMMAND0) & RAMPS) != 0;
1000 ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck,
1005 if (ahc->features & AHC_MULTI_FUNC) {
1010 ahc_outb(ahc, SCBBADDR, ahc_get_pci_function(ahc->dev_softc));
1013 ahc->flags &= ~AHC_LSCBS_ENABLED;
1015 ahc->flags |= AHC_LSCBS_ENABLED;
1016 devconfig = ahc_pci_read_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4);
1017 if ((ahc->features & AHC_ULTRA2) != 0) {
1020 dscommand0 = ahc_inb(ahc, DSCOMMAND0);
1029 ahc_outb(ahc, DSCOMMAND0, dscommand0);
1049 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
1058 ahc_probe_ext_scbram(struct ahc_softc *ahc)
1073 if (ahc_ext_scbram_present(ahc) == 0)
1079 ahc_scbram_config(ahc, /*enable*/TRUE, pcheck, fast, large);
1080 num_scbs = ahc_probe_scbs(ahc);
1092 ahc_outb(ahc, SEQCTL, 0);
1093 ahc_outb(ahc, CLRINT, CLRPARERR);
1094 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1097 ahc_scbram_config(ahc, enable, /*pcheck*/TRUE, fast, large);
1098 num_scbs = ahc_probe_scbs(ahc);
1099 if ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
1100 || (ahc_inb(ahc, ERROR) & MPARERR) == 0)
1104 ahc_outb(ahc, CLRINT, CLRPARERR);
1105 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1108 ahc_scbram_config(ahc, enable, pcheck, /*fast*/TRUE, large);
1109 test_num_scbs = ahc_probe_scbs(ahc);
1111 && ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
1112 || (ahc_inb(ahc, ERROR) & MPARERR) == 0))
1119 if ((ahc->features & AHC_LARGE_SCBS) != 0) {
1120 ahc_scbram_config(ahc, enable, pcheck, fast, /*large*/TRUE);
1121 test_num_scbs = ahc_probe_scbs(ahc);
1132 ahc->flags |= AHC_SCB_BTT;
1141 ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
1143 ahc_outb(ahc, CLRINT, CLRPARERR);
1144 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1147 ahc_name(ahc), fast ? "fast" : "slow",
1151 ahc_scbram_config(ahc, enable, pcheck, fast, large);
1159 ahc_pci_test_register_access(struct ahc_softc *ahc)
1172 cmd = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/2);
1173 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
1184 hcntrl = ahc_inb(ahc, HCNTRL);
1195 ahc->flags |= AHC_NO_BIOS_INIT;
1207 ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
1208 while (ahc_is_paused(ahc) == 0)
1212 status1 = ahc_pci_read_config(ahc->dev_softc,
1214 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1216 ahc_outb(ahc, CLRINT, CLRPARERR);
1218 ahc_outb(ahc, SEQCTL, PERRORDIS);
1219 ahc_outb(ahc, SCBPTR, 0);
1220 ahc_outl(ahc, SCB_BASE, 0x5aa555aa);
1221 if (ahc_inl(ahc, SCB_BASE) != 0x5aa555aa)
1224 status1 = ahc_pci_read_config(ahc->dev_softc,
1233 status1 = ahc_pci_read_config(ahc->dev_softc,
1235 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1237 ahc_outb(ahc, CLRINT, CLRPARERR);
1238 ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
1239 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
1248 check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
1255 sd.sd_ahc = ahc;
1259 sc = ahc->seep_config;
1267 if (ahc->flags & AHC_LARGE_SEEPROM)
1279 have_seeprom = ahc_acquire_seeprom(ahc, &sd);
1283 printk("%s: Reading SEEPROM...", ahc_name(ahc));
1288 start_addr = 32 * (ahc->channel - 'A');
1312 ahc->flags |= AHC_LARGE_SEEPROM;
1323 ahc_outb(ahc, SCBPTR, 2);
1324 if (ahc_inb(ahc, SCB_BASE) == 'A'
1325 && ahc_inb(ahc, SCB_BASE + 1) == 'D'
1326 && ahc_inb(ahc, SCB_BASE + 2) == 'P'
1327 && ahc_inb(ahc, SCB_BASE + 3) == 'T') {
1336 *sc_data = ahc_inb(ahc, SRAM_BASE + j)
1337 | ahc_inb(ahc, SRAM_BASE + j + 1) << 8;
1341 ahc->flags |= AHC_SCB_CONFIG_USED;
1347 ahc_outb(ahc, CLRINT, CLRPARERR);
1348 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
1353 printk("%s: No SEEPROM available.\n", ahc_name(ahc));
1354 ahc->flags |= AHC_USEDEFAULTS;
1355 kfree(ahc->seep_config);
1356 ahc->seep_config = NULL;
1359 ahc_parse_pci_eeprom(ahc, sc);
1375 if ((ahc->features & AHC_SPIOCAP) != 0) {
1376 if ((ahc_inb(ahc, SPIOCAP) & SSPIOCPS) == 0)
1381 ahc->flags |= AHC_HAS_TERM_LOGIC;
1382 ahc_acquire_seeprom(ahc, &sd);
1383 configure_termination(ahc, &sd, sc->adapter_control, sxfrctl1);
1391 ahc_name(ahc),
1397 ahc_parse_pci_eeprom(struct ahc_softc *ahc, struct seeprom_config *sc)
1418 ahc->flags |= AHC_NEWEEPROM_FMT;
1431 if ((ahc->flags & AHC_NEWEEPROM_FMT) != 0) {
1443 if ((ahc->features & AHC_ULTRA2) != 0) {
1450 ahc_outb(ahc, TARG_OFFSET + i, offset);
1468 ahc_outb(ahc, TARG_SCSIRATE + i, scsirate);
1470 ahc->our_id = sc->brtime_id & CFSCSIID;
1472 scsi_conf = (ahc->our_id & 0x7);
1478 ahc->flags |= (sc->adapter_control & CFBOOTCHAN) >> CFBOOTCHANSHIFT;
1481 ahc->flags |= AHC_EXTENDED_TRANS_A;
1484 ahc->flags |= AHC_BIOS_ENABLED;
1485 if (ahc->features & AHC_ULTRA
1486 && (ahc->flags & AHC_NEWEEPROM_FMT) == 0) {
1498 devconfig = ahc_pci_read_config(ahc->dev_softc,
1503 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
1507 ahc_outb(ahc, SCSICONF, scsi_conf);
1508 ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
1509 ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
1510 ahc_outb(ahc, ULTRA_ENB, ultraenb & 0xff);
1511 ahc_outb(ahc, ULTRA_ENB + 1, (ultraenb >> 8) & 0xff);
1515 configure_termination(struct ahc_softc *ahc,
1537 || (ahc->features & AHC_NEW_TERMCTL) != 0) {
1552 if ((ahc->features & AHC_NEW_TERMCTL) != 0) {
1553 ahc_new_term_detect(ahc, &enableSEC_low,
1561 ahc_name(ahc));
1569 ahc_name(ahc));
1577 } else if ((ahc->features & AHC_SPIOCAP) != 0) {
1578 aic785X_cable_detect(ahc, &internal50_present,
1584 aic787X_cable_detect(ahc, &internal50_present,
1590 if ((ahc->features & AHC_WIDE) == 0)
1594 && (ahc->features & AHC_ULTRA2) == 0) {
1596 ahc_name(ahc),
1599 if ((ahc->features & AHC_WIDE) != 0)
1603 ahc_name(ahc),
1608 ahc_name(ahc), eeprom_present ? "is" : "not");
1610 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) {
1629 if ((ahc->features & AHC_ULTRA2) == 0
1636 "time!\n", ahc_name(ahc));
1648 if ((ahc->features & AHC_WIDE) != 0
1654 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
1656 "Enabled\n", ahc_name(ahc));
1659 "Enabled\n", ahc_name(ahc),
1668 if ((ahc->features & AHC_ULTRA2) != 0)
1673 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
1675 "Enabled\n", ahc_name(ahc));
1678 "Enabled\n", ahc_name(ahc),
1688 "Enabled\n", ahc_name(ahc));
1695 ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
1702 ahc_name(ahc));
1705 write_brdctl(ahc, brddat);
1713 ahc_name(ahc),
1714 (ahc->features & AHC_ULTRA2) ? "Primary "
1719 && (ahc->features & AHC_WIDE) != 0) {
1723 ahc_name(ahc),
1724 (ahc->features & AHC_ULTRA2)
1732 ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
1734 if ((ahc->features & AHC_WIDE) != 0)
1735 write_brdctl(ahc, brddat);
1741 ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low,
1754 brdctl = read_brdctl(ahc);
1763 aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
1776 write_brdctl(ahc, 0);
1783 brdctl = read_brdctl(ahc);
1791 write_brdctl(ahc, BRDDAT5);
1798 brdctl = read_brdctl(ahc);
1804 aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
1810 spiocap = ahc_inb(ahc, SPIOCAP);
1813 ahc_outb(ahc, SPIOCAP, spiocap);
1814 ahc_outb(ahc, BRDCTL, BRDRW|BRDCS);
1815 ahc_flush_device_writes(ahc);
1817 ahc_outb(ahc, BRDCTL, 0);
1818 ahc_flush_device_writes(ahc);
1820 brdctl = ahc_inb(ahc, BRDCTL);
1823 *eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) ? 1 : 0;
1827 ahc_acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd)
1831 if ((ahc->features & AHC_SPIOCAP) != 0
1832 && (ahc_inb(ahc, SPIOCAP) & SEEPROM) == 0)
1862 write_brdctl(struct ahc_softc *ahc, uint8_t value)
1866 if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
1868 if (ahc->channel == 'B')
1870 } else if ((ahc->features & AHC_ULTRA2) != 0) {
1875 ahc_outb(ahc, BRDCTL, brdctl);
1876 ahc_flush_device_writes(ahc);
1878 ahc_outb(ahc, BRDCTL, brdctl);
1879 ahc_flush_device_writes(ahc);
1880 if ((ahc->features & AHC_ULTRA2) != 0)
1884 ahc_outb(ahc, BRDCTL, brdctl);
1885 ahc_flush_device_writes(ahc);
1886 if ((ahc->features & AHC_ULTRA2) != 0)
1890 ahc_outb(ahc, BRDCTL, brdctl);
1894 read_brdctl(struct ahc_softc *ahc)
1899 if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
1901 if (ahc->channel == 'B')
1903 } else if ((ahc->features & AHC_ULTRA2) != 0) {
1908 ahc_outb(ahc, BRDCTL, brdctl);
1909 ahc_flush_device_writes(ahc);
1910 value = ahc_inb(ahc, BRDCTL);
1911 ahc_outb(ahc, BRDCTL, 0);
1916 ahc_pci_intr(struct ahc_softc *ahc)
1921 error = ahc_inb(ahc, ERROR);
1925 status1 = ahc_pci_read_config(ahc->dev_softc,
1929 ahc_name(ahc),
1930 ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
1933 ahc->pci_target_perr_count++;
1935 "or write data phase\n", ahc_name(ahc));
1938 printk("%s: Signal System Error Detected\n", ahc_name(ahc));
1941 printk("%s: Received a Master Abort\n", ahc_name(ahc));
1944 printk("%s: Received a Target Abort\n", ahc_name(ahc));
1947 printk("%s: Signaled a Target Abort\n", ahc_name(ahc));
1951 ahc_name(ahc));
1955 ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
1960 "no status bits set\n", ahc_name(ahc));
1962 ahc_outb(ahc, CLRINT, CLRPARERR);
1965 if (ahc->pci_target_perr_count > AHC_PCI_TARGET_PERR_THRESH) {
1973 ahc_name(ahc), ahc_name(ahc), ahc_name(ahc),
1974 ahc_name(ahc), ahc_name(ahc), ahc_name(ahc));
1975 ahc->seqctl |= FAILDIS;
1976 ahc_outb(ahc, SEQCTL, ahc->seqctl);
1978 ahc_unpause(ahc);
1982 ahc_pci_chip_init(struct ahc_softc *ahc)
1984 ahc_outb(ahc, DSCOMMAND0, ahc->bus_softc.pci_softc.dscommand0);
1985 ahc_outb(ahc, DSPCISTATUS, ahc->bus_softc.pci_softc.dspcistatus);
1986 if ((ahc->features & AHC_DT) != 0) {
1989 sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
1990 ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
1991 ahc_outb(ahc, OPTIONMODE, ahc->bus_softc.pci_softc.optionmode);
1992 ahc_outw(ahc, TARGCRCCNT, ahc->bus_softc.pci_softc.targcrccnt);
1993 ahc_outb(ahc, SFUNCT, sfunct);
1994 ahc_outb(ahc, CRCCONTROL1,
1995 ahc->bus_softc.pci_softc.crccontrol1);
1997 if ((ahc->features & AHC_MULTI_FUNC) != 0)
1998 ahc_outb(ahc, SCBBADDR, ahc->bus_softc.pci_softc.scbbaddr);
2000 if ((ahc->features & AHC_ULTRA2) != 0)
2001 ahc_outb(ahc, DFF_THRSH, ahc->bus_softc.pci_softc.dff_thrsh);
2003 return (ahc_chip_init(ahc));
2008 ahc_pci_resume(struct ahc_softc *ahc)
2016 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
2017 ahc->bus_softc.pci_softc.devconfig, /*bytes*/4);
2018 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
2019 ahc->bus_softc.pci_softc.command, /*bytes*/1);
2020 ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
2021 ahc->bus_softc.pci_softc.csize_lattime, /*bytes*/1);
2022 if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) {
2026 sd.sd_ahc = ahc;
2031 ahc_acquire_seeprom(ahc, &sd);
2032 configure_termination(ahc, &sd,
2033 ahc->seep_config->adapter_control,
2041 ahc_aic785X_setup(struct ahc_softc *ahc)
2046 pci = ahc->dev_softc;
2047 ahc->channel = 'A';
2048 ahc->chip = AHC_AIC7850;
2049 ahc->features = AHC_AIC7850_FE;
2050 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2053 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
2054 ahc->instruction_ram_size = 512;
2059 ahc_aic7860_setup(struct ahc_softc *ahc)
2064 pci = ahc->dev_softc;
2065 ahc->channel = 'A';
2066 ahc->chip = AHC_AIC7860;
2067 ahc->features = AHC_AIC7860_FE;
2068 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2071 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
2072 ahc->instruction_ram_size = 512;
2077 ahc_apa1480_setup(struct ahc_softc *ahc)
2081 error = ahc_aic7860_setup(ahc);
2084 ahc->features |= AHC_REMOVABLE;
2089 ahc_aic7870_setup(struct ahc_softc *ahc)
2092 ahc->channel = 'A';
2093 ahc->chip = AHC_AIC7870;
2094 ahc->features = AHC_AIC7870_FE;
2095 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2096 ahc->instruction_ram_size = 512;
2101 ahc_aic7870h_setup(struct ahc_softc *ahc)
2103 int error = ahc_aic7870_setup(ahc);
2105 ahc->features |= AHC_HVD;
2111 ahc_aha394X_setup(struct ahc_softc *ahc)
2115 error = ahc_aic7870_setup(ahc);
2117 error = ahc_aha394XX_setup(ahc);
2122 ahc_aha394Xh_setup(struct ahc_softc *ahc)
2124 int error = ahc_aha394X_setup(ahc);
2126 ahc->features |= AHC_HVD;
2132 ahc_aha398X_setup(struct ahc_softc *ahc)
2136 error = ahc_aic7870_setup(ahc);
2138 error = ahc_aha398XX_setup(ahc);
2143 ahc_aha494X_setup(struct ahc_softc *ahc)
2147 error = ahc_aic7870_setup(ahc);
2149 error = ahc_aha494XX_setup(ahc);
2154 ahc_aha494Xh_setup(struct ahc_softc *ahc)
2156 int error = ahc_aha494X_setup(ahc);
2158 ahc->features |= AHC_HVD;
2164 ahc_aic7880_setup(struct ahc_softc *ahc)
2169 pci = ahc->dev_softc;
2170 ahc->channel = 'A';
2171 ahc->chip = AHC_AIC7880;
2172 ahc->features = AHC_AIC7880_FE;
2173 ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
2176 ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
2178 ahc->bugs |= AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
2180 ahc->instruction_ram_size = 512;
2185 ahc_aic7880h_setup(struct ahc_softc *ahc)
2187 int error = ahc_aic7880_setup(ahc);
2189 ahc->features |= AHC_HVD;
2196 ahc_aha2940Pro_setup(struct ahc_softc *ahc)
2199 ahc->flags |= AHC_INT50_SPEEDFLEX;
2200 return (ahc_aic7880_setup(ahc));
2204 ahc_aha394XU_setup(struct ahc_softc *ahc)
2208 error = ahc_aic7880_setup(ahc);
2210 error = ahc_aha394XX_setup(ahc);
2215 ahc_aha394XUh_setup(struct ahc_softc *ahc)
2217 int error = ahc_aha394XU_setup(ahc);
2219 ahc->features |= AHC_HVD;
2225 ahc_aha398XU_setup(struct ahc_softc *ahc)
2229 error = ahc_aic7880_setup(ahc);
2231 error = ahc_aha398XX_setup(ahc);
2236 ahc_aic7890_setup(struct ahc_softc *ahc)
2241 pci = ahc->dev_softc;
2242 ahc->channel = 'A';
2243 ahc->chip = AHC_AIC7890;
2244 ahc->features = AHC_AIC7890_FE;
2245 ahc->flags |= AHC_NEWEEPROM_FMT;
2248 ahc->bugs |= AHC_AUTOFLUSH_BUG|AHC_CACHETHEN_BUG;
2249 ahc->instruction_ram_size = 768;
2254 ahc_aic7892_setup(struct ahc_softc *ahc)
2257 ahc->channel = 'A';
2258 ahc->chip = AHC_AIC7892;
2259 ahc->features = AHC_AIC7892_FE;
2260 ahc->flags |= AHC_NEWEEPROM_FMT;
2261 ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
2262 ahc->instruction_ram_size = 1024;
2267 ahc_aic7895_setup(struct ahc_softc *ahc)
2272 pci = ahc->dev_softc;
2273 ahc->channel = ahc_get_pci_function(pci) == 1 ? 'B' : 'A';
2279 ahc->chip = AHC_AIC7895C;
2280 ahc->features = AHC_AIC7895C_FE;
2284 ahc->chip = AHC_AIC7895;
2285 ahc->features = AHC_AIC7895_FE;
2290 ahc->bugs |= AHC_PCI_MWI_BUG;
2292 ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_PCI_2_1_RETRY_BUG
2295 ahc->flags |= AHC_NEWEEPROM_FMT;
2296 ahc->instruction_ram_size = 512;
2301 ahc_aic7895h_setup(struct ahc_softc *ahc)
2303 int error = ahc_aic7895_setup(ahc);
2305 ahc->features |= AHC_HVD;
2311 ahc_aic7896_setup(struct ahc_softc *ahc)
2315 pci = ahc->dev_softc;
2316 ahc->channel = ahc_get_pci_function(pci) == 1 ? 'B' : 'A';
2317 ahc->chip = AHC_AIC7896;
2318 ahc->features = AHC_AIC7896_FE;
2319 ahc->flags |= AHC_NEWEEPROM_FMT;
2320 ahc->bugs |= AHC_CACHETHEN_DIS_BUG;
2321 ahc->instruction_ram_size = 768;
2326 ahc_aic7899_setup(struct ahc_softc *ahc)
2330 pci = ahc->dev_softc;
2331 ahc->channel = ahc_get_pci_function(pci) == 1 ? 'B' : 'A';
2332 ahc->chip = AHC_AIC7899;
2333 ahc->features = AHC_AIC7899_FE;
2334 ahc->flags |= AHC_NEWEEPROM_FMT;
2335 ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
2336 ahc->instruction_ram_size = 1024;
2341 ahc_aha29160C_setup(struct ahc_softc *ahc)
2345 error = ahc_aic7899_setup(ahc);
2348 ahc->features |= AHC_REMOVABLE;
2353 ahc_raid_setup(struct ahc_softc *ahc)
2360 ahc_aha394XX_setup(struct ahc_softc *ahc)
2364 pci = ahc->dev_softc;
2367 ahc->channel = 'A';
2370 ahc->channel = 'B';
2376 ahc->channel = 'A';
2382 ahc_aha398XX_setup(struct ahc_softc *ahc)
2386 pci = ahc->dev_softc;
2389 ahc->channel = 'A';
2392 ahc->channel = 'B';
2395 ahc->channel = 'C';
2401 ahc->channel = 'A';
2404 ahc->flags |= AHC_LARGE_SEEPROM;
2409 ahc_aha494XX_setup(struct ahc_softc *ahc)
2413 pci = ahc->dev_softc;
2416 ahc->channel = 'A';
2419 ahc->channel = 'B';
2422 ahc->channel = 'C';
2425 ahc->channel = 'D';
2431 ahc->channel = 'A';
2433 ahc->flags |= AHC_LARGE_SEEPROM;