Home | History | Annotate | Download | only in ic

Lines Matching refs:ahc

97 ahc_check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
104 sd.sd_tag = ahc->tag;
105 sd.sd_bsh = ahc->bsh;
110 sc = ahc->seep_config;
118 if (ahc->flags & AHC_LARGE_SEEPROM)
130 have_seeprom = ahc_acquire_seeprom(ahc, &sd);
134 printf("%s: Reading SEEPROM...", ahc_name(ahc));
139 start_addr = 32 * (ahc->channel - 'A');
169 ahc_outb(ahc, SCBPTR, 2);
170 if (ahc_inb(ahc, SCB_BASE) == 'A'
171 && ahc_inb(ahc, SCB_BASE + 1) == 'D'
172 && ahc_inb(ahc, SCB_BASE + 2) == 'P'
173 && ahc_inb(ahc, SCB_BASE + 3) == 'T') {
182 *sc_data = ahc_inb(ahc, SRAM_BASE + j)
183 | ahc_inb(ahc, SRAM_BASE + j + 1) << 8;
187 ahc->flags |= AHC_SCB_CONFIG_USED;
193 ahc_outb(ahc, CLRINT, CLRPARERR);
194 ahc_outb(ahc, CLRINT, CLRBRKADRINT);
199 printf("%s: No SEEPROM available.\n", ahc_name(ahc));
200 ahc->flags |= AHC_USEDEFAULTS;
201 free(ahc->seep_config, M_DEVBUF);
202 ahc->seep_config = NULL;
205 ahc_parse_pci_eeprom(ahc, sc);
221 if ((ahc->features & AHC_SPIOCAP) != 0) {
222 if ((ahc_inb(ahc, SPIOCAP) & SSPIOCPS) == 0)
227 ahc_acquire_seeprom(ahc, &sd);
228 configure_termination(ahc, &sd, sc->adapter_control, sxfrctl1);
236 ahc_name(ahc),
242 ahc_parse_pci_eeprom(struct ahc_softc *ahc, struct seeprom_config *sc)
263 ahc->flags |= AHC_NEWEEPROM_FMT;
276 if ((ahc->flags & AHC_NEWEEPROM_FMT) != 0) {
288 if ((ahc->features & AHC_ULTRA2) != 0) {
295 ahc_outb(ahc, TARG_OFFSET + i, offset);
313 ahc_outb(ahc, TARG_SCSIRATE + i, scsirate);
315 ahc->our_id = sc->brtime_id & CFSCSIID;
317 scsi_conf = (ahc->our_id & 0x7);
323 ahc->flags |= (sc->adapter_control & CFBOOTCHAN) >> CFBOOTCHANSHIFT;
326 ahc->flags |= AHC_EXTENDED_TRANS_A;
329 ahc->flags |= AHC_BIOS_ENABLED;
330 if (ahc->features & AHC_ULTRA
331 && (ahc->flags & AHC_NEWEEPROM_FMT) == 0) {
343 devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
347 pci_conf_write(ahc->bd->pc, ahc->bd->tag, DEVCONFIG, devconfig);
350 ahc_outb(ahc, SCSICONF, scsi_conf);
351 ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
352 ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
353 ahc_outb(ahc, ULTRA_ENB, ultraenb & 0xff);
354 ahc_outb(ahc, ULTRA_ENB + 1, (ultraenb >> 8) & 0xff);
358 configure_termination(struct ahc_softc *ahc,
380 || (ahc->features & AHC_NEW_TERMCTL) != 0) {
395 if ((ahc->features & AHC_NEW_TERMCTL) != 0) {
396 ahc_new_term_detect(ahc, &enableSEC_low,
404 ahc_name(ahc));
412 ahc_name(ahc));
420 } else if ((ahc->features & AHC_SPIOCAP) != 0) {
421 aic785X_cable_detect(ahc, &internal50_present,
427 aic787X_cable_detect(ahc, &internal50_present,
433 if ((ahc->features & AHC_WIDE) == 0)
437 && (ahc->features & AHC_ULTRA2) == 0) {
439 ahc_name(ahc),
442 if ((ahc->features & AHC_WIDE) != 0)
446 ahc_name(ahc),
451 ahc_name(ahc), eeprom_present ? "is" : "not");
453 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) {
472 if ((ahc->features & AHC_ULTRA2) == 0
479 "time!\n", ahc_name(ahc));
491 if ((ahc->features & AHC_WIDE) != 0
497 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
499 "Enabled\n", ahc_name(ahc));
502 "Enabled\n", ahc_name(ahc),
511 if ((ahc->features & AHC_ULTRA2) != 0)
516 if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
518 "Enabled\n", ahc_name(ahc));
521 "Enabled\n", ahc_name(ahc),
531 "Enabled\n", ahc_name(ahc));
538 ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
545 ahc_name(ahc));
548 write_brdctl(ahc, brddat);
556 ahc_name(ahc),
557 (ahc->features & AHC_ULTRA2) ? "Primary "
562 && (ahc->features & AHC_WIDE) != 0) {
566 ahc_name(ahc),
567 (ahc
575 ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
577 if ((ahc->features & AHC_WIDE) != 0)
578 write_brdctl(ahc, brddat);
584 ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low,
597 brdctl = read_brdctl(ahc);
606 aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
619 write_brdctl(ahc, 0);
626 brdctl = read_brdctl(ahc);
634 write_brdctl(ahc, BRDDAT5);
641 brdctl = read_brdctl(ahc);
647 aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
653 spiocap = ahc_inb(ahc, SPIOCAP);
656 ahc_outb(ahc, SPIOCAP, spiocap);
657 ahc_outb(ahc, BRDCTL, BRDRW|BRDCS);
658 ahc_outb(ahc, BRDCTL, 0);
659 brdctl = ahc_inb(ahc, BRDCTL);
663 *eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) ? 1 : 0;
667 ahc_acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd)
671 if ((ahc->features & AHC_SPIOCAP) != 0
672 && (ahc_inb(ahc, SPIOCAP) & SEEPROM) == 0)
702 write_brdctl(struct ahc_softc *ahc, uint8_t value)
706 if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
708 if (ahc->channel == 'B')
710 } else if ((ahc->features & AHC_ULTRA2) != 0) {
715 ahc_outb(ahc, BRDCTL, brdctl);
716 ahc_flush_device_writes(ahc);
718 ahc_outb(ahc, BRDCTL, brdctl);
719 ahc_flush_device_writes(ahc);
720 if ((ahc->features & AHC_ULTRA2) != 0)
724 ahc_outb(ahc, BRDCTL, brdctl);
725 ahc_flush_device_writes(ahc);
726 if ((ahc->features & AHC_ULTRA2) != 0)
730 ahc_outb(ahc, BRDCTL, brdctl);
734 read_brdctl(struct ahc_softc *ahc)
739 if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
741 if (ahc->channel == 'B')
743 } else if ((ahc->features & AHC_ULTRA2) != 0) {
748 ahc_outb(ahc, BRDCTL, brdctl);
749 ahc_flush_device_writes(ahc);
750 value = ahc_inb(ahc, BRDCTL);
751 ahc_outb(ahc, BRDCTL, 0);