Lines Matching refs:ahc

56 static int aic7770_chip_init(struct ahc_softc *ahc);
57 static int aha2840_load_seeprom(struct ahc_softc *ahc);
119 aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io) in aic7770_config() argument
127 error = entry->setup(ahc); in aic7770_config()
132 error = aic7770_map_registers(ahc, io); in aic7770_config()
142 ahc_intr_enable(ahc, FALSE); in aic7770_config()
144 ahc->description = entry->name; in aic7770_config()
145 error = ahc_softc_init(ahc); in aic7770_config()
149 ahc->bus_chip_init = aic7770_chip_init; in aic7770_config()
151 error = ahc_reset(ahc, /*reinit*/FALSE); in aic7770_config()
156 intdef = ahc_inb(ahc, INTDEF); in aic7770_config()
172 ahc->flags |= AHC_EDGE_INTERRUPT; in aic7770_config()
174 switch (ahc->chip & (AHC_EISA|AHC_VL)) { in aic7770_config()
181 biosctrl = ahc_inb(ahc, HA_274_BIOSCTRL); in aic7770_config()
182 scsiconf = ahc_inb(ahc, SCSICONF); in aic7770_config()
183 scsiconf1 = ahc_inb(ahc, SCSICONF + 1); in aic7770_config()
187 ahc->flags |= 1; in aic7770_config()
190 ahc->flags |= AHC_USEDEFAULTS; in aic7770_config()
192 if ((ahc->features & AHC_WIDE) != 0) { in aic7770_config()
193 ahc->our_id = scsiconf1 & HWSCSIID; in aic7770_config()
195 ahc->flags |= AHC_TERM_ENB_A; in aic7770_config()
197 ahc->our_id = scsiconf & HSCSIID; in aic7770_config()
198 ahc->our_id_b = scsiconf1 & HSCSIID; in aic7770_config()
200 ahc->flags |= AHC_TERM_ENB_A; in aic7770_config()
202 ahc->flags |= AHC_TERM_ENB_B; in aic7770_config()
205 if ((ahc_inb(ahc, HA_274_BIOSGLOBAL) & HA_274_EXTENDED_TRANS)) in aic7770_config()
206 ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B; in aic7770_config()
211 have_seeprom = aha2840_load_seeprom(ahc); in aic7770_config()
218 kfree(ahc->seep_config); in aic7770_config()
219 ahc->seep_config = NULL; in aic7770_config()
225 ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~AUTOFLUSHDIS); in aic7770_config()
228 hostconf = ahc_inb(ahc, HOSTCONF); in aic7770_config()
229 ahc_outb(ahc, BUSSPD, hostconf & DFTHRSH); in aic7770_config()
230 ahc_outb(ahc, BUSTIME, (hostconf << 2) & BOFF); in aic7770_config()
232 ahc->bus_softc.aic7770_softc.busspd = hostconf & DFTHRSH; in aic7770_config()
233 ahc->bus_softc.aic7770_softc.bustime = (hostconf << 2) & BOFF; in aic7770_config()
238 error = ahc_init(ahc); in aic7770_config()
242 error = aic7770_map_int(ahc, irq); in aic7770_config()
246 ahc->init_level++; in aic7770_config()
251 ahc_outb(ahc, BCTL, ENABLE); in aic7770_config()
256 aic7770_chip_init(struct ahc_softc *ahc) in aic7770_chip_init() argument
258 ahc_outb(ahc, BUSSPD, ahc->bus_softc.aic7770_softc.busspd); in aic7770_chip_init()
259 ahc_outb(ahc, BUSTIME, ahc->bus_softc.aic7770_softc.bustime); in aic7770_chip_init()
260 ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~AUTOFLUSHDIS); in aic7770_chip_init()
261 ahc_outb(ahc, BCTL, ENABLE); in aic7770_chip_init()
262 return (ahc_chip_init(ahc)); in aic7770_chip_init()
269 aha2840_load_seeprom(struct ahc_softc *ahc) in aha2840_load_seeprom() argument
276 sd.sd_ahc = ahc; in aha2840_load_seeprom()
287 sc = ahc->seep_config; in aha2840_load_seeprom()
290 printk("%s: Reading SEEPROM...", ahc_name(ahc)); in aha2840_load_seeprom()
307 printk("%s: No SEEPROM available\n", ahc_name(ahc)); in aha2840_load_seeprom()
308 ahc->flags |= AHC_USEDEFAULTS; in aha2840_load_seeprom()
318 max_targ = (ahc->features & AHC_WIDE) != 0 ? 16 : 8; in aha2840_load_seeprom()
330 ahc_outb(ahc, TARG_SCSIRATE + i, target_settings); in aha2840_load_seeprom()
332 ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff)); in aha2840_load_seeprom()
333 ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff)); in aha2840_load_seeprom()
335 ahc->our_id = sc->brtime_id & CFSCSIID; in aha2840_load_seeprom()
337 scsi_conf = (ahc->our_id & 0x7); in aha2840_load_seeprom()
344 ahc->flags |= AHC_EXTENDED_TRANS_A; in aha2840_load_seeprom()
346 ahc_outb(ahc, SCSICONF, scsi_conf); in aha2840_load_seeprom()
349 ahc->flags |= AHC_TERM_ENB_A; in aha2840_load_seeprom()
355 ahc_aic7770_VL_setup(struct ahc_softc *ahc) in ahc_aic7770_VL_setup() argument
359 error = ahc_aic7770_setup(ahc); in ahc_aic7770_VL_setup()
360 ahc->chip |= AHC_VL; in ahc_aic7770_VL_setup()
365 ahc_aic7770_EISA_setup(struct ahc_softc *ahc) in ahc_aic7770_EISA_setup() argument
369 error = ahc_aic7770_setup(ahc); in ahc_aic7770_EISA_setup()
370 ahc->chip |= AHC_EISA; in ahc_aic7770_EISA_setup()
375 ahc_aic7770_setup(struct ahc_softc *ahc) in ahc_aic7770_setup() argument
377 ahc->channel = 'A'; in ahc_aic7770_setup()
378 ahc->channel_b = 'B'; in ahc_aic7770_setup()
379 ahc->chip = AHC_AIC7770; in ahc_aic7770_setup()
380 ahc->features = AHC_AIC7770_FE; in ahc_aic7770_setup()
381 ahc->bugs |= AHC_TMODE_WIDEODD_BUG; in ahc_aic7770_setup()
382 ahc->flags |= AHC_PAGESCBS; in ahc_aic7770_setup()
383 ahc->instruction_ram_size = 448; in ahc_aic7770_setup()