11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * Permedia2 framebuffer driver definitions. 31da177e4SLinus Torvalds * Copyright (c) 1998-2000 Ilario Nardinocchi (nardinoc@CS.UniBO.IT) 41da177e4SLinus Torvalds * -------------------------------------------------------------------------- 51da177e4SLinus Torvalds * $Id: pm2fb.h,v 1.26 2000/09/19 00:11:53 illo Exp $ 61da177e4SLinus Torvalds * -------------------------------------------------------------------------- 71da177e4SLinus Torvalds * This file is subject to the terms and conditions of the GNU General Public 81da177e4SLinus Torvalds * License. See the file COPYING in the main directory of this archive 91da177e4SLinus Torvalds * for more details. 101da177e4SLinus Torvalds */ 111da177e4SLinus Torvalds 121da177e4SLinus Torvalds #ifndef PM2FB_H 131da177e4SLinus Torvalds #define PM2FB_H 141da177e4SLinus Torvalds 151da177e4SLinus Torvalds #define PM2_REFERENCE_CLOCK 14318 /* in KHz */ 161da177e4SLinus Torvalds #define PM2_MAX_PIXCLOCK 230000 /* in KHz */ 171da177e4SLinus Torvalds #define PM2_REGS_SIZE 0x10000 181da177e4SLinus Torvalds 191da177e4SLinus Torvalds #define PM2TAG(r) (u32 )(((r)-0x8000)>>3) 201da177e4SLinus Torvalds 211da177e4SLinus Torvalds /***************************************************************************** 221da177e4SLinus Torvalds * Permedia2 registers used in the framebuffer 231da177e4SLinus Torvalds *****************************************************************************/ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #define PM2R_RESET_STATUS 0x0000 261da177e4SLinus Torvalds #define PM2R_IN_FIFO_SPACE 0x0018 271da177e4SLinus Torvalds #define PM2R_OUT_FIFO_WORDS 0x0020 281da177e4SLinus Torvalds #define PM2R_APERTURE_ONE 0x0050 291da177e4SLinus Torvalds #define PM2R_APERTURE_TWO 0x0058 301da177e4SLinus Torvalds #define PM2R_FIFO_DISCON 0x0068 311da177e4SLinus Torvalds #define PM2R_CHIP_CONFIG 0x0070 321da177e4SLinus Torvalds 331da177e4SLinus Torvalds #define PM2R_REBOOT 0x1000 341da177e4SLinus Torvalds #define PM2R_MEM_CONTROL 0x1040 351da177e4SLinus Torvalds #define PM2R_BOOT_ADDRESS 0x1080 361da177e4SLinus Torvalds #define PM2R_MEM_CONFIG 0x10c0 371da177e4SLinus Torvalds #define PM2R_BYPASS_WRITE_MASK 0x1100 381da177e4SLinus Torvalds #define PM2R_FRAMEBUFFER_WRITE_MASK 0x1140 391da177e4SLinus Torvalds 401da177e4SLinus Torvalds #define PM2R_OUT_FIFO 0x2000 411da177e4SLinus Torvalds 421da177e4SLinus Torvalds #define PM2R_SCREEN_BASE 0x3000 431da177e4SLinus Torvalds #define PM2R_SCREEN_STRIDE 0x3008 441da177e4SLinus Torvalds #define PM2R_H_TOTAL 0x3010 451da177e4SLinus Torvalds #define PM2R_HG_END 0x3018 461da177e4SLinus Torvalds #define PM2R_HB_END 0x3020 471da177e4SLinus Torvalds #define PM2R_HS_START 0x3028 481da177e4SLinus Torvalds #define PM2R_HS_END 0x3030 491da177e4SLinus Torvalds #define PM2R_V_TOTAL 0x3038 501da177e4SLinus Torvalds #define PM2R_VB_END 0x3040 511da177e4SLinus Torvalds #define PM2R_VS_START 0x3048 521da177e4SLinus Torvalds #define PM2R_VS_END 0x3050 531da177e4SLinus Torvalds #define PM2R_VIDEO_CONTROL 0x3058 541da177e4SLinus Torvalds #define PM2R_LINE_COUNT 0x3070 551da177e4SLinus Torvalds #define PM2R_FIFO_CONTROL 0x3078 561da177e4SLinus Torvalds 571da177e4SLinus Torvalds #define PM2R_RD_PALETTE_WRITE_ADDRESS 0x4000 581da177e4SLinus Torvalds #define PM2R_RD_PALETTE_DATA 0x4008 591da177e4SLinus Torvalds #define PM2R_RD_PIXEL_MASK 0x4010 601da177e4SLinus Torvalds #define PM2R_RD_PALETTE_READ_ADDRESS 0x4018 611da177e4SLinus Torvalds #define PM2R_RD_INDEXED_DATA 0x4050 621da177e4SLinus Torvalds 631da177e4SLinus Torvalds #define PM2R_START_X_DOM 0x8000 641da177e4SLinus Torvalds #define PM2R_D_X_DOM 0x8008 651da177e4SLinus Torvalds #define PM2R_START_X_SUB 0x8010 661da177e4SLinus Torvalds #define PM2R_D_X_SUB 0x8018 671da177e4SLinus Torvalds #define PM2R_START_Y 0x8020 681da177e4SLinus Torvalds #define PM2R_D_Y 0x8028 691da177e4SLinus Torvalds #define PM2R_COUNT 0x8030 701da177e4SLinus Torvalds #define PM2R_RENDER 0x8038 7191b3a6f4SKrzysztof Helt #define PM2R_BIT_MASK_PATTERN 0x8068 721da177e4SLinus Torvalds #define PM2R_RASTERIZER_MODE 0x80a0 731da177e4SLinus Torvalds #define PM2R_RECTANGLE_ORIGIN 0x80d0 741da177e4SLinus Torvalds #define PM2R_RECTANGLE_SIZE 0x80d8 751da177e4SLinus Torvalds #define PM2R_PACKED_DATA_LIMITS 0x8150 761da177e4SLinus Torvalds #define PM2R_SCISSOR_MODE 0x8180 7791b3a6f4SKrzysztof Helt #define PM2R_SCISSOR_MIN_XY 0x8188 7891b3a6f4SKrzysztof Helt #define PM2R_SCISSOR_MAX_XY 0x8190 791da177e4SLinus Torvalds #define PM2R_SCREEN_SIZE 0x8198 801da177e4SLinus Torvalds #define PM2R_AREA_STIPPLE_MODE 0x81a0 811da177e4SLinus Torvalds #define PM2R_WINDOW_ORIGIN 0x81c8 821da177e4SLinus Torvalds #define PM2R_TEXTURE_ADDRESS_MODE 0x8380 831da177e4SLinus Torvalds #define PM2R_TEXTURE_MAP_FORMAT 0x8588 841da177e4SLinus Torvalds #define PM2R_TEXTURE_DATA_FORMAT 0x8590 851da177e4SLinus Torvalds #define PM2R_TEXTURE_READ_MODE 0x8670 861da177e4SLinus Torvalds #define PM2R_TEXEL_LUT_MODE 0x8678 871da177e4SLinus Torvalds #define PM2R_TEXTURE_COLOR_MODE 0x8680 881da177e4SLinus Torvalds #define PM2R_FOG_MODE 0x8690 8991b3a6f4SKrzysztof Helt #define PM2R_TEXEL0 0x8760 901da177e4SLinus Torvalds #define PM2R_COLOR_DDA_MODE 0x87e0 9191b3a6f4SKrzysztof Helt #define PM2R_CONSTANT_COLOR 0x87e8 921da177e4SLinus Torvalds #define PM2R_ALPHA_BLEND_MODE 0x8810 931da177e4SLinus Torvalds #define PM2R_DITHER_MODE 0x8818 941da177e4SLinus Torvalds #define PM2R_FB_SOFT_WRITE_MASK 0x8820 951da177e4SLinus Torvalds #define PM2R_LOGICAL_OP_MODE 0x8828 961da177e4SLinus Torvalds #define PM2R_LB_READ_MODE 0x8880 971da177e4SLinus Torvalds #define PM2R_LB_READ_FORMAT 0x8888 981da177e4SLinus Torvalds #define PM2R_LB_SOURCE_OFFSET 0x8890 991da177e4SLinus Torvalds #define PM2R_LB_WINDOW_BASE 0x88b8 1001da177e4SLinus Torvalds #define PM2R_LB_WRITE_FORMAT 0x88c8 1011da177e4SLinus Torvalds #define PM2R_STENCIL_MODE 0x8988 1021da177e4SLinus Torvalds #define PM2R_DEPTH_MODE 0x89a0 1031da177e4SLinus Torvalds #define PM2R_FB_READ_MODE 0x8a80 1041da177e4SLinus Torvalds #define PM2R_FB_SOURCE_OFFSET 0x8a88 1051da177e4SLinus Torvalds #define PM2R_FB_PIXEL_OFFSET 0x8a90 1061da177e4SLinus Torvalds #define PM2R_FB_WINDOW_BASE 0x8ab0 1071da177e4SLinus Torvalds #define PM2R_FB_WRITE_MODE 0x8ab8 1081da177e4SLinus Torvalds #define PM2R_FB_HARD_WRITE_MASK 0x8ac0 1091da177e4SLinus Torvalds #define PM2R_FB_BLOCK_COLOR 0x8ac8 1101da177e4SLinus Torvalds #define PM2R_FB_READ_PIXEL 0x8ad0 1111da177e4SLinus Torvalds #define PM2R_FILTER_MODE 0x8c00 1121da177e4SLinus Torvalds #define PM2R_SYNC 0x8c40 1131da177e4SLinus Torvalds #define PM2R_YUV_MODE 0x8f00 1141da177e4SLinus Torvalds #define PM2R_STATISTICS_MODE 0x8c08 1151da177e4SLinus Torvalds #define PM2R_FB_SOURCE_DELTA 0x8d88 1161da177e4SLinus Torvalds #define PM2R_CONFIG 0x8d90 1171da177e4SLinus Torvalds #define PM2R_DELTA_MODE 0x9300 1181da177e4SLinus Torvalds 1191da177e4SLinus Torvalds /* Permedia2v */ 1201da177e4SLinus Torvalds #define PM2VR_RD_INDEX_LOW 0x4020 1211da177e4SLinus Torvalds #define PM2VR_RD_INDEX_HIGH 0x4028 1221da177e4SLinus Torvalds #define PM2VR_RD_INDEXED_DATA 0x4030 1231da177e4SLinus Torvalds 1241da177e4SLinus Torvalds /* Permedia2 RAMDAC indexed registers */ 1251da177e4SLinus Torvalds #define PM2I_RD_CURSOR_CONTROL 0x06 1261da177e4SLinus Torvalds #define PM2I_RD_COLOR_MODE 0x18 1271da177e4SLinus Torvalds #define PM2I_RD_MODE_CONTROL 0x19 1281da177e4SLinus Torvalds #define PM2I_RD_MISC_CONTROL 0x1e 1291da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_A1 0x20 1301da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_A2 0x21 1311da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_A3 0x22 1321da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_STATUS 0x29 1331da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_1 0x30 1341da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_2 0x31 1351da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_3 0x32 1361da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_STATUS 0x33 1371da177e4SLinus Torvalds #define PM2I_RD_COLOR_KEY_CONTROL 0x40 1381da177e4SLinus Torvalds #define PM2I_RD_OVERLAY_KEY 0x41 1391da177e4SLinus Torvalds #define PM2I_RD_RED_KEY 0x42 1401da177e4SLinus Torvalds #define PM2I_RD_GREEN_KEY 0x43 1411da177e4SLinus Torvalds #define PM2I_RD_BLUE_KEY 0x44 1421da177e4SLinus Torvalds 1431da177e4SLinus Torvalds /* Permedia2v extensions */ 1441da177e4SLinus Torvalds #define PM2VI_RD_MISC_CONTROL 0x000 1451da177e4SLinus Torvalds #define PM2VI_RD_SYNC_CONTROL 0x001 1461da177e4SLinus Torvalds #define PM2VI_RD_DAC_CONTROL 0x002 1471da177e4SLinus Torvalds #define PM2VI_RD_PIXEL_SIZE 0x003 1481da177e4SLinus Torvalds #define PM2VI_RD_COLOR_FORMAT 0x004 1491da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_MODE 0x005 1501da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_X_LOW 0x007 1511da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_X_HIGH 0x008 1521da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_Y_LOW 0x009 1531da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_Y_HIGH 0x00A 1541da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_X_HOT 0x00B 1551da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_Y_HOT 0x00C 156138a451cSKrzysztof Helt #define PM2VI_RD_OVERLAY_KEY 0x00D 1571da177e4SLinus Torvalds #define PM2VI_RD_CLK0_PRESCALE 0x201 1581da177e4SLinus Torvalds #define PM2VI_RD_CLK0_FEEDBACK 0x202 1591da177e4SLinus Torvalds #define PM2VI_RD_CLK0_POSTSCALE 0x203 1601da177e4SLinus Torvalds #define PM2VI_RD_CLK1_PRESCALE 0x204 1611da177e4SLinus Torvalds #define PM2VI_RD_CLK1_FEEDBACK 0x205 1621da177e4SLinus Torvalds #define PM2VI_RD_CLK1_POSTSCALE 0x206 163e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_CONTROL 0x20D 164e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_PRESCALE 0x20E 165e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_FEEDBACK 0x20F 166e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_POSTSCALE 0x210 1671da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_PALETTE 0x303 1681da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_PATTERN 0x400 1691da177e4SLinus Torvalds 1701da177e4SLinus Torvalds /* Fields and flags */ 1711da177e4SLinus Torvalds #define PM2F_RENDER_AREASTIPPLE (1L<<0) 1721da177e4SLinus Torvalds #define PM2F_RENDER_FASTFILL (1L<<3) 1731da177e4SLinus Torvalds #define PM2F_RENDER_PRIMITIVE_MASK (3L<<6) 1741da177e4SLinus Torvalds #define PM2F_RENDER_LINE 0 1751da177e4SLinus Torvalds #define PM2F_RENDER_TRAPEZOID (1L<<6) 1761da177e4SLinus Torvalds #define PM2F_RENDER_POINT (2L<<6) 1771da177e4SLinus Torvalds #define PM2F_RENDER_RECTANGLE (3L<<6) 17891b3a6f4SKrzysztof Helt #define PM2F_RENDER_SYNC_ON_BIT_MASK (1L<<11) 17991b3a6f4SKrzysztof Helt #define PM2F_RENDER_TEXTURE_ENABLE (1L<<13) 1801da177e4SLinus Torvalds #define PM2F_SYNCHRONIZATION (1L<<10) 1811da177e4SLinus Torvalds #define PM2F_PLL_LOCKED 0x10 1821da177e4SLinus Torvalds #define PM2F_BEING_RESET (1L<<31) 1831da177e4SLinus Torvalds #define PM2F_DATATYPE_COLOR 0x8000 1841da177e4SLinus Torvalds #define PM2F_VGA_ENABLE 0x02 1851da177e4SLinus Torvalds #define PM2F_VGA_FIXED 0x04 1861da177e4SLinus Torvalds #define PM2F_FB_WRITE_ENABLE 0x01 1871da177e4SLinus Torvalds #define PM2F_FB_READ_SOURCE_ENABLE 0x0200 1881da177e4SLinus Torvalds #define PM2F_RD_PALETTE_WIDTH_8 0x02 1891da177e4SLinus Torvalds #define PM2F_PART_PROD_MASK 0x01ff 1901da177e4SLinus Torvalds #define PM2F_SCREEN_SCISSOR_ENABLE 0x02 1911da177e4SLinus Torvalds #define PM2F_DATA_64_ENABLE 0x00010000 1921da177e4SLinus Torvalds #define PM2F_BLANK_LOW 0x02 1931da177e4SLinus Torvalds #define PM2F_HSYNC_MASK 0x18 1941da177e4SLinus Torvalds #define PM2F_VSYNC_MASK 0x60 1951da177e4SLinus Torvalds #define PM2F_HSYNC_ACT_HIGH 0x08 1961da177e4SLinus Torvalds #define PM2F_HSYNC_FORCED_LOW 0x10 1971da177e4SLinus Torvalds #define PM2F_HSYNC_ACT_LOW 0x18 1981da177e4SLinus Torvalds #define PM2F_VSYNC_ACT_HIGH 0x20 1991da177e4SLinus Torvalds #define PM2F_VSYNC_FORCED_LOW 0x40 2001da177e4SLinus Torvalds #define PM2F_VSYNC_ACT_LOW 0x60 2011da177e4SLinus Torvalds #define PM2F_LINE_DOUBLE 0x04 2021da177e4SLinus Torvalds #define PM2F_VIDEO_ENABLE 0x01 2031da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_SVGA 0x01 2041da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGB232OFFSET 0x02 2051da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA2321 0x03 2061da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA5551 0x04 2071da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA4444 0x05 2081da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGB565 0x06 2091da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA8888 0x08 2101da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGB888 0x09 2111da177e4SLinus Torvalds #define PM2F_RD_GUI_ACTIVE 0x10 2121da177e4SLinus Torvalds #define PM2F_RD_COLOR_MODE_RGB 0x20 2131da177e4SLinus Torvalds #define PM2F_DELTA_ORDER_RGB (1L<<18) 2141da177e4SLinus Torvalds #define PM2F_RD_TRUECOLOR 0x80 2151da177e4SLinus Torvalds #define PM2F_NO_ALPHA_BUFFER 0x10 2161da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_16 0x00080000 2171da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_32 0x00100000 2181da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_4 0x00180000 2191da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_24 0x00200000 2201da177e4SLinus Torvalds #define PM2F_INCREASE_X (1L<<21) 2211da177e4SLinus Torvalds #define PM2F_INCREASE_Y (1L<<22) 2221da177e4SLinus Torvalds #define PM2F_CONFIG_FB_WRITE_ENABLE (1L<<3) 2231da177e4SLinus Torvalds #define PM2F_CONFIG_FB_PACKED_DATA (1L<<2) 2241da177e4SLinus Torvalds #define PM2F_CONFIG_FB_READ_DEST_ENABLE (1L<<1) 2251da177e4SLinus Torvalds #define PM2F_CONFIG_FB_READ_SOURCE_ENABLE (1L<<0) 2261da177e4SLinus Torvalds #define PM2F_COLOR_KEY_TEST_OFF (1L<<4) 2271da177e4SLinus Torvalds #define PM2F_MEM_CONFIG_RAM_MASK (3L<<29) 2281da177e4SLinus Torvalds #define PM2F_MEM_BANKS_1 0L 2291da177e4SLinus Torvalds #define PM2F_MEM_BANKS_2 (1L<<29) 2301da177e4SLinus Torvalds #define PM2F_MEM_BANKS_3 (2L<<29) 2311da177e4SLinus Torvalds #define PM2F_MEM_BANKS_4 (3L<<29) 2321da177e4SLinus Torvalds #define PM2F_APERTURE_STANDARD 0 2331da177e4SLinus Torvalds #define PM2F_APERTURE_BYTESWAP 1 2341da177e4SLinus Torvalds #define PM2F_APERTURE_HALFWORDSWAP 2 2358f5d050aSKrzysztof Helt #define PM2F_CURSORMODE_CURSOR_ENABLE (1 << 0) 2368f5d050aSKrzysztof Helt #define PM2F_CURSORMODE_TYPE_X (1 << 4) 2371da177e4SLinus Torvalds 2381da177e4SLinus Torvalds typedef enum { 2391da177e4SLinus Torvalds PM2_TYPE_PERMEDIA2, 2401da177e4SLinus Torvalds PM2_TYPE_PERMEDIA2V 2411da177e4SLinus Torvalds } pm2type_t; 2421da177e4SLinus Torvalds 2431da177e4SLinus Torvalds #endif /* PM2FB_H */ 2441da177e4SLinus Torvalds 2451da177e4SLinus Torvalds /***************************************************************************** 2461da177e4SLinus Torvalds * That's all folks! 2471da177e4SLinus Torvalds *****************************************************************************/ 248