Module Name: src
Committed By: macallan
Date: Mon Mar 1 05:42:08 UTC 2010
Modified Files:
src/sys/dev/sbus: files.sbus p9100.c
Log Message:
make latching optional.
The SPARCbook docs claim it's necessary but my 3GX happily works without.
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sbus/files.sbus
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/sbus/p9100.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/sbus/files.sbus
diff -u src/sys/dev/sbus/files.sbus:1.34 src/sys/dev/sbus/files.sbus:1.35
--- src/sys/dev/sbus/files.sbus:1.34 Wed Jan 27 21:01:33 2010
+++ src/sys/dev/sbus/files.sbus Mon Mar 1 05:42:08 2010
@@ -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 @@
# 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
Index: src/sys/dev/sbus/p9100.c
diff -u src/sys/dev/sbus/p9100.c:1.53 src/sys/dev/sbus/p9100.c:1.54
--- src/sys/dev/sbus/p9100.c:1.53 Mon Mar 1 05:26:53 2010
+++ src/sys/dev/sbus/p9100.c Mon Mar 1 05:42:08 2010
@@ -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 @@
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 @@
};
#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 - 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 @@
} 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 @@
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;