Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sbus make latching optional.
details: https://anonhg.NetBSD.org/src/rev/06b0a815b207
branches: trunk
changeset: 752549:06b0a815b207
user: macallan <macallan%NetBSD.org@localhost>
date: Mon Mar 01 05:42:08 2010 +0000
description:
make latching optional.
The SPARCbook docs claim it's necessary but my 3GX happily works without.
diffstat:
sys/dev/sbus/files.sbus | 3 ++-
sys/dev/sbus/p9100.c | 17 +++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
diffs (91 lines):
diff -r 22e2c14aaecd -r 06b0a815b207 sys/dev/sbus/files.sbus
--- a/sys/dev/sbus/files.sbus Mon Mar 01 05:37:37 2010 +0000
+++ b/sys/dev/sbus/files.sbus Mon Mar 01 05:42:08 2010 +0000
@@ -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
diff -r 22e2c14aaecd -r 06b0a815b207 sys/dev/sbus/p9100.c
--- a/sys/dev/sbus/p9100.c Mon Mar 01 05:37:37 2010 +0000
+++ b/sys/dev/sbus/p9100.c Mon Mar 01 05:42:08 2010 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index