creatorreg.h revision 119381
1119381Sjake/*- 2119381Sjake * Copyright (c) 2003 Jake Burkholder. 3119381Sjake * All rights reserved. 4119381Sjake * 5119381Sjake * Redistribution and use in source and binary forms, with or without 6119381Sjake * modification, are permitted provided that the following conditions 7119381Sjake * are met: 8119381Sjake * 1. Redistributions of source code must retain the above copyright 9119381Sjake * notice, this list of conditions and the following disclaimer. 10119381Sjake * 2. Redistributions in binary form must reproduce the above copyright 11119381Sjake * notice, this list of conditions and the following disclaimer in the 12119381Sjake * documentation and/or other materials provided with the distribution. 13119381Sjake * 14119381Sjake * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15119381Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16119381Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17119381Sjake * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18119381Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19119381Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20119381Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21119381Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22119381Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23119381Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24119381Sjake * SUCH DAMAGE. 25119381Sjake * 26119381Sjake * $FreeBSD: head/sys/dev/fb/creatorreg.h 119381 2003-08-24 01:15:40Z jake $ 27119381Sjake */ 28119381Sjake 29119381Sjake#ifndef _DEV_FB_CREATOR_H_ 30119381Sjake#define _DEV_FB_CREATOR_H_ 31119381Sjake 32119381Sjake#define FFB_NREG 24 33119381Sjake 34119381Sjake#define FFB_DAC 1 35119381Sjake#define FFB_DAC_TYPE 0x0 36119381Sjake#define FFB_DAC_VALUE 0x4 37119381Sjake#define FFB_DAC_TYPE2 0x8 38119381Sjake#define FFB_DAC_VALUE2 0xc 39119381Sjake 40119381Sjake#define FFB_FBC 2 41119381Sjake#define FFB_FBC_BY 0x60 42119381Sjake#define FFB_FBC_BX 0x64 43119381Sjake#define FFB_FBC_DY 0x68 44119381Sjake#define FFB_FBC_DX 0x6c 45119381Sjake#define FFB_FBC_BH 0x70 46119381Sjake#define FFB_FBC_BW 0x74 47119381Sjake#define FFB_FBC_PPC 0x200 /* Pixel Processor Control */ 48119381Sjake#define FFB_FBC_FG 0x208 /* Foreground */ 49119381Sjake#define FFB_FBC_BG 0x20c /* Background */ 50119381Sjake#define FFB_FBC_FBC 0x254 /* Frame Buffer Control */ 51119381Sjake#define FFB_FBC_ROP 0x258 /* Raster Operation */ 52119381Sjake#define FFB_FBC_PMASK 0x290 /* Pixel Mask */ 53119381Sjake#define FFB_FBC_DRAWOP 0x300 /* Draw Operation */ 54119381Sjake#define FFB_FBC_FONTXY 0x314 /* Font X/Y */ 55119381Sjake#define FFB_FBC_FONTW 0x318 /* Font Width */ 56119381Sjake#define FFB_FBC_FONTINC 0x31c /* Font Increment */ 57119381Sjake#define FFB_FBC_FONT 0x320 /* Font Data */ 58119381Sjake#define FFB_FBC_UCSR 0x900 /* User Control & Status */ 59119381Sjake 60119381Sjake#define FBC_PPC_VCE_DIS 0x00001000 61119381Sjake#define FBC_PPC_APE_DIS 0x00000800 62119381Sjake#define FBC_PPC_TBE_OPAQUE 0x00000200 63119381Sjake#define FBC_PPC_CS_CONST 0x00000003 64119381Sjake 65119381Sjake#define FFB_FBC_WB_A 0x20000000 66119381Sjake#define FFB_FBC_RB_A 0x00004000 67119381Sjake#define FFB_FBC_SB_BOTH 0x00003000 68119381Sjake#define FFB_FBC_XE_OFF 0x00000040 69119381Sjake#define FFB_FBC_RGBE_MASK 0x0000003f 70119381Sjake 71119381Sjake#define FBC_ROP_NEW 0x83 72119381Sjake 73119381Sjake#define FBC_DRAWOP_RECTANGLE 0x08 74119381Sjake 75119381Sjake#define FBC_UCSR_FIFO_OVFL 0x80000000 76119381Sjake#define FBC_UCSR_READ_ERR 0x40000000 77119381Sjake#define FBC_UCSR_RP_BUSY 0x02000000 78119381Sjake#define FBC_UCSR_FB_BUSY 0x01000000 79119381Sjake#define FBC_UCSR_FIFO_MASK 0x00000fff 80119381Sjake 81119381Sjake#define FFB_VIRT_SFB8R 0x00000000 82119381Sjake#define FFB_VIRT_SFB8G 0x00400000 83119381Sjake#define FFB_VIRT_SFB8B 0x00800000 84119381Sjake#define FFB_VIRT_SFB8X 0x00c00000 85119381Sjake#define FFB_VIRT_SFB32 0x01000000 86119381Sjake#define FFB_VIRT_SFB64 0x02000000 87119381Sjake#define FFB_VIRT_FBC 0x04000000 88119381Sjake#define FFB_VIRT_FBC_BM 0x04002000 89119381Sjake#define FFB_VIRT_DFB8R 0x04004000 90119381Sjake#define FFB_VIRT_DFB8G 0x04404000 91119381Sjake#define FFB_VIRT_DFB8B 0x04804000 92119381Sjake#define FFB_VIRT_DFB8X 0x04c04000 93119381Sjake#define FFB_VIRT_DFB24 0x05004000 94119381Sjake#define FFB_VIRT_DFB32 0x06004000 95119381Sjake#define FFB_VIRT_DFB422A 0x07004000 96119381Sjake#define FFB_VIRT_DFB422AD 0x07804000 97119381Sjake#define FFB_VIRT_DFB24B 0x08004000 98119381Sjake#define FFB_VIRT_DFB422B 0x09004000 99119381Sjake#define FFB_VIRT_DFB422BD 0x09804000 100119381Sjake#define FFB_VIRT_SFB16Z 0x0a004000 101119381Sjake#define FFB_VIRT_SFB8Z 0x0a404000 102119381Sjake#define FFB_VIRT_SFB422 0x0ac04000 103119381Sjake#define FFB_VIRT_SFB422D 0x0b404000 104119381Sjake#define FFB_VIRT_FBC_KREG 0x0bc04000 105119381Sjake#define FFB_VIRT_DAC 0x0bc06000 106119381Sjake#define FFB_VIRT_PROM 0x0bc08000 107119381Sjake#define FFB_VIRT_EXP 0x0bc18000 108119381Sjake 109119381Sjake#define FFB_PHYS_SFB8R 0x04000000 110119381Sjake#define FFB_PHYS_SFB8G 0x04400000 111119381Sjake#define FFB_PHYS_SFB8B 0x04800000 112119381Sjake#define FFB_PHYS_SFB8X 0x04c00000 113119381Sjake#define FFB_PHYS_SFB32 0x05000000 114119381Sjake#define FFB_PHYS_SFB64 0x06000000 115119381Sjake#define FFB_PHYS_FBC 0x00600000 116119381Sjake#define FFB_PHYS_FBC_BM 0x00600000 117119381Sjake#define FFB_PHYS_DFB8R 0x01000000 118119381Sjake#define FFB_PHYS_DFB8G 0x01400000 119119381Sjake#define FFB_PHYS_DFB8B 0x01800000 120119381Sjake#define FFB_PHYS_DFB8X 0x01c00000 121119381Sjake#define FFB_PHYS_DFB24 0x02000000 122119381Sjake#define FFB_PHYS_DFB32 0x03000000 123119381Sjake#define FFB_PHYS_DFB422A 0x09000000 124119381Sjake#define FFB_PHYS_DFB422AD 0x09800000 125119381Sjake#define FFB_PHYS_DFB24B 0x0a000000 126119381Sjake#define FFB_PHYS_DFB422B 0x0b000000 127119381Sjake#define FFB_PHYS_DFB422BD 0x0b800000 128119381Sjake#define FFB_PHYS_SFB16Z 0x0c800000 129119381Sjake#define FFB_PHYS_SFB8Z 0x0c000000 130119381Sjake#define FFB_PHYS_SFB422 0x0d000000 131119381Sjake#define FFB_PHYS_SFB422D 0x0d800000 132119381Sjake#define FFB_PHYS_FBC_KREG 0x00610000 133119381Sjake#define FFB_PHYS_DAC 0x00400000 134119381Sjake#define FFB_PHYS_PROM 0x00000000 135119381Sjake#define FFB_PHYS_EXP 0x00200000 136119381Sjake 137119381Sjake#define FFB_READ(sc, reg, off) \ 138119381Sjake bus_space_read_4((sc)->sc_bt[(reg)], (sc)->sc_bh[(reg)], (off)) 139119381Sjake#define FFB_WRITE(sc, reg, off, val) \ 140119381Sjake bus_space_write_4((sc)->sc_bt[(reg)], (sc)->sc_bh[(reg)], (off), (val)) 141119381Sjake 142119381Sjakestruct creator_softc { 143119381Sjake video_adapter_t sc_va; /* XXX must be first */ 144119381Sjake 145119381Sjake dev_t sc_si; 146119381Sjake 147119381Sjake struct resource *sc_reg[FFB_NREG]; 148119381Sjake bus_space_tag_t sc_bt[FFB_NREG]; 149119381Sjake bus_space_handle_t sc_bh[FFB_NREG]; 150119381Sjake char sc_model[32]; 151119381Sjake int sc_console; 152119381Sjake int sc_dac; 153119381Sjake 154119381Sjake int sc_height; 155119381Sjake int sc_width; 156119381Sjake int sc_ncol; 157119381Sjake int sc_nrow; 158119381Sjake 159119381Sjake int sc_xmargin; 160119381Sjake int sc_ymargin; 161119381Sjake 162119381Sjake u_char *sc_font; 163119381Sjake int *sc_rowp; 164119381Sjake int *sc_colp; 165119381Sjake 166119381Sjake int sc_bg_cache; 167119381Sjake int sc_fg_cache; 168119381Sjake int sc_fifo_cache; 169119381Sjake}; 170119381Sjake 171119381Sjake#endif 172