Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Permedia2 framebuffer driver definitions.
0003  * Copyright (c) 1998-2000 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
0004  * --------------------------------------------------------------------------
0005  * $Id: pm2fb.h,v 1.26 2000/09/19 00:11:53 illo Exp $
0006  * --------------------------------------------------------------------------
0007  * This file is subject to the terms and conditions of the GNU General Public
0008  * License.  See the file COPYING in the main directory of this archive
0009  * for more details.
0010  */
0011 
0012 #ifndef PM2FB_H
0013 #define PM2FB_H
0014 
0015 #define PM2_REFERENCE_CLOCK 14318           /* in KHz */
0016 #define PM2_MAX_PIXCLOCK    230000          /* in KHz */
0017 #define PM2_REGS_SIZE       0x10000
0018 
0019 #define PM2TAG(r) (u32 )(((r)-0x8000)>>3)
0020 
0021 /*****************************************************************************
0022  * Permedia2 registers used in the framebuffer
0023  *****************************************************************************/
0024  
0025 #define PM2R_RESET_STATUS               0x0000
0026 #define PM2R_IN_FIFO_SPACE              0x0018
0027 #define PM2R_OUT_FIFO_WORDS             0x0020
0028 #define PM2R_APERTURE_ONE               0x0050
0029 #define PM2R_APERTURE_TWO               0x0058
0030 #define PM2R_FIFO_DISCON                0x0068
0031 #define PM2R_CHIP_CONFIG                0x0070
0032 
0033 #define PM2R_REBOOT                 0x1000
0034 #define PM2R_MEM_CONTROL                0x1040
0035 #define PM2R_BOOT_ADDRESS               0x1080
0036 #define PM2R_MEM_CONFIG                 0x10c0
0037 #define PM2R_BYPASS_WRITE_MASK              0x1100
0038 #define PM2R_FRAMEBUFFER_WRITE_MASK         0x1140
0039 
0040 #define PM2R_OUT_FIFO                   0x2000
0041 
0042 #define PM2R_SCREEN_BASE                0x3000
0043 #define PM2R_SCREEN_STRIDE              0x3008
0044 #define PM2R_H_TOTAL                    0x3010
0045 #define PM2R_HG_END                 0x3018
0046 #define PM2R_HB_END                 0x3020
0047 #define PM2R_HS_START                   0x3028
0048 #define PM2R_HS_END                 0x3030
0049 #define PM2R_V_TOTAL                    0x3038
0050 #define PM2R_VB_END                 0x3040
0051 #define PM2R_VS_START                   0x3048
0052 #define PM2R_VS_END                 0x3050
0053 #define PM2R_VIDEO_CONTROL              0x3058
0054 #define PM2R_LINE_COUNT                 0x3070
0055 #define PM2R_FIFO_CONTROL               0x3078
0056 
0057 #define PM2R_RD_PALETTE_WRITE_ADDRESS           0x4000
0058 #define PM2R_RD_PALETTE_DATA                0x4008
0059 #define PM2R_RD_PIXEL_MASK              0x4010
0060 #define PM2R_RD_PALETTE_READ_ADDRESS            0x4018
0061 #define PM2R_RD_CURSOR_COLOR_ADDRESS                0x4020
0062 #define PM2R_RD_CURSOR_COLOR_DATA               0x4028
0063 #define PM2R_RD_INDEXED_DATA                0x4050
0064 #define PM2R_RD_CURSOR_DATA             0x4058
0065 #define PM2R_RD_CURSOR_X_LSB                0x4060
0066 #define PM2R_RD_CURSOR_X_MSB                0x4068
0067 #define PM2R_RD_CURSOR_Y_LSB                0x4070
0068 #define PM2R_RD_CURSOR_Y_MSB                0x4078
0069 
0070 #define PM2R_START_X_DOM                0x8000
0071 #define PM2R_D_X_DOM                    0x8008
0072 #define PM2R_START_X_SUB                0x8010
0073 #define PM2R_D_X_SUB                    0x8018
0074 #define PM2R_START_Y                    0x8020
0075 #define PM2R_D_Y                    0x8028
0076 #define PM2R_COUNT                  0x8030
0077 #define PM2R_RENDER                 0x8038
0078 #define PM2R_BIT_MASK_PATTERN               0x8068
0079 #define PM2R_RASTERIZER_MODE                0x80a0
0080 #define PM2R_RECTANGLE_ORIGIN               0x80d0
0081 #define PM2R_RECTANGLE_SIZE             0x80d8
0082 #define PM2R_PACKED_DATA_LIMITS             0x8150
0083 #define PM2R_SCISSOR_MODE               0x8180
0084 #define PM2R_SCISSOR_MIN_XY             0x8188
0085 #define PM2R_SCISSOR_MAX_XY             0x8190
0086 #define PM2R_SCREEN_SIZE                0x8198
0087 #define PM2R_AREA_STIPPLE_MODE              0x81a0
0088 #define PM2R_WINDOW_ORIGIN              0x81c8
0089 #define PM2R_TEXTURE_ADDRESS_MODE           0x8380
0090 #define PM2R_TEXTURE_MAP_FORMAT             0x8588
0091 #define PM2R_TEXTURE_DATA_FORMAT            0x8590
0092 #define PM2R_TEXTURE_READ_MODE              0x8670
0093 #define PM2R_TEXEL_LUT_MODE             0x8678
0094 #define PM2R_TEXTURE_COLOR_MODE             0x8680
0095 #define PM2R_FOG_MODE                   0x8690
0096 #define PM2R_TEXEL0                 0x8760
0097 #define PM2R_COLOR_DDA_MODE             0x87e0
0098 #define PM2R_CONSTANT_COLOR             0x87e8
0099 #define PM2R_ALPHA_BLEND_MODE               0x8810
0100 #define PM2R_DITHER_MODE                0x8818
0101 #define PM2R_FB_SOFT_WRITE_MASK             0x8820
0102 #define PM2R_LOGICAL_OP_MODE                0x8828
0103 #define PM2R_LB_READ_MODE               0x8880
0104 #define PM2R_LB_READ_FORMAT             0x8888
0105 #define PM2R_LB_SOURCE_OFFSET               0x8890
0106 #define PM2R_LB_WINDOW_BASE             0x88b8
0107 #define PM2R_LB_WRITE_FORMAT                0x88c8
0108 #define PM2R_STENCIL_MODE               0x8988
0109 #define PM2R_DEPTH_MODE                 0x89a0
0110 #define PM2R_FB_READ_MODE               0x8a80
0111 #define PM2R_FB_SOURCE_OFFSET               0x8a88
0112 #define PM2R_FB_PIXEL_OFFSET                0x8a90
0113 #define PM2R_FB_WINDOW_BASE             0x8ab0
0114 #define PM2R_FB_WRITE_MODE              0x8ab8
0115 #define PM2R_FB_HARD_WRITE_MASK             0x8ac0
0116 #define PM2R_FB_BLOCK_COLOR             0x8ac8
0117 #define PM2R_FB_READ_PIXEL              0x8ad0
0118 #define PM2R_FILTER_MODE                0x8c00
0119 #define PM2R_SYNC                   0x8c40
0120 #define PM2R_YUV_MODE                   0x8f00
0121 #define PM2R_STATISTICS_MODE                0x8c08
0122 #define PM2R_FB_SOURCE_DELTA                0x8d88
0123 #define PM2R_CONFIG                 0x8d90
0124 #define PM2R_DELTA_MODE                 0x9300
0125 
0126 /* Permedia2v */
0127 #define PM2VR_RD_INDEX_LOW              0x4020
0128 #define PM2VR_RD_INDEX_HIGH             0x4028
0129 #define PM2VR_RD_INDEXED_DATA               0x4030
0130 
0131 /* Permedia2 RAMDAC indexed registers */
0132 #define PM2I_RD_CURSOR_CONTROL              0x06
0133 #define PM2I_RD_COLOR_MODE              0x18
0134 #define PM2I_RD_MODE_CONTROL                0x19
0135 #define PM2I_RD_MISC_CONTROL                0x1e
0136 #define PM2I_RD_PIXEL_CLOCK_A1              0x20
0137 #define PM2I_RD_PIXEL_CLOCK_A2              0x21
0138 #define PM2I_RD_PIXEL_CLOCK_A3              0x22
0139 #define PM2I_RD_PIXEL_CLOCK_STATUS          0x29
0140 #define PM2I_RD_MEMORY_CLOCK_1              0x30
0141 #define PM2I_RD_MEMORY_CLOCK_2              0x31
0142 #define PM2I_RD_MEMORY_CLOCK_3              0x32
0143 #define PM2I_RD_MEMORY_CLOCK_STATUS         0x33
0144 #define PM2I_RD_COLOR_KEY_CONTROL           0x40
0145 #define PM2I_RD_OVERLAY_KEY             0x41
0146 #define PM2I_RD_RED_KEY                 0x42
0147 #define PM2I_RD_GREEN_KEY               0x43
0148 #define PM2I_RD_BLUE_KEY                0x44
0149 
0150 /* Permedia2v extensions */
0151 #define PM2VI_RD_MISC_CONTROL               0x000
0152 #define PM2VI_RD_SYNC_CONTROL               0x001
0153 #define PM2VI_RD_DAC_CONTROL                0x002
0154 #define PM2VI_RD_PIXEL_SIZE             0x003
0155 #define PM2VI_RD_COLOR_FORMAT               0x004
0156 #define PM2VI_RD_CURSOR_MODE                0x005
0157 #define PM2VI_RD_CURSOR_X_LOW               0x007
0158 #define PM2VI_RD_CURSOR_X_HIGH              0x008
0159 #define PM2VI_RD_CURSOR_Y_LOW               0x009
0160 #define PM2VI_RD_CURSOR_Y_HIGH              0x00A
0161 #define PM2VI_RD_CURSOR_X_HOT               0x00B
0162 #define PM2VI_RD_CURSOR_Y_HOT               0x00C
0163 #define PM2VI_RD_OVERLAY_KEY                0x00D
0164 #define PM2VI_RD_CLK0_PRESCALE              0x201
0165 #define PM2VI_RD_CLK0_FEEDBACK              0x202
0166 #define PM2VI_RD_CLK0_POSTSCALE             0x203
0167 #define PM2VI_RD_CLK1_PRESCALE              0x204
0168 #define PM2VI_RD_CLK1_FEEDBACK              0x205
0169 #define PM2VI_RD_CLK1_POSTSCALE             0x206
0170 #define PM2VI_RD_MCLK_CONTROL               0x20D
0171 #define PM2VI_RD_MCLK_PRESCALE              0x20E
0172 #define PM2VI_RD_MCLK_FEEDBACK              0x20F
0173 #define PM2VI_RD_MCLK_POSTSCALE             0x210
0174 #define PM2VI_RD_CURSOR_PALETTE             0x303
0175 #define PM2VI_RD_CURSOR_PATTERN             0x400
0176 
0177 /* Fields and flags */
0178 #define PM2F_RENDER_AREASTIPPLE             (1L<<0)
0179 #define PM2F_RENDER_FASTFILL                (1L<<3)
0180 #define PM2F_RENDER_PRIMITIVE_MASK          (3L<<6)
0181 #define PM2F_RENDER_LINE                0
0182 #define PM2F_RENDER_TRAPEZOID               (1L<<6)
0183 #define PM2F_RENDER_POINT               (2L<<6)
0184 #define PM2F_RENDER_RECTANGLE               (3L<<6)
0185 #define PM2F_RENDER_SYNC_ON_BIT_MASK            (1L<<11)
0186 #define PM2F_RENDER_TEXTURE_ENABLE          (1L<<13)
0187 #define PM2F_SYNCHRONIZATION                (1L<<10)
0188 #define PM2F_PLL_LOCKED                 0x10
0189 #define PM2F_BEING_RESET                (1L<<31)
0190 #define PM2F_DATATYPE_COLOR             0x8000
0191 #define PM2F_VGA_ENABLE                 0x02
0192 #define PM2F_VGA_FIXED                  0x04
0193 #define PM2F_FB_WRITE_ENABLE                0x01
0194 #define PM2F_FB_READ_SOURCE_ENABLE          0x0200
0195 #define PM2F_RD_PALETTE_WIDTH_8             0x02
0196 #define PM2F_PART_PROD_MASK             0x01ff
0197 #define PM2F_SCREEN_SCISSOR_ENABLE          0x02
0198 #define PM2F_DATA_64_ENABLE             0x00010000
0199 #define PM2F_BLANK_LOW                  0x02
0200 #define PM2F_HSYNC_MASK                 0x18
0201 #define PM2F_VSYNC_MASK                 0x60
0202 #define PM2F_HSYNC_ACT_HIGH             0x08
0203 #define PM2F_HSYNC_FORCED_LOW               0x10
0204 #define PM2F_HSYNC_ACT_LOW              0x18
0205 #define PM2F_VSYNC_ACT_HIGH             0x20
0206 #define PM2F_VSYNC_FORCED_LOW               0x40
0207 #define PM2F_VSYNC_ACT_LOW              0x60
0208 #define PM2F_LINE_DOUBLE                0x04
0209 #define PM2F_VIDEO_ENABLE               0x01
0210 #define PM2F_RD_PIXELFORMAT_SVGA            0x01
0211 #define PM2F_RD_PIXELFORMAT_RGB232OFFSET        0x02
0212 #define PM2F_RD_PIXELFORMAT_RGBA2321            0x03
0213 #define PM2F_RD_PIXELFORMAT_RGBA5551            0x04
0214 #define PM2F_RD_PIXELFORMAT_RGBA4444            0x05
0215 #define PM2F_RD_PIXELFORMAT_RGB565          0x06
0216 #define PM2F_RD_PIXELFORMAT_RGBA8888            0x08
0217 #define PM2F_RD_PIXELFORMAT_RGB888          0x09
0218 #define PM2F_RD_GUI_ACTIVE              0x10
0219 #define PM2F_RD_COLOR_MODE_RGB              0x20
0220 #define PM2F_DELTA_ORDER_RGB                (1L<<18)
0221 #define PM2F_RD_TRUECOLOR               0x80
0222 #define PM2F_NO_ALPHA_BUFFER                0x10
0223 #define PM2F_TEXTEL_SIZE_16             0x00080000
0224 #define PM2F_TEXTEL_SIZE_32             0x00100000
0225 #define PM2F_TEXTEL_SIZE_4              0x00180000
0226 #define PM2F_TEXTEL_SIZE_24             0x00200000
0227 #define PM2F_INCREASE_X                 (1L<<21)
0228 #define PM2F_INCREASE_Y                 (1L<<22)
0229 #define PM2F_CONFIG_FB_WRITE_ENABLE         (1L<<3)
0230 #define PM2F_CONFIG_FB_PACKED_DATA          (1L<<2)
0231 #define PM2F_CONFIG_FB_READ_DEST_ENABLE         (1L<<1)
0232 #define PM2F_CONFIG_FB_READ_SOURCE_ENABLE       (1L<<0)
0233 #define PM2F_COLOR_KEY_TEST_OFF             (1L<<4)
0234 #define PM2F_MEM_CONFIG_RAM_MASK            (3L<<29)
0235 #define PM2F_MEM_BANKS_1                0L
0236 #define PM2F_MEM_BANKS_2                (1L<<29)
0237 #define PM2F_MEM_BANKS_3                (2L<<29)
0238 #define PM2F_MEM_BANKS_4                (3L<<29)
0239 #define PM2F_APERTURE_STANDARD              0
0240 #define PM2F_APERTURE_BYTESWAP              1
0241 #define PM2F_APERTURE_HALFWORDSWAP          2
0242 #define PM2F_CURSORMODE_CURSOR_ENABLE           (1 << 0)
0243 #define PM2F_CURSORMODE_TYPE_X              (1 << 4)
0244 
0245 typedef enum {
0246     PM2_TYPE_PERMEDIA2,
0247     PM2_TYPE_PERMEDIA2V
0248 } pm2type_t;
0249 
0250 #endif /* PM2FB_H */
0251 
0252 /*****************************************************************************
0253  * That's all folks!
0254  *****************************************************************************/