summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-03-01 21:23:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-03-01 21:23:37 +0000
commit93d0660b452cb985934616dfc83c560c4d49f5c5 (patch)
tree2743f99142fcd7a44cd65d89655decadf8ebdb7a /sys/dev/sbus
parent8e05790a9959fd4507e6d64a9663705e9a9a3205 (diff)
Display hardware name and display resolution at attach time, as done on sparc.
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r--sys/dev/sbus/bwtwo.c17
-rw-r--r--sys/dev/sbus/cgsix.c20
-rw-r--r--sys/dev/sbus/cgthree.c17
3 files changed, 38 insertions, 16 deletions
diff --git a/sys/dev/sbus/bwtwo.c b/sys/dev/sbus/bwtwo.c
index e3e273b7a4b..04361f9ec35 100644
--- a/sys/dev/sbus/bwtwo.c
+++ b/sys/dev/sbus/bwtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwtwo.c,v 1.12 2005/01/05 23:04:25 miod Exp $ */
+/* $OpenBSD: bwtwo.c,v 1.13 2005/03/01 21:23:36 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -157,12 +157,14 @@ bwtwoattach(parent, self, aux)
{
struct bwtwo_softc *sc = (struct bwtwo_softc *)self;
struct sbus_attach_args *sa = aux;
- int console;
+ int node, console;
+ const char *nam;
+ node = sa->sa_node;
sc->sc_bustag = sa->sa_bustag;
sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset);
- fb_setsize(&sc->sc_sunfb, 1, 1152, 900, sa->sa_node, 0);
+ fb_setsize(&sc->sc_sunfb, 1, 1152, 900, node, 0);
if (sa->sa_nreg != 1) {
printf(": expected %d registers, got %d\n", 1, sa->sa_nreg);
@@ -187,13 +189,18 @@ bwtwoattach(parent, self, aux)
goto fail_vid;
}
- console = bwtwo_is_console(sa->sa_node);
+ nam = getpropstring(node, "model");
+ if (*nam == '\0')
+ nam = sa->sa_name;
+ printf(": %s", nam);
+
+ console = bwtwo_is_console(node);
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
bwtwo_burner(sc, 1, 0);
- printf("\n");
+ printf(", %dx%d\n", sc->sc_sunfb.sf_width, sc->sc_sunfb.sf_height);
sc->sc_sunfb.sf_ro.ri_bits = (void *)bus_space_vaddr(sc->sc_bustag,
sc->sc_vid_regs);
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 3448238745a..f991ac09926 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.46 2005/01/05 23:04:25 miod Exp $ */
+/* $OpenBSD: cgsix.c,v 1.47 2005/03/01 21:23:36 miod Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -117,9 +117,11 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
{
struct cgsix_softc *sc = (struct cgsix_softc *)self;
struct sbus_attach_args *sa = aux;
- int console, i;
+ int node, console, i;
u_int32_t fhc, rev;
+ const char *nam;
+ node = sa->sa_node;
sc->sc_bustag = sa->sa_bustag;
sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset);
@@ -128,7 +130,7 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
goto fail;
}
- fb_setsize(&sc->sc_sunfb, 8, 1152, 900, sa->sa_node, 0);
+ fb_setsize(&sc->sc_sunfb, 8, 1152, 900, node, 0);
/*
* Map just BT, FHC, FBC, THC, and video RAM.
@@ -183,10 +185,15 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
}
/* if prom didn't initialize us, do it the hard way */
- if (OF_getproplen(sa->sa_node, "width") != sizeof(u_int32_t))
+ if (OF_getproplen(node, "width") != sizeof(u_int32_t))
cgsix_hardreset(sc);
- console = cgsix_is_console(sa->sa_node);
+ nam = getpropstring(node, "model");
+ if (*nam == '\0')
+ nam = sa->sa_name;
+ printf(": %s", nam);
+
+ console = cgsix_is_console(node);
fhc = FHC_READ(sc);
rev = (fhc & FHC_REV_MASK) >> FHC_REV_SHIFT;
@@ -228,7 +235,8 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
cgsix_ras_init(sc);
}
- printf("\n");
+ printf(", %dx%d, rev %d\n", sc->sc_sunfb.sf_width,
+ sc->sc_sunfb.sf_height, rev);
fbwscons_setcolormap(&sc->sc_sunfb, cgsix_setcolor);
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c
index e5ffe5ab0ae..4644546cdb4 100644
--- a/sys/dev/sbus/cgthree.c
+++ b/sys/dev/sbus/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.37 2005/01/05 23:04:25 miod Exp $ */
+/* $OpenBSD: cgthree.c,v 1.38 2005/03/01 21:23:36 miod Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -211,12 +211,14 @@ cgthreeattach(struct device *parent, struct device *self, void *aux)
{
struct cgthree_softc *sc = (struct cgthree_softc *)self;
struct sbus_attach_args *sa = aux;
- int console, i;
+ int node, console, i;
+ const char *nam;
+ node = sa->sa_node;
sc->sc_bustag = sa->sa_bustag;
sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset);
- fb_setsize(&sc->sc_sunfb, 8, 1152, 900, sa->sa_node, 0);
+ fb_setsize(&sc->sc_sunfb, 8, 1152, 900, node, 0);
if (sa->sa_nreg != 1) {
printf(": expected %d registers, got %d\n", 1, sa->sa_nreg);
@@ -241,7 +243,12 @@ cgthreeattach(struct device *parent, struct device *self, void *aux)
goto fail_vid;
}
- console = cgthree_is_console(sa->sa_node);
+ nam = getpropstring(node, "model");
+ if (*nam == '\0')
+ nam = sa->sa_name;
+ printf(": %s", nam);
+
+ console = cgthree_is_console(node);
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
@@ -257,7 +264,7 @@ cgthreeattach(struct device *parent, struct device *self, void *aux)
sc->sc_vid_regs);
sc->sc_sunfb.sf_ro.ri_hw = sc;
- printf("\n");
+ printf(", %dx%d\n", sc->sc_sunfb.sf_width, sc->sc_sunfb.sf_height);
/*
* If the framebuffer width is under 1024x768, which is the case for