Module Name:    src
Committed By:   macallan
Date:           Wed Mar 30 18:25:31 UTC 2011

Modified Files:
        src/sys/arch/sgimips/dev: crmfbreg.h

Log Message:
add a bunch of GBE registers, no functional change (yet)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sgimips/dev/crmfbreg.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/dev/crmfbreg.h
diff -u src/sys/arch/sgimips/dev/crmfbreg.h:1.11 src/sys/arch/sgimips/dev/crmfbreg.h:1.12
--- src/sys/arch/sgimips/dev/crmfbreg.h:1.11	Tue Mar  1 21:47:13 2011
+++ src/sys/arch/sgimips/dev/crmfbreg.h	Wed Mar 30 18:25:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crmfbreg.h,v 1.11 2011/03/01 21:47:13 macallan Exp $ */
+/* $NetBSD: crmfbreg.h,v 1.12 2011/03/30 18:25:31 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -34,26 +34,137 @@
 #ifndef CRMFBREG_H
 #define CRMFBREG_H
 
+#define	CRMFB_CTRLSTAT		0x00000000
+#define		CRMFB_CTRLSTAT_CHIPID_MASK	0x0000000f
+#define		CRMFB_CTRLSTAT_SENSE		0x00000010 /* monitor sense pin */
+#define		CRMFB_CTRLSTAT_GPIO0_SENSE	0x00000040
+#define		CRMFB_CTRLSTAT_GPIO0_INPUT	0x00000080
+#define		CRMFB_CTRLSTAT_GPIO1_SENSE	0x00000100
+#define		CRMFB_CTRLSTAT_GPIO1_INPUT	0x00000200
+#define		CRMFB_CTRLSTAT_GPIO2_SENSE	0x00000400
+#define		CRMFB_CTRLSTAT_GPIO2_INPUT	0x00000800
+#define		CRMFB_CTRLSTAT_GPIO3_SENSE	0x00001000
+#define		CRMFB_CTRLSTAT_GPIO3_INPUT	0x00002000
+#define		CRMFB_CTRLSTAT_GPIO4_SENSE	0x00004000
+#define		CRMFB_CTRLSTAT_GPIO4_INPUT	0x00008000
+#define		CRMFB_CTRLSTAT_GPIO5_SENSE	0x00010000
+#define		CRMFB_CTRLSTAT_GPIO5_INPUT	0x00020000
+#define		CRMFB_CTRLSTAT_GPIO6_SENSE	0x00040000
+#define		CRMFB_CTRLSTAT_GPIO6_INPUT	0x00080000
+#define		CRMFB_CTRLSTAT_GPIO7_SENSE	0x00100000
+#define		CRMFB_CTRLSTAT_GPIO7_INPUT	0x00200000
+#define		CRMFB_CTRLSTAT_GPIO8_SENSE	0x00400000
+#define		CRMFB_CTRLSTAT_GPIO8_INPUT	0x00800000
+#define		CRMFB_CTRLSTAT_GPIO9_SENSE	0x01000000
+#define		CRMFB_CTRLSTAT_GPIO9_INPUT	0x02000000
+#define		CRMFB_CTRLSTAT_HALF_PHASE	0x04000000 /* for flat panel */
+#define		CRMFB_CTRLSTAT_CSYNC_ALOW	0x08000000 /* csync active low */
+#define		CRMFB_CTRLSTAT_EXTERNAL_PCLK	0x00000000
+#define		CRMFB_CTRLSTAT_DIFF_PCLK	0x10000000 /* differential pclock */
+#define		CRMFB_CTRLSTAT_INTERNAL_PCLK	0x30000000
+
 #define CRMFB_DOTCLOCK		0x00000004
+#define		CRMFB_DOTCLOCK_M_MASK		0x000000ff
+#define		CRMFB_DOTCLOCK_N_MASK		0x00003f00
+#define		CRMFB_DOTCLOCK_P_MASK		0x0000c000
 #define		CRMFB_DOTCLOCK_CLKRUN_SHIFT	20
-#define CRMFB_VT_XY		0x00010000
+#define		CRMFB_DOTCLOCK_OUT_OF_RANGE	0x00400000
+#define		CRMFB_DOTCLOCK_OUT_OF_LOCK	0x00800000
+#define		CRMFB_DOTCLOCK_TDWNI		0x01000000 /* ? */
+#define		CRMFB_DOTCLOCK_TUPI		0x02000000 /* ? */
+
+#define CRMFB_I2C_VGA		0x00000008
+#define 	CRMFB_I2C_SDA			0x00000001
+#define 	CRMFB_I2C_SCL			0x00000002
+
+#define CRMFB_SYSCLK		0x0000000c
+
+#define CRMFB_I2C_FP		0x00000010 /* same bits as CRMFB_I2C_VGA */
+
+#define CRMFB_DEVICE_ID		0x00000014
+#define		CRMFB_DEVICE_ID_DEF		0x00000666 /* this chip is EVIL */
+
+
+#define CRMFB_VT_XY		0x00010000 /* pixel / line counters */
+#define		CRMFB_VT_XY_X_MASK		0x00000fff
+#define		CRMFB_VT_XY_Y_MASK		0x00fff000
 #define		CRMFB_VT_XY_FREEZE_SHIFT	31
+#define CRMFB_VT_MAX		0x00010004 /* same masks as CRMFB_VT_XY, counters in
+					    * CRMFB_VT_XY reset when reaching max */
+#define CRMFB_VT_VSYNC		0x00010008
+#define		CRMFB_VT_VSYNC_OFF_MASK		0x00000fff
+#define		CRMFB_VT_VSYNC_ON_MASK		0x00fff000
+#define CRMFB_VT_HSYNC		0x0001000c
+#define		CRMFB_VT_HSYNC_OFF_MASK		0x00000fff
+#define		CRMFB_VT_HSYNC_ON_MASK		0x00fff000
+#define CRMFB_VT_VBLANK		0x00010010
+#define		CRMFB_VT_VBLANK_OFF_MASK	0x00000fff
+#define		CRMFB_VT_VBLANK_ON_MASK		0x00fff000
+#define CRMFB_VT_HBLANK		0x00010014
+#define		CRMFB_VT_HBLANK_OFF_MASK	0x00000fff
+#define		CRMFB_VT_HBLANK_ON_MASK		0x00fff000
+
 #define	CRMFB_VT_FLAGS		0x00010018
+#define 	CRMFB_VT_FLAGS_VDRV_INVERT	0x00000001
+#define 	CRMFB_VT_FLAGS_VDRV_LOW		0x00000002
+#define 	CRMFB_VT_FLAGS_HDRV_INVERT	0x00000004
+#define 	CRMFB_VT_FLAGS_HDRV_LOW		0x00000008 /* put monitor to sleep */
+#define 	CRMFB_VT_FLAGS_SYNC_HIGH	0x00000010
+#define 	CRMFB_VT_FLAGS_SYNC_LOW		0x00000020
 #define		CRMFB_VT_FLAGS_SYNC_LOW_MSB	5
 #define		CRMFB_VT_FLAGS_SYNC_LOW_LSB	5
+#define 	CRMFB_VT_FLAGS_F2RF_HIGH	0x00000040 /* sync left/right ? */
+
+#define CRMFB_VT_FRAMELOCK	0x0001001c
+#define		CRMFB_VT_FRAMELOCK_F2RF_MASK	0x00000fff /* f2rf toggles when y
+							    * reaches this */
+#define		CRMFB_VT_FRAMELOCK_LOCK_MASK	0x00fff000
+
+/* scanline interrupts! */
 #define CRMFB_VT_INTR01		0x00010020
-#define		CRMFB_VT_INTR01_EN		0xffffffff
+#define		CRMFB_INTR_1_MASK		0x00000fff /* intr1 when y == this */
+#define		CRMFB_INTR_0_MASK		0x00fff000 /* intr0 when y == this */
 #define CRMFB_VT_INTR23		0x00010024
-#define		CRMFB_VT_INTR23_EN		0xffffffff
+#define		CRMFB_INTR_3_MASK		0x00000fff /* intr3 when y == this */
+#define		CRMFB_INTR_2_MASK		0x00fff000 /* intr2 when y == this */
+
+#define CRMFB_VT_HPIXEN		0x00010034
+#define		CRMFB_HPIXEN_OFF_MASK		0x00000fff
+#define		CRMFB_HPIXEN_ON_MASK		0x00fff000
 #define CRMFB_VT_VPIX_EN	0x00010038
 #define		CRMFB_VT_VPIX_EN_OFF_SHIFT	0
+#define		CRMFB_VPIXEN_OFF_MASK		0x00000fff
+#define		CRMFB_VPIXEN_ON_MASK		0x00fff000
 #define CRMFB_VT_HCMAP		0x0001003c
+#define		CRMFB_HCMAP_OFF_MASK		0x00000fff
+#define		CRMFB_HCMAP_ON_MASK		0x00fff000
 #define		CRMFB_VT_HCMAP_ON_SHIFT		12
 #define CRMFB_VT_VCMAP		0x00010040
+#define		CRMFB_VCMAP_OFF_MASK		0x00000fff
+#define		CRMFB_VCMAP_ON_MASK		0x00fff000
 #define		CRMFB_VT_VCMAP_ON_SHIFT		12
+
+#define CRMFB_VT_DID_START	0x00010044
+#define		CRMFB_VT_DID_START_X_MASK	0x00000fff
+#define		CRMFB_VT_DID_START_Y_MASK	0x00fff000
+#define CRMFB_VT_CRS_START	0x00010048
+#define		CRMFB_VT_CRS_START_X_MASK	0x00000fff
+#define		CRMFB_VT_CRS_START_Y_MASK	0x00fff000
+#define CRMFB_VT_VC_START	0x0001004c
+#define		CRMFB_VT_VC_START_X_MASK	0x00000fff
+#define		CRMFB_VT_VC_START_Y_MASK	0x00fff000
+
 #define CRMFB_OVR_WIDTH_TILE	0x00020000
-#define CRMFB_OVR_CONTROL	0x00020008
+#define		CRMFB_OVR_WIDTH_TILE_RHS_MASK	0x0000001f /* width of rightmost tile
+							    * in 32 byte units */
+#define		CRMFB_OVR_WIDTH_TILES_MASK	0x00001fe0 /* width in whole tiles */
+#define CRMFB_OVR_TILE_PTR	0x00020004
+#define		CRMFB_OVR_TILE_LIST_MASK	0xfffff000
+#define 	CRMFB_OVR_DMA_ENABLE		0x00000001
+#define CRMFB_OVR_CONTROL	0x00020008 /* same bits as CRMFB_OVR_TILE_PTR, copied 
+					    * from here when blanking */
 #define		CRMFB_OVR_CONTROL_DMAEN_SHIFT	0
+
 #define CRMFB_FRM_TILESIZE	0x00030000
 #define		CRMFB_FRM_TILESIZE_RHS_SHIFT	0
 #define		CRMFB_FRM_TILESIZE_WIDTH_SHIFT	5
@@ -64,12 +175,21 @@
 #define		CRMFB_FRM_TILESIZE_FIFOR_SHIFT	15
 #define CRMFB_FRM_PIXSIZE	0x00030004
 #define		CRMFB_FRM_PIXSIZE_HEIGHT_SHIFT	16
+#define CRMFB_TILE_PTR		0x00020008
+#define		CRMFB_TILE_LIST_MASK		0xfffff000
+#define 	CRMFB_DMA_ENABLE		0x00000001
 #define CRMFB_FRM_CONTROL	0x0003000c
 #define		CRMFB_FRM_CONTROL_DMAEN_SHIFT	0
 #define		CRMFB_FRM_CONTROL_LINEAR_SHIFT	1
 #define		CRMFB_FRM_CONTROL_TILEPTR_SHIFT	9
+
+#define CRMFB_DID_PTR		0x00040000
+#define		CRMFB_DID_BASE_MASK		0x0000ffff
+#define 	CRMFB_DID_DMA_ENABLE		0x00010000
 #define CRMFB_DID_CONTROL	0x00040004
 #define		CRMFB_DID_CONTROL_DMAEN_SHIFT	0
+
+#define CRMFB_WID		0x00048000	/* 32 WIDs */
 #define CRMFB_MODE		0x00048000
 #define		CRMFB_MODE_TYP_SHIFT		2
 #define			CRMFB_MODE_TYP_I8	0
@@ -77,9 +197,14 @@
 #define			CRMFB_MODE_TYP_RGB8	5
 #define		CRMFB_MODE_BUF_SHIFT		0
 #define			CRMFB_MODE_BUF_BOTH	3
-#define CRMFB_CMAP		0x00050000
+#define		CRMFB_MODE_CMAP_SELECT_SHIFT	5 /* upper 5 bit */
+#define		CRMFB_MODE_GAMMA_ENABLE_SHIFT	10
+#define		CRMFB_MODE_FP_ENABLE_SHIFT	11 /* two bits */
+
+#define CRMFB_CMAP		0x00050000	/* 32*256 entries */
+#define CRMFB_CMAP_OVL		0x00051400
 #define CRMFB_CMAP_FIFO		0x00058000
-#define CRMFB_GMAP		0x00060000
+#define CRMFB_GMAP		0x00060000	/* gamma map */
 #define CRMFB_CURSOR_POS	0x00070000
 /*
  * upper 16 bit are Y, lower 16 bit are X - both signed so there's no need for
@@ -87,6 +212,7 @@
  */
 #define CRMFB_CURSOR_CONTROL	0x00070004
 	#define CRMFB_CURSOR_ON		0x00000001
+	#define CRMFB_CURSOR_CROSSHAIR	0x00000002
 #define CRMFB_CURSOR_CMAP0	0x00070008
 #define CRMFB_CURSOR_CMAP1	0x0007000c
 #define CRMFB_CURSOR_CMAP2	0x00070010

Reply via email to