diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 1996-06-22 23:12:15 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 1996-06-22 23:12:15 +0000 |
commit | 8459d4b1b2d36b677790b8d39938b2f9130e286d (patch) | |
tree | 21dd6cc1108a306ca216c987461dac18f289010a /sys | |
parent | 24168a5e98557174d294e165aaac628d739c9505 (diff) |
Pica bus support added
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/com.c | 44 | ||||
-rw-r--r-- | sys/dev/isa/com.c | 44 |
2 files changed, 86 insertions, 2 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index f150dee595f..d20b35a31c5 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.17 1996/06/10 19:29:59 niklas Exp $ */ +/* $OpenBSD: com.c,v 1.18 1996/06/22 23:12:14 pefo Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /*- @@ -158,6 +158,15 @@ struct cfattach com_commulti_ca = { }; #endif +#if NCOM_PICA +#undef CONADDR /* This is stupid but using devs before config .. */ +#define CONADDR 0xe0006000 + +struct cfattach com_pica_ca = { + sizeof(struct com_softc), comprobe, comattach +}; +#endif + struct cfdriver com_cd = { NULL, "com", DV_TTY @@ -525,6 +534,10 @@ comprobe(parent, match, aux) #define IS_ISA(parent) \ !strcmp((parent)->dv_cfdata->cf_driver->cd_name, "isa") #endif +#if NCOM_PICA +#define IS_PICA(parent) \ + !strcmp((parent)->dv_cfdata->cf_driver->cd_name, "pica") +#endif /* * XXX should be broken out into functions for isa probe and * XXX for commulti probe, with a helper function that contains @@ -539,6 +552,16 @@ comprobe(parent, match, aux) needioh = 1; } else #endif +#if NCOM_PICA + if(IS_PICA(parent)) { + struct confargs *ca = aux; + if(!BUS_MATCHNAME(ca, "com")) + return(0); + iobase = (long)BUS_CVTADDR(ca); + bc = 0; + needioh = 1; + } else +#endif #if NCOM_COMMULTI if (1) { struct cfdata *cf = match; @@ -623,6 +646,15 @@ comattach(parent, self, aux) irq = ia->ia_irq; } else #endif +#if NCOM_PICA + if(IS_PICA(parent)) { + struct confargs *ca = aux; + iobase = (long)BUS_CVTADDR(ca); + bc = 0; + irq = 0; + ioh = iobase; + } else +#endif #if NCOM_COMMULTI if (1) { struct commulti_attach_args *ca = aux; @@ -710,6 +742,12 @@ comattach(parent, self, aux) sc->sc_dev.dv_xname); } else #endif +#if NCOM_PICA + if (IS_PICA(parent)) { + struct confargs *ca = aux; + BUS_INTR_ESTABLISH(ca, comintr, (void *)(long)sc); + } else +#endif panic("comattach: IRQ but can't have one"); } @@ -1618,10 +1656,14 @@ comcnprobe(cp) bus_io_handle_t ioh; int found; +#if 0 if (bus_io_map(bc, CONADDR, COM_NPORTS, &ioh)) { cp->cn_pri = CN_DEAD; return; } +#else + ioh = CONADDR; +#endif found = comprobe1(bc, ioh, CONADDR); bus_io_unmap(bc, ioh, COM_NPORTS); if (!found) { diff --git a/sys/dev/isa/com.c b/sys/dev/isa/com.c index f150dee595f..d20b35a31c5 100644 --- a/sys/dev/isa/com.c +++ b/sys/dev/isa/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.17 1996/06/10 19:29:59 niklas Exp $ */ +/* $OpenBSD: com.c,v 1.18 1996/06/22 23:12:14 pefo Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /*- @@ -158,6 +158,15 @@ struct cfattach com_commulti_ca = { }; #endif +#if NCOM_PICA +#undef CONADDR /* This is stupid but using devs before config .. */ +#define CONADDR 0xe0006000 + +struct cfattach com_pica_ca = { + sizeof(struct com_softc), comprobe, comattach +}; +#endif + struct cfdriver com_cd = { NULL, "com", DV_TTY @@ -525,6 +534,10 @@ comprobe(parent, match, aux) #define IS_ISA(parent) \ !strcmp((parent)->dv_cfdata->cf_driver->cd_name, "isa") #endif +#if NCOM_PICA +#define IS_PICA(parent) \ + !strcmp((parent)->dv_cfdata->cf_driver->cd_name, "pica") +#endif /* * XXX should be broken out into functions for isa probe and * XXX for commulti probe, with a helper function that contains @@ -539,6 +552,16 @@ comprobe(parent, match, aux) needioh = 1; } else #endif +#if NCOM_PICA + if(IS_PICA(parent)) { + struct confargs *ca = aux; + if(!BUS_MATCHNAME(ca, "com")) + return(0); + iobase = (long)BUS_CVTADDR(ca); + bc = 0; + needioh = 1; + } else +#endif #if NCOM_COMMULTI if (1) { struct cfdata *cf = match; @@ -623,6 +646,15 @@ comattach(parent, self, aux) irq = ia->ia_irq; } else #endif +#if NCOM_PICA + if(IS_PICA(parent)) { + struct confargs *ca = aux; + iobase = (long)BUS_CVTADDR(ca); + bc = 0; + irq = 0; + ioh = iobase; + } else +#endif #if NCOM_COMMULTI if (1) { struct commulti_attach_args *ca = aux; @@ -710,6 +742,12 @@ comattach(parent, self, aux) sc->sc_dev.dv_xname); } else #endif +#if NCOM_PICA + if (IS_PICA(parent)) { + struct confargs *ca = aux; + BUS_INTR_ESTABLISH(ca, comintr, (void *)(long)sc); + } else +#endif panic("comattach: IRQ but can't have one"); } @@ -1618,10 +1656,14 @@ comcnprobe(cp) bus_io_handle_t ioh; int found; +#if 0 if (bus_io_map(bc, CONADDR, COM_NPORTS, &ioh)) { cp->cn_pri = CN_DEAD; return; } +#else + ioh = CONADDR; +#endif found = comprobe1(bc, ioh, CONADDR); bus_io_unmap(bc, ioh, COM_NPORTS); if (!found) { |