CVS commit: src/sys/arch/sgimips/gio

2019-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov 21 22:05:09 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: gio.c

Log Message:
ga_iot = 0 -> normal_memt
now a Challenge S should work again
from George Harvey


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sgimips/gio/gio.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/arch/sgimips/gio/gio.c
diff -u src/sys/arch/sgimips/gio/gio.c:1.35 src/sys/arch/sgimips/gio/gio.c:1.36
--- src/sys/arch/sgimips/gio/gio.c:1.35	Wed Jul 20 22:16:37 2016
+++ src/sys/arch/sgimips/gio/gio.c	Thu Nov 21 22:05:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gio.c,v 1.35 2016/07/20 22:16:37 macallan Exp $	*/
+/*	$NetBSD: gio.c,v 1.36 2019/11/21 22:05:09 macallan Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gio.c,v 1.35 2016/07/20 22:16:37 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gio.c,v 1.36 2019/11/21 22:05:09 macallan Exp $");
 
 #include "opt_ddb.h"
 
@@ -329,7 +329,7 @@ gio_search(device_t parent, cfdata_t cf,
 
 		ga->ga_slot = cf->cf_loc[GIOCF_SLOT];
 		ga->ga_addr = cf->cf_loc[GIOCF_ADDR];
-		ga->ga_iot = 0;
+		ga->ga_iot = normal_memt;
 		ga->ga_ioh = MIPS_PHYS_TO_KSEG1(ga->ga_addr);
 
 		if (config_match(parent, cf, ga) > 0)



CVS commit: src/sys/arch/sgimips/gio

2019-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov 21 22:05:09 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: gio.c

Log Message:
ga_iot = 0 -> normal_memt
now a Challenge S should work again
from George Harvey


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sgimips/gio/gio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sgimips/gio

2019-05-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu May 16 23:42:23 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: newportreg.h

Log Message:
Even more registers!


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sgimips/gio/newportreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sgimips/gio

2019-05-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu May 16 23:42:23 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: newportreg.h

Log Message:
Even more registers!


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sgimips/gio/newportreg.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/arch/sgimips/gio/newportreg.h
diff -u src/sys/arch/sgimips/gio/newportreg.h:1.8 src/sys/arch/sgimips/gio/newportreg.h:1.9
--- src/sys/arch/sgimips/gio/newportreg.h:1.8	Fri May 10 22:54:51 2019
+++ src/sys/arch/sgimips/gio/newportreg.h	Thu May 16 23:42:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: newportreg.h,v 1.8 2019/05/10 22:54:51 macallan Exp $	*/
+/*	$NetBSD: newportreg.h,v 1.9 2019/05/16 23:42:23 macallan Exp $	*/
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -145,6 +145,14 @@
 #define REX3_REG_COLORBACK		0x0018
 #define REX3_REG_COLORVRAM		0x001c
 
+#define REX3_REG_ALPHAREF		0x0020
+#define REX3_REG_STALL0			0x0024	/* stall until engine is idle */
+
+#define REX3_REG_SMASK0X		0x0028	/* min/max 16.16 */  
+#define REX3_REG_SMASK0Y		0x002c	/* min/max 16.16 */  
+
+#define REX3_REG_SETUP			0x0030  
+
 #define REX3_REG_XSTART			0x0100
 
 #define REX3_REG_XYMOVE			0x0114
@@ -162,6 +170,9 @@
 
 #define REX3_REG_COLORI			0x0224
 
+#define REX3_REG_HOSTRW0		0x0230
+#define REX3_REG_HOSTRW1		0x0234
+
 #define REX3_REG_DCBMODE		0x0238
 #define  REX3_DCBMODE_DW_MASK		0x0003
 #define   REX3_DCBMODE_DW_4		0x
@@ -190,6 +201,16 @@
 /* Not really a register, but in the same space */
 #define REX3_REG_GO			0x0800
 
+/* clipping regions, enable/disable in REG_CLIPMODE */
+#define REX3_REG_SMASK1X		0x1300	/* min/max 16.16 */  
+#define REX3_REG_SMASK1Y		0x1304	/* min/max 16.16 */  
+#define REX3_REG_SMASK2X		0x1308	/* min/max 16.16 */  
+#define REX3_REG_SMASK2Y		0x130c	/* min/max 16.16 */  
+#define REX3_REG_SMASK3X		0x1310	/* min/max 16.16 */  
+#define REX3_REG_SMASK3Y		0x1314	/* min/max 16.16 */  
+#define REX3_REG_SMASK4X		0x1318	/* min/max 16.16 */  
+#define REX3_REG_SMASK4Y		0x131c	/* min/max 16.16 */  
+
 #define REX3_REG_TOPSCAN		0x1320
 #define REX3_REG_XYWIN			0x1324
 #define REX3_REG_CLIPMODE		0x1328
@@ -203,6 +224,8 @@
 #define  REX3_CLIPMODE_CIDMATCH2	0x0800
 #define  REX3_CLIPMODE_CIDMATCH3	0x1000
 
+#define REX3_REG_STALL1			0x132c
+#define REX3_REG_CONFIG			0x1330
 
 #define REX3_REG_STATUS			0x1338
 #define  REX3_STATUS_GFXBUSY		0x0008



CVS commit: src/sys/arch/sgimips/gio

2019-05-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 10 23:21:42 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: newport.c

Log Message:
general overhaul, in no particular order:
- use MIPS_PHYS_TO_KSEG1()
- get rid of duplicated rasops_allocattr() and _mapchar() methods
- use rasops_init()
- support fonts that aren't 8x16
- use fastclear mode for rectangle fills
- don't mess with XMAP9's config register
- initialize all 32 XMAP9 mode registers, just in case
- make newport_fill_rectangle() use x, y, wi, he like everyone else
- use R3G3B2 palette in preparation for alpha font support


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sgimips/gio/newport.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sgimips/gio

2019-05-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 10 23:21:42 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: newport.c

Log Message:
general overhaul, in no particular order:
- use MIPS_PHYS_TO_KSEG1()
- get rid of duplicated rasops_allocattr() and _mapchar() methods
- use rasops_init()
- support fonts that aren't 8x16
- use fastclear mode for rectangle fills
- don't mess with XMAP9's config register
- initialize all 32 XMAP9 mode registers, just in case
- make newport_fill_rectangle() use x, y, wi, he like everyone else
- use R3G3B2 palette in preparation for alpha font support


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sgimips/gio/newport.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/arch/sgimips/gio/newport.c
diff -u src/sys/arch/sgimips/gio/newport.c:1.19 src/sys/arch/sgimips/gio/newport.c:1.20
--- src/sys/arch/sgimips/gio/newport.c:1.19	Tue Aug 25 02:09:18 2015
+++ src/sys/arch/sgimips/gio/newport.c	Fri May 10 23:21:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: newport.c,v 1.19 2015/08/25 02:09:18 macallan Exp $	*/
+/*	$NetBSD: newport.c,v 1.20 2019/05/10 23:21:42 macallan Exp $	*/
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: newport.c,v 1.19 2015/08/25 02:09:18 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: newport.c,v 1.20 2019/05/10 23:21:42 macallan Exp $");
 
 #include 
 #include 
@@ -73,7 +73,6 @@ struct newport_devconfig {
 
 	int			dc_font;
 	struct wsscreen_descr	*dc_screen;
-	struct wsdisplay_font	*dc_fontdata;
 	int			dc_mode;
 	struct vcons_data	dc_vd;
 };
@@ -87,13 +86,11 @@ CFATTACH_DECL_NEW(newport, sizeof(struct
 /* textops */
 static void newport_cursor(void *, int, int, int);
 static void newport_cursor_dummy(void *, int, int, int);
-static int  newport_mapchar(void *, int, unsigned int *);
 static void newport_putchar(void *, int, int, u_int, long);
 static void newport_copycols(void *, int, int, int, int);
 static void newport_erasecols(void *, int, int, int, long);
 static void newport_copyrows(void *, int, int, int);
 static void newport_eraserows(void *, int, int, long);
-static int  newport_allocattr(void *, int, int, int, long *);
 
 static void newport_init_screen(void *, struct vcons_screen *, int, long *);
 
@@ -107,22 +104,10 @@ static struct wsdisplay_accessops newpor
 	.mmap		= newport_mmap,
 };
 
-static struct wsdisplay_emulops newport_textops = {
-	.cursor		= newport_cursor_dummy,
-	.mapchar	= newport_mapchar,
-	.putchar	= newport_putchar,
-	.copycols	= newport_copycols,
-	.erasecols	= newport_erasecols,
-	.copyrows	= newport_copyrows,
-	.eraserows	= newport_eraserows,
-	.allocattr	= newport_allocattr
-};
-
 static struct wsscreen_descr newport_screen = {
 	.name		= "default",
 	.ncols		= 160,
 	.nrows		= 64,
-	.textops	= &newport_textops,
 	.fontwidth	= 8,
 	.fontheight	= 16,
 	.capabilities	= WSSCREEN_WSCOLORS | WSSCREEN_HILIT | WSSCREEN_REVERSE
@@ -141,11 +126,7 @@ static struct vcons_screen newport_conso
 static struct newport_devconfig newport_console_dc;
 static int newport_is_console = 0;
 
-#define NEWPORT_ATTR_ENCODE(fg,bg)	(((fg) << 8) | (bg))
-#define NEWPORT_ATTR_BG(a)		((a) & 0xff)
-#define NEWPORT_ATTR_FG(a)		(((a) >> 8) & 0xff)
-
-extern const u_char rasops_cmap[768];
+uint8_t our_cmap[768];
 
 / Low-level hardware register groveling functions /
 static void
@@ -273,9 +254,19 @@ xmap9_write(struct newport_devconfig *dc
 	rex3_write(dc, REX3_REG_DCBDATA0, val << 24);
 }
 
+static inline void
+xmap9_wait(struct newport_devconfig *dc)
+{
+	do {} while (xmap9_read(dc, XMAP9_DCBCRS_FIFOAVAIL) == 0);
+}
+
 static void
 xmap9_write_mode(struct newport_devconfig *dc, uint8_t index, uint32_t mode)
 {
+	volatile uint32_t junk;	
+	/* wait for FIFO if needed */
+	xmap9_wait(dc);
+
 	rex3_write(dc, REX3_REG_DCBMODE,
 	REX3_DCBMODE_DW_4 |
 	(NEWPORT_DCBADDR_XMAP_BOTH << REX3_DCBMODE_DCBADDR_SHIFT) |
@@ -284,30 +275,40 @@ xmap9_write_mode(struct newport_devconfi
 	(2 << REX3_DCBMODE_CSHOLD_SHIFT) |
 	(1 << REX3_DCBMODE_CSSETUP_SHIFT));
 
+	xmap9_wait(dc);
+
 	rex3_write(dc, REX3_REG_DCBDATA0, (index << 24) | mode);
+	junk = rex3_read(dc, REX3_REG_DCBDATA0);
+	__USE(junk);
 }
 
 / Helper functions /
 static void
-newport_fill_rectangle(struct newport_devconfig *dc, int x1, int y1, int x2,
-int y2, uint8_t color)
+newport_fill_rectangle(struct newport_devconfig *dc, int x1, int y1, int wi,
+int he, uint32_t color)
 {
+	int x2 = x1 + wi - 1;
+	int y2 = y1 + he - 1;
+
 	rex3_wait_gfifo(dc);
 	
 	rex3_write(dc, REX3_REG_DRAWMODE0, REX3_DRAWMODE0_OPCODE_DRAW |
 	REX3_DRAWMODE0_ADRMODE_BLOCK | REX3_DRAWMODE0_DOSETUP |
 	REX3_DRAWMODE0_STOPONX | REX3_DRAWMODE0_STOPONY);
+	rex3_write(dc, REX3_REG_CLIPMODE, 0x1e00);
 	rex3_write(dc, REX3_REG_DRAWMODE1,
-	REX3_DRAWMODE1_PLANES_CI |
+	REX3_DRAWMODE1_PLAN

CVS commit: src/sys/arch/sgimips/gio

2019-05-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 10 22:54:51 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: newportreg.h

Log Message:
move the CIDMATCH bits where they belong, now FASTCLEAR mode can actually work


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sgimips/gio/newportreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/sgimips/gio

2019-05-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 10 22:54:51 UTC 2019

Modified Files:
src/sys/arch/sgimips/gio: newportreg.h

Log Message:
move the CIDMATCH bits where they belong, now FASTCLEAR mode can actually work


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sgimips/gio/newportreg.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/arch/sgimips/gio/newportreg.h
diff -u src/sys/arch/sgimips/gio/newportreg.h:1.7 src/sys/arch/sgimips/gio/newportreg.h:1.8
--- src/sys/arch/sgimips/gio/newportreg.h:1.7	Sat May  4 00:45:18 2019
+++ src/sys/arch/sgimips/gio/newportreg.h	Fri May 10 22:54:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: newportreg.h,v 1.7 2019/05/04 00:45:18 macallan Exp $	*/
+/*	$NetBSD: newportreg.h,v 1.8 2019/05/10 22:54:51 macallan Exp $	*/
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -198,10 +198,10 @@
 #define  REX3_CLIPMODE_SMASK2		0x0004
 #define  REX3_CLIPMODE_SMASK3		0x0008
 #define  REX3_CLIPMODE_SMASK4		0x0010
-#define  REX3_CLIPMODE_CIDMATCH0	0x0100
-#define  REX3_CLIPMODE_CIDMATCH1	0x0200
-#define  REX3_CLIPMODE_CIDMATCH2	0x0400
-#define  REX3_CLIPMODE_CIDMATCH3	0x0800
+#define  REX3_CLIPMODE_CIDMATCH0	0x0200
+#define  REX3_CLIPMODE_CIDMATCH1	0x0400
+#define  REX3_CLIPMODE_CIDMATCH2	0x0800
+#define  REX3_CLIPMODE_CIDMATCH3	0x1000
 
 
 #define REX3_REG_STATUS			0x1338