CVS commit: [netbsd-5] src/sys/dev/sbus

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 03:52:34 UTC 2011

Modified Files:
src/sys/dev/sbus [netbsd-5]: spif.c

Log Message:
Pull up following revision(s) (requested by hauke in ticket #1506):
sys/dev/sbus/spif.c: revision 1.19
Fix warning about missing initializer that showed up in sparc64
builds, but, strangely enough, not in sparc builds.
Relevant for netbsd-{4,5} release branches.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.6.1 src/sys/dev/sbus/spif.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/spif.c
diff -u src/sys/dev/sbus/spif.c:1.18 src/sys/dev/sbus/spif.c:1.18.6.1
--- src/sys/dev/sbus/spif.c:1.18	Wed Jun 11 21:25:31 2008
+++ src/sys/dev/sbus/spif.c	Fri Jan  7 03:52:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: spif.c,v 1.18 2008/06/11 21:25:31 drochner Exp $	*/
+/*	$NetBSD: spif.c,v 1.18.6.1 2011/01/07 03:52:34 riz Exp $	*/
 /*	$OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spif.c,v 1.18 2008/06/11 21:25:31 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: spif.c,v 1.18.6.1 2011/01/07 03:52:34 riz Exp $);
 
 #include spif.h
 #if NSPIF  0
@@ -110,7 +110,7 @@
 
 const struct cdevsw sbpp_cdevsw = {
 	sbpp_open, sbpp_close, sbpp_read, sbpp_write, sbpp_ioctl,
-	nostop, notty, sbpp_poll, nommap, nokqfilter,
+	nostop, notty, sbpp_poll, nommap, nokqfilter, D_OTHER
 };
 
 



CVS commit: [netbsd-5] src/sys/dev/sbus

2009-10-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 18 13:23:31 UTC 2009

Modified Files:
src/sys/dev/sbus [netbsd-5]: files.sbus zx.c zxreg.h zxvar.h

Log Message:
Pull up following revision(s) (requested by macallan in ticket #960):
sys/dev/sbus/zxreg.h: revision 1.7
sys/dev/sbus/files.sbus: revision 1.32
sys/dev/sbus/zxvar.h: revision 1.4
sys/dev/sbus/zx.c: revision 1.27
Add wscons support


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.36.1 src/sys/dev/sbus/files.sbus
cvs rdiff -u -r1.24.6.1 -r1.24.6.2 src/sys/dev/sbus/zx.c
cvs rdiff -u -r1.5.4.1 -r1.5.4.2 src/sys/dev/sbus/zxreg.h
cvs rdiff -u -r1.2.10.1 -r1.2.10.2 src/sys/dev/sbus/zxvar.h

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.31 src/sys/dev/sbus/files.sbus:1.31.36.1
--- src/sys/dev/sbus/files.sbus:1.31	Sun Aug 26 00:39:39 2007
+++ src/sys/dev/sbus/files.sbus	Sun Oct 18 13:23:31 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sbus,v 1.31 2007/08/26 00:39:39 macallan Exp $
+#	$NetBSD: files.sbus,v 1.31.36.1 2009/10/18 13:23:31 bouyer Exp $
 #
 # Config file and device description for machine-independent SBUS code.
 # Included by ports that need it.
@@ -119,7 +119,7 @@
 attach	tcx at sbus
 file	dev/sbus/tcx.c			tcx needs-flag
 
-device	zx: fb, rasops32
+device	zx: fb, rasops32, wsemuldisplaydev, vcons
 attach	zx at sbus
 file	dev/sbus/zx.c			zx
 

Index: src/sys/dev/sbus/zx.c
diff -u src/sys/dev/sbus/zx.c:1.24.6.1 src/sys/dev/sbus/zx.c:1.24.6.2
--- src/sys/dev/sbus/zx.c:1.24.6.1	Fri Apr  3 17:45:31 2009
+++ src/sys/dev/sbus/zx.c	Sun Oct 18 13:23:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: zx.c,v 1.24.6.1 2009/04/03 17:45:31 snj Exp $	*/
+/*	$NetBSD: zx.c,v 1.24.6.2 2009/10/18 13:23:31 bouyer Exp $	*/
 
 /*
  *  Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zx.c,v 1.24.6.1 2009/04/03 17:45:31 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: zx.c,v 1.24.6.2 2009/10/18 13:23:31 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,45 +66,58 @@
 #include dev/sun/fbio.h
 #include dev/sun/fbvar.h
 
+#include wsdisplay.h
+#if NWSDISPLAY  0
+#include dev/wscons/wsconsio.h
+#include dev/wsfont/wsfont.h
+#include dev/rasops/rasops.h
+#include dev/wscons/wsdisplay_vconsvar.h
+
+#include opt_wsemul.h
+#endif
+
 #include dev/sbus/zxreg.h
 #include dev/sbus/zxvar.h
 #include dev/sbus/sbusvar.h
 
 #include dev/wscons/wsconsio.h
 
-#ifndef RASTERCONSOLE
-#error Sorry, this driver needs the RASTERCONSOLE option
+#if (NWSDISPLAY == 0)  !defined(RASTERCONSOLE)
+#error Sorry, this driver needs WSCONS or RASTERCONSOLE
+#endif
+
+#if (NWSDISPLAY  0)  defined(RASTERCONSOLE)
+#error Sorry, RASTERCONSOLE and WSCONS are mutually exclusive
 #endif
 
 #define	ZX_STD_ROP	(ZX_ROP_NEW | ZX_ATTR_WE_ENABLE | \
 ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID)
 
-void	zx_attach(struct device *, struct device *, void *);
-int	zx_match(struct device *, struct cfdata *, void *);
+static void	zx_attach(device_t, device_t, void *);
+static int	zx_match(device_t, struct cfdata *, void *);
 
-void	zx_blank(struct device *);
-int	zx_cmap_put(struct zx_softc *);
-void	zx_copyrect(struct rasops_info *, int, int, int, int, int, int);
-int	zx_cross_loadwid(struct zx_softc *, u_int, u_int, u_int);
-int	zx_cross_wait(struct zx_softc *);
-void	zx_fillrect(struct rasops_info *, int, int, int, int, long, int);
-int	zx_intr(void *);
-void	zx_reset(struct zx_softc *);
-void	zx_unblank(struct device *);
-
-void	zx_cursor_blank(struct zx_softc *);
-void	zx_cursor_color(struct zx_softc *);
-void	zx_cursor_move(struct zx_softc *);
-void	zx_cursor_set(struct zx_softc *);
-void	zx_cursor_unblank(struct zx_softc *);
-
-void	zx_copycols(void *, int, int, int, int);
-void	zx_copyrows(void *, int, int, int);
-void	zx_cursor(void *, int, int, int);
-void	zx_do_cursor(struct rasops_info *);
-void	zx_erasecols(void *, int, int, int, long);
-void	zx_eraserows(void *, int, int, long);
-void	zx_putchar(void *, int, int, u_int, long);
+static void	zx_blank(device_t);
+static int	zx_cmap_put(struct zx_softc *);
+static void	zx_copyrect(struct zx_softc *, int, int, int, int, int, int);
+static int	zx_cross_loadwid(struct zx_softc *, u_int, u_int, u_int);
+static int	zx_cross_wait(struct zx_softc *);
+static void	zx_fillrect(struct zx_softc *, int, int, int, int, uint32_t, int);
+static int	zx_intr(void *);
+static void	zx_reset(struct zx_softc *);
+static void	zx_unblank(device_t);
+
+static void	zx_cursor_blank(struct zx_softc *);
+static void	zx_cursor_color(struct zx_softc *);
+static void	zx_cursor_move(struct zx_softc *);
+static void	zx_cursor_set(struct zx_softc *);
+static void	zx_cursor_unblank(struct zx_softc *);
+
+static void	zx_copycols(void *, int, int, int, int);
+static void	zx_copyrows(void *, int, int, int);
+static 

CVS commit: [netbsd-5] src/sys/dev/sbus

2009-10-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 18 14:06:36 UTC 2009

Modified Files:
src/sys/dev/sbus [netbsd-5]: p9100reg.h

Log Message:
Pull up following revision(s) (requested by macallan in ticket #993):
sys/dev/sbus/p9100reg.h: revision 1.5
add a bunch of register definitions


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.10.1 src/sys/dev/sbus/p9100reg.h

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/p9100reg.h
diff -u src/sys/dev/sbus/p9100reg.h:1.4 src/sys/dev/sbus/p9100reg.h:1.4.10.1
--- src/sys/dev/sbus/p9100reg.h:1.4	Mon Apr 28 20:23:57 2008
+++ src/sys/dev/sbus/p9100reg.h	Sun Oct 18 14:06:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: p9100reg.h,v 1.4 2008/04/28 20:23:57 martin Exp $ */
+/*	$NetBSD: p9100reg.h,v 1.4.10.1 2009/10/18 14:06:36 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -50,7 +50,8 @@
 	#define DAC_INDX_AUTOINCR	0x01
 	
 #define DAC_VERSION	0x01
-#define DAC_POWER	0x05
+#define DAC_MISC_CLK0x02
+#define DAC_POWER_MGT	0x05
 	#define DAC_POWER_SCLK_DISABLE	0x10
 	#define DAC_POWER_DDOT_DISABLE	0x08
 	#define DAC_POWER_SYNC_DISABLE	0x04
@@ -58,7 +59,34 @@
 	#define DAC_POWER_ICLK_DISABLE	0x02
 	/* Disable internal DAC power */
 	#define DAC_POWER_IPWR_DISABLE	0x01
-
+#define DAC_OPERATION   0x06
+	#define DAC_SYNC_ON_GREEN   0x08
+#define DAC_PALETTE_CTRL 0x07
+#define DAC_PIXEL_FMT   0x0a
+#define DAC_8BIT_CTRL   0x0b
+	#define DAC8_DIRECT_COLOR   0x01
+#define DAC_16BIT_CTRL  0x0c
+	#define DAC16_INDIRECT_COLOR0x00
+	#define DAC16_DYNAMIC_COLOR 0x40
+	#define DAC16_DIRECT_COLOR  0xc0
+	#define DAC16_BYPASS_POLARITY   0x20
+	#define DAC16_BIT_FILL_LINEAR   0x04
+	#define DAC16_555   0x00
+	#define DAC16_565   0x02
+	#define DAC16_CONTIGUOUS0x01
+#define DAC_24BIT_CTRL  0x0d
+	#define DAC24_DIRECT_COLOR  0x01
+#define DAC_32BIT_CTRL  0x0e
+	#define DAC32_BYPASS_POLARITY   0x04
+	#define DAC32_INDIRECT_COLOR0x00
+	#define DAC32_DYNAMIC_COLOR 0x01
+	#define DAC32_DIRECT_COLOR  0x03
+#define DAC_VCO_DIV 0x16
+#define DAC_PLL00x20
+#define DAC_MISC_1  0x70
+#define DAC_MISC_2  0x71
+#define DAC_MISC_3  0x72
+  
 #define DAC_CURSOR_CTL	0x30
 	#define DAC_CURSOR_OFF	0x00
 	#define DAC_CURSOR_WIN	0x02
@@ -74,6 +102,51 @@
 #define DAC_PIX_PLL		0x8e
 #define DAC_CURSOR_DATA		0x100
 
+/* main registers */
+#define SYS_CONF0x0004  /* System Configuration Register */
+#define BUFFER_WRITE_1  0x0200  /* writes got o buffer 1 */
+#define BUFFER_WRITE_0  0x  /* writes go to buffer 0 */
+#define BUFFER_READ_1   0x0400  /* read from buffer 1 */
+#define BUFFER_READ_0   0x  
+#define MEM_SWAP_BITS   0x0800  /* swap bits when accessing VRAM */
+#define MEM_SWAP_BYTES  0x1000  /* swap bytes when accessing VRAM */
+#define MEM_SWAP_HWORDS 0x2000  /* swap halfwords when accessing VRAM */
+#define SHIFT_0 14  
+#define SHIFT_1 17
+#define SHIFT_2 20
+#define SHIFT_3 29
+#define PIXEL_SHIFT 26
+#define SWAP_SHIFT  11
+/* this is what the 3GX manual says */
+#define SC_8BIT 2
+#define SC_16BIT3
+#define SC_24BIT7
+#define SC_32BIT5
+
+/* video controller registers */
+#define VID_HCOUNTER0x104
+#define VID_HTOTAL  0x108
+#define VID_HSRE0x10c   /* hsync raising edge */
+#define VID_HBRE0x110   /* hblank raising edge */
+#define VID_HBFE0x114   /* hblank falling edge */
+#define VID_HCNTPRLD0x118   /* hcounter preload */
+#define VID_VCOUNTER0x11c   /* vcounter */
+#define VID_VLENGTH 0x120   /* lines, including blanks */
+#define VID_VSRE0x124   /* vsync raising edge */
+#define VID_VBRE0x128   /* vblank raising edge */
+#define VID_VBFE0x12c   /* vblank falling edge */
+#define VID_VCNTPRLD0x130   /* vcounter preload */
+#define VID_SRADDR  0x134   /* screen repaint address */
+#define VID_SRTC0x138   /* screen repaint timing control */
+#define VID_QSFCNTR 0x13c   /* QSF counter */
+
+#define VID_MEM_CONFIG  0x184   /* memory config */
+#define VID_RFPERIOD0x188   /* refresh period */
+#define VID_RFCOUNT 0x18c   /* refresh counter */
+#define VID_RLMAX   0x190   /* RAS low max */
+#define VID_RLCUR   0x194   /* RAS low current */
+#define VID_DACSYNC 0x198   /* read after last DAC access */
+
 #define ENGINE_STATUS	0x2000	/* drawing engine status register */
 	#define BLITTER_BUSY	0x8000
 	#define ENGINE_BUSY	0x4000
@@ -84,7 +157,7 @@
 /* apparently bits 2-6 control 

CVS commit: [netbsd-5] src/sys/dev/sbus

2009-10-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 18 14:32:29 UTC 2009

Modified Files:
src/sys/dev/sbus [netbsd-5]: files.sbus zx.c zxreg.h zxvar.h

Log Message:
Back out ticket 960


To generate a diff of this commit:
cvs rdiff -u -r1.31.36.1 -r1.31.36.2 src/sys/dev/sbus/files.sbus
cvs rdiff -u -r1.24.6.2 -r1.24.6.3 src/sys/dev/sbus/zx.c
cvs rdiff -u -r1.5.4.2 -r1.5.4.3 src/sys/dev/sbus/zxreg.h
cvs rdiff -u -r1.2.10.2 -r1.2.10.3 src/sys/dev/sbus/zxvar.h

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.31.36.1 src/sys/dev/sbus/files.sbus:1.31.36.2
--- src/sys/dev/sbus/files.sbus:1.31.36.1	Sun Oct 18 13:23:31 2009
+++ src/sys/dev/sbus/files.sbus	Sun Oct 18 14:32:29 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sbus,v 1.31.36.1 2009/10/18 13:23:31 bouyer Exp $
+#	$NetBSD: files.sbus,v 1.31.36.2 2009/10/18 14:32:29 bouyer Exp $
 #
 # Config file and device description for machine-independent SBUS code.
 # Included by ports that need it.
@@ -119,7 +119,7 @@
 attach	tcx at sbus
 file	dev/sbus/tcx.c			tcx needs-flag
 
-device	zx: fb, rasops32, wsemuldisplaydev, vcons
+device	zx: fb, rasops32
 attach	zx at sbus
 file	dev/sbus/zx.c			zx
 

Index: src/sys/dev/sbus/zx.c
diff -u src/sys/dev/sbus/zx.c:1.24.6.2 src/sys/dev/sbus/zx.c:1.24.6.3
--- src/sys/dev/sbus/zx.c:1.24.6.2	Sun Oct 18 13:23:31 2009
+++ src/sys/dev/sbus/zx.c	Sun Oct 18 14:32:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: zx.c,v 1.24.6.2 2009/10/18 13:23:31 bouyer Exp $	*/
+/*	$NetBSD: zx.c,v 1.24.6.3 2009/10/18 14:32:29 bouyer Exp $	*/
 
 /*
  *  Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zx.c,v 1.24.6.2 2009/10/18 13:23:31 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: zx.c,v 1.24.6.3 2009/10/18 14:32:29 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,58 +66,45 @@
 #include dev/sun/fbio.h
 #include dev/sun/fbvar.h
 
-#include wsdisplay.h
-#if NWSDISPLAY  0
-#include dev/wscons/wsconsio.h
-#include dev/wsfont/wsfont.h
-#include dev/rasops/rasops.h
-#include dev/wscons/wsdisplay_vconsvar.h
-
-#include opt_wsemul.h
-#endif
-
 #include dev/sbus/zxreg.h
 #include dev/sbus/zxvar.h
 #include dev/sbus/sbusvar.h
 
 #include dev/wscons/wsconsio.h
 
-#if (NWSDISPLAY == 0)  !defined(RASTERCONSOLE)
-#error Sorry, this driver needs WSCONS or RASTERCONSOLE
-#endif
-
-#if (NWSDISPLAY  0)  defined(RASTERCONSOLE)
-#error Sorry, RASTERCONSOLE and WSCONS are mutually exclusive
+#ifndef RASTERCONSOLE
+#error Sorry, this driver needs the RASTERCONSOLE option
 #endif
 
 #define	ZX_STD_ROP	(ZX_ROP_NEW | ZX_ATTR_WE_ENABLE | \
 ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID)
 
-static void	zx_attach(device_t, device_t, void *);
-static int	zx_match(device_t, struct cfdata *, void *);
+void	zx_attach(struct device *, struct device *, void *);
+int	zx_match(struct device *, struct cfdata *, void *);
 
-static void	zx_blank(device_t);
-static int	zx_cmap_put(struct zx_softc *);
-static void	zx_copyrect(struct zx_softc *, int, int, int, int, int, int);
-static int	zx_cross_loadwid(struct zx_softc *, u_int, u_int, u_int);
-static int	zx_cross_wait(struct zx_softc *);
-static void	zx_fillrect(struct zx_softc *, int, int, int, int, uint32_t, int);
-static int	zx_intr(void *);
-static void	zx_reset(struct zx_softc *);
-static void	zx_unblank(device_t);
-
-static void	zx_cursor_blank(struct zx_softc *);
-static void	zx_cursor_color(struct zx_softc *);
-static void	zx_cursor_move(struct zx_softc *);
-static void	zx_cursor_set(struct zx_softc *);
-static void	zx_cursor_unblank(struct zx_softc *);
-
-static void	zx_copycols(void *, int, int, int, int);
-static void	zx_copyrows(void *, int, int, int);
-static void	zx_do_cursor(void *, int, int, int);
-static void	zx_erasecols(void *, int, int, int, long);
-static void	zx_eraserows(void *, int, int, long);
-static void	zx_putchar(void *, int, int, u_int, long);
+void	zx_blank(struct device *);
+int	zx_cmap_put(struct zx_softc *);
+void	zx_copyrect(struct rasops_info *, int, int, int, int, int, int);
+int	zx_cross_loadwid(struct zx_softc *, u_int, u_int, u_int);
+int	zx_cross_wait(struct zx_softc *);
+void	zx_fillrect(struct rasops_info *, int, int, int, int, long, int);
+int	zx_intr(void *);
+void	zx_reset(struct zx_softc *);
+void	zx_unblank(struct device *);
+
+void	zx_cursor_blank(struct zx_softc *);
+void	zx_cursor_color(struct zx_softc *);
+void	zx_cursor_move(struct zx_softc *);
+void	zx_cursor_set(struct zx_softc *);
+void	zx_cursor_unblank(struct zx_softc *);
+
+void	zx_copycols(void *, int, int, int, int);
+void	zx_copyrows(void *, int, int, int);
+void	zx_cursor(void *, int, int, int);
+void	zx_do_cursor(struct rasops_info *);
+void	zx_erasecols(void *, int, int, int, long);
+void	zx_eraserows(void *, int, int, long);
+void	zx_putchar(void *, int, int, u_int, long);
 
 struct 

CVS commit: [netbsd-5] src/sys/dev/sbus

2009-10-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 18 14:34:58 UTC 2009

Modified Files:
src/sys/dev/sbus [netbsd-5]: p9100reg.h

Log Message:
back out ticket #993


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.1 -r1.4.10.2 src/sys/dev/sbus/p9100reg.h

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/p9100reg.h
diff -u src/sys/dev/sbus/p9100reg.h:1.4.10.1 src/sys/dev/sbus/p9100reg.h:1.4.10.2
--- src/sys/dev/sbus/p9100reg.h:1.4.10.1	Sun Oct 18 14:06:36 2009
+++ src/sys/dev/sbus/p9100reg.h	Sun Oct 18 14:34:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: p9100reg.h,v 1.4.10.1 2009/10/18 14:06:36 bouyer Exp $ */
+/*	$NetBSD: p9100reg.h,v 1.4.10.2 2009/10/18 14:34:58 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -50,8 +50,7 @@
 	#define DAC_INDX_AUTOINCR	0x01
 	
 #define DAC_VERSION	0x01
-#define DAC_MISC_CLK0x02
-#define DAC_POWER_MGT	0x05
+#define DAC_POWER	0x05
 	#define DAC_POWER_SCLK_DISABLE	0x10
 	#define DAC_POWER_DDOT_DISABLE	0x08
 	#define DAC_POWER_SYNC_DISABLE	0x04
@@ -59,34 +58,7 @@
 	#define DAC_POWER_ICLK_DISABLE	0x02
 	/* Disable internal DAC power */
 	#define DAC_POWER_IPWR_DISABLE	0x01
-#define DAC_OPERATION   0x06
-	#define DAC_SYNC_ON_GREEN   0x08
-#define DAC_PALETTE_CTRL 0x07
-#define DAC_PIXEL_FMT   0x0a
-#define DAC_8BIT_CTRL   0x0b
-	#define DAC8_DIRECT_COLOR   0x01
-#define DAC_16BIT_CTRL  0x0c
-	#define DAC16_INDIRECT_COLOR0x00
-	#define DAC16_DYNAMIC_COLOR 0x40
-	#define DAC16_DIRECT_COLOR  0xc0
-	#define DAC16_BYPASS_POLARITY   0x20
-	#define DAC16_BIT_FILL_LINEAR   0x04
-	#define DAC16_555   0x00
-	#define DAC16_565   0x02
-	#define DAC16_CONTIGUOUS0x01
-#define DAC_24BIT_CTRL  0x0d
-	#define DAC24_DIRECT_COLOR  0x01
-#define DAC_32BIT_CTRL  0x0e
-	#define DAC32_BYPASS_POLARITY   0x04
-	#define DAC32_INDIRECT_COLOR0x00
-	#define DAC32_DYNAMIC_COLOR 0x01
-	#define DAC32_DIRECT_COLOR  0x03
-#define DAC_VCO_DIV 0x16
-#define DAC_PLL00x20
-#define DAC_MISC_1  0x70
-#define DAC_MISC_2  0x71
-#define DAC_MISC_3  0x72
-  
+
 #define DAC_CURSOR_CTL	0x30
 	#define DAC_CURSOR_OFF	0x00
 	#define DAC_CURSOR_WIN	0x02
@@ -102,51 +74,6 @@
 #define DAC_PIX_PLL		0x8e
 #define DAC_CURSOR_DATA		0x100
 
-/* main registers */
-#define SYS_CONF0x0004  /* System Configuration Register */
-#define BUFFER_WRITE_1  0x0200  /* writes got o buffer 1 */
-#define BUFFER_WRITE_0  0x  /* writes go to buffer 0 */
-#define BUFFER_READ_1   0x0400  /* read from buffer 1 */
-#define BUFFER_READ_0   0x  
-#define MEM_SWAP_BITS   0x0800  /* swap bits when accessing VRAM */
-#define MEM_SWAP_BYTES  0x1000  /* swap bytes when accessing VRAM */
-#define MEM_SWAP_HWORDS 0x2000  /* swap halfwords when accessing VRAM */
-#define SHIFT_0 14  
-#define SHIFT_1 17
-#define SHIFT_2 20
-#define SHIFT_3 29
-#define PIXEL_SHIFT 26
-#define SWAP_SHIFT  11
-/* this is what the 3GX manual says */
-#define SC_8BIT 2
-#define SC_16BIT3
-#define SC_24BIT7
-#define SC_32BIT5
-
-/* video controller registers */
-#define VID_HCOUNTER0x104
-#define VID_HTOTAL  0x108
-#define VID_HSRE0x10c   /* hsync raising edge */
-#define VID_HBRE0x110   /* hblank raising edge */
-#define VID_HBFE0x114   /* hblank falling edge */
-#define VID_HCNTPRLD0x118   /* hcounter preload */
-#define VID_VCOUNTER0x11c   /* vcounter */
-#define VID_VLENGTH 0x120   /* lines, including blanks */
-#define VID_VSRE0x124   /* vsync raising edge */
-#define VID_VBRE0x128   /* vblank raising edge */
-#define VID_VBFE0x12c   /* vblank falling edge */
-#define VID_VCNTPRLD0x130   /* vcounter preload */
-#define VID_SRADDR  0x134   /* screen repaint address */
-#define VID_SRTC0x138   /* screen repaint timing control */
-#define VID_QSFCNTR 0x13c   /* QSF counter */
-
-#define VID_MEM_CONFIG  0x184   /* memory config */
-#define VID_RFPERIOD0x188   /* refresh period */
-#define VID_RFCOUNT 0x18c   /* refresh counter */
-#define VID_RLMAX   0x190   /* RAS low max */
-#define VID_RLCUR   0x194   /* RAS low current */
-#define VID_DACSYNC 0x198   /* read after last DAC access */
-
 #define ENGINE_STATUS	0x2000	/* drawing engine status register */
 	#define BLITTER_BUSY	0x8000
 	#define ENGINE_BUSY	0x4000
@@ -157,7 +84,7 @@
 /* apparently bits 2-6 control how many pixels we write - n+1 */
 
 /* drawing engine registers */
-#define COORD_INDEX		0x218c
+#define