static int apecs_attach(device_t dev) { struct apecs_softc* sc = APECS_SOFTC(dev); apecs_init(); /* * the avanti routes interrupts through the isa interrupt * controller, so we need to special case it */ if(hwrpb->rpb_type == ST_DEC_2100_A50) chipset.intrdev = isa0; else chipset.intrdev = apecs0; sc->dmem_base = APECS_PCI_DENSE; sc->smem_base = APECS_PCI_SPARSE; sc->io_base = APECS_PCI_SIO; sc->cfg0_base = KV(APECS_PCI_CONF); sc->cfg1_base = NULL; set_iointr(alpha_dispatch_intr); snprintf(chipset_type, sizeof(chipset_type), "apecs"); chipset_bwx = 0; chipset_ports = APECS_PCI_SIO; chipset_memory = APECS_PCI_SPARSE; chipset_dense = APECS_PCI_DENSE; chipset_hae_mask = EPIC_HAXR1_EADDR; bus_generic_attach(dev); return 0; }
static void dec_2100_a50_cons_init() { struct ctb *ctb; struct apecs_config *acp; extern struct apecs_config apecs_configuration; acp = &apecs_configuration; apecs_init(acp, 0); ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case CTB_PRINTERPORT: /* serial console ... */ /* XXX */ { /* * Delay to allow PROM putchars to complete. * FIFO depth * character time, * character time = (1000000 / (defaultrate / 10)) */ DELAY(160000000 / comcnrate); if(comcnattach(&acp->ac_iot, 0x3f8, comcnrate, COM_FREQ, (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8)) panic("can't init serial console"); break; } case CTB_GRAPHICS: #if NPCKBD > 0 /* display console ... */ /* XXX */ (void) pckbc_cnattach(&acp->ac_iot, IO_KBD, KBCMDP, PCKBC_KBD_SLOT); if (CTB_TURBOSLOT_TYPE(ctb->ctb_turboslot) == CTB_TURBOSLOT_TYPE_ISA) isa_display_console(&acp->ac_iot, &acp->ac_memt); else pci_display_console(&acp->ac_iot, &acp->ac_memt, &acp->ac_pc, CTB_TURBOSLOT_BUS(ctb->ctb_turboslot), CTB_TURBOSLOT_SLOT(ctb->ctb_turboslot), 0); #else panic("not configured to use display && keyboard console"); #endif break; default: printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type); printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot); panic("consinit: unknown console type %ld", ctb->ctb_term_type); } }
void dec_1000a_cons_init() { struct ctb *ctb; struct cia_config *ccp; struct apecs_config *acp; extern struct cia_config cia_configuration; extern struct apecs_config apecs_configuration; bus_space_tag_t iot, memt; struct alpha_pci_chipset *pcichipset; if(strcmp(platform.iobus, "cia") == 0) { ccp = &cia_configuration; cia_init(ccp, 0); iot = &ccp->cc_iot; memt = &ccp->cc_memt; pcichipset = &ccp->cc_pc; } else { acp = &apecs_configuration; apecs_init(acp, 0); iot = &acp->ac_iot; memt = &acp->ac_memt; pcichipset = &acp->ac_pc; } ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case CTB_PRINTERPORT: /* serial console ... */ /* XXX */ { /* * Delay to allow PROM putchars to complete. * FIFO depth * character time, * character time = (1000000 / (defaultrate / 10)) */ DELAY(160000000 / comcnrate); if(comcnattach(iot, 0x3f8, comcnrate, COM_FREQ, (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8)) panic("can't init serial console"); break; } case CTB_GRAPHICS: #if NPCKBD > 0 /* display console ... */ /* XXX */ (void) pckbc_cnattach(iot, IO_KBD, KBCMDP, PCKBC_KBD_SLOT); /* * AlphaServer 1000s have a firmware bug whereby the * built-in ISA VGA is reported incorrectly -- ctb_turboslot * is mostly 0. */ switch (CTB_TURBOSLOT_TYPE(ctb->ctb_turboslot)) { case CTB_TURBOSLOT_TYPE_PCI: pci_display_console(iot, memt, pcichipset, CTB_TURBOSLOT_BUS(ctb->ctb_turboslot), CTB_TURBOSLOT_SLOT(ctb->ctb_turboslot), 0); break; default: isa_display_console(iot, memt); break; } #else panic("not configured to use display && keyboard console"); #endif break; default: printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type); printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot); panic("consinit: unknown console type %ld", ctb->ctb_term_type); } #ifdef KGDB /* Attach the KGDB device. */ alpha_kgdb_init(kgdb_devlist, iot); #endif /* KGDB */ }