From 8459d4b1b2d36b677790b8d39938b2f9130e286d Mon Sep 17 00:00:00 2001 From: Per Fogelstrom Date: Sat, 22 Jun 1996 23:12:15 +0000 Subject: Pica bus support added --- sys/dev/ic/com.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'sys/dev/ic') 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 @@ -524,6 +533,10 @@ comprobe(parent, match, aux) #elif NCOM_ISA #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 @@ -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; @@ -709,6 +741,12 @@ comattach(parent, self, aux) IST_EDGE, IPL_TTY, comintr, sc, 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) { -- cgit v1.2.3