cp = cy_pci_lookup(pa);
if (cp == NULL)
panic("cy_pci_attach: impossible");
aprint_normal(": Cyclades-Y multiport serial\n");
if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_IO, 0,
&psc->sc_iot, &psc->sc_ioh, NULL, NULL) != 0) {
aprint_error_dev(sc->sc_dev, "unable to map PLX registers\n");
return;
}
if (pci_mapreg_map(pa, 0x18, cp->cp_memtype, 0,
&sc->sc_memt, &sc->sc_bsh, NULL, NULL) != 0) {
aprint_error_dev(sc->sc_dev,
"unable to map device registers\n");
return;
}
if (cy_find(sc) == 0) {
aprint_error_dev(sc->sc_dev, "unable to find CD1400s\n");
return;
}
/*
* XXX Like the Cyclades-Z, we should really check the EEPROM to
* determine the "poll or interrupt" setting. For now, we always
* map the interrupt and enable it in the PLX.
*/
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih) != 0) {
aprint_error_dev(sc->sc_dev, "unable to map interrupt\n");
return;
}
intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
sc->sc_ih = pci_intr_establish_xname(pa->pa_pc, ih, IPL_TTY, cy_intr,
sc, device_xname(self));
if (sc->sc_ih == NULL) {
aprint_error_dev(sc->sc_dev, "unable to establish interrupt");
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
return;
}
aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);