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 
-__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 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 COORD

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 
-__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 
 #include 
@@ -66,58 +66,45 @@
 #include 
 #include 
 
-#include "wsdisplay.h"
-#if NWSDISPLAY > 0
-#include 
-#include 
-#include 
-#include 
-
-#include "opt_wsemul.h"
-#endif
-
 #include 
 #include 
 #include 
 
 #include 
 
-#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 zx_mmo {
 	off_t	mo_va;
@@ -137,66 +124,22 @@
 	{ ZX_LD_GBL_VOFF,	ZX_OFF_LD_GBL,		0x1000 },
 };
 
-CFATTACH_DECL_NEW(zx, sizeof(struct zx_softc),
+CFATTACH_DECL(zx, sizeof(struct zx_softc),
 zx_match, zx_at

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 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 
-__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 
 #include 
@@ -66,45 +66,58 @@
 #include 
 #include 
 
+#include "wsdisplay.h"
+#if NWSDISPLAY > 0
+#include 
+#include 
+#include 
+#include 
+
+#include "opt_wsemul.h"
+#endif
+
 #include 
 #include 
 #include 
 
 #include 
 
-#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 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);
 
 st

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

2009-06-19 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun 19 21:25:22 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #818):
sys/dev/sbus/if_le_ledma.c: revision 1.31
Don't immediately switch UTP/AUI ports on lost carrior.
It may take a while for modern switches to set 10baseT media.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.10.1 src/sys/dev/sbus/if_le_ledma.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/if_le_ledma.c
diff -u src/sys/dev/sbus/if_le_ledma.c:1.30 src/sys/dev/sbus/if_le_ledma.c:1.30.10.1
--- src/sys/dev/sbus/if_le_ledma.c:1.30	Mon Apr 28 20:23:57 2008
+++ src/sys/dev/sbus/if_le_ledma.c	Fri Jun 19 21:25:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_le_ledma.c,v 1.30 2008/04/28 20:23:57 martin Exp $	*/
+/*	$NetBSD: if_le_ledma.c,v 1.30.10.1 2009/06/19 21:25:21 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.30 2008/04/28 20:23:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.30.10.1 2009/06/19 21:25:21 snj Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -83,6 +83,8 @@
 	bus_space_handle_t	sc_reg;		/* LANCE registers */
 	struct	lsi64854_softc	*sc_dma;	/* pointer to my dma */
 	u_int			sc_laddr;	/* LANCE DMA address */
+	u_int			sc_lostcount;
+#define LE_LOSTTHRESH	5	/* lost carrior count to switch media */
 };
 
 #define MEMSIZE		(16*1024)	/* LANCE memory size */
@@ -277,6 +279,12 @@
 {
 	struct le_softc *lesc = (struct le_softc *)sc;
 
+	/* it may take a while for modern switches to set 10baseT media */
+	if (lesc->sc_lostcount++ < LE_LOSTTHRESH)
+		return;
+
+	lesc->sc_lostcount = 0;
+
 	/*
 	 * Check if the user has requested a certain cable type, and
 	 * if so, honor that request.
@@ -379,7 +387,7 @@
 	lesc->sc_laddr = lesc->sc_dmamap->dm_segs[0].ds_addr;
 	sc->sc_addr = lesc->sc_laddr & 0xff;
 	sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON;
-
+	lesc->sc_lostcount = 0;
 
 	/* Assume SBus is grandparent */
 	lesc->sc_sd.sd_reset = (void *)lance_reset;



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

2009-04-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Apr  3 17:45:31 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #647):
sys/dev/sbus/zx.c: revision 1.25
sys/dev/sbus/zxreg.h: revision 1.6
sys/dev/sbus/zxvar.h: revision 1.3
Use bus_space(9) to access registers.  SETREG() macro using bogus casts
against packed structures doesn't work on gcc4. (no character on screen)
See also:
http://mail-index.NetBSD.org/port-sparc/2003/11/11/0002.html
Should be pulled up to netbsd-4 and netbsd-5.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.6.1 src/sys/dev/sbus/zx.c
cvs rdiff -u -r1.5 -r1.5.4.1 src/sys/dev/sbus/zxreg.h
cvs rdiff -u -r1.2 -r1.2.10.1 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/zx.c
diff -u src/sys/dev/sbus/zx.c:1.24 src/sys/dev/sbus/zx.c:1.24.6.1
--- src/sys/dev/sbus/zx.c:1.24	Wed Jun 11 21:25:31 2008
+++ src/sys/dev/sbus/zx.c	Fri Apr  3 17:45:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: zx.c,v 1.24 2008/06/11 21:25:31 drochner Exp $	*/
+/*	$NetBSD: zx.c,v 1.24.6.1 2009/04/03 17:45:31 snj Exp $	*/
 
 /*
  *  Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.24 2008/06/11 21:25:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.24.6.1 2009/04/03 17:45:31 snj Exp $");
 
 #include 
 #include 
@@ -76,9 +76,6 @@
 #error Sorry, this driver needs the RASTERCONSOLE option
 #endif
 
-/* Force 32-bit writes. */
-#define	SETREG(r, v)	(*((volatile u_int32_t *)&r) = (v))
-
 #define	ZX_STD_ROP	(ZX_ROP_NEW | ZX_ATTR_WE_ENABLE | \
 ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID)
 
@@ -160,7 +157,6 @@
 	bus_space_tag_t bt;
 	struct fbdevice *fb;
 	struct rasops_info *ri;
-	volatile struct zx_command *zc;
 	int isconsole;
 
 	sc = device_private(self);
@@ -185,36 +181,35 @@
 		aprint_error_dev(self, "can't map zc\n");
 		return;
 	}
-	sc->sc_zc = (struct zx_command *)bus_space_vaddr(bt, bh);
+	sc->sc_bhzc = bh;
 
 	if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_LD_SS0,
 	PAGE_SIZE, BUS_SPACE_MAP_LINEAR, &bh) != 0) {
 		aprint_error_dev(self, "can't map ld/ss0\n");
 		return;
 	}
-	sc->sc_zd_ss0 = (struct zx_draw *)bus_space_vaddr(bt, bh);
+	sc->sc_bhzdss0 = bh;
 
 	if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_LD_SS1,
 	PAGE_SIZE, BUS_SPACE_MAP_LINEAR, &bh) != 0) {
 		aprint_error_dev(self, "can't map ld/ss1\n");
 		return;
 	}
-	sc->sc_zd_ss1 =
-	(struct zx_draw_ss1 *)bus_space_vaddr(bt, bh);
+	sc->sc_bhzdss1 = bh;
 
 	if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_LX_CROSS,
 	PAGE_SIZE, BUS_SPACE_MAP_LINEAR, &bh) != 0) {
 		aprint_error_dev(self, "can't map zx\n");
 		return;
 	}
-	sc->sc_zx = (struct zx_cross *)bus_space_vaddr(bt, bh);
+	sc->sc_bhzx = bh;
 
 	if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_LX_CURSOR,
 	PAGE_SIZE, BUS_SPACE_MAP_LINEAR, &bh) != 0) {
 		aprint_error_dev(self, "can't map zcu\n");
 		return;
 	}
-	sc->sc_zcu = (struct zx_cursor *)bus_space_vaddr(bt, bh);
+	sc->sc_bhzcu = bh;
 
 	fb->fb_driver = &zx_fbdriver;
 	fb->fb_device = &sc->sc_dv;
@@ -248,14 +243,13 @@
 	 * called before we get our hooks in place.  So, we mask off access
 	 * to the framebuffer until it's done.
 	 */
-	zc = sc->sc_zc;
-	SETREG(zc->zc_fontt, 1);
-	SETREG(zc->zc_fontmsk, 0);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzc, zc_fontt, 1);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzc, zc_fontmsk, 0);
 
 	fbrcons_init(&sc->sc_fb);
 
-	SETREG(zc->zc_fontt, 0);
-	SETREG(zc->zc_fontmsk, 0x);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzc, zc_fontt, 0);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzc, zc_fontmsk, 0x);
 
 	ri->ri_hw = sc;
 	ri->ri_do_cursor = zx_do_cursor;
@@ -487,13 +481,9 @@
 void
 zx_reset(struct zx_softc *sc)
 {
-	volatile struct zx_draw *zd;
-	volatile struct zx_command *zc;
 	struct fbtype *fbt;
 	u_int i;
 
-	zd = sc->sc_zd_ss0;
-	zc = sc->sc_zc;
 	fbt = &sc->sc_fb.fb_type;
 
 	zx_cross_loadwid(sc, ZX_WID_DBL_8, 0, 0x2c0);
@@ -501,24 +491,25 @@
 	zx_cross_loadwid(sc, ZX_WID_DBL_8, 2, 0x20);
 	zx_cross_loadwid(sc, ZX_WID_DBL_24, 1, 0x30);
 
-	i = sc->sc_zd_ss1->zd_misc;
+	i = bus_space_read_4(sc->sc_bt, sc->sc_bhzdss1, zd_misc);
 	i |= ZX_SS1_MISC_ENABLE;
-	SETREG(sc->sc_zd_ss1->zd_misc, i);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzdss1, zd_misc, i);
 
-	SETREG(zd->zd_wid, 0x);
-	SETREG(zd->zd_widclip, 0);
-	SETREG(zd->zd_wmask, 0x);
-	SETREG(zd->zd_vclipmin, 0);
-	SETREG(zd->zd_vclipmax,
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzdss0, zd_wid, 0x);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzdss0, zd_widclip, 0);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzdss0, zd_wmask, 0x);
+	bus_space_write_4(sc->sc_bt, sc->sc_bhzdss0, zd_vclipmin, 0);
+	bus_space_write_4(sc->sc_bt, sc-