156816Sralph /*- 2*63206Sbostic * Copyright (c) 1992, 1993 3*63206Sbostic * The Regents of the University of California. All rights reserved. 456816Sralph * 556816Sralph * This code is derived from software contributed to Berkeley by 656816Sralph * Ralph Campbell and Rick Macklem. 756816Sralph * 856816Sralph * %sccs.include.redist.c% 956816Sralph * 10*63206Sbostic * @(#)mfbreg.h 8.1 (Berkeley) 06/10/93 1156816Sralph */ 1256816Sralph 1356816Sralph /* 1456816Sralph * Mach Operating System 1556816Sralph * Copyright (c) 1991,1990,1989 Carnegie Mellon University 1656816Sralph * All Rights Reserved. 1756816Sralph * 1856816Sralph * Permission to use, copy, modify and distribute this software and its 1956816Sralph * documentation is hereby granted, provided that both the copyright 2056816Sralph * notice and this permission notice appear in all copies of the 2156816Sralph * software, derivative works or modified versions, and any portions 2256816Sralph * thereof, and that both notices appear in supporting documentation. 2356816Sralph * 2456816Sralph * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS 2556816Sralph * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 2656816Sralph * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 2756816Sralph * 2856816Sralph * Carnegie Mellon requests users of this software to return to 2956816Sralph * 3056816Sralph * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 3156816Sralph * School of Computer Science 3256816Sralph * Carnegie Mellon University 3356816Sralph * Pittsburgh PA 15213-3890 3456816Sralph * 3556816Sralph * any improvements or extensions that they make and grant Carnegie the 3656816Sralph * rights to redistribute these changes. 3756816Sralph */ 3856816Sralph /* 3956816Sralph * This configuration uses two twin Bt431s and a single Bt455 colour map. 4056816Sralph * (Yep, that's a colour map on a single bitplane mono display) 4156816Sralph */ 4256816Sralph #define SET_VALUE(x) (((x)<<8)|((x)&0xff)) 4356816Sralph #define GET_VALUE(x) ((x)&0xff) 4456816Sralph 4556816Sralph typedef struct { 4656816Sralph volatile u_short addr_lo; 4756816Sralph short pad0; 4856816Sralph volatile u_short addr_hi; 4956816Sralph short pad1; 5056816Sralph volatile u_short addr_cmap; 5156816Sralph short pad2; 5256816Sralph volatile u_short addr_reg; 5356816Sralph short pad3; 5456816Sralph } bt431_regmap_t; 5556816Sralph 5656816Sralph /* 5756816Sralph * Generic register access 5856816Sralph */ 5956816Sralph /* when using autoincrement */ 6056816Sralph #define BT431_WRITE_REG_AUTOI(regs, val) { \ 6156816Sralph (regs)->addr_reg = SET_VALUE(val); \ 6256816Sralph MachEmptyWriteBuffer(); \ 6356816Sralph } 6456816Sralph 6556816Sralph #define BT431_READ_REG_AUTOI(regs) \ 6656816Sralph GET_VALUE(((regs)->addr_reg)) 6756816Sralph 6856816Sralph #define BT431_WRITE_CMAP_AUTOI(regs, val) { \ 6956816Sralph (regs)->addr_cmap = (val); \ 7056816Sralph MachEmptyWriteBuffer(); \ 7156816Sralph } 7256816Sralph 7356816Sralph #define BT431_READ_CMAP_AUTOI(regs) \ 7456816Sralph ((regs)->addr_cmap) 7556816Sralph 7656816Sralph typedef struct { 7756816Sralph volatile u_char addr_cmap; 7856816Sralph char pad0[3]; 7956816Sralph volatile u_char addr_cmap_data; 8056816Sralph char pad1[3]; 8156816Sralph volatile u_char addr_clr; 8256816Sralph char pad2[3]; 8356816Sralph volatile u_char addr_ovly; 8456816Sralph char pad3[3]; 8556816Sralph } bt455_regmap_t; 8656816Sralph 8756816Sralph 8856816Sralph /* 8956816Sralph * Generic register access 9056816Sralph */ 9156816Sralph #define BT455_SELECT_ENTRY(regs, regno) { \ 9256816Sralph (regs)->addr_cmap = (regno)&0x0f; \ 9356816Sralph MachEmptyWriteBuffer(); \ 9456816Sralph } 9556816Sralph 9656816Sralph /* 9756816Sralph * Additional registers addressed indirectly 9856816Sralph */ 9956816Sralph #define BT431_REG_CMD 0x0000 10056816Sralph #define BT431_REG_CXLO 0x0001 10156816Sralph #define BT431_REG_CXHI 0x0002 10256816Sralph #define BT431_REG_CYLO 0x0003 10356816Sralph #define BT431_REG_CYHI 0x0004 10456816Sralph #define BT431_REG_WXLO 0x0005 10556816Sralph #define BT431_REG_WXHI 0x0006 10656816Sralph #define BT431_REG_WYLO 0x0007 10756816Sralph #define BT431_REG_WYHI 0x0008 10856816Sralph #define BT431_REG_WWLO 0x0009 10956816Sralph #define BT431_REG_WWHI 0x000a 11056816Sralph #define BT431_REG_WHLO 0x000b 11156816Sralph #define BT431_REG_WHHI 0x000c 11256816Sralph 11356816Sralph #define BT431_REG_CRAM_BASE 0x0000 11456816Sralph #define BT431_REG_CRAM_END 0x01ff 11556816Sralph 11656816Sralph /* 11756816Sralph * Command register 11856816Sralph */ 11956816Sralph 12056816Sralph #define BT431_CMD_CURS_ENABLE 0x40 12156816Sralph #define BT431_CMD_XHAIR_ENABLE 0x20 12256816Sralph #define BT431_CMD_OR_CURSORS 0x10 12356816Sralph #define BT431_CMD_AND_CURSORS 0x00 12456816Sralph #define BT431_CMD_1_1_MUX 0x00 12556816Sralph #define BT431_CMD_4_1_MUX 0x04 12656816Sralph #define BT431_CMD_5_1_MUX 0x08 12756816Sralph #define BT431_CMD_xxx_MUX 0x0c 12856816Sralph #define BT431_CMD_THICK_1 0x00 12956816Sralph #define BT431_CMD_THICK_3 0x01 13056816Sralph #define BT431_CMD_THICK_5 0x02 13156816Sralph #define BT431_CMD_THICK_7 0x03 132