diff options
Diffstat (limited to 'sys/arch/hp300/dev')
-rw-r--r-- | sys/arch/hp300/dev/dca.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dcm.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/dev/diofbvar.h | 8 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dvbox.c | 95 | ||||
-rw-r--r-- | sys/arch/hp300/dev/gbox.c | 96 | ||||
-rw-r--r-- | sys/arch/hp300/dev/hyper.c | 64 | ||||
-rw-r--r-- | sys/arch/hp300/dev/rbox.c | 95 | ||||
-rw-r--r-- | sys/arch/hp300/dev/sti_sgc.c | 108 | ||||
-rw-r--r-- | sys/arch/hp300/dev/topcat.c | 111 |
9 files changed, 48 insertions, 537 deletions
diff --git a/sys/arch/hp300/dev/dca.c b/sys/arch/hp300/dev/dca.c index 69dfd03f2d5..12598c21fdc 100644 --- a/sys/arch/hp300/dev/dca.c +++ b/sys/arch/hp300/dev/dca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dca.c,v 1.29 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: dca.c,v 1.30 2005/12/31 18:13:41 miod Exp $ */ /* $NetBSD: dca.c,v 1.35 1997/05/05 20:58:18 thorpej Exp $ */ /* @@ -1046,7 +1046,7 @@ dcacnprobe(cp) cp->cn_dev = makedev(dcamajor, 0); /* XXX */ cp->cn_pri = CN_DEAD; - console_scan(dca_console_scan, cp, HP300_BUS_DIO); + console_scan(dca_console_scan, cp); #ifdef KGDB /* XXX this needs to be fixed. */ diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c index 205bc3889e5..206f3da52e9 100644 --- a/sys/arch/hp300/dev/dcm.c +++ b/sys/arch/hp300/dev/dcm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dcm.c,v 1.26 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: dcm.c,v 1.27 2005/12/31 18:13:41 miod Exp $ */ /* $NetBSD: dcm.c,v 1.41 1997/05/05 20:59:16 thorpej Exp $ */ /* @@ -1557,7 +1557,7 @@ dcmcnprobe(cp) cp->cn_dev = makedev(dcmmajor, 0); /* XXX */ cp->cn_pri = CN_DEAD; - console_scan(dcm_console_scan, cp, HP300_BUS_DIO); + console_scan(dcm_console_scan, cp); #ifdef KGDB_CHEAT /* XXX this needs to be fixed. */ diff --git a/sys/arch/hp300/dev/diofbvar.h b/sys/arch/hp300/dev/diofbvar.h index 9017ed5c83a..eace8c24262 100644 --- a/sys/arch/hp300/dev/diofbvar.h +++ b/sys/arch/hp300/dev/diofbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: diofbvar.h,v 1.4 2005/01/24 21:36:39 miod Exp $ */ +/* $OpenBSD: diofbvar.h,v 1.5 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -121,6 +121,12 @@ paddr_t diofb_mmap(void *, off_t, int); int diofb_show_screen(void *, void *, int, void (*)(void *, int, int), void *); +/* Console support */ +void dvboxcninit(void); +void gboxcninit(void); +void hypercninit(void); +void rboxcninit(void); +void topcatcninit(void); extern struct diofb diofb_cn; /* struct diofb for console device */ #endif diff --git a/sys/arch/hp300/dev/dvbox.c b/sys/arch/hp300/dev/dvbox.c index 3f31d0c4028..3d6d75e3d61 100644 --- a/sys/arch/hp300/dev/dvbox.c +++ b/sys/arch/hp300/dev/dvbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvbox.c,v 1.11 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: dvbox.c,v 1.12 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -83,8 +83,6 @@ #include <hp300/dev/diodevs.h> #include <hp300/dev/intiovar.h> -#include <dev/cons.h> - #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -420,97 +418,8 @@ dvbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, * DaVinci console support */ -int dvbox_console_scan(int, caddr_t, void *); -cons_decl(dvbox); - -int -dvbox_console_scan(int scode, caddr_t va, void *arg) -{ - struct diofbreg *fbr = (struct diofbreg *)va; - struct consdev *cp = arg; - u_int pri; - - if (fbr->id != GRFHWID || fbr->fbid != GID_DAVINCI) - return (0); - - pri = CN_NORMAL; - -#ifdef CONSCODE - /* - * Raise our priority, if appropriate. - */ - if (scode == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = scode; - return (DIO_SIZE(scode, va)); - } - return (0); -} - -void -dvboxcnprobe(struct consdev *cp) -{ - int maj; - caddr_t va; - struct diofbreg *fbr; - - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } - - if (maj == nchrdev) - return; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; - - /* Look for "internal" framebuffer. */ - va = (caddr_t)IIOV(GRFIADDR); - fbr = (struct diofbreg *)va; - if (!badaddr(va) && - fbr->id == GRFHWID && fbr->fbid == GID_DAVINCI) { - cp->cn_pri = CN_INTERNAL; - -#ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) - cp->cn_pri = CN_FORCED; -#endif - - /* - * If our priority is higher than the currently - * remembered console, stash our priority, and - * unmap whichever device might be currently mapped. - * Since we're internal, we set the saved size to 0 - * so they don't attempt to unmap our fixed VA later. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - if (convasize) - iounmap(conaddr, convasize); - conscode = CONSCODE_INTERNAL; - conaddr = va; - convasize = 0; - } - } - - console_scan(dvbox_console_scan, cp, HP300_BUS_DIO); -} - void -dvboxcninit(struct consdev *cp) +dvboxcninit() { dvbox_reset(&diofb_cn, conscode, (struct diofbreg *)conaddr); diofb_cnattach(&diofb_cn); diff --git a/sys/arch/hp300/dev/gbox.c b/sys/arch/hp300/dev/gbox.c index f954da36a6a..bb35fa3da72 100644 --- a/sys/arch/hp300/dev/gbox.c +++ b/sys/arch/hp300/dev/gbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gbox.c,v 1.12 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: gbox.c,v 1.13 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -87,8 +87,6 @@ #include <hp300/dev/diodevs.h> #include <hp300/dev/intiovar.h> -#include <dev/cons.h> - #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -440,98 +438,8 @@ gbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, * Gatorbox console support */ -int gbox_console_scan(int, caddr_t, void *); -cons_decl(gbox); - -int -gbox_console_scan(int scode, caddr_t va, void *arg) -{ - struct diofbreg *fbr = (struct diofbreg *)va; - struct consdev *cp = arg; - u_int pri; - - if (fbr->id != GRFHWID || fbr->fbid != GID_GATORBOX) - return (0); - - pri = CN_NORMAL; - -#ifdef CONSCODE - /* - * Raise our priority, if appropriate. - */ - if (scode == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = scode; - return (DIO_SIZE(scode, va)); - } - return (0); -} - -void -gboxcnprobe(struct consdev *cp) -{ - int maj; - caddr_t va; - struct diofbreg *fbr; - - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } - - if (maj == nchrdev) - return; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; - - /* Look for "internal" framebuffer. */ - va = (caddr_t)IIOV(GRFIADDR); - fbr = (struct diofbreg *)va; - if (!badaddr(va) && - fbr->id == GRFHWID && fbr->fbid == GID_GATORBOX) { - cp->cn_pri = CN_INTERNAL; - -#ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) - cp->cn_pri = CN_FORCED; -#endif - - /* - * If our priority is higher than the currently - * remembered console, stash our priority, and - * unmap whichever device might be currently mapped. - * Since we're internal, we set the saved size to 0 - * so they don't attempt to unmap our fixed VA later. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - if (convasize) - iounmap(conaddr, convasize); - conscode = CONSCODE_INTERNAL; - conaddr = va; - convasize = 0; - } - } - - console_scan(gbox_console_scan, cp, HP300_BUS_DIO); -} - void -gboxcninit(cp) - struct consdev *cp; +gboxcninit() { gbox_reset(&diofb_cn, conscode, (struct diofbreg *)conaddr); diofb_cnattach(&diofb_cn); diff --git a/sys/arch/hp300/dev/hyper.c b/sys/arch/hp300/dev/hyper.c index 5653e8b2a34..712a115cea4 100644 --- a/sys/arch/hp300/dev/hyper.c +++ b/sys/arch/hp300/dev/hyper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hyper.c,v 1.13 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: hyper.c,v 1.14 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -86,8 +86,6 @@ #include <hp300/dev/diodevs.h> #include <hp300/dev/intiovar.h> -#include <dev/cons.h> - #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -487,66 +485,8 @@ hyper_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, * Hyperion console support */ -int hyper_console_scan(int, caddr_t, void *); -cons_decl(hyper); - -int -hyper_console_scan(int scode, caddr_t va, void *arg) -{ - struct diofbreg *fbr = (struct diofbreg *)va; - struct consdev *cp = arg; - u_int pri; - - if (fbr->id != GRFHWID || fbr->fbid != GID_HYPERION) - return (0); - - pri = CN_NORMAL; - -#ifdef CONSCODE - /* - * Raise our prioity, if appropriate. - */ - if (scode == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = scode; - return (DIO_SIZE(scode, va)); - } - return (0); -} - -void -hypercnprobe(struct consdev *cp) -{ - int maj; - - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } - - if (maj == nchrdev) - return; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; - - console_scan(hyper_console_scan, cp, HP300_BUS_DIO); -} - void -hypercninit(struct consdev *cp) +hypercninit() { hyper_reset(&diofb_cn, conscode, (struct diofbreg *)conaddr); diofb_cnattach(&diofb_cn); diff --git a/sys/arch/hp300/dev/rbox.c b/sys/arch/hp300/dev/rbox.c index 4d17431e8cd..92951682cbc 100644 --- a/sys/arch/hp300/dev/rbox.c +++ b/sys/arch/hp300/dev/rbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rbox.c,v 1.12 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: rbox.c,v 1.13 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -83,8 +83,6 @@ #include <hp300/dev/diodevs.h> #include <hp300/dev/intiovar.h> -#include <dev/cons.h> - #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -383,97 +381,8 @@ rbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, * Renaissance console support */ -int rbox_console_scan(int, caddr_t, void *); -cons_decl(rbox); - -int -rbox_console_scan(int scode, caddr_t va, void *arg) -{ - struct diofbreg *fbr = (struct diofbreg *)va; - struct consdev *cp = arg; - u_int pri; - - if (fbr->id != GRFHWID || fbr->fbid != GID_RENAISSANCE) - return (0); - - pri = CN_NORMAL; - -#ifdef CONSCODE - /* - * Raise our priority, if appropriate. - */ - if (scode == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = scode; - return (DIO_SIZE(scode, va)); - } - return (0); -} - -void -rboxcnprobe(struct consdev *cp) -{ - int maj; - caddr_t va; - struct diofbreg *fbr; - - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } - - if (maj == nchrdev) - return; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; - - /* Look for "internal" framebuffer. */ - va = (caddr_t)IIOV(GRFIADDR); - fbr = (struct diofbreg *)va; - if (!badaddr(va) && - fbr->id == GRFHWID && fbr->fbid == GID_RENAISSANCE) { - cp->cn_pri = CN_INTERNAL; - -#ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) - cp->cn_pri = CN_FORCED; -#endif - - /* - * If our priority is higher than the currently - * remembered console, stash our priority, and - * unmap whichever device might be currently mapped. - * Since we're internal, we set the saved size to 0 - * so they don't attempt to unmap our fixed VA later. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - if (convasize) - iounmap(conaddr, convasize); - conscode = CONSCODE_INTERNAL; - conaddr = va; - convasize = 0; - } - } - - console_scan(rbox_console_scan, cp, HP300_BUS_DIO); -} - void -rboxcninit(struct consdev *cp) +rboxcninit() { rbox_reset(&diofb_cn, conscode, (struct diofbreg *)conaddr); diofb_cnattach(&diofb_cn); diff --git a/sys/arch/hp300/dev/sti_sgc.c b/sys/arch/hp300/dev/sti_sgc.c index 7e57692ae77..06302a79196 100644 --- a/sys/arch/hp300/dev/sti_sgc.c +++ b/sys/arch/hp300/dev/sti_sgc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti_sgc.c,v 1.5 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: sti_sgc.c,v 1.6 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -35,8 +35,6 @@ #include <machine/bus.h> #include <machine/cpu.h> -#include <dev/cons.h> - #include <hp300/dev/sgcreg.h> #include <hp300/dev/sgcvar.h> @@ -48,8 +46,9 @@ #include <uvm/uvm_extern.h> -int sti_sgc_match(struct device *, void *, void *); -void sti_sgc_attach(struct device *, struct device *, void *); +void sti_sgc_attach(struct device *, struct device *, void *); +int sti_sgc_match(struct device *, void *, void *); +int sti_sgc_probe(bus_space_tag_t, int); struct cfattach sti_sgc_ca = { sizeof(struct sti_softc), sti_sgc_match, sti_sgc_attach @@ -60,8 +59,6 @@ sti_sgc_match(struct device *parent, void *match, void *aux) { struct sgc_attach_args *saa = aux; bus_space_tag_t iot; - bus_space_handle_t ioh; - int devtype; /* * If we already probed it succesfully as a console device, go ahead, @@ -72,24 +69,7 @@ sti_sgc_match(struct device *parent, void *match, void *aux) iot = HP300_BUS_TAG(HP300_BUS_SGC, saa->saa_slot); - if (bus_space_map(iot, (bus_addr_t)sgc_slottopa(saa->saa_slot), - PAGE_SIZE, 0, &ioh)) - return (0); - - devtype = bus_space_read_1(iot, ioh, 3); - - bus_space_unmap(iot, ioh, PAGE_SIZE); - - /* - * This might not be reliable enough. On the other hand, non-STI - * SGC cards will apparently not initialize in an hp300, to the - * point of not even answering bus probes (checked with an - * Harmony/FDDI SGC card). - */ - if (devtype != STI_DEVTYPE1 && devtype != STI_DEVTYPE4) - return (0); - - return (1); + return (sti_sgc_probe(iot, saa->saa_slot)); } void @@ -153,85 +133,51 @@ sti_sgc_attach(struct device *parent, struct device *self, void *aux) sti_end_attach(sc); } -/* - * Console code - */ - -int sti_console_scan(int, caddr_t, void *); -cons_decl(sti); - int -sti_console_scan(int slot, caddr_t va, void *arg) +sti_sgc_probe(bus_space_tag_t iot, int slot) { - struct consdev *cp = arg; - bus_space_tag_t iot; bus_space_handle_t ioh; int devtype; - u_int pri; - iot = HP300_BUS_TAG(HP300_BUS_SGC, slot); - - if (bus_space_map(iot, (bus_addr_t)sgc_slottopa(slot), PAGE_SIZE, 0, - &ioh)) + if (bus_space_map(iot, (bus_addr_t)sgc_slottopa(slot), + PAGE_SIZE, 0, &ioh)) return (0); devtype = bus_space_read_1(iot, ioh, 3); bus_space_unmap(iot, ioh, PAGE_SIZE); - /* XXX this is not reliable enough */ - if (devtype != STI_DEVTYPE1 && devtype != STI_DEVTYPE4) - return (0); - - pri = CN_INTERNAL; - -#ifdef CONSCODE - /* - * Raise our priority, if appropriate. - */ - if (SGC_SLOT_TO_CONSCODE(slot) == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. + * This might not be reliable enough. On the other hand, non-STI + * SGC cards will apparently not initialize in an hp300, to the + * point of not even answering bus probes (checked with an + * Harmony/FDDI SGC card). */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = SGC_SLOT_TO_CONSCODE(slot); - return (1); - } + if (devtype != STI_DEVTYPE1 && devtype != STI_DEVTYPE4) + return (0); - return (0); + return (1); } -void -sticnprobe(struct consdev *cp) -{ - int maj; +/* + * Console code + */ - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } +int sti_console_scan(int); +void sticninit(void); - if (maj == nchrdev) - return; +int +sti_console_scan(int slot) +{ + bus_space_tag_t iot; - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; + iot = HP300_BUS_TAG(HP300_BUS_SGC, slot); - /* Search for an sti device */ - console_scan(sti_console_scan, cp, HP300_BUS_SGC); + return (sti_sgc_probe(iot, slot)); } void -sticninit(struct consdev *cp) +sticninit() { extern struct sti_screen stifb_cn; bus_space_tag_t iot; diff --git a/sys/arch/hp300/dev/topcat.c b/sys/arch/hp300/dev/topcat.c index 702bd35be2f..8ad9c6a8425 100644 --- a/sys/arch/hp300/dev/topcat.c +++ b/sys/arch/hp300/dev/topcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: topcat.c,v 1.13 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: topcat.c,v 1.14 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -85,8 +85,6 @@ #include <hp300/dev/diodevs.h> #include <hp300/dev/intiovar.h> -#include <dev/cons.h> - #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -501,113 +499,8 @@ topcat_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, * Topcat/catseye console support */ -int topcat_console_scan(int, caddr_t, void *); -cons_decl(topcat); - -int -topcat_console_scan(int scode, caddr_t va, void *arg) -{ - struct diofbreg *fbr = (struct diofbreg *)va; - struct consdev *cp = arg; - u_int pri; - - if (fbr->id != GRFHWID) - return (0); - - switch (fbr->fbid) { - case GID_TOPCAT: - case GID_LRCATSEYE: - case GID_HRCCATSEYE: - case GID_HRMCATSEYE: - break; - - default: - return (0); - } - - pri = CN_NORMAL; - -#ifdef CONSCODE - /* - * Raise our priority, if appropriate. - */ - if (scode == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = scode; - return (DIO_SIZE(scode, va)); - } - return (0); -} - -void -topcatcnprobe(struct consdev *cp) -{ - int maj; - caddr_t va; - struct diofbreg *fbr; - - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } - - if (maj == nchrdev) - return; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; - - /* Look for "internal" framebuffer. */ - va = (caddr_t)IIOV(GRFIADDR); - fbr = (struct diofbreg *)va; - if (!badaddr(va) && (fbr->id == GRFHWID)) { - switch (fbr->fbid) { - case GID_TOPCAT: - case GID_LRCATSEYE: - case GID_HRCCATSEYE: - case GID_HRMCATSEYE: - cp->cn_pri = CN_INTERNAL; - -#ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) - cp->cn_pri = CN_FORCED; -#endif - - /* - * If our priority is higher than the currently - * remembered console, stash our priority, and unmap - * whichever device might be currently mapped. - * Since we're internal, we set the saved size to 0 - * so they don't attempt to unmap our fixed VA later. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - if (convasize) - iounmap(conaddr, convasize); - conscode = CONSCODE_INTERNAL; - conaddr = va; - convasize = 0; - } - } - } - - console_scan(topcat_console_scan, cp, HP300_BUS_DIO); -} - void -topcatcninit(struct consdev *cp) +topcatcninit() { topcat_reset(&diofb_cn, conscode, (struct diofbreg *)conaddr); diofb_cnattach(&diofb_cn); |