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 711da177e4SLinus Torvalds #define PM2R_RASTERIZER_MODE 0x80a0 721da177e4SLinus Torvalds #define PM2R_RECTANGLE_ORIGIN 0x80d0 731da177e4SLinus Torvalds #define PM2R_RECTANGLE_SIZE 0x80d8 741da177e4SLinus Torvalds #define PM2R_PACKED_DATA_LIMITS 0x8150 751da177e4SLinus Torvalds #define PM2R_SCISSOR_MODE 0x8180 761da177e4SLinus Torvalds #define PM2R_SCREEN_SIZE 0x8198 771da177e4SLinus Torvalds #define PM2R_AREA_STIPPLE_MODE 0x81a0 781da177e4SLinus Torvalds #define PM2R_WINDOW_ORIGIN 0x81c8 791da177e4SLinus Torvalds #define PM2R_TEXTURE_ADDRESS_MODE 0x8380 801da177e4SLinus Torvalds #define PM2R_TEXTURE_MAP_FORMAT 0x8588 811da177e4SLinus Torvalds #define PM2R_TEXTURE_DATA_FORMAT 0x8590 821da177e4SLinus Torvalds #define PM2R_TEXTURE_READ_MODE 0x8670 831da177e4SLinus Torvalds #define PM2R_TEXEL_LUT_MODE 0x8678 841da177e4SLinus Torvalds #define PM2R_TEXTURE_COLOR_MODE 0x8680 851da177e4SLinus Torvalds #define PM2R_FOG_MODE 0x8690 861da177e4SLinus Torvalds #define PM2R_COLOR_DDA_MODE 0x87e0 871da177e4SLinus Torvalds #define PM2R_ALPHA_BLEND_MODE 0x8810 881da177e4SLinus Torvalds #define PM2R_DITHER_MODE 0x8818 891da177e4SLinus Torvalds #define PM2R_FB_SOFT_WRITE_MASK 0x8820 901da177e4SLinus Torvalds #define PM2R_LOGICAL_OP_MODE 0x8828 911da177e4SLinus Torvalds #define PM2R_LB_READ_MODE 0x8880 921da177e4SLinus Torvalds #define PM2R_LB_READ_FORMAT 0x8888 931da177e4SLinus Torvalds #define PM2R_LB_SOURCE_OFFSET 0x8890 941da177e4SLinus Torvalds #define PM2R_LB_WINDOW_BASE 0x88b8 951da177e4SLinus Torvalds #define PM2R_LB_WRITE_FORMAT 0x88c8 961da177e4SLinus Torvalds #define PM2R_STENCIL_MODE 0x8988 971da177e4SLinus Torvalds #define PM2R_DEPTH_MODE 0x89a0 981da177e4SLinus Torvalds #define PM2R_FB_READ_MODE 0x8a80 991da177e4SLinus Torvalds #define PM2R_FB_SOURCE_OFFSET 0x8a88 1001da177e4SLinus Torvalds #define PM2R_FB_PIXEL_OFFSET 0x8a90 1011da177e4SLinus Torvalds #define PM2R_FB_WINDOW_BASE 0x8ab0 1021da177e4SLinus Torvalds #define PM2R_FB_WRITE_MODE 0x8ab8 1031da177e4SLinus Torvalds #define PM2R_FB_HARD_WRITE_MASK 0x8ac0 1041da177e4SLinus Torvalds #define PM2R_FB_BLOCK_COLOR 0x8ac8 1051da177e4SLinus Torvalds #define PM2R_FB_READ_PIXEL 0x8ad0 1061da177e4SLinus Torvalds #define PM2R_FILTER_MODE 0x8c00 1071da177e4SLinus Torvalds #define PM2R_SYNC 0x8c40 1081da177e4SLinus Torvalds #define PM2R_YUV_MODE 0x8f00 1091da177e4SLinus Torvalds #define PM2R_STATISTICS_MODE 0x8c08 1101da177e4SLinus Torvalds #define PM2R_FB_SOURCE_DELTA 0x8d88 1111da177e4SLinus Torvalds #define PM2R_CONFIG 0x8d90 1121da177e4SLinus Torvalds #define PM2R_DELTA_MODE 0x9300 1131da177e4SLinus Torvalds 1141da177e4SLinus Torvalds /* Permedia2v */ 1151da177e4SLinus Torvalds #define PM2VR_RD_INDEX_LOW 0x4020 1161da177e4SLinus Torvalds #define PM2VR_RD_INDEX_HIGH 0x4028 1171da177e4SLinus Torvalds #define PM2VR_RD_INDEXED_DATA 0x4030 1181da177e4SLinus Torvalds 1191da177e4SLinus Torvalds /* Permedia2 RAMDAC indexed registers */ 1201da177e4SLinus Torvalds #define PM2I_RD_CURSOR_CONTROL 0x06 1211da177e4SLinus Torvalds #define PM2I_RD_COLOR_MODE 0x18 1221da177e4SLinus Torvalds #define PM2I_RD_MODE_CONTROL 0x19 1231da177e4SLinus Torvalds #define PM2I_RD_MISC_CONTROL 0x1e 1241da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_A1 0x20 1251da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_A2 0x21 1261da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_A3 0x22 1271da177e4SLinus Torvalds #define PM2I_RD_PIXEL_CLOCK_STATUS 0x29 1281da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_1 0x30 1291da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_2 0x31 1301da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_3 0x32 1311da177e4SLinus Torvalds #define PM2I_RD_MEMORY_CLOCK_STATUS 0x33 1321da177e4SLinus Torvalds #define PM2I_RD_COLOR_KEY_CONTROL 0x40 1331da177e4SLinus Torvalds #define PM2I_RD_OVERLAY_KEY 0x41 1341da177e4SLinus Torvalds #define PM2I_RD_RED_KEY 0x42 1351da177e4SLinus Torvalds #define PM2I_RD_GREEN_KEY 0x43 1361da177e4SLinus Torvalds #define PM2I_RD_BLUE_KEY 0x44 1371da177e4SLinus Torvalds 1381da177e4SLinus Torvalds /* Permedia2v extensions */ 1391da177e4SLinus Torvalds #define PM2VI_RD_MISC_CONTROL 0x000 1401da177e4SLinus Torvalds #define PM2VI_RD_SYNC_CONTROL 0x001 1411da177e4SLinus Torvalds #define PM2VI_RD_DAC_CONTROL 0x002 1421da177e4SLinus Torvalds #define PM2VI_RD_PIXEL_SIZE 0x003 1431da177e4SLinus Torvalds #define PM2VI_RD_COLOR_FORMAT 0x004 1441da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_MODE 0x005 1451da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_X_LOW 0x007 1461da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_X_HIGH 0x008 1471da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_Y_LOW 0x009 1481da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_Y_HIGH 0x00A 1491da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_X_HOT 0x00B 1501da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_Y_HOT 0x00C 1511da177e4SLinus Torvalds #define PM2VI_RD_CLK0_PRESCALE 0x201 1521da177e4SLinus Torvalds #define PM2VI_RD_CLK0_FEEDBACK 0x202 1531da177e4SLinus Torvalds #define PM2VI_RD_CLK0_POSTSCALE 0x203 1541da177e4SLinus Torvalds #define PM2VI_RD_CLK1_PRESCALE 0x204 1551da177e4SLinus Torvalds #define PM2VI_RD_CLK1_FEEDBACK 0x205 1561da177e4SLinus Torvalds #define PM2VI_RD_CLK1_POSTSCALE 0x206 157e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_CONTROL 0x20D 158e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_PRESCALE 0x20E 159e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_FEEDBACK 0x20F 160e5d809d7SKrzysztof Helt #define PM2VI_RD_MCLK_POSTSCALE 0x210 1611da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_PALETTE 0x303 1621da177e4SLinus Torvalds #define PM2VI_RD_CURSOR_PATTERN 0x400 1631da177e4SLinus Torvalds 1641da177e4SLinus Torvalds /* Fields and flags */ 1651da177e4SLinus Torvalds #define PM2F_RENDER_AREASTIPPLE (1L<<0) 1661da177e4SLinus Torvalds #define PM2F_RENDER_FASTFILL (1L<<3) 1671da177e4SLinus Torvalds #define PM2F_RENDER_PRIMITIVE_MASK (3L<<6) 1681da177e4SLinus Torvalds #define PM2F_RENDER_LINE 0 1691da177e4SLinus Torvalds #define PM2F_RENDER_TRAPEZOID (1L<<6) 1701da177e4SLinus Torvalds #define PM2F_RENDER_POINT (2L<<6) 1711da177e4SLinus Torvalds #define PM2F_RENDER_RECTANGLE (3L<<6) 1721da177e4SLinus Torvalds #define PM2F_SYNCHRONIZATION (1L<<10) 1731da177e4SLinus Torvalds #define PM2F_PLL_LOCKED 0x10 1741da177e4SLinus Torvalds #define PM2F_BEING_RESET (1L<<31) 1751da177e4SLinus Torvalds #define PM2F_DATATYPE_COLOR 0x8000 1761da177e4SLinus Torvalds #define PM2F_VGA_ENABLE 0x02 1771da177e4SLinus Torvalds #define PM2F_VGA_FIXED 0x04 1781da177e4SLinus Torvalds #define PM2F_FB_WRITE_ENABLE 0x01 1791da177e4SLinus Torvalds #define PM2F_FB_READ_SOURCE_ENABLE 0x0200 1801da177e4SLinus Torvalds #define PM2F_RD_PALETTE_WIDTH_8 0x02 1811da177e4SLinus Torvalds #define PM2F_PART_PROD_MASK 0x01ff 1821da177e4SLinus Torvalds #define PM2F_SCREEN_SCISSOR_ENABLE 0x02 1831da177e4SLinus Torvalds #define PM2F_DATA_64_ENABLE 0x00010000 1841da177e4SLinus Torvalds #define PM2F_BLANK_LOW 0x02 1851da177e4SLinus Torvalds #define PM2F_HSYNC_MASK 0x18 1861da177e4SLinus Torvalds #define PM2F_VSYNC_MASK 0x60 1871da177e4SLinus Torvalds #define PM2F_HSYNC_ACT_HIGH 0x08 1881da177e4SLinus Torvalds #define PM2F_HSYNC_FORCED_LOW 0x10 1891da177e4SLinus Torvalds #define PM2F_HSYNC_ACT_LOW 0x18 1901da177e4SLinus Torvalds #define PM2F_VSYNC_ACT_HIGH 0x20 1911da177e4SLinus Torvalds #define PM2F_VSYNC_FORCED_LOW 0x40 1921da177e4SLinus Torvalds #define PM2F_VSYNC_ACT_LOW 0x60 1931da177e4SLinus Torvalds #define PM2F_LINE_DOUBLE 0x04 1941da177e4SLinus Torvalds #define PM2F_VIDEO_ENABLE 0x01 1951da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_SVGA 0x01 1961da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGB232OFFSET 0x02 1971da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA2321 0x03 1981da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA5551 0x04 1991da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA4444 0x05 2001da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGB565 0x06 2011da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGBA8888 0x08 2021da177e4SLinus Torvalds #define PM2F_RD_PIXELFORMAT_RGB888 0x09 2031da177e4SLinus Torvalds #define PM2F_RD_GUI_ACTIVE 0x10 2041da177e4SLinus Torvalds #define PM2F_RD_COLOR_MODE_RGB 0x20 2051da177e4SLinus Torvalds #define PM2F_DELTA_ORDER_RGB (1L<<18) 2061da177e4SLinus Torvalds #define PM2F_RD_TRUECOLOR 0x80 2071da177e4SLinus Torvalds #define PM2F_NO_ALPHA_BUFFER 0x10 2081da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_16 0x00080000 2091da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_32 0x00100000 2101da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_4 0x00180000 2111da177e4SLinus Torvalds #define PM2F_TEXTEL_SIZE_24 0x00200000 2121da177e4SLinus Torvalds #define PM2F_INCREASE_X (1L<<21) 2131da177e4SLinus Torvalds #define PM2F_INCREASE_Y (1L<<22) 2141da177e4SLinus Torvalds #define PM2F_CONFIG_FB_WRITE_ENABLE (1L<<3) 2151da177e4SLinus Torvalds #define PM2F_CONFIG_FB_PACKED_DATA (1L<<2) 2161da177e4SLinus Torvalds #define PM2F_CONFIG_FB_READ_DEST_ENABLE (1L<<1) 2171da177e4SLinus Torvalds #define PM2F_CONFIG_FB_READ_SOURCE_ENABLE (1L<<0) 2181da177e4SLinus Torvalds #define PM2F_COLOR_KEY_TEST_OFF (1L<<4) 2191da177e4SLinus Torvalds #define PM2F_MEM_CONFIG_RAM_MASK (3L<<29) 2201da177e4SLinus Torvalds #define PM2F_MEM_BANKS_1 0L 2211da177e4SLinus Torvalds #define PM2F_MEM_BANKS_2 (1L<<29) 2221da177e4SLinus Torvalds #define PM2F_MEM_BANKS_3 (2L<<29) 2231da177e4SLinus Torvalds #define PM2F_MEM_BANKS_4 (3L<<29) 2241da177e4SLinus Torvalds #define PM2F_APERTURE_STANDARD 0 2251da177e4SLinus Torvalds #define PM2F_APERTURE_BYTESWAP 1 2261da177e4SLinus Torvalds #define PM2F_APERTURE_HALFWORDSWAP 2 2271da177e4SLinus Torvalds 2281da177e4SLinus Torvalds typedef enum { 2291da177e4SLinus Torvalds PM2_TYPE_PERMEDIA2, 2301da177e4SLinus Torvalds PM2_TYPE_PERMEDIA2V 2311da177e4SLinus Torvalds } pm2type_t; 2321da177e4SLinus Torvalds 2331da177e4SLinus Torvalds #endif /* PM2FB_H */ 2341da177e4SLinus Torvalds 2351da177e4SLinus Torvalds /***************************************************************************** 2361da177e4SLinus Torvalds * That's all folks! 2371da177e4SLinus Torvalds *****************************************************************************/ 238