summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2010-03-01 05:42:08 +0000
committermacallan <macallan@NetBSD.org>2010-03-01 05:42:08 +0000
commit3bc5d8b535375aecb282e9a8a2b7528fff658649 (patch)
treeffd6310113bf2d0ca09332434aeebdd72cc6547e /sys/dev
parent5bc6f3c06a2a48725fa44960c4475fd286ea6832 (diff)
make latching optional.
The SPARCbook docs claim it's necessary but my 3GX happily works without.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sbus/files.sbus3
-rw-r--r--sys/dev/sbus/p9100.c17
2 files changed, 15 insertions, 5 deletions
diff --git a/sys/dev/sbus/files.sbus b/sys/dev/sbus/files.sbus
index 4524b625adf..99afaaf8d1b 100644
--- a/sys/dev/sbus/files.sbus
+++ b/sys/dev/sbus/files.sbus
@@ -1,4 +1,4 @@
-# $NetBSD: files.sbus,v 1.34 2010/01/27 21:01:33 macallan Exp $
+# $NetBSD: files.sbus,v 1.35 2010/03/01 05:42:08 macallan Exp $
#
# Config file and device description for machine-independent SBUS code.
# Included by ports that need it.
@@ -126,6 +126,7 @@ file dev/sbus/zx.c zx
# Tadpole 3GX/3GS (P9100 -- P Nine One Zero Zero -> pnozz)
defflag opt_pnozz.h PNOZZ_DEBUG
defflag opt_pnozz.h PNOZZ_EMUL_CG3
+defflag opt_pnozz.h PNOZZ_USE_LATCH
device pnozz: fb, rasops8, bt_dac, wsemuldisplaydev, vcons
attach pnozz at sbus
file dev/sbus/p9100.c pnozz needs-flag
diff --git a/sys/dev/sbus/p9100.c b/sys/dev/sbus/p9100.c
index d0390fd5ad6..d3ec72608fc 100644
--- a/sys/dev/sbus/p9100.c
+++ b/sys/dev/sbus/p9100.c
@@ -1,4 +1,4 @@
-/* $NetBSD: p9100.c,v 1.53 2010/03/01 05:26:53 macallan Exp $ */
+/* $NetBSD: p9100.c,v 1.54 2010/03/01 05:42:08 macallan Exp $ */
/*-
* Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.53 2010/03/01 05:26:53 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.54 2010/03/01 05:42:08 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -110,8 +110,9 @@ struct p9100_softc {
bus_addr_t sc_fb_paddr; /* phys address description */
bus_size_t sc_fb_psize; /* for device mmap() */
+#ifdef PNOZZ_USE_LATCH
bus_space_handle_t sc_fb_memh; /* bus space handle */
-
+#endif
volatile uint32_t sc_junk;
uint32_t sc_mono_width; /* for setup_mono */
@@ -256,10 +257,14 @@ struct wsdisplay_accessops p9100_accessops = {
};
#endif
+#ifdef PNOZZ_USE_LATCH
#define PNOZZ_LATCH(sc, off) if(sc->sc_last_offset != (off & 0xffffff80)) { \
sc->sc_junk = bus_space_read_4(sc->sc_bustag, sc->sc_fb_memh, \
off); \
sc->sc_last_offset = off & 0xffffff80; }
+#else
+#define PNOZZ_LATCH(a, b)
+#endif
/*
* Match a p9100.
@@ -338,7 +343,9 @@ p9100_sbus_attach(device_t parent, device_t self, void *args)
* P9100 - all register accesses need to be 'latched in' whenever we
* go to another 0x80 aligned 'page' by reading the framebuffer at the
* same offset
+ * XXX apparently the latter isn't true - my SP3GX works fine without
*/
+#ifdef PNOZZ_USE_LATCH
if (fb->fb_pixels == NULL) {
if (sbus_bus_map(sc->sc_bustag,
sa->sa_reg[2].oa_space,
@@ -354,6 +361,7 @@ p9100_sbus_attach(device_t parent, device_t self, void *args)
} else {
sc->sc_fb_memh = (bus_space_handle_t) fb->fb_pixels;
}
+#endif
sc->sc_width = prom_getpropint(node, "width", 800);
sc->sc_height = prom_getpropint(node, "height", 600);
sc->sc_depth = prom_getpropint(node, "depth", 8) >> 3;
@@ -1217,9 +1225,10 @@ p9100_init_screen(void *cookie, struct vcons_screen *scr,
ri->ri_stride = sc->sc_stride;
ri->ri_flg = RI_CENTER | RI_FULLCLEAR;
+#ifdef PNOZZ_USE_LATCH
ri->ri_bits = bus_space_vaddr(sc->sc_bustag, sc->sc_fb_memh);
-
DPRINTF("addr: %08lx\n",(ulong)ri->ri_bits);
+#endif
rasops_init(ri, sc->sc_height/8, sc->sc_width/8);
ri->ri_caps = WSSCREEN_WSCOLORS;