summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>1999-12-15 15:09:36 +0000
committerad <ad@NetBSD.org>1999-12-15 15:09:36 +0000
commitf607dfe4dd6ffa42173b6493b2fd1e33888bc4f4 (patch)
tree586c2a091287ec8319654ce5006091dd9049bdb2 /sys/dev
parentf458e50bdf5bdc062f7d5bd0057d68ebd5040ba7 (diff)
- Change prefix for Bt459 register defs to BT459_IREG to indicate that
these are indirectly accessed registers. - Add defs for directly accessed registers to bt459reg.h.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/bt459reg.h91
-rw-r--r--sys/dev/tc/cfb.c20
-rw-r--r--sys/dev/tc/sfb.c20
-rw-r--r--sys/dev/tc/sfbplus.c20
4 files changed, 85 insertions, 66 deletions
diff --git a/sys/dev/ic/bt459reg.h b/sys/dev/ic/bt459reg.h
index 18e4ba26c88..39d474c4733 100644
--- a/sys/dev/ic/bt459reg.h
+++ b/sys/dev/ic/bt459reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: bt459reg.h,v 1.1 1998/10/28 04:10:36 nisimura Exp $ */
+/* $NetBSD: bt459reg.h,v 1.2 1999/12/15 15:09:36 ad Exp $ */
/*
* Mach Operating System
@@ -30,39 +30,58 @@
* Register definitions for the Brooktree Bt459 135 MHz Monolithic
* CMOS 256x64 Color Palette RAMDAC.
*/
- /* 0000-00ff Color Map entries */
-#define BT459_REG_CCOLOR_1 0x0181 /* Cursor color regs */
-#define BT459_REG_CCOLOR_2 0x0182
-#define BT459_REG_CCOLOR_3 0x0183
-#define BT459_REG_ID 0x0200 /* read-only, gives "4a" */
-#define BT459_REG_COMMAND_0 0x0201
-#define BT459_REG_COMMAND_1 0x0202
-#define BT459_REG_COMMAND_2 0x0203
-#define BT459_REG_PRM 0x0204
- /* 0205 reserved */
-#define BT459_REG_PBM 0x0206
- /* 0207 reserved */
-#define BT459_REG_ORM 0x0208
-#define BT459_REG_OBM 0x0209
-#define BT459_REG_ILV 0x020a
-#define BT459_REG_TEST 0x020b
-#define BT459_REG_RSIG 0x020c
-#define BT459_REG_GSIG 0x020d
-#define BT459_REG_BSIG 0x020e
- /* 020f-02ff reserved */
-#define BT459_REG_CCR 0x0300
-#define BT459_REG_CURSOR_X_LOW 0x0301
-#define BT459_REG_CURSOR_X_HIGH 0x0302
-#define BT459_REG_CURSOR_Y_LOW 0x0303
-#define BT459_REG_CURSOR_Y_HIGH 0x0304
-#define BT459_REG_WXLO 0x0305
-#define BT459_REG_WXHI 0x0306
-#define BT459_REG_WYLO 0x0307
-#define BT459_REG_WYHI 0x0308
-#define BT459_REG_WWLO 0x0309
-#define BT459_REG_WWHI 0x030a
-#define BT459_REG_WHLO 0x030b
-#define BT459_REG_WHHI 0x030c
- /* 030d-03ff reserved */
-#define BT459_REG_CRAM_BASE 0x0400
+/*
+ * Directly-accessible registers. Note the address register is
+ * auto-incrementing.
+ */
+#define BT459_REG_ADDR_LOW 0x00 /* C1,C0 == 0,0 */
+#define BT459_REG_ADDR_HIGH 0x01 /* C1,C0 == 0,1 */
+#define BT459_REG_IREG_DATA 0x02 /* C1,C0 == 1,0 */
+#define BT459_REG_CMAP_DATA 0x03 /* C1,C0 == 1,1 */
+
+#define BT459_REG_MAX BT459_REG_CMAP_DATA
+
+/*
+ * All internal register access to the Bt459 is done indirectly via the
+ * Address Register (mapped into the host bus in a device-specific
+ * fashion). The following register definitions are in terms of
+ * their address register address values.
+ */
+
+ /* 0000-00ff colormap entries */
+
+#define BT459_IREG_CCOLOR_1 0x0181 /* Cursor color regs */
+#define BT459_IREG_CCOLOR_2 0x0182
+#define BT459_IREG_CCOLOR_3 0x0183
+#define BT459_IREG_ID 0x0200 /* read-only, gives "4a" */
+#define BT459_IREG_COMMAND_0 0x0201
+#define BT459_IREG_COMMAND_1 0x0202
+#define BT459_IREG_COMMAND_2 0x0203
+#define BT459_IREG_PRM 0x0204
+ /* 0205 reserved */
+#define BT459_IREG_PBM 0x0206
+ /* 0207 reserved */
+#define BT459_IREG_ORM 0x0208
+#define BT459_IREG_OBM 0x0209
+#define BT459_IREG_ILV 0x020a
+#define BT459_IREG_TEST 0x020b
+#define BT459_IREG_RSIG 0x020c
+#define BT459_IREG_GSIG 0x020d
+#define BT459_IREG_BSIG 0x020e
+ /* 020f-02ff reserved */
+#define BT459_IREG_CCR 0x0300
+#define BT459_IREG_CURSOR_X_LOW 0x0301
+#define BT459_IREG_CURSOR_X_HIGH 0x0302
+#define BT459_IREG_CURSOR_Y_LOW 0x0303
+#define BT459_IREG_CURSOR_Y_HIGH 0x0304
+#define BT459_IREG_WXLO 0x0305
+#define BT459_IREG_WXHI 0x0306
+#define BT459_IREG_WYLO 0x0307
+#define BT459_IREG_WYHI 0x0308
+#define BT459_IREG_WWLO 0x0309
+#define BT459_IREG_WWHI 0x030a
+#define BT459_IREG_WHLO 0x030b
+#define BT459_IREG_WHHI 0x030c
+ /* 030d-03ff reserved */
+#define BT459_IREG_CRAM_BASE 0x0400
diff --git a/sys/dev/tc/cfb.c b/sys/dev/tc/cfb.c
index 0d403e3e387..fcff1b416ff 100644
--- a/sys/dev/tc/cfb.c
+++ b/sys/dev/tc/cfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cfb.c,v 1.16 1999/12/08 09:41:24 nisimura Exp $ */
+/* $NetBSD: cfb.c,v 1.17 1999/12/15 15:09:37 ad Exp $ */
/*
* Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.16 1999/12/08 09:41:24 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.17 1999/12/15 15:09:37 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -534,13 +534,13 @@ cfbintr(arg)
v = sc->sc_changed;
sc->sc_changed = 0;
if (v & DATA_ENB_CHANGED) {
- SELECT(vdac, BT459_REG_CCR);
+ SELECT(vdac, BT459_IREG_CCR);
REG(vdac, bt_reg) = (sc->sc_curenb) ? 0xc0 : 0x00;
}
if (v & DATA_CURCMAP_CHANGED) {
u_int8_t *cp = sc->sc_cursor.cc_color;
- SELECT(vdac, BT459_REG_CCOLOR_2);
+ SELECT(vdac, BT459_IREG_CCOLOR_2);
REG(vdac, bt_reg) = cp[1]; tc_wmb();
REG(vdac, bt_reg) = cp[3]; tc_wmb();
REG(vdac, bt_reg) = cp[5]; tc_wmb();
@@ -558,7 +558,7 @@ cfbintr(arg)
mp = (u_int8_t *)(sc->sc_cursor.cc_image + CURSOR_MAX_SIZE);
bcnt = 0;
- SELECT(vdac, BT459_REG_CRAM_BASE+0);
+ SELECT(vdac, BT459_IREG_CRAM_BASE+0);
/* 64 pixel scan line is consisted with 16 byte cursor ram */
while (bcnt < sc->sc_cursor.cc_size.y * 16) {
/* pad right half 32 pixel when smaller than 33 */
@@ -606,7 +606,7 @@ cfbinit(dc)
struct bt459reg *vdac = (void *)(cfbbase + CX_BT459_OFFSET);
int i;
- SELECT(vdac, BT459_REG_COMMAND_0);
+ SELECT(vdac, BT459_IREG_COMMAND_0);
REG(vdac, bt_reg) = 0x40; /* CMD0 */ tc_wmb();
REG(vdac, bt_reg) = 0x0; /* CMD1 */ tc_wmb();
REG(vdac, bt_reg) = 0xc0; /* CMD2 */ tc_wmb();
@@ -619,7 +619,7 @@ cfbinit(dc)
REG(vdac, bt_reg) = 0x0; /* ILV */ tc_wmb();
REG(vdac, bt_reg) = 0x0; /* TEST */ tc_wmb();
- SELECT(vdac, BT459_REG_CCR);
+ SELECT(vdac, BT459_IREG_CCR);
REG(vdac, bt_reg) = 0x0; tc_wmb();
REG(vdac, bt_reg) = 0x0; tc_wmb();
REG(vdac, bt_reg) = 0x0; tc_wmb();
@@ -646,7 +646,7 @@ cfbinit(dc)
}
/* clear out cursor image */
- SELECT(vdac, BT459_REG_CRAM_BASE);
+ SELECT(vdac, BT459_IREG_CRAM_BASE);
for (i = 0; i < 1024; i++)
REG(vdac, bt_reg) = 0xff; tc_wmb();
@@ -655,7 +655,7 @@ cfbinit(dc)
* cursor image. CCOLOR_2 for mask color, while CCOLOR_3 for
* image color. CCOLOR_1 will be never used.
*/
- SELECT(vdac, BT459_REG_CCOLOR_1);
+ SELECT(vdac, BT459_IREG_CCOLOR_1);
REG(vdac, bt_reg) = 0xff; tc_wmb();
REG(vdac, bt_reg) = 0xff; tc_wmb();
REG(vdac, bt_reg) = 0xff; tc_wmb();
@@ -817,7 +817,7 @@ bt459_set_curpos(sc)
s = spltty();
- SELECT(vdac, BT459_REG_CURSOR_X_LOW);
+ SELECT(vdac, BT459_IREG_CURSOR_X_LOW);
REG(vdac, bt_reg) = x; tc_wmb();
REG(vdac, bt_reg) = x >> 8; tc_wmb();
REG(vdac, bt_reg) = y; tc_wmb();
diff --git a/sys/dev/tc/sfb.c b/sys/dev/tc/sfb.c
index 6d5dc3b55dc..506f8a9d41f 100644
--- a/sys/dev/tc/sfb.c
+++ b/sys/dev/tc/sfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sfb.c,v 1.30 1999/12/06 19:26:00 drochner Exp $ */
+/* $NetBSD: sfb.c,v 1.31 1999/12/15 15:09:37 ad Exp $ */
/*
* Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.30 1999/12/06 19:26:00 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.31 1999/12/15 15:09:37 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -556,13 +556,13 @@ sfbintr(arg)
sc->sc_changed = 0;
if (v & DATA_ENB_CHANGED) {
- SELECT(vdac, BT459_REG_CCR);
+ SELECT(vdac, BT459_IREG_CCR);
REG(vdac, bt_reg) = (sc->sc_curenb) ? 0xc0 : 0x00;
}
if (v & DATA_CURCMAP_CHANGED) {
u_int8_t *cp = sc->sc_cursor.cc_color;
- SELECT(vdac, BT459_REG_CCOLOR_2);
+ SELECT(vdac, BT459_IREG_CCOLOR_2);
REG(vdac, bt_reg) = cp[1]; tc_wmb();
REG(vdac, bt_reg) = cp[3]; tc_wmb();
REG(vdac, bt_reg) = cp[5]; tc_wmb();
@@ -580,7 +580,7 @@ sfbintr(arg)
mp = (u_int8_t *)(sc->sc_cursor.cc_image + CURSOR_MAX_SIZE);
bcnt = 0;
- SELECT(vdac, BT459_REG_CRAM_BASE+0);
+ SELECT(vdac, BT459_IREG_CRAM_BASE+0);
/* 64 pixel scan line is consisted with 16 byte cursor ram */
while (bcnt < sc->sc_cursor.cc_size.y * 16) {
/* pad right half 32 pixel when smaller than 33 */
@@ -635,7 +635,7 @@ sfbinit(dc)
*(u_int32_t *)(sfbasic + 0x180000) = 0; /* Bt459 reset */
- SELECT(vdac, BT459_REG_COMMAND_0);
+ SELECT(vdac, BT459_IREG_COMMAND_0);
REG(vdac, bt_reg) = 0x40; /* CMD0 */ tc_wmb();
REG(vdac, bt_reg) = 0x0; /* CMD1 */ tc_wmb();
REG(vdac, bt_reg) = 0xc0; /* CMD2 */ tc_wmb();
@@ -648,7 +648,7 @@ sfbinit(dc)
REG(vdac, bt_reg) = 0x0; /* ILV */ tc_wmb();
REG(vdac, bt_reg) = 0x0; /* TEST */ tc_wmb();
- SELECT(vdac, BT459_REG_CCR);
+ SELECT(vdac, BT459_IREG_CCR);
REG(vdac, bt_reg) = 0x0; tc_wmb();
REG(vdac, bt_reg) = 0x0; tc_wmb();
REG(vdac, bt_reg) = 0x0; tc_wmb();
@@ -675,7 +675,7 @@ sfbinit(dc)
}
/* clear out cursor image */
- SELECT(vdac, BT459_REG_CRAM_BASE);
+ SELECT(vdac, BT459_IREG_CRAM_BASE);
for (i = 0; i < 1024; i++)
REG(vdac, bt_reg) = 0xff; tc_wmb();
@@ -684,7 +684,7 @@ sfbinit(dc)
* cursor image. CCOLOR_2 for mask color, while CCOLOR_3 for
* image color. CCOLOR_1 will be never used.
*/
- SELECT(vdac, BT459_REG_CCOLOR_1);
+ SELECT(vdac, BT459_IREG_CCOLOR_1);
REG(vdac, bt_reg) = 0xff; tc_wmb();
REG(vdac, bt_reg) = 0xff; tc_wmb();
REG(vdac, bt_reg) = 0xff; tc_wmb();
@@ -846,7 +846,7 @@ bt459_set_curpos(sc)
s = spltty();
- SELECT(vdac, BT459_REG_CURSOR_X_LOW);
+ SELECT(vdac, BT459_IREG_CURSOR_X_LOW);
REG(vdac, bt_reg) = x; tc_wmb();
REG(vdac, bt_reg) = x >> 8; tc_wmb();
REG(vdac, bt_reg) = y; tc_wmb();
diff --git a/sys/dev/tc/sfbplus.c b/sys/dev/tc/sfbplus.c
index b9829964c88..557fb6bce77 100644
--- a/sys/dev/tc/sfbplus.c
+++ b/sys/dev/tc/sfbplus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sfbplus.c,v 1.2 1999/12/06 19:26:01 drochner Exp $ */
+/* $NetBSD: sfbplus.c,v 1.3 1999/12/15 15:09:37 ad Exp $ */
/*
* Copyright (c) 1999 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: sfbplus.c,v 1.2 1999/12/06 19:26:01 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sfbplus.c,v 1.3 1999/12/15 15:09:37 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -609,7 +609,7 @@ sfbpinit(dc)
if (dc->dc_depth == 8) {
*(u_int32_t *)(sfbasic + 0x180000) = 0; /* Bt459 reset */
- SELECT(vdac, BT459_REG_COMMAND_0);
+ SELECT(vdac, BT459_IREG_COMMAND_0);
REG(vdac, bt_reg) = 0x40; /* CMD0 */ tc_wmb();
REG(vdac, bt_reg) = 0x0; /* CMD1 */ tc_wmb();
REG(vdac, bt_reg) = 0xc0; /* CMD2 */ tc_wmb();
@@ -622,7 +622,7 @@ sfbpinit(dc)
REG(vdac, bt_reg) = 0x0; /* ILV */ tc_wmb();
REG(vdac, bt_reg) = 0x0; /* TEST */ tc_wmb();
- SELECT(vdac, BT459_REG_CCR);
+ SELECT(vdac, BT459_IREG_CCR);
REG(vdac, bt_reg) = 0x0; tc_wmb();
REG(vdac, bt_reg) = 0x0; tc_wmb();
REG(vdac, bt_reg) = 0x0; tc_wmb();
@@ -649,7 +649,7 @@ sfbpinit(dc)
}
/* clear out cursor image */
- SELECT(vdac, BT459_REG_CRAM_BASE);
+ SELECT(vdac, BT459_IREG_CRAM_BASE);
for (i = 0; i < 1024; i++)
REG(vdac, bt_reg) = 0xff; tc_wmb();
@@ -658,7 +658,7 @@ sfbpinit(dc)
* cursor image. CCOLOR_2 for mask color, while CCOLOR_3 for
* image color. CCOLOR_1 will be never used.
*/
- SELECT(vdac, BT459_REG_CCOLOR_1);
+ SELECT(vdac, BT459_IREG_CCOLOR_1);
REG(vdac, bt_reg) = 0xff; tc_wmb();
REG(vdac, bt_reg) = 0xff; tc_wmb();
REG(vdac, bt_reg) = 0xff; tc_wmb();
@@ -873,7 +873,7 @@ bt459visible(hw, on)
void *hw;
int on;
{
- SELECT(hw, BT459_REG_CCR);
+ SELECT(hw, BT459_IREG_CCR);
REG(hw, bt_reg) = (on) ? 0xc0 : 0x00;
tc_wmb();
}
@@ -893,7 +893,7 @@ bt459locate(hw, x, y)
int s;
s = spltty();
- SELECT(hw, BT459_REG_CURSOR_X_LOW);
+ SELECT(hw, BT459_IREG_CURSOR_X_LOW);
REG(hw, bt_reg) = x; tc_wmb();
REG(hw, bt_reg) = x >> 8; tc_wmb();
REG(hw, bt_reg) = y; tc_wmb();
@@ -915,7 +915,7 @@ bt459color(hw, cp)
void *hw;
u_int8_t *cp;
{
- SELECT(hw, BT459_REG_CCOLOR_2);
+ SELECT(hw, BT459_IREG_CCOLOR_2);
REG(hw, bt_reg) = cp[1]; tc_wmb();
REG(hw, bt_reg) = cp[3]; tc_wmb();
REG(hw, bt_reg) = cp[5]; tc_wmb();
@@ -946,7 +946,7 @@ bt459shape(hw, size, image)
mp = (u_int8_t *)(image + CURSOR_MAX_SIZE);
bcnt = 0;
- SELECT(hw, BT459_REG_CRAM_BASE+0);
+ SELECT(hw, BT459_IREG_CRAM_BASE+0);
/* 64 pixel scan line is consisted with 16 byte cursor ram */
while (bcnt < size->y * 16) {
/* pad right half 32 pixel when smaller than 33 */