Lines Matching defs:ahc

62 static int aic7770_chip_init(struct ahc_softc *ahc);
63 static int aic7770_suspend(struct ahc_softc *ahc);
64 static int aic7770_resume(struct ahc_softc *ahc);
65 static int aha2840_load_seeprom(struct ahc_softc *ahc);
127 aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
135 error = entry->setup(ahc);
140 error = aic7770_map_registers(ahc, io);
150 ahc_intr_enable(ahc, FALSE);
152 ahc->description = entry->name;
153 error = ahc_softc_init(ahc);
157 ahc->bus_chip_init = aic7770_chip_init;
158 ahc->bus_suspend = aic7770_suspend;
159 ahc->bus_resume = aic7770_resume;
161 error = ahc_reset(ahc, /*reinit*/FALSE);
166 intdef = ahc_inb(ahc, INTDEF);
182 ahc->flags |= AHC_EDGE_INTERRUPT;
184 switch (ahc->chip & (AHC_EISA|AHC_VL)) {
191 biosctrl = ahc_inb(ahc, HA_274_BIOSCTRL);
192 scsiconf = ahc_inb(ahc, SCSICONF);
193 scsiconf1 = ahc_inb(ahc, SCSICONF + 1);
197 ahc->flags |= 1;
200 ahc->flags |= AHC_USEDEFAULTS;
202 if ((ahc->features & AHC_WIDE) != 0) {
203 ahc->our_id = scsiconf1 & HWSCSIID;
205 ahc->flags |= AHC_TERM_ENB_A;
207 ahc->our_id = scsiconf & HSCSIID;
208 ahc->our_id_b = scsiconf1 & HSCSIID;
210 ahc->flags |= AHC_TERM_ENB_A;
212 ahc->flags |= AHC_TERM_ENB_B;
215 if ((ahc_inb(ahc, HA_274_BIOSGLOBAL) & HA_274_EXTENDED_TRANS))
216 ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B;
221 have_seeprom = aha2840_load_seeprom(ahc);
228 free(ahc->seep_config, M_DEVBUF);
229 ahc->seep_config = NULL;
235 ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~AUTOFLUSHDIS);
238 hostconf = ahc_inb(ahc, HOSTCONF);
239 ahc_outb(ahc, BUSSPD, hostconf & DFTHRSH);
240 ahc_outb(ahc, BUSTIME, (hostconf << 2) & BOFF);
242 ahc->bus_softc.aic7770_softc.busspd = hostconf & DFTHRSH;
243 ahc->bus_softc.aic7770_softc.bustime = (hostconf << 2) & BOFF;
248 error = ahc_init(ahc);
252 error = aic7770_map_int(ahc, irq);
256 ahc_lock(ahc);
258 * Link this softc in with all other ahc instances.
260 ahc_softc_insert(ahc);
265 ahc_outb(ahc, BCTL, ENABLE);
267 ahc_unlock(ahc);
273 aic7770_chip_init(struct ahc_softc *ahc)
275 ahc_outb(ahc, BUSSPD, ahc->bus_softc.aic7770_softc.busspd);
276 ahc_outb(ahc, BUSTIME, ahc->bus_softc.aic7770_softc.bustime);
277 ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~AUTOFLUSHDIS);
278 ahc_outb(ahc, BCTL, ENABLE);
279 return (ahc_chip_init(ahc));
283 aic7770_suspend(struct ahc_softc *ahc)
285 return (ahc_suspend(ahc));
289 aic7770_resume(struct ahc_softc *ahc)
291 return (ahc_resume(ahc));
298 aha2840_load_seeprom(struct ahc_softc *ahc)
305 sd.sd_ahc = ahc;
316 sc = ahc->seep_config;
319 printf("%s: Reading SEEPROM...", ahc_name(ahc));
336 printf("%s: No SEEPROM available\n", ahc_name(ahc));
337 ahc->flags |= AHC_USEDEFAULTS;
347 max_targ = (ahc->features & AHC_WIDE) != 0 ? 16 : 8;
359 ahc_outb(ahc, TARG_SCSIRATE + i, target_settings);
361 ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
362 ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
364 ahc->our_id = sc->brtime_id & CFSCSIID;
366 scsi_conf = (ahc->our_id & 0x7);
373 ahc->flags |= AHC_EXTENDED_TRANS_A;
375 ahc_outb(ahc, SCSICONF, scsi_conf);
378 ahc->flags |= AHC_TERM_ENB_A;
384 ahc_aic7770_VL_setup(struct ahc_softc *ahc)
388 error = ahc_aic7770_setup(ahc);
389 ahc->chip |= AHC_VL;
394 ahc_aic7770_EISA_setup(struct ahc_softc *ahc)
398 error = ahc_aic7770_setup(ahc);
399 ahc->chip |= AHC_EISA;
404 ahc_aic7770_setup(struct ahc_softc *ahc)
406 ahc->channel = 'A';
407 ahc->channel_b = 'B';
408 ahc->chip = AHC_AIC7770;
409 ahc->features = AHC_AIC7770_FE;
410 ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
411 ahc->flags |= AHC_PAGESCBS;
412 ahc->instruction_ram_size = 448;