Creation of Cybook 2416 (actually Gen4) repository

This commit is contained in:
mlt
2009-12-18 17:10:00 +00:00
committed by godzil
commit 76f20f4d40
13791 changed files with 6812321 additions and 0 deletions

1
include/video/Kbuild Normal file
View File

@@ -0,0 +1 @@
unifdef-y += sisfb.h

422
include/video/aty128.h Normal file
View File

@@ -0,0 +1,422 @@
/* $Id: aty128.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
* linux/drivers/video/aty128.h
* Register definitions for ATI Rage128 boards
*
* Anthony Tong <atong@uiuc.edu>, 1999
* Brad Douglas <brad@neruo.com>, 2000
*/
#ifndef REG_RAGE128_H
#define REG_RAGE128_H
#define CLOCK_CNTL_INDEX 0x0008
#define CLOCK_CNTL_DATA 0x000c
#define BIOS_0_SCRATCH 0x0010
#define BUS_CNTL 0x0030
#define BUS_CNTL1 0x0034
#define GEN_INT_CNTL 0x0040
#define CRTC_GEN_CNTL 0x0050
#define CRTC_EXT_CNTL 0x0054
#define DAC_CNTL 0x0058
#define I2C_CNTL_1 0x0094
#define PALETTE_INDEX 0x00b0
#define PALETTE_DATA 0x00b4
#define CONFIG_CNTL 0x00e0
#define GEN_RESET_CNTL 0x00f0
#define CONFIG_MEMSIZE 0x00f8
#define MEM_CNTL 0x0140
#define MEM_POWER_MISC 0x015c
#define AGP_BASE 0x0170
#define AGP_CNTL 0x0174
#define AGP_APER_OFFSET 0x0178
#define PCI_GART_PAGE 0x017c
#define PC_NGUI_MODE 0x0180
#define PC_NGUI_CTLSTAT 0x0184
#define MPP_TB_CONFIG 0x01C0
#define MPP_GP_CONFIG 0x01C8
#define VIPH_CONTROL 0x01D0
#define CRTC_H_TOTAL_DISP 0x0200
#define CRTC_H_SYNC_STRT_WID 0x0204
#define CRTC_V_TOTAL_DISP 0x0208
#define CRTC_V_SYNC_STRT_WID 0x020c
#define CRTC_VLINE_CRNT_VLINE 0x0210
#define CRTC_CRNT_FRAME 0x0214
#define CRTC_GUI_TRIG_VLINE 0x0218
#define CRTC_OFFSET 0x0224
#define CRTC_OFFSET_CNTL 0x0228
#define CRTC_PITCH 0x022c
#define OVR_CLR 0x0230
#define OVR_WID_LEFT_RIGHT 0x0234
#define OVR_WID_TOP_BOTTOM 0x0238
#define LVDS_GEN_CNTL 0x02d0
#define DDA_CONFIG 0x02e0
#define DDA_ON_OFF 0x02e4
#define VGA_DDA_CONFIG 0x02e8
#define VGA_DDA_ON_OFF 0x02ec
#define CRTC2_H_TOTAL_DISP 0x0300
#define CRTC2_H_SYNC_STRT_WID 0x0304
#define CRTC2_V_TOTAL_DISP 0x0308
#define CRTC2_V_SYNC_STRT_WID 0x030c
#define CRTC2_VLINE_CRNT_VLINE 0x0310
#define CRTC2_CRNT_FRAME 0x0314
#define CRTC2_GUI_TRIG_VLINE 0x0318
#define CRTC2_OFFSET 0x0324
#define CRTC2_OFFSET_CNTL 0x0328
#define CRTC2_PITCH 0x032c
#define DDA2_CONFIG 0x03e0
#define DDA2_ON_OFF 0x03e4
#define CRTC2_GEN_CNTL 0x03f8
#define CRTC2_STATUS 0x03fc
#define OV0_SCALE_CNTL 0x0420
#define SUBPIC_CNTL 0x0540
#define PM4_BUFFER_OFFSET 0x0700
#define PM4_BUFFER_CNTL 0x0704
#define PM4_BUFFER_WM_CNTL 0x0708
#define PM4_BUFFER_DL_RPTR_ADDR 0x070c
#define PM4_BUFFER_DL_RPTR 0x0710
#define PM4_BUFFER_DL_WPTR 0x0714
#define PM4_VC_FPU_SETUP 0x071c
#define PM4_FPU_CNTL 0x0720
#define PM4_VC_FORMAT 0x0724
#define PM4_VC_CNTL 0x0728
#define PM4_VC_I01 0x072c
#define PM4_VC_VLOFF 0x0730
#define PM4_VC_VLSIZE 0x0734
#define PM4_IW_INDOFF 0x0738
#define PM4_IW_INDSIZE 0x073c
#define PM4_FPU_FPX0 0x0740
#define PM4_FPU_FPY0 0x0744
#define PM4_FPU_FPX1 0x0748
#define PM4_FPU_FPY1 0x074c
#define PM4_FPU_FPX2 0x0750
#define PM4_FPU_FPY2 0x0754
#define PM4_FPU_FPY3 0x0758
#define PM4_FPU_FPY4 0x075c
#define PM4_FPU_FPY5 0x0760
#define PM4_FPU_FPY6 0x0764
#define PM4_FPU_FPR 0x0768
#define PM4_FPU_FPG 0x076c
#define PM4_FPU_FPB 0x0770
#define PM4_FPU_FPA 0x0774
#define PM4_FPU_INTXY0 0x0780
#define PM4_FPU_INTXY1 0x0784
#define PM4_FPU_INTXY2 0x0788
#define PM4_FPU_INTARGB 0x078c
#define PM4_FPU_FPTWICEAREA 0x0790
#define PM4_FPU_DMAJOR01 0x0794
#define PM4_FPU_DMAJOR12 0x0798
#define PM4_FPU_DMAJOR02 0x079c
#define PM4_FPU_STAT 0x07a0
#define PM4_STAT 0x07b8
#define PM4_TEST_CNTL 0x07d0
#define PM4_MICROCODE_ADDR 0x07d4
#define PM4_MICROCODE_RADDR 0x07d8
#define PM4_MICROCODE_DATAH 0x07dc
#define PM4_MICROCODE_DATAL 0x07e0
#define PM4_CMDFIFO_ADDR 0x07e4
#define PM4_CMDFIFO_DATAH 0x07e8
#define PM4_CMDFIFO_DATAL 0x07ec
#define PM4_BUFFER_ADDR 0x07f0
#define PM4_BUFFER_DATAH 0x07f4
#define PM4_BUFFER_DATAL 0x07f8
#define PM4_MICRO_CNTL 0x07fc
#define CAP0_TRIG_CNTL 0x0950
#define CAP1_TRIG_CNTL 0x09c0
/******************************************************************************
* GUI Block Memory Mapped Registers *
* These registers are FIFOed. *
*****************************************************************************/
#define PM4_FIFO_DATA_EVEN 0x1000
#define PM4_FIFO_DATA_ODD 0x1004
#define DST_OFFSET 0x1404
#define DST_PITCH 0x1408
#define DST_WIDTH 0x140c
#define DST_HEIGHT 0x1410
#define SRC_X 0x1414
#define SRC_Y 0x1418
#define DST_X 0x141c
#define DST_Y 0x1420
#define SRC_PITCH_OFFSET 0x1428
#define DST_PITCH_OFFSET 0x142c
#define SRC_Y_X 0x1434
#define DST_Y_X 0x1438
#define DST_HEIGHT_WIDTH 0x143c
#define DP_GUI_MASTER_CNTL 0x146c
#define BRUSH_SCALE 0x1470
#define BRUSH_Y_X 0x1474
#define DP_BRUSH_BKGD_CLR 0x1478
#define DP_BRUSH_FRGD_CLR 0x147c
#define DST_WIDTH_X 0x1588
#define DST_HEIGHT_WIDTH_8 0x158c
#define SRC_X_Y 0x1590
#define DST_X_Y 0x1594
#define DST_WIDTH_HEIGHT 0x1598
#define DST_WIDTH_X_INCY 0x159c
#define DST_HEIGHT_Y 0x15a0
#define DST_X_SUB 0x15a4
#define DST_Y_SUB 0x15a8
#define SRC_OFFSET 0x15ac
#define SRC_PITCH 0x15b0
#define DST_HEIGHT_WIDTH_BW 0x15b4
#define CLR_CMP_CNTL 0x15c0
#define CLR_CMP_CLR_SRC 0x15c4
#define CLR_CMP_CLR_DST 0x15c8
#define CLR_CMP_MASK 0x15cc
#define DP_SRC_FRGD_CLR 0x15d8
#define DP_SRC_BKGD_CLR 0x15dc
#define DST_BRES_ERR 0x1628
#define DST_BRES_INC 0x162c
#define DST_BRES_DEC 0x1630
#define DST_BRES_LNTH 0x1634
#define DST_BRES_LNTH_SUB 0x1638
#define SC_LEFT 0x1640
#define SC_RIGHT 0x1644
#define SC_TOP 0x1648
#define SC_BOTTOM 0x164c
#define SRC_SC_RIGHT 0x1654
#define SRC_SC_BOTTOM 0x165c
#define GUI_DEBUG0 0x16a0
#define GUI_DEBUG1 0x16a4
#define GUI_TIMEOUT 0x16b0
#define GUI_TIMEOUT0 0x16b4
#define GUI_TIMEOUT1 0x16b8
#define GUI_PROBE 0x16bc
#define DP_CNTL 0x16c0
#define DP_DATATYPE 0x16c4
#define DP_MIX 0x16c8
#define DP_WRITE_MASK 0x16cc
#define DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0
#define DEFAULT_OFFSET 0x16e0
#define DEFAULT_PITCH 0x16e4
#define DEFAULT_SC_BOTTOM_RIGHT 0x16e8
#define SC_TOP_LEFT 0x16ec
#define SC_BOTTOM_RIGHT 0x16f0
#define SRC_SC_BOTTOM_RIGHT 0x16f4
#define WAIT_UNTIL 0x1720
#define CACHE_CNTL 0x1724
#define GUI_STAT 0x1740
#define PC_GUI_MODE 0x1744
#define PC_GUI_CTLSTAT 0x1748
#define PC_DEBUG_MODE 0x1760
#define BRES_DST_ERR_DEC 0x1780
#define TRAIL_BRES_T12_ERR_DEC 0x1784
#define TRAIL_BRES_T12_INC 0x1788
#define DP_T12_CNTL 0x178c
#define DST_BRES_T1_LNTH 0x1790
#define DST_BRES_T2_LNTH 0x1794
#define SCALE_SRC_HEIGHT_WIDTH 0x1994
#define SCALE_OFFSET_0 0x1998
#define SCALE_PITCH 0x199c
#define SCALE_X_INC 0x19a0
#define SCALE_Y_INC 0x19a4
#define SCALE_HACC 0x19a8
#define SCALE_VACC 0x19ac
#define SCALE_DST_X_Y 0x19b0
#define SCALE_DST_HEIGHT_WIDTH 0x19b4
#define SCALE_3D_CNTL 0x1a00
#define SCALE_3D_DATATYPE 0x1a20
#define SETUP_CNTL 0x1bc4
#define SOLID_COLOR 0x1bc8
#define WINDOW_XY_OFFSET 0x1bcc
#define DRAW_LINE_POINT 0x1bd0
#define SETUP_CNTL_PM4 0x1bd4
#define DST_PITCH_OFFSET_C 0x1c80
#define DP_GUI_MASTER_CNTL_C 0x1c84
#define SC_TOP_LEFT_C 0x1c88
#define SC_BOTTOM_RIGHT_C 0x1c8c
#define CLR_CMP_MASK_3D 0x1A28
#define MISC_3D_STATE_CNTL_REG 0x1CA0
#define MC_SRC1_CNTL 0x19D8
#define TEX_CNTL 0x1800
/* CONSTANTS */
#define GUI_ACTIVE 0x80000000
#define ENGINE_IDLE 0x0
#define PLL_WR_EN 0x00000080
#define CLK_PIN_CNTL 0x0001
#define PPLL_CNTL 0x0002
#define PPLL_REF_DIV 0x0003
#define PPLL_DIV_0 0x0004
#define PPLL_DIV_1 0x0005
#define PPLL_DIV_2 0x0006
#define PPLL_DIV_3 0x0007
#define VCLK_ECP_CNTL 0x0008
#define HTOTAL_CNTL 0x0009
#define X_MPLL_REF_FB_DIV 0x000a
#define XPLL_CNTL 0x000b
#define XDLL_CNTL 0x000c
#define XCLK_CNTL 0x000d
#define MPLL_CNTL 0x000e
#define MCLK_CNTL 0x000f
#define AGP_PLL_CNTL 0x0010
#define FCP_CNTL 0x0012
#define PLL_TEST_CNTL 0x0013
#define P2PLL_CNTL 0x002a
#define P2PLL_REF_DIV 0x002b
#define P2PLL_DIV_0 0x002b
#define POWER_MANAGEMENT 0x002f
#define PPLL_RESET 0x01
#define PPLL_ATOMIC_UPDATE_EN 0x10000
#define PPLL_VGA_ATOMIC_UPDATE_EN 0x20000
#define PPLL_REF_DIV_MASK 0x3FF
#define PPLL_FB3_DIV_MASK 0x7FF
#define PPLL_POST3_DIV_MASK 0x70000
#define PPLL_ATOMIC_UPDATE_R 0x8000
#define PPLL_ATOMIC_UPDATE_W 0x8000
#define MEM_CFG_TYPE_MASK 0x3
#define XCLK_SRC_SEL_MASK 0x7
#define XPLL_FB_DIV_MASK 0xFF00
#define X_MPLL_REF_DIV_MASK 0xFF
/* CRTC control values (CRTC_GEN_CNTL) */
#define CRTC_CSYNC_EN 0x00000010
#define CRTC2_DBL_SCAN_EN 0x00000001
#define CRTC2_DISPLAY_DIS 0x00800000
#define CRTC2_FIFO_EXTSENSE 0x00200000
#define CRTC2_ICON_EN 0x00100000
#define CRTC2_CUR_EN 0x00010000
#define CRTC2_EN 0x02000000
#define CRTC2_DISP_REQ_EN_B 0x04000000
#define CRTC_PIX_WIDTH_MASK 0x00000700
#define CRTC_PIX_WIDTH_4BPP 0x00000100
#define CRTC_PIX_WIDTH_8BPP 0x00000200
#define CRTC_PIX_WIDTH_15BPP 0x00000300
#define CRTC_PIX_WIDTH_16BPP 0x00000400
#define CRTC_PIX_WIDTH_24BPP 0x00000500
#define CRTC_PIX_WIDTH_32BPP 0x00000600
/* DAC_CNTL bit constants */
#define DAC_8BIT_EN 0x00000100
#define DAC_MASK 0xFF000000
#define DAC_BLANKING 0x00000004
#define DAC_RANGE_CNTL 0x00000003
#define DAC_CLK_SEL 0x00000010
#define DAC_PALETTE_ACCESS_CNTL 0x00000020
#define DAC_PALETTE2_SNOOP_EN 0x00000040
#define DAC_PDWN 0x00008000
/* CRTC_EXT_CNTL */
#define CRT_CRTC_ON 0x00008000
/* GEN_RESET_CNTL bit constants */
#define SOFT_RESET_GUI 0x00000001
#define SOFT_RESET_VCLK 0x00000100
#define SOFT_RESET_PCLK 0x00000200
#define SOFT_RESET_ECP 0x00000400
#define SOFT_RESET_DISPENG_XCLK 0x00000800
/* PC_GUI_CTLSTAT bit constants */
#define PC_BUSY_INIT 0x10000000
#define PC_BUSY_GUI 0x20000000
#define PC_BUSY_NGUI 0x40000000
#define PC_BUSY 0x80000000
#define BUS_MASTER_DIS 0x00000040
#define PM4_BUFFER_CNTL_NONPM4 0x00000000
/* DP_DATATYPE bit constants */
#define DST_8BPP 0x00000002
#define DST_15BPP 0x00000003
#define DST_16BPP 0x00000004
#define DST_24BPP 0x00000005
#define DST_32BPP 0x00000006
#define BRUSH_SOLIDCOLOR 0x00000d00
/* DP_GUI_MASTER_CNTL bit constants */
#define GMC_SRC_PITCH_OFFSET_DEFAULT 0x00000000
#define GMC_DST_PITCH_OFFSET_DEFAULT 0x00000000
#define GMC_SRC_CLIP_DEFAULT 0x00000000
#define GMC_DST_CLIP_DEFAULT 0x00000000
#define GMC_BRUSH_SOLIDCOLOR 0x000000d0
#define GMC_SRC_DSTCOLOR 0x00003000
#define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000
#define GMC_DP_SRC_RECT 0x02000000
#define GMC_3D_FCN_EN_CLR 0x00000000
#define GMC_AUX_CLIP_CLEAR 0x20000000
#define GMC_DST_CLR_CMP_FCN_CLEAR 0x10000000
#define GMC_WRITE_MASK_SET 0x40000000
#define GMC_DP_CONVERSION_TEMP_6500 0x00000000
/* DP_GUI_MASTER_CNTL ROP3 named constants */
#define ROP3_PATCOPY 0x00f00000
#define ROP3_SRCCOPY 0x00cc0000
#define SRC_DSTCOLOR 0x00030000
/* DP_CNTL bit constants */
#define DST_X_RIGHT_TO_LEFT 0x00000000
#define DST_X_LEFT_TO_RIGHT 0x00000001
#define DST_Y_BOTTOM_TO_TOP 0x00000000
#define DST_Y_TOP_TO_BOTTOM 0x00000002
#define DST_X_MAJOR 0x00000000
#define DST_Y_MAJOR 0x00000004
#define DST_X_TILE 0x00000008
#define DST_Y_TILE 0x00000010
#define DST_LAST_PEL 0x00000020
#define DST_TRAIL_X_RIGHT_TO_LEFT 0x00000000
#define DST_TRAIL_X_LEFT_TO_RIGHT 0x00000040
#define DST_TRAP_FILL_RIGHT_TO_LEFT 0x00000000
#define DST_TRAP_FILL_LEFT_TO_RIGHT 0x00000080
#define DST_BRES_SIGN 0x00000100
#define DST_HOST_BIG_ENDIAN_EN 0x00000200
#define DST_POLYLINE_NONLAST 0x00008000
#define DST_RASTER_STALL 0x00010000
#define DST_POLY_EDGE 0x00040000
/* DP_MIX bit constants */
#define DP_SRC_RECT 0x00000200
#define DP_SRC_HOST 0x00000300
#define DP_SRC_HOST_BYTEALIGN 0x00000400
/* LVDS_GEN_CNTL constants */
#define LVDS_BL_MOD_LEVEL_MASK 0x0000ff00
#define LVDS_BL_MOD_LEVEL_SHIFT 8
#define LVDS_BL_MOD_EN 0x00010000
#define LVDS_DIGION 0x00040000
#define LVDS_BLON 0x00080000
#define LVDS_ON 0x00000001
#define LVDS_DISPLAY_DIS 0x00000002
#define LVDS_PANEL_TYPE_2PIX_PER_CLK 0x00000004
#define LVDS_PANEL_24BITS_TFT 0x00000008
#define LVDS_FRAME_MOD_NO 0x00000000
#define LVDS_FRAME_MOD_2_LEVELS 0x00000010
#define LVDS_FRAME_MOD_4_LEVELS 0x00000020
#define LVDS_RST_FM 0x00000040
#define LVDS_EN 0x00000080
/* CRTC2_GEN_CNTL constants */
#define CRTC2_EN 0x02000000
/* POWER_MANAGEMENT constants */
#define PWR_MGT_ON 0x00000001
#define PWR_MGT_MODE_MASK 0x00000006
#define PWR_MGT_MODE_PIN 0x00000000
#define PWR_MGT_MODE_REGISTER 0x00000002
#define PWR_MGT_MODE_TIMER 0x00000004
#define PWR_MGT_MODE_PCI 0x00000006
#define PWR_MGT_AUTO_PWR_UP_EN 0x00000008
#define PWR_MGT_ACTIVITY_PIN_ON 0x00000010
#define PWR_MGT_STANDBY_POL 0x00000020
#define PWR_MGT_SUSPEND_POL 0x00000040
#define PWR_MGT_SELF_REFRESH 0x00000080
#define PWR_MGT_ACTIVITY_PIN_EN 0x00000100
#define PWR_MGT_KEYBD_SNOOP 0x00000200
#define PWR_MGT_TRISTATE_MEM_EN 0x00000800
#define PWR_MGT_SELW4MS 0x00001000
#define PWR_MGT_SLOWDOWN_MCLK 0x00002000
#define PMI_PMSCR_REG 0x60
/* used by ATI bug fix for hardware ROM */
#define RAGE128_MPP_TB_CONFIG 0x01c0
#endif /* REG_RAGE128_H */

122
include/video/cirrus.h Normal file
View File

@@ -0,0 +1,122 @@
/*
* drivers/video/clgenfb.h - Cirrus Logic chipset constants
*
* Copyright 1999 Jeff Garzik <jgarzik@pobox.com>
*
* Original clgenfb author: Frank Neumann
*
* Based on retz3fb.c and clgen.c:
* Copyright (C) 1997 Jes Sorensen
* Copyright (C) 1996 Frank Neumann
*
***************************************************************
*
* Format this code with GNU indent '-kr -i8 -pcs' options.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*
*/
#ifndef __CLGENFB_H__
#define __CLGENFB_H__
/* OLD COMMENT: definitions for Piccolo/SD64 VGA controller chip */
/* OLD COMMENT: these definitions might most of the time also work */
/* OLD COMMENT: for other CL-GD542x/543x based boards.. */
/*** External/General Registers ***/
#define CL_POS102 0x102 /* POS102 register */
#define CL_VSSM 0x46e8 /* Adapter Sleep */
#define CL_VSSM2 0x3c3 /* Motherboard Sleep */
/*** VGA Sequencer Registers ***/
#define CL_SEQR0 0x0 /* Reset */
/* the following are from the "extension registers" group */
#define CL_SEQR6 0x6 /* Unlock ALL Extensions */
#define CL_SEQR7 0x7 /* Extended Sequencer Mode */
#define CL_SEQR8 0x8 /* EEPROM Control */
#define CL_SEQR9 0x9 /* Scratch Pad 0 (do not access!) */
#define CL_SEQRA 0xa /* Scratch Pad 1 (do not access!) */
#define CL_SEQRB 0xb /* VCLK0 Numerator */
#define CL_SEQRC 0xc /* VCLK1 Numerator */
#define CL_SEQRD 0xd /* VCLK2 Numerator */
#define CL_SEQRE 0xe /* VCLK3 Numerator */
#define CL_SEQRF 0xf /* DRAM Control */
#define CL_SEQR10 0x10 /* Graphics Cursor X Position */
#define CL_SEQR11 0x11 /* Graphics Cursor Y Position */
#define CL_SEQR12 0x12 /* Graphics Cursor Attributes */
#define CL_SEQR13 0x13 /* Graphics Cursor Pattern Address Offset */
#define CL_SEQR14 0x14 /* Scratch Pad 2 (CL-GD5426/'28 Only) (do not access!) */
#define CL_SEQR15 0x15 /* Scratch Pad 3 (CL-GD5426/'28 Only) (do not access!) */
#define CL_SEQR16 0x16 /* Performance Tuning (CL-GD5424/'26/'28 Only) */
#define CL_SEQR17 0x17 /* Configuration ReadBack and Extended Control (CL-GF5428 Only) */
#define CL_SEQR18 0x18 /* Signature Generator Control (Not CL-GD5420) */
#define CL_SEQR19 0x19 /* Signature Generator Result Low Byte (Not CL-GD5420) */
#define CL_SEQR1A 0x1a /* Signature Generator Result High Byte (Not CL-GD5420) */
#define CL_SEQR1B 0x1b /* VCLK0 Denominator and Post-Scalar Value */
#define CL_SEQR1C 0x1c /* VCLK1 Denominator and Post-Scalar Value */
#define CL_SEQR1D 0x1d /* VCLK2 Denominator and Post-Scalar Value */
#define CL_SEQR1E 0x1e /* VCLK3 Denominator and Post-Scalar Value */
#define CL_SEQR1F 0x1f /* BIOS ROM write enable and MCLK Select */
/*** CRT Controller Registers ***/
#define CL_CRT22 0x22 /* Graphics Data Latches ReadBack */
#define CL_CRT24 0x24 /* Attribute Controller Toggle ReadBack */
#define CL_CRT26 0x26 /* Attribute Controller Index ReadBack */
/* the following are from the "extension registers" group */
#define CL_CRT19 0x19 /* Interlace End */
#define CL_CRT1A 0x1a /* Interlace Control */
#define CL_CRT1B 0x1b /* Extended Display Controls */
#define CL_CRT1C 0x1c /* Sync adjust and genlock register */
#define CL_CRT1D 0x1d /* Overlay Extended Control register */
#define CL_CRT25 0x25 /* Part Status Register */
#define CL_CRT27 0x27 /* ID Register */
#define CL_CRT51 0x51 /* P4 disable "flicker fixer" */
/*** Graphics Controller Registers ***/
/* the following are from the "extension registers" group */
#define CL_GR9 0x9 /* Offset Register 0 */
#define CL_GRA 0xa /* Offset Register 1 */
#define CL_GRB 0xb /* Graphics Controller Mode Extensions */
#define CL_GRC 0xc /* Color Key (CL-GD5424/'26/'28 Only) */
#define CL_GRD 0xd /* Color Key Mask (CL-GD5424/'26/'28 Only) */
#define CL_GRE 0xe /* Miscellaneous Control (Cl-GD5428 Only) */
#define CL_GRF 0xf /* Display Compression Control register */
#define CL_GR10 0x10 /* 16-bit Pixel BG Color High Byte (Not CL-GD5420) */
#define CL_GR11 0x11 /* 16-bit Pixel FG Color High Byte (Not CL-GD5420) */
#define CL_GR12 0x12 /* Background Color Byte 2 Register */
#define CL_GR13 0x13 /* Foreground Color Byte 2 Register */
#define CL_GR14 0x14 /* Background Color Byte 3 Register */
#define CL_GR15 0x15 /* Foreground Color Byte 3 Register */
/* the following are CL-GD5426/'28 specific blitter registers */
#define CL_GR20 0x20 /* BLT Width Low */
#define CL_GR21 0x21 /* BLT Width High */
#define CL_GR22 0x22 /* BLT Height Low */
#define CL_GR23 0x23 /* BLT Height High */
#define CL_GR24 0x24 /* BLT Destination Pitch Low */
#define CL_GR25 0x25 /* BLT Destination Pitch High */
#define CL_GR26 0x26 /* BLT Source Pitch Low */
#define CL_GR27 0x27 /* BLT Source Pitch High */
#define CL_GR28 0x28 /* BLT Destination Start Low */
#define CL_GR29 0x29 /* BLT Destination Start Mid */
#define CL_GR2A 0x2a /* BLT Destination Start High */
#define CL_GR2C 0x2c /* BLT Source Start Low */
#define CL_GR2D 0x2d /* BLT Source Start Mid */
#define CL_GR2E 0x2e /* BLT Source Start High */
#define CL_GR2F 0x2f /* Picasso IV Blitter compat mode..? */
#define CL_GR30 0x30 /* BLT Mode */
#define CL_GR31 0x31 /* BLT Start/Status */
#define CL_GR32 0x32 /* BLT Raster Operation */
#define CL_GR33 0x33 /* another P4 "compat" register.. */
#define CL_GR34 0x34 /* Transparent Color Select Low */
#define CL_GR35 0x35 /* Transparent Color Select High */
#define CL_GR38 0x38 /* Source Transparent Color Mask Low */
#define CL_GR39 0x39 /* Source Transparent Color Mask High */
/*** Attribute Controller Registers ***/
#define CL_AR33 0x33 /* The "real" Pixel Panning register (?) */
#define CL_AR34 0x34 /* TEST */
#endif /* __CLGENFB_H__ */

View File

@@ -0,0 +1,51 @@
/*
* Phase5 CybervisionPPC (TVP4020) definitions for the Permedia2 framebuffer
* driver.
*
* Copyright (c) 1998-1999 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
* --------------------------------------------------------------------------
* $Id: cvisionppc.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#ifndef CVISIONPPC_H
#define CVISIONPPC_H
#ifndef PM2FB_H
#include "pm2fb.h"
#endif
struct cvppc_par {
unsigned char* pci_config;
unsigned char* pci_bridge;
u32 user_flags;
};
#define CSPPC_PCI_BRIDGE 0xfffe0000
#define CSPPC_BRIDGE_ENDIAN 0x0000
#define CSPPC_BRIDGE_INT 0x0010
#define CVPPC_PCI_CONFIG 0xfffc0000
#define CVPPC_ROM_ADDRESS 0xe2000001
#define CVPPC_REGS_REGION 0xef000000
#define CVPPC_FB_APERTURE_ONE 0xe0000000
#define CVPPC_FB_APERTURE_TWO 0xe1000000
#define CVPPC_FB_SIZE 0x00800000
#define CVPPC_MEM_CONFIG_OLD 0xed61fcaa /* FIXME Fujitsu?? */
#define CVPPC_MEM_CONFIG_NEW 0xed41c532 /* FIXME USA?? */
#define CVPPC_MEMCLOCK 83000 /* in KHz */
/* CVPPC_BRIDGE_ENDIAN */
#define CSPPCF_BRIDGE_BIG_ENDIAN 0x02
/* CVPPC_BRIDGE_INT */
#define CSPPCF_BRIDGE_ACTIVE_INT2 0x01
#endif /* CVISIONPPC_H */
/*****************************************************************************
* That's all folks!
*****************************************************************************/

175
include/video/cyblafb.h Normal file
View File

@@ -0,0 +1,175 @@
#ifndef CYBLAFB_DEBUG
#define CYBLAFB_DEBUG 0
#endif
#if CYBLAFB_DEBUG
#define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a);
#else
#define debug(f,a...)
#endif
#define output(f, a...) printk("cyblafb: " f, ## a)
#define Kb (1024)
#define Mb (Kb*Kb)
/* PCI IDS of supported cards temporarily here */
#define CYBERBLADEi1 0x8500
/* these defines are for 'lcd' variable */
#define LCD_STRETCH 0
#define LCD_CENTER 1
#define LCD_BIOS 2
/* display types */
#define DISPLAY_CRT 0
#define DISPLAY_FP 1
#define ROP_S 0xCC
#define point(x,y) ((y)<<16|(x))
//
// Attribute Regs, ARxx, 3c0/3c1
//
#define AR00 0x00
#define AR01 0x01
#define AR02 0x02
#define AR03 0x03
#define AR04 0x04
#define AR05 0x05
#define AR06 0x06
#define AR07 0x07
#define AR08 0x08
#define AR09 0x09
#define AR0A 0x0A
#define AR0B 0x0B
#define AR0C 0x0C
#define AR0D 0x0D
#define AR0E 0x0E
#define AR0F 0x0F
#define AR10 0x10
#define AR12 0x12
#define AR13 0x13
//
// Sequencer Regs, SRxx, 3c4/3c5
//
#define SR00 0x00
#define SR01 0x01
#define SR02 0x02
#define SR03 0x03
#define SR04 0x04
#define SR0D 0x0D
#define SR0E 0x0E
#define SR11 0x11
#define SR18 0x18
#define SR19 0x19
//
//
//
#define CR00 0x00
#define CR01 0x01
#define CR02 0x02
#define CR03 0x03
#define CR04 0x04
#define CR05 0x05
#define CR06 0x06
#define CR07 0x07
#define CR08 0x08
#define CR09 0x09
#define CR0A 0x0A
#define CR0B 0x0B
#define CR0C 0x0C
#define CR0D 0x0D
#define CR0E 0x0E
#define CR0F 0x0F
#define CR10 0x10
#define CR11 0x11
#define CR12 0x12
#define CR13 0x13
#define CR14 0x14
#define CR15 0x15
#define CR16 0x16
#define CR17 0x17
#define CR18 0x18
#define CR19 0x19
#define CR1A 0x1A
#define CR1B 0x1B
#define CR1C 0x1C
#define CR1D 0x1D
#define CR1E 0x1E
#define CR1F 0x1F
#define CR20 0x20
#define CR21 0x21
#define CR27 0x27
#define CR29 0x29
#define CR2A 0x2A
#define CR2B 0x2B
#define CR2D 0x2D
#define CR2F 0x2F
#define CR36 0x36
#define CR38 0x38
#define CR39 0x39
#define CR3A 0x3A
#define CR55 0x55
#define CR56 0x56
#define CR57 0x57
#define CR58 0x58
//
//
//
#define GR00 0x01
#define GR01 0x01
#define GR02 0x02
#define GR03 0x03
#define GR04 0x04
#define GR05 0x05
#define GR06 0x06
#define GR07 0x07
#define GR08 0x08
#define GR0F 0x0F
#define GR20 0x20
#define GR23 0x23
#define GR2F 0x2F
#define GR30 0x30
#define GR31 0x31
#define GR33 0x33
#define GR52 0x52
#define GR53 0x53
#define GR5D 0x5d
//
// Graphics Engine
//
#define GEBase 0x2100 // could be mapped elsewhere if we like it
#define GE00 (GEBase+0x00) // source 1, p 111
#define GE04 (GEBase+0x04) // source 2, p 111
#define GE08 (GEBase+0x08) // destination 1, p 111
#define GE0C (GEBase+0x0C) // destination 2, p 112
#define GE10 (GEBase+0x10) // right view base & enable, p 112
#define GE13 (GEBase+0x13) // left view base & enable, p 112
#define GE18 (GEBase+0x18) // block write start address, p 112
#define GE1C (GEBase+0x1C) // block write end address, p 112
#define GE20 (GEBase+0x20) // engine status, p 113
#define GE24 (GEBase+0x24) // reset all GE pointers
#define GE44 (GEBase+0x44) // command register, p 126
#define GE48 (GEBase+0x48) // raster operation, p 127
#define GE60 (GEBase+0x60) // foreground color, p 128
#define GE64 (GEBase+0x64) // background color, p 128
#define GE6C (GEBase+0x6C) // Pattern and Style, p 129, ok
#define GE9C (GEBase+0x9C) // pixel engine data port, p 125
#define GEB8 (GEBase+0xB8) // Destination Stride / Buffer Base 0, p 133
#define GEBC (GEBase+0xBC) // Destination Stride / Buffer Base 1, p 133
#define GEC0 (GEBase+0xC0) // Destination Stride / Buffer Base 2, p 133
#define GEC4 (GEBase+0xC4) // Destination Stride / Buffer Base 3, p 133
#define GEC8 (GEBase+0xC8) // Source Stride / Buffer Base 0, p 133
#define GECC (GEBase+0xCC) // Source Stride / Buffer Base 1, p 133
#define GED0 (GEBase+0xD0) // Source Stride / Buffer Base 2, p 133
#define GED4 (GEBase+0xD4) // Source Stride / Buffer Base 3, p 133

17
include/video/edid.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef __linux_video_edid_h__
#define __linux_video_edid_h__
#ifdef __KERNEL__
#ifdef CONFIG_X86
struct edid_info {
unsigned char dummy[128];
};
extern struct edid_info edid_info;
#endif /* CONFIG_X86 */
#endif /* __KERNEL__ */
#endif /* __linux_video_edid_h__ */

64
include/video/epson1355.h Normal file
View File

@@ -0,0 +1,64 @@
/*
* include/video/epson13xx.h -- Epson 13xx frame buffer
*
* Copyright (C) Hewlett-Packard Company. All rights reserved.
*
* Written by Christopher Hoover <ch@hpl.hp.com>
*
*/
#ifndef _EPSON13XX_H_
#define _EPSON13XX_H_
#define REG_REVISION_CODE 0x00
#define REG_MEMORY_CONFIG 0x01
#define REG_PANEL_TYPE 0x02
#define REG_MOD_RATE 0x03
#define REG_HORZ_DISP_WIDTH 0x04
#define REG_HORZ_NONDISP_PERIOD 0x05
#define REG_HRTC_START_POSITION 0x06
#define REG_HRTC_PULSE_WIDTH 0x07
#define REG_VERT_DISP_HEIGHT0 0x08
#define REG_VERT_DISP_HEIGHT1 0x09
#define REG_VERT_NONDISP_PERIOD 0x0A
#define REG_VRTC_START_POSITION 0x0B
#define REG_VRTC_PULSE_WIDTH 0x0C
#define REG_DISPLAY_MODE 0x0D
#define REG_SCRN1_LINE_COMPARE0 0x0E
#define REG_SCRN1_LINE_COMPARE1 0x0F
#define REG_SCRN1_DISP_START_ADDR0 0x10
#define REG_SCRN1_DISP_START_ADDR1 0x11
#define REG_SCRN1_DISP_START_ADDR2 0x12
#define REG_SCRN2_DISP_START_ADDR0 0x13
#define REG_SCRN2_DISP_START_ADDR1 0x14
#define REG_SCRN2_DISP_START_ADDR2 0x15
#define REG_MEM_ADDR_OFFSET0 0x16
#define REG_MEM_ADDR_OFFSET1 0x17
#define REG_PIXEL_PANNING 0x18
#define REG_CLOCK_CONFIG 0x19
#define REG_POWER_SAVE_CONFIG 0x1A
#define REG_MISC 0x1B
#define REG_MD_CONFIG_READBACK0 0x1C
#define REG_MD_CONFIG_READBACK1 0x1D
#define REG_GPIO_CONFIG0 0x1E
#define REG_GPIO_CONFIG1 0x1F
#define REG_GPIO_CONTROL0 0x20
#define REG_GPIO_CONTROL1 0x21
#define REG_PERF_ENHANCEMENT0 0x22
#define REG_PERF_ENHANCEMENT1 0x23
#define REG_LUT_ADDR 0x24
#define REG_RESERVED_1 0x25
#define REG_LUT_DATA 0x26
#define REG_INK_CURSOR_CONTROL 0x27
#define REG_CURSOR_X_POSITION0 0x28
#define REG_CURSOR_X_POSITION1 0x29
#define REG_CURSOR_Y_POSITION0 0x2A
#define REG_CURSOR_Y_POSITION1 0x2B
#define REG_INK_CURSOR_COLOR0_0 0x2C
#define REG_INK_CURSOR_COLOR0_1 0x2D
#define REG_INK_CURSOR_COLOR1_0 0x2E
#define REG_INK_CURSOR_COLOR1_1 0x2F
#define REG_INK_CURSOR_START_ADDR 0x30
#define REG_ALTERNATE_FRM 0x31
#endif

317
include/video/gbe.h Normal file
View File

@@ -0,0 +1,317 @@
/*
* include/video/gbe.h -- SGI GBE (Graphics Back End)
*
* Copyright (C) 1999 Silicon Graphics, Inc. (Jeffrey Newquist)
*
* This file is subject to the terms and conditions of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*/
#ifndef __GBE_H__
#define __GBE_H__
struct sgi_gbe {
volatile uint32_t ctrlstat; /* general control */
volatile uint32_t dotclock; /* dot clock PLL control */
volatile uint32_t i2c; /* crt I2C control */
volatile uint32_t sysclk; /* system clock PLL control */
volatile uint32_t i2cfp; /* flat panel I2C control */
volatile uint32_t id; /* device id/chip revision */
volatile uint32_t config; /* power on configuration [1] */
volatile uint32_t bist; /* internal bist status [1] */
uint32_t _pad0[0x010000/4 - 8];
volatile uint32_t vt_xy; /* current dot coords */
volatile uint32_t vt_xymax; /* maximum dot coords */
volatile uint32_t vt_vsync; /* vsync on/off */
volatile uint32_t vt_hsync; /* hsync on/off */
volatile uint32_t vt_vblank; /* vblank on/off */
volatile uint32_t vt_hblank; /* hblank on/off */
volatile uint32_t vt_flags; /* polarity of vt signals */
volatile uint32_t vt_f2rf_lock; /* f2rf & framelck y coord */
volatile uint32_t vt_intr01; /* intr 0,1 y coords */
volatile uint32_t vt_intr23; /* intr 2,3 y coords */
volatile uint32_t fp_hdrv; /* flat panel hdrv on/off */
volatile uint32_t fp_vdrv; /* flat panel vdrv on/off */
volatile uint32_t fp_de; /* flat panel de on/off */
volatile uint32_t vt_hpixen; /* intrnl horiz pixel on/off */
volatile uint32_t vt_vpixen; /* intrnl vert pixel on/off */
volatile uint32_t vt_hcmap; /* cmap write (horiz) */
volatile uint32_t vt_vcmap; /* cmap write (vert) */
volatile uint32_t did_start_xy; /* eol/f did/xy reset val */
volatile uint32_t crs_start_xy; /* eol/f crs/xy reset val */
volatile uint32_t vc_start_xy; /* eol/f vc/xy reset val */
uint32_t _pad1[0xffb0/4];
volatile uint32_t ovr_width_tile;/*overlay plane ctrl 0 */
volatile uint32_t ovr_inhwctrl; /* overlay plane ctrl 1 */
volatile uint32_t ovr_control; /* overlay plane ctrl 1 */
uint32_t _pad2[0xfff4/4];
volatile uint32_t frm_size_tile;/* normal plane ctrl 0 */
volatile uint32_t frm_size_pixel;/*normal plane ctrl 1 */
volatile uint32_t frm_inhwctrl; /* normal plane ctrl 2 */
volatile uint32_t frm_control; /* normal plane ctrl 3 */
uint32_t _pad3[0xfff0/4];
volatile uint32_t did_inhwctrl; /* DID control */
volatile uint32_t did_control; /* DID shadow */
uint32_t _pad4[0x7ff8/4];
volatile uint32_t mode_regs[32];/* WID table */
uint32_t _pad5[0x7f80/4];
volatile uint32_t cmap[6144]; /* color map */
uint32_t _pad6[0x2000/4];
volatile uint32_t cm_fifo; /* color map fifo status */
uint32_t _pad7[0x7ffc/4];
volatile uint32_t gmap[256]; /* gamma map */
uint32_t _pad8[0x7c00/4];
volatile uint32_t gmap10[1024]; /* gamma map */
uint32_t _pad9[0x7000/4];
volatile uint32_t crs_pos; /* cusror control 0 */
volatile uint32_t crs_ctl; /* cusror control 1 */
volatile uint32_t crs_cmap[3]; /* crs cmap */
uint32_t _pad10[0x7fec/4];
volatile uint32_t crs_glyph[64];/* crs glyph */
uint32_t _pad11[0x7f00/4];
volatile uint32_t vc_0; /* video capture crtl 0 */
volatile uint32_t vc_1; /* video capture crtl 1 */
volatile uint32_t vc_2; /* video capture crtl 2 */
volatile uint32_t vc_3; /* video capture crtl 3 */
volatile uint32_t vc_4; /* video capture crtl 4 */
volatile uint32_t vc_5; /* video capture crtl 5 */
volatile uint32_t vc_6; /* video capture crtl 6 */
volatile uint32_t vc_7; /* video capture crtl 7 */
volatile uint32_t vc_8; /* video capture crtl 8 */
};
#define MASK(msb, lsb) \
( (((u32)1<<((msb)-(lsb)+1))-1) << (lsb) )
#define GET(v, msb, lsb) \
( ((u32)(v) & MASK(msb,lsb)) >> (lsb) )
#define SET(v, f, msb, lsb) \
( (v) = ((v)&~MASK(msb,lsb)) | (( (u32)(f)<<(lsb) ) & MASK(msb,lsb)) )
#define GET_GBE_FIELD(reg, field, v) \
GET((v), GBE_##reg##_##field##_MSB, GBE_##reg##_##field##_LSB)
#define SET_GBE_FIELD(reg, field, v, f) \
SET((v), (f), GBE_##reg##_##field##_MSB, GBE_##reg##_##field##_LSB)
/*
* Bit mask information
*/
#define GBE_CTRLSTAT_CHIPID_MSB 3
#define GBE_CTRLSTAT_CHIPID_LSB 0
#define GBE_CTRLSTAT_SENSE_N_MSB 4
#define GBE_CTRLSTAT_SENSE_N_LSB 4
#define GBE_CTRLSTAT_PCLKSEL_MSB 29
#define GBE_CTRLSTAT_PCLKSEL_LSB 28
#define GBE_DOTCLK_M_MSB 7
#define GBE_DOTCLK_M_LSB 0
#define GBE_DOTCLK_N_MSB 13
#define GBE_DOTCLK_N_LSB 8
#define GBE_DOTCLK_P_MSB 15
#define GBE_DOTCLK_P_LSB 14
#define GBE_DOTCLK_RUN_MSB 20
#define GBE_DOTCLK_RUN_LSB 20
#define GBE_VT_XY_Y_MSB 23
#define GBE_VT_XY_Y_LSB 12
#define GBE_VT_XY_X_MSB 11
#define GBE_VT_XY_X_LSB 0
#define GBE_VT_XY_FREEZE_MSB 31
#define GBE_VT_XY_FREEZE_LSB 31
#define GBE_FP_VDRV_ON_MSB 23
#define GBE_FP_VDRV_ON_LSB 12
#define GBE_FP_VDRV_OFF_MSB 11
#define GBE_FP_VDRV_OFF_LSB 0
#define GBE_FP_HDRV_ON_MSB 23
#define GBE_FP_HDRV_ON_LSB 12
#define GBE_FP_HDRV_OFF_MSB 11
#define GBE_FP_HDRV_OFF_LSB 0
#define GBE_FP_DE_ON_MSB 23
#define GBE_FP_DE_ON_LSB 12
#define GBE_FP_DE_OFF_MSB 11
#define GBE_FP_DE_OFF_LSB 0
#define GBE_VT_VSYNC_VSYNC_ON_MSB 23
#define GBE_VT_VSYNC_VSYNC_ON_LSB 12
#define GBE_VT_VSYNC_VSYNC_OFF_MSB 11
#define GBE_VT_VSYNC_VSYNC_OFF_LSB 0
#define GBE_VT_HSYNC_HSYNC_ON_MSB 23
#define GBE_VT_HSYNC_HSYNC_ON_LSB 12
#define GBE_VT_HSYNC_HSYNC_OFF_MSB 11
#define GBE_VT_HSYNC_HSYNC_OFF_LSB 0
#define GBE_VT_VBLANK_VBLANK_ON_MSB 23
#define GBE_VT_VBLANK_VBLANK_ON_LSB 12
#define GBE_VT_VBLANK_VBLANK_OFF_MSB 11
#define GBE_VT_VBLANK_VBLANK_OFF_LSB 0
#define GBE_VT_HBLANK_HBLANK_ON_MSB 23
#define GBE_VT_HBLANK_HBLANK_ON_LSB 12
#define GBE_VT_HBLANK_HBLANK_OFF_MSB 11
#define GBE_VT_HBLANK_HBLANK_OFF_LSB 0
#define GBE_VT_FLAGS_F2RF_HIGH_MSB 6
#define GBE_VT_FLAGS_F2RF_HIGH_LSB 6
#define GBE_VT_FLAGS_SYNC_LOW_MSB 5
#define GBE_VT_FLAGS_SYNC_LOW_LSB 5
#define GBE_VT_FLAGS_SYNC_HIGH_MSB 4
#define GBE_VT_FLAGS_SYNC_HIGH_LSB 4
#define GBE_VT_FLAGS_HDRV_LOW_MSB 3
#define GBE_VT_FLAGS_HDRV_LOW_LSB 3
#define GBE_VT_FLAGS_HDRV_INVERT_MSB 2
#define GBE_VT_FLAGS_HDRV_INVERT_LSB 2
#define GBE_VT_FLAGS_VDRV_LOW_MSB 1
#define GBE_VT_FLAGS_VDRV_LOW_LSB 1
#define GBE_VT_FLAGS_VDRV_INVERT_MSB 0
#define GBE_VT_FLAGS_VDRV_INVERT_LSB 0
#define GBE_VT_VCMAP_VCMAP_ON_MSB 23
#define GBE_VT_VCMAP_VCMAP_ON_LSB 12
#define GBE_VT_VCMAP_VCMAP_OFF_MSB 11
#define GBE_VT_VCMAP_VCMAP_OFF_LSB 0
#define GBE_VT_HCMAP_HCMAP_ON_MSB 23
#define GBE_VT_HCMAP_HCMAP_ON_LSB 12
#define GBE_VT_HCMAP_HCMAP_OFF_MSB 11
#define GBE_VT_HCMAP_HCMAP_OFF_LSB 0
#define GBE_VT_XYMAX_MAXX_MSB 11
#define GBE_VT_XYMAX_MAXX_LSB 0
#define GBE_VT_XYMAX_MAXY_MSB 23
#define GBE_VT_XYMAX_MAXY_LSB 12
#define GBE_VT_HPIXEN_HPIXEN_ON_MSB 23
#define GBE_VT_HPIXEN_HPIXEN_ON_LSB 12
#define GBE_VT_HPIXEN_HPIXEN_OFF_MSB 11
#define GBE_VT_HPIXEN_HPIXEN_OFF_LSB 0
#define GBE_VT_VPIXEN_VPIXEN_ON_MSB 23
#define GBE_VT_VPIXEN_VPIXEN_ON_LSB 12
#define GBE_VT_VPIXEN_VPIXEN_OFF_MSB 11
#define GBE_VT_VPIXEN_VPIXEN_OFF_LSB 0
#define GBE_OVR_CONTROL_OVR_DMA_ENABLE_MSB 0
#define GBE_OVR_CONTROL_OVR_DMA_ENABLE_LSB 0
#define GBE_OVR_INHWCTRL_OVR_DMA_ENABLE_MSB 0
#define GBE_OVR_INHWCTRL_OVR_DMA_ENABLE_LSB 0
#define GBE_OVR_WIDTH_TILE_OVR_FIFO_RESET_MSB 13
#define GBE_OVR_WIDTH_TILE_OVR_FIFO_RESET_LSB 13
#define GBE_FRM_CONTROL_FRM_DMA_ENABLE_MSB 0
#define GBE_FRM_CONTROL_FRM_DMA_ENABLE_LSB 0
#define GBE_FRM_CONTROL_FRM_TILE_PTR_MSB 31
#define GBE_FRM_CONTROL_FRM_TILE_PTR_LSB 9
#define GBE_FRM_CONTROL_FRM_LINEAR_MSB 1
#define GBE_FRM_CONTROL_FRM_LINEAR_LSB 1
#define GBE_FRM_INHWCTRL_FRM_DMA_ENABLE_MSB 0
#define GBE_FRM_INHWCTRL_FRM_DMA_ENABLE_LSB 0
#define GBE_FRM_SIZE_TILE_FRM_WIDTH_TILE_MSB 12
#define GBE_FRM_SIZE_TILE_FRM_WIDTH_TILE_LSB 5
#define GBE_FRM_SIZE_TILE_FRM_RHS_MSB 4
#define GBE_FRM_SIZE_TILE_FRM_RHS_LSB 0
#define GBE_FRM_SIZE_TILE_FRM_DEPTH_MSB 14
#define GBE_FRM_SIZE_TILE_FRM_DEPTH_LSB 13
#define GBE_FRM_SIZE_TILE_FRM_FIFO_RESET_MSB 15
#define GBE_FRM_SIZE_TILE_FRM_FIFO_RESET_LSB 15
#define GBE_FRM_SIZE_PIXEL_FB_HEIGHT_PIX_MSB 31
#define GBE_FRM_SIZE_PIXEL_FB_HEIGHT_PIX_LSB 16
#define GBE_DID_CONTROL_DID_DMA_ENABLE_MSB 0
#define GBE_DID_CONTROL_DID_DMA_ENABLE_LSB 0
#define GBE_DID_INHWCTRL_DID_DMA_ENABLE_MSB 0
#define GBE_DID_INHWCTRL_DID_DMA_ENABLE_LSB 0
#define GBE_DID_START_XY_DID_STARTY_MSB 23
#define GBE_DID_START_XY_DID_STARTY_LSB 12
#define GBE_DID_START_XY_DID_STARTX_MSB 11
#define GBE_DID_START_XY_DID_STARTX_LSB 0
#define GBE_CRS_START_XY_CRS_STARTY_MSB 23
#define GBE_CRS_START_XY_CRS_STARTY_LSB 12
#define GBE_CRS_START_XY_CRS_STARTX_MSB 11
#define GBE_CRS_START_XY_CRS_STARTX_LSB 0
#define GBE_WID_AUX_MSB 12
#define GBE_WID_AUX_LSB 11
#define GBE_WID_GAMMA_MSB 10
#define GBE_WID_GAMMA_LSB 10
#define GBE_WID_CM_MSB 9
#define GBE_WID_CM_LSB 5
#define GBE_WID_TYP_MSB 4
#define GBE_WID_TYP_LSB 2
#define GBE_WID_BUF_MSB 1
#define GBE_WID_BUF_LSB 0
#define GBE_VC_START_XY_VC_STARTY_MSB 23
#define GBE_VC_START_XY_VC_STARTY_LSB 12
#define GBE_VC_START_XY_VC_STARTX_MSB 11
#define GBE_VC_START_XY_VC_STARTX_LSB 0
/* Constants */
#define GBE_FRM_DEPTH_8 0
#define GBE_FRM_DEPTH_16 1
#define GBE_FRM_DEPTH_32 2
#define GBE_CMODE_I8 0
#define GBE_CMODE_I12 1
#define GBE_CMODE_RG3B2 2
#define GBE_CMODE_RGB4 3
#define GBE_CMODE_ARGB5 4
#define GBE_CMODE_RGB8 5
#define GBE_CMODE_RGBA5 6
#define GBE_CMODE_RGB10 7
#define GBE_BMODE_BOTH 3
#define GBE_CRS_MAGIC 54
#define GBE_PIXEN_MAGIC_ON 19
#define GBE_PIXEN_MAGIC_OFF 2
#define GBE_TLB_SIZE 128
/* [1] - only GBE revision 2 and later */
/*
* Video Timing Data Structure
*/
struct gbe_timing_info {
int flags;
short width; /* Monitor resolution */
short height;
int fields_sec; /* fields/sec (Hz -3 dec. places */
int cfreq; /* pixel clock frequency (MHz -3 dec. places) */
short htotal; /* Horizontal total pixels */
short hblank_start; /* Horizontal blank start */
short hblank_end; /* Horizontal blank end */
short hsync_start; /* Horizontal sync start */
short hsync_end; /* Horizontal sync end */
short vtotal; /* Vertical total lines */
short vblank_start; /* Vertical blank start */
short vblank_end; /* Vertical blank end */
short vsync_start; /* Vertical sync start */
short vsync_end; /* Vertical sync end */
short pll_m; /* PLL M parameter */
short pll_n; /* PLL P parameter */
short pll_p; /* PLL N parameter */
};
/* Defines for gbe_vof_info_t flags */
#define GBE_VOF_UNKNOWNMON 1
#define GBE_VOF_STEREO 2
#define GBE_VOF_DO_GENSYNC 4 /* enable incoming sync */
#define GBE_VOF_SYNC_ON_GREEN 8 /* sync on green */
#define GBE_VOF_FLATPANEL 0x1000 /* FLATPANEL Timing */
#define GBE_VOF_MAGICKEY 0x2000 /* Backdoor key */
#endif /* ! __GBE_H__ */

24
include/video/iga.h Normal file
View File

@@ -0,0 +1,24 @@
/* $Id: iga.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
* iga1682.h: Sparc/PCI iga1682 driver constants etc.
*
* Copyleft 1998 V. Roganov and G. Raiko
*/
#ifndef _IGA1682_H
#define _IGA1682_H 1
#define IGA_ATTR_CTL 0x3C0
#define IGA_IDX_VGA_OVERSCAN 0x11
#define DAC_W_INDEX 0x03C8
#define DAC_DATA 0x03C9
#define IGA_EXT_CNTRL 0x3CE
#define IGA_IDX_EXT_BUS_CNTL 0x30
#define MEM_SIZE_ALIAS 0x3
#define MEM_SIZE_1M 0x0
#define MEM_SIZE_2M 0x1
#define MEM_SIZE_4M 0x2
#define MEM_SIZE_RESERVED 0x3
#define IGA_IDX_OVERSCAN_COLOR 0x58
#define IGA_IDX_EXT_MEM_2 0x72
#endif /* !(_IGA1682_H) */

93
include/video/kyro.h Normal file
View File

@@ -0,0 +1,93 @@
/*
* linux/drivers/video/kyro/kryo.h
*
* Copyright (C) 2002 STMicroelectronics
* Copyright (C) 2004 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#ifndef _KYRO_H
#define _KYRO_H
struct kyrofb_info {
void __iomem *regbase;
u32 palette[16];
u32 HTot; /* Hor Total Time */
u32 HFP; /* Hor Front Porch */
u32 HST; /* Hor Sync Time */
u32 HBP; /* Hor Back Porch */
s32 HSP; /* Hor Sync Polarity */
u32 VTot; /* Ver Total Time */
u32 VFP; /* Ver Front Porch */
u32 VST; /* Ver Sync Time */
u32 VBP; /* Ver Back Porch */
s32 VSP; /* Ver Sync Polarity */
u32 XRES; /* X Resolution */
u32 YRES; /* Y Resolution */
u32 VFREQ; /* Ver Frequency */
u32 PIXCLK; /* Pixel Clock */
u32 HCLK; /* Hor Clock */
/* Usefull to hold depth here for Linux */
u8 PIXDEPTH;
#ifdef CONFIG_MTRR
int mtrr_handle;
#endif
};
extern int kyro_dev_init(void);
extern void kyro_dev_reset(void);
extern unsigned char *kyro_dev_physical_fb_ptr(void);
extern unsigned char *kyro_dev_virtual_fb_ptr(void);
extern void *kyro_dev_physical_regs_ptr(void);
extern void *kyro_dev_virtual_regs_ptr(void);
extern unsigned int kyro_dev_fb_size(void);
extern unsigned int kyro_dev_regs_size(void);
extern u32 kyro_dev_overlay_offset(void);
/*
* benedict.gaster@superh.com
* Added the follow IOCTLS for the creation of overlay services...
*/
#define KYRO_IOC_MAGIC 'k'
#define KYRO_IOCTL_OVERLAY_CREATE _IO(KYRO_IOC_MAGIC, 0)
#define KYRO_IOCTL_OVERLAY_VIEWPORT_SET _IO(KYRO_IOC_MAGIC, 1)
#define KYRO_IOCTL_SET_VIDEO_MODE _IO(KYRO_IOC_MAGIC, 2)
#define KYRO_IOCTL_UVSTRIDE _IO(KYRO_IOC_MAGIC, 3)
#define KYRO_IOCTL_OVERLAY_OFFSET _IO(KYRO_IOC_MAGIC, 4)
#define KYRO_IOCTL_STRIDE _IO(KYRO_IOC_MAGIC, 5)
/*
* The follow 3 structures are used to pass data from user space into the kernel
* for the creation of overlay surfaces and setting the video mode.
*/
typedef struct _OVERLAY_CREATE {
u32 ulWidth;
u32 ulHeight;
int bLinear;
} overlay_create;
typedef struct _OVERLAY_VIEWPORT_SET {
u32 xOrgin;
u32 yOrgin;
u32 xSize;
u32 ySize;
} overlay_viewport_set;
typedef struct _SET_VIDEO_MODE {
u32 ulWidth;
u32 ulHeight;
u32 ulScan;
u8 displayDepth;
int bLinear;
} set_video_mode;
#endif /* _KYRO_H */

1377
include/video/mach64.h Normal file

File diff suppressed because it is too large Load Diff

38
include/video/maxinefb.h Normal file
View File

@@ -0,0 +1,38 @@
/*
* linux/drivers/video/maxinefb.h
*
* DECstation 5000/xx onboard framebuffer support, Copyright (C) 1999 by
* Michael Engel <engel@unix-ag.org> and Karsten Merker <merker@guug.de>
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*/
#include <asm/addrspace.h>
/*
* IMS332 video controller register base address
*/
#define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000)
/*
* Begin of DECstation 5000/xx onboard framebuffer memory, default resolution
* is 1024x768x8
*/
#define DS5000_xx_ONBOARD_FBMEM_START KSEG1ADDR(0x0a000000)
/*
* The IMS 332 video controller used in the DECstation 5000/xx series
* uses 32 bits wide registers; the following defines declare the
* register numbers, to get the real offset, these have to be multiplied
* by four.
*/
#define IMS332_REG_CURSOR_RAM 0x200 /* hardware cursor bitmap */
/*
* The color palette entries have the form 0x00BBGGRR
*/
#define IMS332_REG_COLOR_PALETTE 0x100 /* color palette, 256 entries */
#define IMS332_REG_CURSOR_COLOR_PALETTE 0x0a1 /* cursor color palette, */
/* 3 entries */

59
include/video/mbxfb.h Normal file
View File

@@ -0,0 +1,59 @@
#ifndef __MBX_FB_H
#define __MBX_FB_H
#include <asm/ioctl.h>
#include <asm/types.h>
struct mbxfb_val {
unsigned int defval;
unsigned int min;
unsigned int max;
};
struct fb_info;
struct mbxfb_platform_data {
/* Screen info */
struct mbxfb_val xres;
struct mbxfb_val yres;
struct mbxfb_val bpp;
/* Memory info */
unsigned long memsize; /* if 0 use ODFB? */
unsigned long timings1;
unsigned long timings2;
unsigned long timings3;
int (*probe)(struct fb_info *fb);
int (*remove)(struct fb_info *fb);
};
/* planar */
#define MBXFB_FMT_YUV12 0
/* packed */
#define MBXFB_FMT_UY0VY1 1
#define MBXFB_FMT_VY0UY1 2
#define MBXFB_FMT_Y0UY1V 3
#define MBXFB_FMT_Y0VY1U 4
struct mbxfb_overlaySetup {
__u32 enable;
__u32 x, y;
__u32 width, height;
__u32 alpha;
__u32 fmt;
__u32 mem_offset;
__u32 scaled_width;
__u32 scaled_height;
/* Filled by the driver */
__u32 U_offset;
__u32 V_offset;
__u16 Y_stride;
__u16 UV_stride;
};
#define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup)
#endif /* __MBX_FB_H */

210
include/video/neomagic.h Normal file
View File

@@ -0,0 +1,210 @@
/*
* linux/include/video/neo_reg.h -- NeoMagic Framebuffer Driver
*
* Copyright (c) 2001 Denis Oliver Kropp <dok@convergence.de>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*/
#define NEO_BS0_BLT_BUSY 0x00000001
#define NEO_BS0_FIFO_AVAIL 0x00000002
#define NEO_BS0_FIFO_PEND 0x00000004
#define NEO_BC0_DST_Y_DEC 0x00000001
#define NEO_BC0_X_DEC 0x00000002
#define NEO_BC0_SRC_TRANS 0x00000004
#define NEO_BC0_SRC_IS_FG 0x00000008
#define NEO_BC0_SRC_Y_DEC 0x00000010
#define NEO_BC0_FILL_PAT 0x00000020
#define NEO_BC0_SRC_MONO 0x00000040
#define NEO_BC0_SYS_TO_VID 0x00000080
#define NEO_BC1_DEPTH8 0x00000100
#define NEO_BC1_DEPTH16 0x00000200
#define NEO_BC1_X_320 0x00000400
#define NEO_BC1_X_640 0x00000800
#define NEO_BC1_X_800 0x00000c00
#define NEO_BC1_X_1024 0x00001000
#define NEO_BC1_X_1152 0x00001400
#define NEO_BC1_X_1280 0x00001800
#define NEO_BC1_X_1600 0x00001c00
#define NEO_BC1_DST_TRANS 0x00002000
#define NEO_BC1_MSTR_BLT 0x00004000
#define NEO_BC1_FILTER_Z 0x00008000
#define NEO_BC2_WR_TR_DST 0x00800000
#define NEO_BC3_SRC_XY_ADDR 0x01000000
#define NEO_BC3_DST_XY_ADDR 0x02000000
#define NEO_BC3_CLIP_ON 0x04000000
#define NEO_BC3_FIFO_EN 0x08000000
#define NEO_BC3_BLT_ON_ADDR 0x10000000
#define NEO_BC3_SKIP_MAPPING 0x80000000
#define NEO_MODE1_DEPTH8 0x0100
#define NEO_MODE1_DEPTH16 0x0200
#define NEO_MODE1_DEPTH24 0x0300
#define NEO_MODE1_X_320 0x0400
#define NEO_MODE1_X_640 0x0800
#define NEO_MODE1_X_800 0x0c00
#define NEO_MODE1_X_1024 0x1000
#define NEO_MODE1_X_1152 0x1400
#define NEO_MODE1_X_1280 0x1800
#define NEO_MODE1_X_1600 0x1c00
#define NEO_MODE1_BLT_ON_ADDR 0x2000
/* These are offseted in MMIO space by par->CursorOff */
#define NEOREG_CURSCNTL 0x00
#define NEOREG_CURSX 0x04
#define NEOREG_CURSY 0x08
#define NEOREG_CURSBGCOLOR 0x0C
#define NEOREG_CURSFGCOLOR 0x10
#define NEOREG_CURSMEMPOS 0x14
#define NEO_CURS_DISABLE 0x00000000
#define NEO_CURS_ENABLE 0x00000001
#define NEO_ICON64_ENABLE 0x00000008
#define NEO_ICON128_ENABLE 0x0000000C
#define NEO_ICON_BLANK 0x00000010
#define NEO_GR01_SUPPRESS_VSYNC 0x10
#define NEO_GR01_SUPPRESS_HSYNC 0x20
#ifdef __KERNEL__
#ifdef NEOFB_DEBUG
# define DBG(x) printk (KERN_DEBUG "neofb: %s\n", (x));
#else
# define DBG(x)
#endif
#define PCI_CHIP_NM2070 0x0001
#define PCI_CHIP_NM2090 0x0002
#define PCI_CHIP_NM2093 0x0003
#define PCI_CHIP_NM2097 0x0083
#define PCI_CHIP_NM2160 0x0004
#define PCI_CHIP_NM2200 0x0005
#define PCI_CHIP_NM2230 0x0025
#define PCI_CHIP_NM2360 0x0006
#define PCI_CHIP_NM2380 0x0016
struct xtimings {
unsigned int pixclock;
unsigned int HDisplay;
unsigned int HSyncStart;
unsigned int HSyncEnd;
unsigned int HTotal;
unsigned int VDisplay;
unsigned int VSyncStart;
unsigned int VSyncEnd;
unsigned int VTotal;
unsigned int sync;
int dblscan;
int interlaced;
};
/* --------------------------------------------------------------------- */
typedef volatile struct {
__u32 bltStat;
__u32 bltCntl;
__u32 xpColor;
__u32 fgColor;
__u32 bgColor;
__u32 pitch;
__u32 clipLT;
__u32 clipRB;
__u32 srcBitOffset;
__u32 srcStart;
__u32 reserved0;
__u32 dstStart;
__u32 xyExt;
__u32 reserved1[19];
__u32 pageCntl;
__u32 pageBase;
__u32 postBase;
__u32 postPtr;
__u32 dataPtr;
} Neo2200;
#define MMIO_SIZE 0x200000
#define NEO_EXT_CR_MAX 0x85
#define NEO_EXT_GR_MAX 0xC7
struct neofb_par {
struct vgastate state;
struct mutex open_lock;
unsigned int ref_count;
unsigned char MiscOutReg; /* Misc */
unsigned char CRTC[25]; /* Crtc Controller */
unsigned char Sequencer[5]; /* Video Sequencer */
unsigned char Graphics[9]; /* Video Graphics */
unsigned char Attribute[21]; /* Video Atribute */
unsigned char GeneralLockReg;
unsigned char ExtCRTDispAddr;
unsigned char ExtCRTOffset;
unsigned char SysIfaceCntl1;
unsigned char SysIfaceCntl2;
unsigned char ExtColorModeSelect;
unsigned char biosMode;
unsigned char PanelDispCntlReg1;
unsigned char PanelDispCntlReg2;
unsigned char PanelDispCntlReg3;
unsigned char PanelDispCntlRegRead;
unsigned char PanelVertCenterReg1;
unsigned char PanelVertCenterReg2;
unsigned char PanelVertCenterReg3;
unsigned char PanelVertCenterReg4;
unsigned char PanelVertCenterReg5;
unsigned char PanelHorizCenterReg1;
unsigned char PanelHorizCenterReg2;
unsigned char PanelHorizCenterReg3;
unsigned char PanelHorizCenterReg4;
unsigned char PanelHorizCenterReg5;
int ProgramVCLK;
unsigned char VCLK3NumeratorLow;
unsigned char VCLK3NumeratorHigh;
unsigned char VCLK3Denominator;
unsigned char VerticalExt;
#ifdef CONFIG_MTRR
int mtrr;
#endif
u8 __iomem *mmio_vbase;
u8 cursorOff;
u8 *cursorPad; /* Must die !! */
Neo2200 __iomem *neo2200;
/* Panels size */
int NeoPanelWidth;
int NeoPanelHeight;
int maxClock;
int pci_burst;
int lcd_stretch;
int internal_display;
int external_display;
int libretto;
u32 palette[16];
};
typedef struct {
int x_res;
int y_res;
int mode;
} biosMode;
#endif

583
include/video/newport.h Normal file
View File

@@ -0,0 +1,583 @@
/* $Id: newport.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
*
* newport.h: Defines and register layout for NEWPORT graphics
* hardware.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
* Ulf Carlsson - Compability with the IRIX structures added
*/
#ifndef _SGI_NEWPORT_H
#define _SGI_NEWPORT_H
typedef volatile unsigned int npireg_t;
union npfloat {
volatile float flt;
npireg_t word;
};
typedef union npfloat npfreg_t;
union np_dcb {
npireg_t byword;
struct { volatile unsigned short s0, s1; } byshort;
struct { volatile unsigned char b0, b1, b2, b3; } bybytes;
};
struct newport_rexregs {
npireg_t drawmode1; /* GL extra mode bits */
#define DM1_PLANES 0x00000007
#define DM1_NOPLANES 0x00000000
#define DM1_RGBPLANES 0x00000001
#define DM1_RGBAPLANES 0x00000002
#define DM1_OLAYPLANES 0x00000004
#define DM1_PUPPLANES 0x00000005
#define DM1_CIDPLANES 0x00000006
#define NPORT_DMODE1_DDMASK 0x00000018
#define NPORT_DMODE1_DD4 0x00000000
#define NPORT_DMODE1_DD8 0x00000008
#define NPORT_DMODE1_DD12 0x00000010
#define NPORT_DMODE1_DD24 0x00000018
#define NPORT_DMODE1_DSRC 0x00000020
#define NPORT_DMODE1_YFLIP 0x00000040
#define NPORT_DMODE1_RWPCKD 0x00000080
#define NPORT_DMODE1_HDMASK 0x00000300
#define NPORT_DMODE1_HD4 0x00000000
#define NPORT_DMODE1_HD8 0x00000100
#define NPORT_DMODE1_HD12 0x00000200
#define NPORT_DMODE1_HD32 0x00000300
#define NPORT_DMODE1_RWDBL 0x00000400
#define NPORT_DMODE1_ESWAP 0x00000800 /* Endian swap */
#define NPORT_DMODE1_CCMASK 0x00007000
#define NPORT_DMODE1_CCLT 0x00001000
#define NPORT_DMODE1_CCEQ 0x00002000
#define NPORT_DMODE1_CCGT 0x00004000
#define NPORT_DMODE1_RGBMD 0x00008000
#define NPORT_DMODE1_DENAB 0x00010000 /* Dither enable */
#define NPORT_DMODE1_FCLR 0x00020000 /* Fast clear */
#define NPORT_DMODE1_BENAB 0x00040000 /* Blend enable */
#define NPORT_DMODE1_SFMASK 0x00380000
#define NPORT_DMODE1_SF0 0x00000000
#define NPORT_DMODE1_SF1 0x00080000
#define NPORT_DMODE1_SFDC 0x00100000
#define NPORT_DMODE1_SFMDC 0x00180000
#define NPORT_DMODE1_SFSA 0x00200000
#define NPORT_DMODE1_SFMSA 0x00280000
#define NPORT_DMODE1_DFMASK 0x01c00000
#define NPORT_DMODE1_DF0 0x00000000
#define NPORT_DMODE1_DF1 0x00400000
#define NPORT_DMODE1_DFSC 0x00800000
#define NPORT_DMODE1_DFMSC 0x00c00000
#define NPORT_DMODE1_DFSA 0x01000000
#define NPORT_DMODE1_DFMSA 0x01400000
#define NPORT_DMODE1_BBENAB 0x02000000 /* Back blend enable */
#define NPORT_DMODE1_PFENAB 0x04000000 /* Pre-fetch enable */
#define NPORT_DMODE1_ABLEND 0x08000000 /* Alpha blend */
#define NPORT_DMODE1_LOMASK 0xf0000000
#define NPORT_DMODE1_LOZERO 0x00000000
#define NPORT_DMODE1_LOAND 0x10000000
#define NPORT_DMODE1_LOANDR 0x20000000
#define NPORT_DMODE1_LOSRC 0x30000000
#define NPORT_DMODE1_LOANDI 0x40000000
#define NPORT_DMODE1_LODST 0x50000000
#define NPORT_DMODE1_LOXOR 0x60000000
#define NPORT_DMODE1_LOOR 0x70000000
#define NPORT_DMODE1_LONOR 0x80000000
#define NPORT_DMODE1_LOXNOR 0x90000000
#define NPORT_DMODE1_LONDST 0xa0000000
#define NPORT_DMODE1_LOORR 0xb0000000
#define NPORT_DMODE1_LONSRC 0xc0000000
#define NPORT_DMODE1_LOORI 0xd0000000
#define NPORT_DMODE1_LONAND 0xe0000000
#define NPORT_DMODE1_LOONE 0xf0000000
npireg_t drawmode0; /* REX command register */
/* These bits define the graphics opcode being performed. */
#define NPORT_DMODE0_OPMASK 0x00000003 /* Opcode mask */
#define NPORT_DMODE0_NOP 0x00000000 /* No operation */
#define NPORT_DMODE0_RD 0x00000001 /* Read operation */
#define NPORT_DMODE0_DRAW 0x00000002 /* Draw operation */
#define NPORT_DMODE0_S2S 0x00000003 /* Screen to screen operation */
/* The following decide what addressing mode(s) are to be used */
#define NPORT_DMODE0_AMMASK 0x0000001c /* Address mode mask */
#define NPORT_DMODE0_SPAN 0x00000000 /* Spanning address mode */
#define NPORT_DMODE0_BLOCK 0x00000004 /* Block address mode */
#define NPORT_DMODE0_ILINE 0x00000008 /* Iline address mode */
#define NPORT_DMODE0_FLINE 0x0000000c /* Fline address mode */
#define NPORT_DMODE0_ALINE 0x00000010 /* Aline address mode */
#define NPORT_DMODE0_TLINE 0x00000014 /* Tline address mode */
#define NPORT_DMODE0_BLINE 0x00000018 /* Bline address mode */
/* And now some misc. operation control bits. */
#define NPORT_DMODE0_DOSETUP 0x00000020
#define NPORT_DMODE0_CHOST 0x00000040
#define NPORT_DMODE0_AHOST 0x00000080
#define NPORT_DMODE0_STOPX 0x00000100
#define NPORT_DMODE0_STOPY 0x00000200
#define NPORT_DMODE0_SK1ST 0x00000400
#define NPORT_DMODE0_SKLST 0x00000800
#define NPORT_DMODE0_ZPENAB 0x00001000
#define NPORT_DMODE0_LISPENAB 0x00002000
#define NPORT_DMODE0_LISLST 0x00004000
#define NPORT_DMODE0_L32 0x00008000
#define NPORT_DMODE0_ZOPQ 0x00010000
#define NPORT_DMODE0_LISOPQ 0x00020000
#define NPORT_DMODE0_SHADE 0x00040000
#define NPORT_DMODE0_LRONLY 0x00080000
#define NPORT_DMODE0_XYOFF 0x00100000
#define NPORT_DMODE0_CLAMP 0x00200000
#define NPORT_DMODE0_ENDPF 0x00400000
#define NPORT_DMODE0_YSTR 0x00800000
npireg_t lsmode; /* Mode for line stipple ops */
npireg_t lspattern; /* Pattern for line stipple ops */
npireg_t lspatsave; /* Backup save pattern */
npireg_t zpattern; /* Pixel zpattern */
npireg_t colorback; /* Background color */
npireg_t colorvram; /* Clear color for fast vram */
npireg_t alpharef; /* Reference value for afunctions */
unsigned int pad0;
npireg_t smask0x; /* Window GL relative screen mask 0 */
npireg_t smask0y; /* Window GL relative screen mask 0 */
npireg_t _setup;
npireg_t _stepz;
npireg_t _lsrestore;
npireg_t _lssave;
unsigned int _pad1[0x30];
/* Iterators, full state for context switch */
npfreg_t _xstart; /* X-start point (current) */
npfreg_t _ystart; /* Y-start point (current) */
npfreg_t _xend; /* x-end point */
npfreg_t _yend; /* y-end point */
npireg_t xsave; /* copy of xstart integer value for BLOCk addressing MODE */
npireg_t xymove; /* x.y offset from xstart, ystart for relative operations */
npfreg_t bresd;
npfreg_t bress1;
npireg_t bresoctinc1;
volatile int bresrndinc2;
npireg_t brese1;
npireg_t bress2;
npireg_t aweight0;
npireg_t aweight1;
npfreg_t xstartf;
npfreg_t ystartf;
npfreg_t xendf;
npfreg_t yendf;
npireg_t xstarti;
npfreg_t xendf1;
npireg_t xystarti;
npireg_t xyendi;
npireg_t xstartendi;
unsigned int _unused2[0x29];
npfreg_t colorred;
npfreg_t coloralpha;
npfreg_t colorgrn;
npfreg_t colorblue;
npfreg_t slopered;
npfreg_t slopealpha;
npfreg_t slopegrn;
npfreg_t slopeblue;
npireg_t wrmask;
npireg_t colori;
npfreg_t colorx;
npfreg_t slopered1;
npireg_t hostrw0;
npireg_t hostrw1;
npireg_t dcbmode;
#define NPORT_DMODE_WMASK 0x00000003
#define NPORT_DMODE_W4 0x00000000
#define NPORT_DMODE_W1 0x00000001
#define NPORT_DMODE_W2 0x00000002
#define NPORT_DMODE_W3 0x00000003
#define NPORT_DMODE_EDPACK 0x00000004
#define NPORT_DMODE_ECINC 0x00000008
#define NPORT_DMODE_CMASK 0x00000070
#define NPORT_DMODE_AMASK 0x00000780
#define NPORT_DMODE_AVC2 0x00000000
#define NPORT_DMODE_ACMALL 0x00000080
#define NPORT_DMODE_ACM0 0x00000100
#define NPORT_DMODE_ACM1 0x00000180
#define NPORT_DMODE_AXMALL 0x00000200
#define NPORT_DMODE_AXM0 0x00000280
#define NPORT_DMODE_AXM1 0x00000300
#define NPORT_DMODE_ABT 0x00000380
#define NPORT_DMODE_AVCC1 0x00000400
#define NPORT_DMODE_AVAB1 0x00000480
#define NPORT_DMODE_ALG3V0 0x00000500
#define NPORT_DMODE_A1562 0x00000580
#define NPORT_DMODE_ESACK 0x00000800
#define NPORT_DMODE_EASACK 0x00001000
#define NPORT_DMODE_CWMASK 0x0003e000
#define NPORT_DMODE_CHMASK 0x007c0000
#define NPORT_DMODE_CSMASK 0x0f800000
#define NPORT_DMODE_SENDIAN 0x10000000
unsigned int _unused3;
union np_dcb dcbdata0;
npireg_t dcbdata1;
};
struct newport_cregs {
npireg_t smask1x;
npireg_t smask1y;
npireg_t smask2x;
npireg_t smask2y;
npireg_t smask3x;
npireg_t smask3y;
npireg_t smask4x;
npireg_t smask4y;
npireg_t topscan;
npireg_t xywin;
npireg_t clipmode;
#define NPORT_CMODE_SM0 0x00000001
#define NPORT_CMODE_SM1 0x00000002
#define NPORT_CMODE_SM2 0x00000004
#define NPORT_CMODE_SM3 0x00000008
#define NPORT_CMODE_SM4 0x00000010
#define NPORT_CMODE_CMSK 0x00001e00
unsigned int _unused0;
unsigned int config;
#define NPORT_CFG_G32MD 0x00000001
#define NPORT_CFG_BWIDTH 0x00000002
#define NPORT_CFG_ERCVR 0x00000004
#define NPORT_CFG_BDMSK 0x00000078
#define NPORT_CFG_BFAINT 0x00000080
#define NPORT_CFG_GDMSK 0x00001f80
#define NPORT_CFG_GD0 0x00000100
#define NPORT_CFG_GD1 0x00000200
#define NPORT_CFG_GD2 0x00000400
#define NPORT_CFG_GD3 0x00000800
#define NPORT_CFG_GD4 0x00001000
#define NPORT_CFG_GFAINT 0x00002000
#define NPORT_CFG_TOMSK 0x0001c000
#define NPORT_CFG_VRMSK 0x000e0000
#define NPORT_CFG_FBTYP 0x00100000
npireg_t _unused1;
npireg_t status;
#define NPORT_STAT_VERS 0x00000007
#define NPORT_STAT_GBUSY 0x00000008
#define NPORT_STAT_BBUSY 0x00000010
#define NPORT_STAT_VRINT 0x00000020
#define NPORT_STAT_VIDINT 0x00000040
#define NPORT_STAT_GLMSK 0x00001f80
#define NPORT_STAT_BLMSK 0x0007e000
#define NPORT_STAT_BFIRQ 0x00080000
#define NPORT_STAT_GFIRQ 0x00100000
npireg_t ustatus;
npireg_t dcbreset;
};
struct newport_regs {
struct newport_rexregs set;
unsigned int _unused0[0x16e];
struct newport_rexregs go;
unsigned int _unused1[0x22e];
struct newport_cregs cset;
unsigned int _unused2[0x1ef];
struct newport_cregs cgo;
};
typedef struct {
unsigned int drawmode1;
unsigned int drawmode0;
unsigned int lsmode;
unsigned int lspattern;
unsigned int lspatsave;
unsigned int zpattern;
unsigned int colorback;
unsigned int colorvram;
unsigned int alpharef;
unsigned int smask0x;
unsigned int smask0y;
unsigned int _xstart;
unsigned int _ystart;
unsigned int _xend;
unsigned int _yend;
unsigned int xsave;
unsigned int xymove;
unsigned int bresd;
unsigned int bress1;
unsigned int bresoctinc1;
unsigned int bresrndinc2;
unsigned int brese1;
unsigned int bress2;
unsigned int aweight0;
unsigned int aweight1;
unsigned int colorred;
unsigned int coloralpha;
unsigned int colorgrn;
unsigned int colorblue;
unsigned int slopered;
unsigned int slopealpha;
unsigned int slopegrn;
unsigned int slopeblue;
unsigned int wrmask;
unsigned int hostrw0;
unsigned int hostrw1;
/* configregs */
unsigned int smask1x;
unsigned int smask1y;
unsigned int smask2x;
unsigned int smask2y;
unsigned int smask3x;
unsigned int smask3y;
unsigned int smask4x;
unsigned int smask4y;
unsigned int topscan;
unsigned int xywin;
unsigned int clipmode;
unsigned int config;
/* dcb registers */
unsigned int dcbmode;
unsigned int dcbdata0;
unsigned int dcbdata1;
} newport_ctx;
/* Reading/writing VC2 registers. */
#define VC2_REGADDR_INDEX 0x00000000
#define VC2_REGADDR_IREG 0x00000010
#define VC2_REGADDR_RAM 0x00000030
#define VC2_PROTOCOL (NPORT_DMODE_EASACK | 0x00800000 | 0x00040000)
#define VC2_VLINET_ADDR 0x000
#define VC2_VFRAMET_ADDR 0x400
#define VC2_CGLYPH_ADDR 0x500
/* Now the Indexed registers of the VC2. */
#define VC2_IREG_VENTRY 0x00
#define VC2_IREG_CENTRY 0x01
#define VC2_IREG_CURSX 0x02
#define VC2_IREG_CURSY 0x03
#define VC2_IREG_CCURSX 0x04
#define VC2_IREG_DENTRY 0x05
#define VC2_IREG_SLEN 0x06
#define VC2_IREG_RADDR 0x07
#define VC2_IREG_VFPTR 0x08
#define VC2_IREG_VLSPTR 0x09
#define VC2_IREG_VLIR 0x0a
#define VC2_IREG_VLCTR 0x0b
#define VC2_IREG_CTPTR 0x0c
#define VC2_IREG_WCURSY 0x0d
#define VC2_IREG_DFPTR 0x0e
#define VC2_IREG_DLTPTR 0x0f
#define VC2_IREG_CONTROL 0x10
#define VC2_IREG_CONFIG 0x20
static inline void newport_vc2_set(struct newport_regs *regs,
unsigned char vc2ireg,
unsigned short val)
{
regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W3 |
NPORT_DMODE_ECINC | VC2_PROTOCOL);
regs->set.dcbdata0.byword = (vc2ireg << 24) | (val << 8);
}
static inline unsigned short newport_vc2_get(struct newport_regs *regs,
unsigned char vc2ireg)
{
regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W1 |
NPORT_DMODE_ECINC | VC2_PROTOCOL);
regs->set.dcbdata0.bybytes.b3 = vc2ireg;
regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_IREG | NPORT_DMODE_W2 |
NPORT_DMODE_ECINC | VC2_PROTOCOL);
return regs->set.dcbdata0.byshort.s1;
}
/* VC2 Control register bits */
#define VC2_CTRL_EVIRQ 0x0001
#define VC2_CTRL_EDISP 0x0002
#define VC2_CTRL_EVIDEO 0x0004
#define VC2_CTRL_EDIDS 0x0008
#define VC2_CTRL_ECURS 0x0010
#define VC2_CTRL_EGSYNC 0x0020
#define VC2_CTRL_EILACE 0x0040
#define VC2_CTRL_ECDISP 0x0080
#define VC2_CTRL_ECCURS 0x0100
#define VC2_CTRL_ECG64 0x0200
#define VC2_CTRL_GLSEL 0x0400
/* Controlling the color map on NEWPORT. */
#define NCMAP_REGADDR_AREG 0x00000000
#define NCMAP_REGADDR_ALO 0x00000000
#define NCMAP_REGADDR_AHI 0x00000010
#define NCMAP_REGADDR_PBUF 0x00000020
#define NCMAP_REGADDR_CREG 0x00000030
#define NCMAP_REGADDR_SREG 0x00000040
#define NCMAP_REGADDR_RREG 0x00000060
#define NCMAP_PROTOCOL (0x00008000 | 0x00040000 | 0x00800000)
static __inline__ void newport_cmap_setaddr(struct newport_regs *regs,
unsigned short addr)
{
regs->set.dcbmode = (NPORT_DMODE_ACMALL | NCMAP_PROTOCOL |
NPORT_DMODE_SENDIAN | NPORT_DMODE_ECINC |
NCMAP_REGADDR_AREG | NPORT_DMODE_W2);
regs->set.dcbdata0.byshort.s1 = addr;
regs->set.dcbmode = (NPORT_DMODE_ACMALL | NCMAP_PROTOCOL |
NCMAP_REGADDR_PBUF | NPORT_DMODE_W3);
}
static __inline__ void newport_cmap_setrgb(struct newport_regs *regs,
unsigned char red,
unsigned char green,
unsigned char blue)
{
regs->set.dcbdata0.byword =
(red << 24) |
(green << 16) |
(blue << 8);
}
/* Miscellaneous NEWPORT routines. */
#define BUSY_TIMEOUT 100000
static __inline__ int newport_wait(struct newport_regs *regs)
{
int t = BUSY_TIMEOUT;
while (t--)
if (!(regs->cset.status & NPORT_STAT_GBUSY))
break;
return !t;
}
static __inline__ int newport_bfwait(struct newport_regs *regs)
{
int t = BUSY_TIMEOUT;
while (t--)
if(!(regs->cset.status & NPORT_STAT_BBUSY))
break;
return !t;
}
/*
* DCBMODE register defines:
*/
/* Width of the data being transferred for each DCBDATA[01] word */
#define DCB_DATAWIDTH_4 0x0
#define DCB_DATAWIDTH_1 0x1
#define DCB_DATAWIDTH_2 0x2
#define DCB_DATAWIDTH_3 0x3
/* If set, all of DCBDATA will be moved, otherwise only DATAWIDTH bytes */
#define DCB_ENDATAPACK (1 << 2)
/* Enables DCBCRS auto increment after each DCB transfer */
#define DCB_ENCRSINC (1 << 3)
/* shift for accessing the control register select address (DBCCRS, 3 bits) */
#define DCB_CRS_SHIFT 4
/* DCBADDR (4 bits): display bus slave address */
#define DCB_ADDR_SHIFT 7
#define DCB_VC2 (0 << DCB_ADDR_SHIFT)
#define DCB_CMAP_ALL (1 << DCB_ADDR_SHIFT)
#define DCB_CMAP0 (2 << DCB_ADDR_SHIFT)
#define DCB_CMAP1 (3 << DCB_ADDR_SHIFT)
#define DCB_XMAP_ALL (4 << DCB_ADDR_SHIFT)
#define DCB_XMAP0 (5 << DCB_ADDR_SHIFT)
#define DCB_XMAP1 (6 << DCB_ADDR_SHIFT)
#define DCB_BT445 (7 << DCB_ADDR_SHIFT)
#define DCB_VCC1 (8 << DCB_ADDR_SHIFT)
#define DCB_VAB1 (9 << DCB_ADDR_SHIFT)
#define DCB_LG3_BDVERS0 (10 << DCB_ADDR_SHIFT)
#define DCB_LG3_ICS1562 (11 << DCB_ADDR_SHIFT)
#define DCB_RESERVED (15 << DCB_ADDR_SHIFT)
/* DCB protocol ack types */
#define DCB_ENSYNCACK (1 << 11)
#define DCB_ENASYNCACK (1 << 12)
#define DCB_CSWIDTH_SHIFT 13
#define DCB_CSHOLD_SHIFT 18
#define DCB_CSSETUP_SHIFT 23
/* XMAP9 specific defines */
/* XMAP9 -- registers as seen on the DCBMODE register*/
# define XM9_CRS_CONFIG (0 << DCB_CRS_SHIFT)
# define XM9_PUPMODE (1 << 0)
# define XM9_ODD_PIXEL (1 << 1)
# define XM9_8_BITPLANES (1 << 2)
# define XM9_SLOW_DCB (1 << 3)
# define XM9_VIDEO_RGBMAP_MASK (3 << 4)
# define XM9_EXPRESS_VIDEO (1 << 6)
# define XM9_VIDEO_OPTION (1 << 7)
# define XM9_CRS_REVISION (1 << DCB_CRS_SHIFT)
# define XM9_CRS_FIFO_AVAIL (2 << DCB_CRS_SHIFT)
# define XM9_FIFO_0_AVAIL 0
# define XM9_FIFO_1_AVAIL 1
# define XM9_FIFO_2_AVAIL 3
# define XM9_FIFO_3_AVAIL 2
# define XM9_FIFO_FULL XM9_FIFO_0_AVAIL
# define XM9_FIFO_EMPTY XM9_FIFO_3_AVAIL
# define XM9_CRS_CURS_CMAP_MSB (3 << DCB_CRS_SHIFT)
# define XM9_CRS_PUP_CMAP_MSB (4 << DCB_CRS_SHIFT)
# define XM9_CRS_MODE_REG_DATA (5 << DCB_CRS_SHIFT)
# define XM9_CRS_MODE_REG_INDEX (7 << DCB_CRS_SHIFT)
#define DCB_CYCLES(setup,hold,width) \
((hold << DCB_CSHOLD_SHIFT) | \
(setup << DCB_CSSETUP_SHIFT)| \
(width << DCB_CSWIDTH_SHIFT))
#define W_DCB_XMAP9_PROTOCOL DCB_CYCLES (2, 1, 0)
#define WSLOW_DCB_XMAP9_PROTOCOL DCB_CYCLES (5, 5, 0)
#define WAYSLOW_DCB_XMAP9_PROTOCOL DCB_CYCLES (12, 12, 0)
#define R_DCB_XMAP9_PROTOCOL DCB_CYCLES (2, 1, 3)
static __inline__ void
xmap9FIFOWait (struct newport_regs *rex)
{
rex->set.dcbmode = DCB_XMAP0 | XM9_CRS_FIFO_AVAIL |
DCB_DATAWIDTH_1 | R_DCB_XMAP9_PROTOCOL;
newport_bfwait (rex);
while ((rex->set.dcbdata0.bybytes.b3 & 3) != XM9_FIFO_EMPTY)
;
}
static __inline__ void
xmap9SetModeReg (struct newport_regs *rex, unsigned int modereg, unsigned int data24, int cfreq)
{
if (cfreq > 119)
rex->set.dcbmode = DCB_XMAP_ALL | XM9_CRS_MODE_REG_DATA |
DCB_DATAWIDTH_4 | W_DCB_XMAP9_PROTOCOL;
else if (cfreq > 59)
rex->set.dcbmode = DCB_XMAP_ALL | XM9_CRS_MODE_REG_DATA |
DCB_DATAWIDTH_4 | WSLOW_DCB_XMAP9_PROTOCOL;
else
rex->set.dcbmode = DCB_XMAP_ALL | XM9_CRS_MODE_REG_DATA |
DCB_DATAWIDTH_4 | WAYSLOW_DCB_XMAP9_PROTOCOL;
rex->set.dcbdata0.byword = ((modereg) << 24) | (data24 & 0xffffff);
}
#define BT445_PROTOCOL DCB_CYCLES(1,1,3)
#define BT445_CSR_ADDR_REG (0 << DCB_CRS_SHIFT)
#define BT445_CSR_REVISION (2 << DCB_CRS_SHIFT)
#define BT445_REVISION_REG 0x01
#endif /* !(_SGI_NEWPORT_H) */

233
include/video/permedia2.h Normal file
View File

@@ -0,0 +1,233 @@
/*
* Permedia2 framebuffer driver definitions.
* Copyright (c) 1998-2000 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
* --------------------------------------------------------------------------
* $Id: permedia2.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
* --------------------------------------------------------------------------
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#ifndef PM2FB_H
#define PM2FB_H
#define PM2_REFERENCE_CLOCK 14318 /* in KHz */
#define PM2_MAX_PIXCLOCK 230000 /* in KHz */
#define PM2_REGS_SIZE 0x10000
#define PM2TAG(r) (u32 )(((r)-0x8000)>>3)
/*****************************************************************************
* Permedia2 registers used in the framebuffer
*****************************************************************************/
#define PM2R_RESET_STATUS 0x0000
#define PM2R_IN_FIFO_SPACE 0x0018
#define PM2R_OUT_FIFO_WORDS 0x0020
#define PM2R_APERTURE_ONE 0x0050
#define PM2R_APERTURE_TWO 0x0058
#define PM2R_FIFO_DISCON 0x0068
#define PM2R_CHIP_CONFIG 0x0070
#define PM2R_REBOOT 0x1000
#define PM2R_MEM_CONTROL 0x1040
#define PM2R_BOOT_ADDRESS 0x1080
#define PM2R_MEM_CONFIG 0x10c0
#define PM2R_BYPASS_WRITE_MASK 0x1100
#define PM2R_FRAMEBUFFER_WRITE_MASK 0x1140
#define PM2R_OUT_FIFO 0x2000
#define PM2R_SCREEN_BASE 0x3000
#define PM2R_SCREEN_STRIDE 0x3008
#define PM2R_H_TOTAL 0x3010
#define PM2R_HG_END 0x3018
#define PM2R_HB_END 0x3020
#define PM2R_HS_START 0x3028
#define PM2R_HS_END 0x3030
#define PM2R_V_TOTAL 0x3038
#define PM2R_VB_END 0x3040
#define PM2R_VS_START 0x3048
#define PM2R_VS_END 0x3050
#define PM2R_VIDEO_CONTROL 0x3058
#define PM2R_LINE_COUNT 0x3070
#define PM2R_FIFO_CONTROL 0x3078
#define PM2R_RD_PALETTE_WRITE_ADDRESS 0x4000
#define PM2R_RD_PALETTE_DATA 0x4008
#define PM2R_RD_PIXEL_MASK 0x4010
#define PM2R_RD_PALETTE_READ_ADDRESS 0x4018
#define PM2R_RD_INDEXED_DATA 0x4050
#define PM2R_START_X_DOM 0x8000
#define PM2R_D_X_DOM 0x8008
#define PM2R_START_X_SUB 0x8010
#define PM2R_D_X_SUB 0x8018
#define PM2R_START_Y 0x8020
#define PM2R_D_Y 0x8028
#define PM2R_COUNT 0x8030
#define PM2R_RENDER 0x8038
#define PM2R_RASTERIZER_MODE 0x80a0
#define PM2R_RECTANGLE_ORIGIN 0x80d0
#define PM2R_RECTANGLE_SIZE 0x80d8
#define PM2R_PACKED_DATA_LIMITS 0x8150
#define PM2R_SCISSOR_MODE 0x8180
#define PM2R_SCREEN_SIZE 0x8198
#define PM2R_AREA_STIPPLE_MODE 0x81a0
#define PM2R_WINDOW_ORIGIN 0x81c8
#define PM2R_TEXTURE_ADDRESS_MODE 0x8380
#define PM2R_TEXTURE_MAP_FORMAT 0x8588
#define PM2R_TEXTURE_DATA_FORMAT 0x8590
#define PM2R_TEXTURE_READ_MODE 0x8670
#define PM2R_TEXEL_LUT_MODE 0x8678
#define PM2R_TEXTURE_COLOR_MODE 0x8680
#define PM2R_FOG_MODE 0x8690
#define PM2R_COLOR_DDA_MODE 0x87e0
#define PM2R_ALPHA_BLEND_MODE 0x8810
#define PM2R_DITHER_MODE 0x8818
#define PM2R_FB_SOFT_WRITE_MASK 0x8820
#define PM2R_LOGICAL_OP_MODE 0x8828
#define PM2R_LB_READ_MODE 0x8880
#define PM2R_LB_READ_FORMAT 0x8888
#define PM2R_LB_SOURCE_OFFSET 0x8890
#define PM2R_LB_WINDOW_BASE 0x88b8
#define PM2R_LB_WRITE_FORMAT 0x88c8
#define PM2R_STENCIL_MODE 0x8988
#define PM2R_DEPTH_MODE 0x89a0
#define PM2R_FB_READ_MODE 0x8a80
#define PM2R_FB_SOURCE_OFFSET 0x8a88
#define PM2R_FB_PIXEL_OFFSET 0x8a90
#define PM2R_FB_WINDOW_BASE 0x8ab0
#define PM2R_FB_WRITE_MODE 0x8ab8
#define PM2R_FB_HARD_WRITE_MASK 0x8ac0
#define PM2R_FB_BLOCK_COLOR 0x8ac8
#define PM2R_FB_READ_PIXEL 0x8ad0
#define PM2R_FILTER_MODE 0x8c00
#define PM2R_SYNC 0x8c40
#define PM2R_YUV_MODE 0x8f00
#define PM2R_STATISTICS_MODE 0x8c08
#define PM2R_FB_SOURCE_DELTA 0x8d88
#define PM2R_CONFIG 0x8d90
#define PM2R_DELTA_MODE 0x9300
/* Permedia2v */
#define PM2VR_RD_INDEX_LOW 0x4020
#define PM2VR_RD_INDEX_HIGH 0x4028
#define PM2VR_RD_INDEXED_DATA 0x4030
/* Permedia2 RAMDAC indexed registers */
#define PM2I_RD_CURSOR_CONTROL 0x06
#define PM2I_RD_COLOR_MODE 0x18
#define PM2I_RD_MODE_CONTROL 0x19
#define PM2I_RD_MISC_CONTROL 0x1e
#define PM2I_RD_PIXEL_CLOCK_A1 0x20
#define PM2I_RD_PIXEL_CLOCK_A2 0x21
#define PM2I_RD_PIXEL_CLOCK_A3 0x22
#define PM2I_RD_PIXEL_CLOCK_STATUS 0x29
#define PM2I_RD_MEMORY_CLOCK_1 0x30
#define PM2I_RD_MEMORY_CLOCK_2 0x31
#define PM2I_RD_MEMORY_CLOCK_3 0x32
#define PM2I_RD_MEMORY_CLOCK_STATUS 0x33
#define PM2I_RD_COLOR_KEY_CONTROL 0x40
#define PM2I_RD_OVERLAY_KEY 0x41
#define PM2I_RD_RED_KEY 0x42
#define PM2I_RD_GREEN_KEY 0x43
#define PM2I_RD_BLUE_KEY 0x44
/* Permedia2v extensions */
#define PM2VI_RD_MISC_CONTROL 0x000
#define PM2VI_RD_SYNC_CONTROL 0x001
#define PM2VI_RD_DAC_CONTROL 0x002
#define PM2VI_RD_PIXEL_SIZE 0x003
#define PM2VI_RD_COLOR_FORMAT 0x004
#define PM2VI_RD_CURSOR_MODE 0x005
#define PM2VI_RD_CURSOR_X_LOW 0x007
#define PM2VI_RD_CURSOR_X_HIGH 0x008
#define PM2VI_RD_CURSOR_Y_LOW 0x009
#define PM2VI_RD_CURSOR_Y_HIGH 0x00A
#define PM2VI_RD_CURSOR_X_HOT 0x00B
#define PM2VI_RD_CURSOR_Y_HOT 0x00C
#define PM2VI_RD_CLK0_PRESCALE 0x201
#define PM2VI_RD_CLK0_FEEDBACK 0x202
#define PM2VI_RD_CLK0_POSTSCALE 0x203
#define PM2VI_RD_CLK1_PRESCALE 0x204
#define PM2VI_RD_CLK1_FEEDBACK 0x205
#define PM2VI_RD_CLK1_POSTSCALE 0x206
#define PM2VI_RD_CURSOR_PALETTE 0x303
#define PM2VI_RD_CURSOR_PATTERN 0x400
/* Fields and flags */
#define PM2F_RENDER_AREASTIPPLE (1L<<0)
#define PM2F_RENDER_FASTFILL (1L<<3)
#define PM2F_RENDER_PRIMITIVE_MASK (3L<<6)
#define PM2F_RENDER_LINE 0
#define PM2F_RENDER_TRAPEZOID (1L<<6)
#define PM2F_RENDER_POINT (2L<<6)
#define PM2F_RENDER_RECTANGLE (3L<<6)
#define PM2F_SYNCHRONIZATION (1L<<10)
#define PM2F_PLL_LOCKED 0x10
#define PM2F_BEING_RESET (1L<<31)
#define PM2F_DATATYPE_COLOR 0x8000
#define PM2F_VGA_ENABLE 0x02
#define PM2F_VGA_FIXED 0x04
#define PM2F_FB_WRITE_ENABLE 0x01
#define PM2F_FB_READ_SOURCE_ENABLE 0x0200
#define PM2F_RD_PALETTE_WIDTH_8 0x02
#define PM2F_PART_PROD_MASK 0x01ff
#define PM2F_SCREEN_SCISSOR_ENABLE 0x02
#define PM2F_DATA_64_ENABLE 0x00010000
#define PM2F_BLANK_LOW 0x02
#define PM2F_HSYNC_MASK 0x18
#define PM2F_VSYNC_MASK 0x60
#define PM2F_HSYNC_ACT_HIGH 0x08
#define PM2F_HSYNC_FORCED_LOW 0x10
#define PM2F_HSYNC_ACT_LOW 0x18
#define PM2F_VSYNC_ACT_HIGH 0x20
#define PM2F_VSYNC_FORCED_LOW 0x40
#define PM2F_VSYNC_ACT_LOW 0x60
#define PM2F_LINE_DOUBLE 0x04
#define PM2F_VIDEO_ENABLE 0x01
#define PM2F_RD_PIXELFORMAT_SVGA 0x01
#define PM2F_RD_PIXELFORMAT_RGB232OFFSET 0x02
#define PM2F_RD_PIXELFORMAT_RGBA2321 0x03
#define PM2F_RD_PIXELFORMAT_RGBA5551 0x04
#define PM2F_RD_PIXELFORMAT_RGBA4444 0x05
#define PM2F_RD_PIXELFORMAT_RGB565 0x06
#define PM2F_RD_PIXELFORMAT_RGBA8888 0x08
#define PM2F_RD_PIXELFORMAT_RGB888 0x09
#define PM2F_RD_GUI_ACTIVE 0x10
#define PM2F_RD_COLOR_MODE_RGB 0x20
#define PM2F_DELTA_ORDER_RGB (1L<<18)
#define PM2F_RD_TRUECOLOR 0x80
#define PM2F_NO_ALPHA_BUFFER 0x10
#define PM2F_TEXTEL_SIZE_16 0x00080000
#define PM2F_TEXTEL_SIZE_32 0x00100000
#define PM2F_TEXTEL_SIZE_4 0x00180000
#define PM2F_TEXTEL_SIZE_24 0x00200000
#define PM2F_INCREASE_X (1L<<21)
#define PM2F_INCREASE_Y (1L<<22)
#define PM2F_CONFIG_FB_WRITE_ENABLE (1L<<3)
#define PM2F_CONFIG_FB_PACKED_DATA (1L<<2)
#define PM2F_CONFIG_FB_READ_DEST_ENABLE (1L<<1)
#define PM2F_CONFIG_FB_READ_SOURCE_ENABLE (1L<<0)
#define PM2F_COLOR_KEY_TEST_OFF (1L<<4)
#define PM2F_MEM_CONFIG_RAM_MASK (3L<<29)
#define PM2F_MEM_BANKS_1 0L
#define PM2F_MEM_BANKS_2 (1L<<29)
#define PM2F_MEM_BANKS_3 (2L<<29)
#define PM2F_MEM_BANKS_4 (3L<<29)
#define PM2F_APERTURE_STANDARD 0
#define PM2F_APERTURE_BYTESWAP 1
#define PM2F_APERTURE_HALFWORDSWAP 2
typedef enum {
PM2_TYPE_PERMEDIA2,
PM2_TYPE_PERMEDIA2V
} pm2type_t;
#endif /* PM2FB_H */
/*****************************************************************************
* That's all folks!
*****************************************************************************/

1235
include/video/pm3fb.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
/*
* linux/include/video/pmag-ba-fb.h
*
* TURBOchannel PMAG-BA Color Frame Buffer (CFB) card support,
* Copyright (C) 1999, 2000, 2001 by
* Michael Engel <engel@unix-ag.org>,
* Karsten Merker <merker@linuxtag.org>
* Copyright (c) 2005 Maciej W. Rozycki
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*/
/* IOmem resource offsets. */
#define PMAG_BA_FBMEM 0x000000 /* frame buffer */
#define PMAG_BA_BT459 0x200000 /* Bt459 RAMDAC */
#define PMAG_BA_IRQ 0x300000 /* IRQ acknowledge */
#define PMAG_BA_ROM 0x380000 /* REX option ROM */
#define PMAG_BA_BT438 0x380000 /* Bt438 clock chip reset */
#define PMAG_BA_SIZE 0x400000 /* address space size */
/* Bt459 register offsets, byte-wide registers. */
#define BT459_ADDR_LO 0x0 /* address low */
#define BT459_ADDR_HI 0x4 /* address high */
#define BT459_DATA 0x8 /* data window register */
#define BT459_CMAP 0xc /* color map window register */

View File

@@ -0,0 +1,58 @@
/*
* linux/include/video/pmagb-b-fb.h
*
* TURBOchannel PMAGB-B Smart Frame Buffer (SFB) card support,
* Copyright (C) 1999, 2000, 2001 by
* Michael Engel <engel@unix-ag.org> and
* Karsten Merker <merker@linuxtag.org>
* Copyright (c) 2005 Maciej W. Rozycki
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*/
/* IOmem resource offsets. */
#define PMAGB_B_ROM 0x000000 /* REX option ROM */
#define PMAGB_B_SFB 0x100000 /* SFB ASIC */
#define PMAGB_B_GP0 0x140000 /* general purpose output 0 */
#define PMAGB_B_GP1 0x180000 /* general purpose output 1 */
#define PMAGB_B_BT459 0x1c0000 /* Bt459 RAMDAC */
#define PMAGB_B_FBMEM 0x200000 /* frame buffer */
#define PMAGB_B_SIZE 0x400000 /* address space size */
/* IOmem register offsets. */
#define SFB_REG_VID_HOR 0x64 /* video horizontal setup */
#define SFB_REG_VID_VER 0x68 /* video vertical setup */
#define SFB_REG_VID_BASE 0x6c /* video base address */
#define SFB_REG_TCCLK_COUNT 0x78 /* TURBOchannel clock count */
#define SFB_REG_VIDCLK_COUNT 0x7c /* video clock count */
/* Video horizontal setup register constants. All bits are r/w. */
#define SFB_VID_HOR_BP_SHIFT 0x15 /* back porch */
#define SFB_VID_HOR_BP_MASK 0x7f
#define SFB_VID_HOR_SYN_SHIFT 0x0e /* sync pulse */
#define SFB_VID_HOR_SYN_MASK 0x7f
#define SFB_VID_HOR_FP_SHIFT 0x09 /* front porch */
#define SFB_VID_HOR_FP_MASK 0x1f
#define SFB_VID_HOR_PIX_SHIFT 0x00 /* active video */
#define SFB_VID_HOR_PIX_MASK 0x1ff
/* Video vertical setup register constants. All bits are r/w. */
#define SFB_VID_VER_BP_SHIFT 0x16 /* back porch */
#define SFB_VID_VER_BP_MASK 0x3f
#define SFB_VID_VER_SYN_SHIFT 0x10 /* sync pulse */
#define SFB_VID_VER_SYN_MASK 0x3f
#define SFB_VID_VER_FP_SHIFT 0x0b /* front porch */
#define SFB_VID_VER_FP_MASK 0x1f
#define SFB_VID_VER_SL_SHIFT 0x00 /* active scan lines */
#define SFB_VID_VER_SL_MASK 0x7ff
/* Video base address register constants. All bits are r/w. */
#define SFB_VID_BASE_MASK 0x1ff /* video base row address */
/* Bt459 register offsets, byte-wide registers. */
#define BT459_ADDR_LO 0x0 /* address low */
#define BT459_ADDR_HI 0x4 /* address high */
#define BT459_DATA 0x8 /* data window register */
#define BT459_CMAP 0xc /* color map window register */

1985
include/video/radeon.h Normal file

File diff suppressed because it is too large Load Diff

166
include/video/s1d13xxxfb.h Normal file
View File

@@ -0,0 +1,166 @@
/* include/video/s1d13xxxfb.h
*
* (c) 2004 Simtec Electronics
* (c) 2005 Thibaut VARENE <varenet@parisc-linux.org>
*
* Header file for Epson S1D13XXX driver code
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#ifndef S1D13XXXFB_H
#define S1D13XXXFB_H
#define S1D_PALETTE_SIZE 256
#define S1D_CHIP_REV 7 /* expected chip revision number for s1d13806 */
#define S1D_FBID "S1D13806"
#define S1D_DEVICENAME "s1d13806fb"
/* register definitions (tested on s1d13896) */
#define S1DREG_REV_CODE 0x0000 /* Revision Code Register */
#define S1DREG_MISC 0x0001 /* Miscellaneous Register */
#define S1DREG_GPIO_CNF0 0x0004 /* General IO Pins Configuration Register 0 */
#define S1DREG_GPIO_CNF1 0x0005 /* General IO Pins Configuration Register 1 */
#define S1DREG_GPIO_CTL0 0x0008 /* General IO Pins Control Register 0 */
#define S1DREG_GPIO_CTL1 0x0009 /* General IO Pins Control Register 1 */
#define S1DREG_CNF_STATUS 0x000C /* Configuration Status Readback Register */
#define S1DREG_CLK_CNF 0x0010 /* Memory Clock Configuration Register */
#define S1DREG_LCD_CLK_CNF 0x0014 /* LCD Pixel Clock Configuration Register */
#define S1DREG_CRT_CLK_CNF 0x0018 /* CRT/TV Pixel Clock Configuration Register */
#define S1DREG_MPLUG_CLK_CNF 0x001C /* MediaPlug Clock Configuration Register */
#define S1DREG_CPU2MEM_WST_SEL 0x001E /* CPU To Memory Wait State Select Register */
#define S1DREG_MEM_CNF 0x0020 /* Memory Configuration Register */
#define S1DREG_SDRAM_REF_RATE 0x0021 /* SDRAM Refresh Rate Register */
#define S1DREG_SDRAM_TC0 0x002A /* SDRAM Timing Control Register 0 */
#define S1DREG_SDRAM_TC1 0x002B /* SDRAM Timing Control Register 1 */
#define S1DREG_PANEL_TYPE 0x0030 /* Panel Type Register */
#define S1DREG_MOD_RATE 0x0031 /* MOD Rate Register */
#define S1DREG_LCD_DISP_HWIDTH 0x0032 /* LCD Horizontal Display Width Register: ((val)+1)*8)=pix/line */
#define S1DREG_LCD_NDISP_HPER 0x0034 /* LCD Horizontal Non-Display Period Register: ((val)+1)*8)=NDpix/line */
#define S1DREG_TFT_FPLINE_START 0x0035 /* TFT FPLINE Start Position Register */
#define S1DREG_TFT_FPLINE_PWIDTH 0x0036 /* TFT FPLINE Pulse Width Register. */
#define S1DREG_LCD_DISP_VHEIGHT0 0x0038 /* LCD Vertical Display Height Register 0 */
#define S1DREG_LCD_DISP_VHEIGHT1 0x0039 /* LCD Vertical Display Height Register 1 */
#define S1DREG_LCD_NDISP_VPER 0x003A /* LCD Vertical Non-Display Period Register: (val)+1=NDlines */
#define S1DREG_TFT_FPFRAME_START 0x003B /* TFT FPFRAME Start Position Register */
#define S1DREG_TFT_FPFRAME_PWIDTH 0x003C /* TFT FPFRAME Pulse Width Register */
#define S1DREG_LCD_DISP_MODE 0x0040 /* LCD Display Mode Register */
#define S1DREG_LCD_MISC 0x0041 /* LCD Miscellaneous Register */
#define S1DREG_LCD_DISP_START0 0x0042 /* LCD Display Start Address Register 0 */
#define S1DREG_LCD_DISP_START1 0x0043 /* LCD Display Start Address Register 1 */
#define S1DREG_LCD_DISP_START2 0x0044 /* LCD Display Start Address Register 2 */
#define S1DREG_LCD_MEM_OFF0 0x0046 /* LCD Memory Address Offset Register 0 */
#define S1DREG_LCD_MEM_OFF1 0x0047 /* LCD Memory Address Offset Register 1 */
#define S1DREG_LCD_PIX_PAN 0x0048 /* LCD Pixel Panning Register */
#define S1DREG_LCD_DISP_FIFO_HTC 0x004A /* LCD Display FIFO High Threshold Control Register */
#define S1DREG_LCD_DISP_FIFO_LTC 0x004B /* LCD Display FIFO Low Threshold Control Register */
#define S1DREG_CRT_DISP_HWIDTH 0x0050 /* CRT/TV Horizontal Display Width Register: ((val)+1)*8)=pix/line */
#define S1DREG_CRT_NDISP_HPER 0x0052 /* CRT/TV Horizontal Non-Display Period Register */
#define S1DREG_CRT_HRTC_START 0x0053 /* CRT/TV HRTC Start Position Register */
#define S1DREG_CRT_HRTC_PWIDTH 0x0054 /* CRT/TV HRTC Pulse Width Register */
#define S1DREG_CRT_DISP_VHEIGHT0 0x0056 /* CRT/TV Vertical Display Height Register 0 */
#define S1DREG_CRT_DISP_VHEIGHT1 0x0057 /* CRT/TV Vertical Display Height Register 1 */
#define S1DREG_CRT_NDISP_VPER 0x0058 /* CRT/TV Vertical Non-Display Period Register */
#define S1DREG_CRT_VRTC_START 0x0059 /* CRT/TV VRTC Start Position Register */
#define S1DREG_CRT_VRTC_PWIDTH 0x005A /* CRT/TV VRTC Pulse Width Register */
#define S1DREG_TV_OUT_CTL 0x005B /* TV Output Control Register */
#define S1DREG_CRT_DISP_MODE 0x0060 /* CRT/TV Display Mode Register */
#define S1DREG_CRT_DISP_START0 0x0062 /* CRT/TV Display Start Address Register 0 */
#define S1DREG_CRT_DISP_START1 0x0063 /* CRT/TV Display Start Address Register 1 */
#define S1DREG_CRT_DISP_START2 0x0064 /* CRT/TV Display Start Address Register 2 */
#define S1DREG_CRT_MEM_OFF0 0x0066 /* CRT/TV Memory Address Offset Register 0 */
#define S1DREG_CRT_MEM_OFF1 0x0067 /* CRT/TV Memory Address Offset Register 1 */
#define S1DREG_CRT_PIX_PAN 0x0068 /* CRT/TV Pixel Panning Register */
#define S1DREG_CRT_DISP_FIFO_HTC 0x006A /* CRT/TV Display FIFO High Threshold Control Register */
#define S1DREG_CRT_DISP_FIFO_LTC 0x006B /* CRT/TV Display FIFO Low Threshold Control Register */
#define S1DREG_LCD_CUR_CTL 0x0070 /* LCD Ink/Cursor Control Register */
#define S1DREG_LCD_CUR_START 0x0071 /* LCD Ink/Cursor Start Address Register */
#define S1DREG_LCD_CUR_XPOS0 0x0072 /* LCD Cursor X Position Register 0 */
#define S1DREG_LCD_CUR_XPOS1 0x0073 /* LCD Cursor X Position Register 1 */
#define S1DREG_LCD_CUR_YPOS0 0x0074 /* LCD Cursor Y Position Register 0 */
#define S1DREG_LCD_CUR_YPOS1 0x0075 /* LCD Cursor Y Position Register 1 */
#define S1DREG_LCD_CUR_BCTL0 0x0076 /* LCD Ink/Cursor Blue Color 0 Register */
#define S1DREG_LCD_CUR_GCTL0 0x0077 /* LCD Ink/Cursor Green Color 0 Register */
#define S1DREG_LCD_CUR_RCTL0 0x0078 /* LCD Ink/Cursor Red Color 0 Register */
#define S1DREG_LCD_CUR_BCTL1 0x007A /* LCD Ink/Cursor Blue Color 1 Register */
#define S1DREG_LCD_CUR_GCTL1 0x007B /* LCD Ink/Cursor Green Color 1 Register */
#define S1DREG_LCD_CUR_RCTL1 0x007C /* LCD Ink/Cursor Red Color 1 Register */
#define S1DREG_LCD_CUR_FIFO_HTC 0x007E /* LCD Ink/Cursor FIFO High Threshold Register */
#define S1DREG_CRT_CUR_CTL 0x0080 /* CRT/TV Ink/Cursor Control Register */
#define S1DREG_CRT_CUR_START 0x0081 /* CRT/TV Ink/Cursor Start Address Register */
#define S1DREG_CRT_CUR_XPOS0 0x0082 /* CRT/TV Cursor X Position Register 0 */
#define S1DREG_CRT_CUR_XPOS1 0x0083 /* CRT/TV Cursor X Position Register 1 */
#define S1DREG_CRT_CUR_YPOS0 0x0084 /* CRT/TV Cursor Y Position Register 0 */
#define S1DREG_CRT_CUR_YPOS1 0x0085 /* CRT/TV Cursor Y Position Register 1 */
#define S1DREG_CRT_CUR_BCTL0 0x0086 /* CRT/TV Ink/Cursor Blue Color 0 Register */
#define S1DREG_CRT_CUR_GCTL0 0x0087 /* CRT/TV Ink/Cursor Green Color 0 Register */
#define S1DREG_CRT_CUR_RCTL0 0x0088 /* CRT/TV Ink/Cursor Red Color 0 Register */
#define S1DREG_CRT_CUR_BCTL1 0x008A /* CRT/TV Ink/Cursor Blue Color 1 Register */
#define S1DREG_CRT_CUR_GCTL1 0x008B /* CRT/TV Ink/Cursor Green Color 1 Register */
#define S1DREG_CRT_CUR_RCTL1 0x008C /* CRT/TV Ink/Cursor Red Color 1 Register */
#define S1DREG_CRT_CUR_FIFO_HTC 0x008E /* CRT/TV Ink/Cursor FIFO High Threshold Register */
#define S1DREG_BBLT_CTL0 0x0100 /* BitBLT Control Register 0 */
#define S1DREG_BBLT_CTL1 0x0101 /* BitBLT Control Register 1 */
#define S1DREG_BBLT_CC_EXP 0x0102 /* BitBLT Code/Color Expansion Register */
#define S1DREG_BBLT_OP 0x0103 /* BitBLT Operation Register */
#define S1DREG_BBLT_SRC_START0 0x0104 /* BitBLT Source Start Address Register 0 */
#define S1DREG_BBLT_SRC_START1 0x0105 /* BitBLT Source Start Address Register 1 */
#define S1DREG_BBLT_SRC_START2 0x0106 /* BitBLT Source Start Address Register 2 */
#define S1DREG_BBLT_DST_START0 0x0108 /* BitBLT Destination Start Address Register 0 */
#define S1DREG_BBLT_DST_START1 0x0109 /* BitBLT Destination Start Address Register 1 */
#define S1DREG_BBLT_DST_START2 0x010A /* BitBLT Destination Start Address Register 2 */
#define S1DREG_BBLT_MEM_OFF0 0x010C /* BitBLT Memory Address Offset Register 0 */
#define S1DREG_BBLT_MEM_OFF1 0x010D /* BitBLT Memory Address Offset Register 1 */
#define S1DREG_BBLT_WIDTH0 0x0110 /* BitBLT Width Register 0 */
#define S1DREG_BBLT_WIDTH1 0x0111 /* BitBLT Width Register 1 */
#define S1DREG_BBLT_HEIGHT0 0x0112 /* BitBLT Height Register 0 */
#define S1DREG_BBLT_HEIGHT1 0x0113 /* BitBLT Height Register 1 */
#define S1DREG_BBLT_BGC0 0x0114 /* BitBLT Background Color Register 0 */
#define S1DREG_BBLT_BGC1 0x0115 /* BitBLT Background Color Register 1 */
#define S1DREG_BBLT_FGC0 0x0118 /* BitBLT Foreground Color Register 0 */
#define S1DREG_BBLT_FGC1 0x0119 /* BitBLT Foreground Color Register 1 */
#define S1DREG_LKUP_MODE 0x01E0 /* Look-Up Table Mode Register */
#define S1DREG_LKUP_ADDR 0x01E2 /* Look-Up Table Address Register */
#define S1DREG_LKUP_DATA 0x01E4 /* Look-Up Table Data Register */
#define S1DREG_PS_CNF 0x01F0 /* Power Save Configuration Register */
#define S1DREG_PS_STATUS 0x01F1 /* Power Save Status Register */
#define S1DREG_CPU2MEM_WDOGT 0x01F4 /* CPU-to-Memory Access Watchdog Timer Register */
#define S1DREG_COM_DISP_MODE 0x01FC /* Common Display Mode Register */
#define S1DREG_DELAYOFF 0xFFFE
#define S1DREG_DELAYON 0xFFFF
/* Note: all above defines should go in separate header files
when implementing other S1D13xxx chip support. */
struct s1d13xxxfb_regval {
u16 addr;
u8 value;
};
struct s1d13xxxfb_par {
void __iomem *regs;
unsigned char display;
unsigned int pseudo_palette[16];
#ifdef CONFIG_PM
void *regs_save; /* pm saves all registers here */
void *disp_save; /* pm saves entire screen here */
#endif
};
struct s1d13xxxfb_pdata {
const struct s1d13xxxfb_regval *initregs;
const unsigned int initregssize;
void (*platform_init_video)(void);
#ifdef CONFIG_PM
int (*platform_suspend_video)(void);
int (*platform_resume_video)(void);
#endif
};
#endif

682
include/video/sgivw.h Normal file
View File

@@ -0,0 +1,682 @@
/*
* linux/drivers/video/sgivw.h -- SGI DBE frame buffer device header
*
* Copyright (C) 1999 Silicon Graphics, Inc.
* Jeffrey Newquist, newquist@engr.sgi.som
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#ifndef __SGIVWFB_H__
#define __SGIVWFB_H__
#define DBE_GETREG(reg, dest) ((dest) = DBE_REG_BASE->reg)
#define DBE_SETREG(reg, src) DBE_REG_BASE->reg = (src)
#define DBE_IGETREG(reg, idx, dest) ((dest) = DBE_REG_BASE->reg[idx])
#define DBE_ISETREG(reg, idx, src) (DBE_REG_BASE->reg[idx] = (src))
#define MASK(msb, lsb) ( (((u32)1<<((msb)-(lsb)+1))-1) << (lsb) )
#define GET(v, msb, lsb) ( ((u32)(v) & MASK(msb,lsb)) >> (lsb) )
#define SET(v, f, msb, lsb) ( (v) = ((v)&~MASK(msb,lsb)) | (( (u32)(f)<<(lsb) ) & MASK(msb,lsb)) )
#define GET_DBE_FIELD(reg, field, v) GET((v), DBE_##reg##_##field##_MSB, DBE_##reg##_##field##_LSB)
#define SET_DBE_FIELD(reg, field, v, f) SET((v), (f), DBE_##reg##_##field##_MSB, DBE_##reg##_##field##_LSB)
/* NOTE: All loads/stores must be 32 bits and uncached */
#define DBE_REG_PHYS 0xd0000000
#define DBE_REG_SIZE 0x01000000
struct asregs {
volatile u32 ctrlstat; /* 0x000000 general control */
volatile u32 dotclock; /* 0x000004 dot clock PLL control */
volatile u32 i2c; /* 0x000008 crt I2C control */
volatile u32 sysclk; /* 0x00000c system clock PLL control */
volatile u32 i2cfp; /* 0x000010 flat panel I2C control */
volatile u32 id; /* 0x000014 device id/chip revision */
volatile u32 config; /* 0x000018 power on configuration */
volatile u32 bist; /* 0x00001c internal bist status */
char _pad0[ 0x010000 - 0x000020 ];
volatile u32 vt_xy; /* 0x010000 current dot coords */
volatile u32 vt_xymax; /* 0x010004 maximum dot coords */
volatile u32 vt_vsync; /* 0x010008 vsync on/off */
volatile u32 vt_hsync; /* 0x01000c hsync on/off */
volatile u32 vt_vblank; /* 0x010010 vblank on/off */
volatile u32 vt_hblank; /* 0x010014 hblank on/off */
volatile u32 vt_flags; /* 0x010018 polarity of vt signals */
volatile u32 vt_f2rf_lock; /* 0x01001c f2rf & framelck y coord */
volatile u32 vt_intr01; /* 0x010020 intr 0,1 y coords */
volatile u32 vt_intr23; /* 0x010024 intr 2,3 y coords */
volatile u32 fp_hdrv; /* 0x010028 flat panel hdrv on/off */
volatile u32 fp_vdrv; /* 0x01002c flat panel vdrv on/off */
volatile u32 fp_de; /* 0x010030 flat panel de on/off */
volatile u32 vt_hpixen; /* 0x010034 intrnl horiz pixel on/off*/
volatile u32 vt_vpixen; /* 0x010038 intrnl vert pixel on/off */
volatile u32 vt_hcmap; /* 0x01003c cmap write (horiz) */
volatile u32 vt_vcmap; /* 0x010040 cmap write (vert) */
volatile u32 did_start_xy; /* 0x010044 eol/f did/xy reset val */
volatile u32 crs_start_xy; /* 0x010048 eol/f crs/xy reset val */
volatile u32 vc_start_xy; /* 0x01004c eol/f vc/xy reset val */
char _pad1[ 0x020000 - 0x010050 ];
volatile u32 ovr_width_tile; /* 0x020000 overlay plane ctrl 0 */
volatile u32 ovr_inhwctrl; /* 0x020004 overlay plane ctrl 1 */
volatile u32 ovr_control; /* 0x020008 overlay plane ctrl 1 */
char _pad2[ 0x030000 - 0x02000C ];
volatile u32 frm_size_tile; /* 0x030000 normal plane ctrl 0 */
volatile u32 frm_size_pixel; /* 0x030004 normal plane ctrl 1 */
volatile u32 frm_inhwctrl; /* 0x030008 normal plane ctrl 2 */
volatile u32 frm_control; /* 0x03000C normal plane ctrl 3 */
char _pad3[ 0x040000 - 0x030010 ];
volatile u32 did_inhwctrl; /* 0x040000 DID control */
volatile u32 did_control; /* 0x040004 DID shadow */
char _pad4[ 0x048000 - 0x040008 ];
volatile u32 mode_regs[32]; /* 0x048000 - 0x04807c WID table */
char _pad5[ 0x050000 - 0x048080 ];
volatile u32 cmap[6144]; /* 0x050000 - 0x055ffc color map */
char _pad6[ 0x058000 - 0x056000 ];
volatile u32 cm_fifo; /* 0x058000 color map fifo status */
char _pad7[ 0x060000 - 0x058004 ];
volatile u32 gmap[256]; /* 0x060000 - 0x0603fc gamma map */
char _pad8[ 0x068000 - 0x060400 ];
volatile u32 gmap10[1024]; /* 0x068000 - 0x068ffc gamma map */
char _pad9[ 0x070000 - 0x069000 ];
volatile u32 crs_pos; /* 0x070000 cusror control 0 */
volatile u32 crs_ctl; /* 0x070004 cusror control 1 */
volatile u32 crs_cmap[3]; /* 0x070008 - 0x070010 crs cmap */
char _pad10[ 0x078000 - 0x070014 ];
volatile u32 crs_glyph[64]; /* 0x078000 - 0x0780fc crs glyph */
char _pad11[ 0x080000 - 0x078100 ];
volatile u32 vc_0; /* 0x080000 video capture crtl 0 */
volatile u32 vc_1; /* 0x080004 video capture crtl 1 */
volatile u32 vc_2; /* 0x080008 video capture crtl 2 */
volatile u32 vc_3; /* 0x08000c video capture crtl 3 */
volatile u32 vc_4; /* 0x080010 video capture crtl 3 */
volatile u32 vc_5; /* 0x080014 video capture crtl 3 */
volatile u32 vc_6; /* 0x080018 video capture crtl 3 */
volatile u32 vc_7; /* 0x08001c video capture crtl 3 */
volatile u32 vc_8; /* 0x08000c video capture crtl 3 */
};
/* Bit mask information */
#define DBE_CTRLSTAT_CHIPID_MSB 3
#define DBE_CTRLSTAT_CHIPID_LSB 0
#define DBE_CTRLSTAT_SENSE_N_MSB 4
#define DBE_CTRLSTAT_SENSE_N_LSB 4
#define DBE_CTRLSTAT_PCLKSEL_MSB 29
#define DBE_CTRLSTAT_PCLKSEL_LSB 28
#define DBE_DOTCLK_M_MSB 7
#define DBE_DOTCLK_M_LSB 0
#define DBE_DOTCLK_N_MSB 13
#define DBE_DOTCLK_N_LSB 8
#define DBE_DOTCLK_P_MSB 15
#define DBE_DOTCLK_P_LSB 14
#define DBE_DOTCLK_RUN_MSB 20
#define DBE_DOTCLK_RUN_LSB 20
#define DBE_VT_XY_VT_FREEZE_MSB 31
#define DBE_VT_XY_VT_FREEZE_LSB 31
#define DBE_FP_VDRV_FP_VDRV_ON_MSB 23
#define DBE_FP_VDRV_FP_VDRV_ON_LSB 12
#define DBE_FP_VDRV_FP_VDRV_OFF_MSB 11
#define DBE_FP_VDRV_FP_VDRV_OFF_LSB 0
#define DBE_FP_HDRV_FP_HDRV_ON_MSB 23
#define DBE_FP_HDRV_FP_HDRV_ON_LSB 12
#define DBE_FP_HDRV_FP_HDRV_OFF_MSB 11
#define DBE_FP_HDRV_FP_HDRV_OFF_LSB 0
#define DBE_FP_DE_FP_DE_ON_MSB 23
#define DBE_FP_DE_FP_DE_ON_LSB 12
#define DBE_FP_DE_FP_DE_OFF_MSB 11
#define DBE_FP_DE_FP_DE_OFF_LSB 0
#define DBE_VT_VSYNC_VT_VSYNC_ON_MSB 23
#define DBE_VT_VSYNC_VT_VSYNC_ON_LSB 12
#define DBE_VT_VSYNC_VT_VSYNC_OFF_MSB 11
#define DBE_VT_VSYNC_VT_VSYNC_OFF_LSB 0
#define DBE_VT_HSYNC_VT_HSYNC_ON_MSB 23
#define DBE_VT_HSYNC_VT_HSYNC_ON_LSB 12
#define DBE_VT_HSYNC_VT_HSYNC_OFF_MSB 11
#define DBE_VT_HSYNC_VT_HSYNC_OFF_LSB 0
#define DBE_VT_VBLANK_VT_VBLANK_ON_MSB 23
#define DBE_VT_VBLANK_VT_VBLANK_ON_LSB 12
#define DBE_VT_VBLANK_VT_VBLANK_OFF_MSB 11
#define DBE_VT_VBLANK_VT_VBLANK_OFF_LSB 0
#define DBE_VT_HBLANK_VT_HBLANK_ON_MSB 23
#define DBE_VT_HBLANK_VT_HBLANK_ON_LSB 12
#define DBE_VT_HBLANK_VT_HBLANK_OFF_MSB 11
#define DBE_VT_HBLANK_VT_HBLANK_OFF_LSB 0
#define DBE_VT_FLAGS_VDRV_INVERT_MSB 0
#define DBE_VT_FLAGS_VDRV_INVERT_LSB 0
#define DBE_VT_FLAGS_HDRV_INVERT_MSB 2
#define DBE_VT_FLAGS_HDRV_INVERT_LSB 2
#define DBE_VT_VCMAP_VT_VCMAP_ON_MSB 23
#define DBE_VT_VCMAP_VT_VCMAP_ON_LSB 12
#define DBE_VT_VCMAP_VT_VCMAP_OFF_MSB 11
#define DBE_VT_VCMAP_VT_VCMAP_OFF_LSB 0
#define DBE_VT_HCMAP_VT_HCMAP_ON_MSB 23
#define DBE_VT_HCMAP_VT_HCMAP_ON_LSB 12
#define DBE_VT_HCMAP_VT_HCMAP_OFF_MSB 11
#define DBE_VT_HCMAP_VT_HCMAP_OFF_LSB 0
#define DBE_VT_XYMAX_VT_MAXX_MSB 11
#define DBE_VT_XYMAX_VT_MAXX_LSB 0
#define DBE_VT_XYMAX_VT_MAXY_MSB 23
#define DBE_VT_XYMAX_VT_MAXY_LSB 12
#define DBE_VT_HPIXEN_VT_HPIXEN_ON_MSB 23
#define DBE_VT_HPIXEN_VT_HPIXEN_ON_LSB 12
#define DBE_VT_HPIXEN_VT_HPIXEN_OFF_MSB 11
#define DBE_VT_HPIXEN_VT_HPIXEN_OFF_LSB 0
#define DBE_VT_VPIXEN_VT_VPIXEN_ON_MSB 23
#define DBE_VT_VPIXEN_VT_VPIXEN_ON_LSB 12
#define DBE_VT_VPIXEN_VT_VPIXEN_OFF_MSB 11
#define DBE_VT_VPIXEN_VT_VPIXEN_OFF_LSB 0
#define DBE_OVR_CONTROL_OVR_DMA_ENABLE_MSB 0
#define DBE_OVR_CONTROL_OVR_DMA_ENABLE_LSB 0
#define DBE_OVR_INHWCTRL_OVR_DMA_ENABLE_MSB 0
#define DBE_OVR_INHWCTRL_OVR_DMA_ENABLE_LSB 0
#define DBE_OVR_WIDTH_TILE_OVR_FIFO_RESET_MSB 13
#define DBE_OVR_WIDTH_TILE_OVR_FIFO_RESET_LSB 13
#define DBE_FRM_CONTROL_FRM_DMA_ENABLE_MSB 0
#define DBE_FRM_CONTROL_FRM_DMA_ENABLE_LSB 0
#define DBE_FRM_CONTROL_FRM_TILE_PTR_MSB 31
#define DBE_FRM_CONTROL_FRM_TILE_PTR_LSB 9
#define DBE_FRM_CONTROL_FRM_LINEAR_MSB 1
#define DBE_FRM_CONTROL_FRM_LINEAR_LSB 1
#define DBE_FRM_INHWCTRL_FRM_DMA_ENABLE_MSB 0
#define DBE_FRM_INHWCTRL_FRM_DMA_ENABLE_LSB 0
#define DBE_FRM_SIZE_TILE_FRM_WIDTH_TILE_MSB 12
#define DBE_FRM_SIZE_TILE_FRM_WIDTH_TILE_LSB 5
#define DBE_FRM_SIZE_TILE_FRM_RHS_MSB 4
#define DBE_FRM_SIZE_TILE_FRM_RHS_LSB 0
#define DBE_FRM_SIZE_TILE_FRM_DEPTH_MSB 14
#define DBE_FRM_SIZE_TILE_FRM_DEPTH_LSB 13
#define DBE_FRM_SIZE_TILE_FRM_FIFO_RESET_MSB 15
#define DBE_FRM_SIZE_TILE_FRM_FIFO_RESET_LSB 15
#define DBE_FRM_SIZE_PIXEL_FB_HEIGHT_PIX_MSB 31
#define DBE_FRM_SIZE_PIXEL_FB_HEIGHT_PIX_LSB 16
#define DBE_DID_CONTROL_DID_DMA_ENABLE_MSB 0
#define DBE_DID_CONTROL_DID_DMA_ENABLE_LSB 0
#define DBE_DID_INHWCTRL_DID_DMA_ENABLE_MSB 0
#define DBE_DID_INHWCTRL_DID_DMA_ENABLE_LSB 0
#define DBE_DID_START_XY_DID_STARTY_MSB 23
#define DBE_DID_START_XY_DID_STARTY_LSB 12
#define DBE_DID_START_XY_DID_STARTX_MSB 11
#define DBE_DID_START_XY_DID_STARTX_LSB 0
#define DBE_CRS_START_XY_CRS_STARTY_MSB 23
#define DBE_CRS_START_XY_CRS_STARTY_LSB 12
#define DBE_CRS_START_XY_CRS_STARTX_MSB 11
#define DBE_CRS_START_XY_CRS_STARTX_LSB 0
#define DBE_WID_TYP_MSB 4
#define DBE_WID_TYP_LSB 2
#define DBE_WID_BUF_MSB 1
#define DBE_WID_BUF_LSB 0
#define DBE_VC_START_XY_VC_STARTY_MSB 23
#define DBE_VC_START_XY_VC_STARTY_LSB 12
#define DBE_VC_START_XY_VC_STARTX_MSB 11
#define DBE_VC_START_XY_VC_STARTX_LSB 0
/* Constants */
#define DBE_FRM_DEPTH_8 0
#define DBE_FRM_DEPTH_16 1
#define DBE_FRM_DEPTH_32 2
#define DBE_CMODE_I8 0
#define DBE_CMODE_I12 1
#define DBE_CMODE_RG3B2 2
#define DBE_CMODE_RGB4 3
#define DBE_CMODE_ARGB5 4
#define DBE_CMODE_RGB8 5
#define DBE_CMODE_RGBA5 6
#define DBE_CMODE_RGB10 7
#define DBE_BMODE_BOTH 3
#define DBE_CRS_MAGIC 54
#define DBE_CLOCK_REF_KHZ 27000
/* Config Register (DBE Only) Definitions */
#define DBE_CONFIG_VDAC_ENABLE 0x00000001
#define DBE_CONFIG_VDAC_GSYNC 0x00000002
#define DBE_CONFIG_VDAC_PBLANK 0x00000004
#define DBE_CONFIG_FPENABLE 0x00000008
#define DBE_CONFIG_LENDIAN 0x00000020
#define DBE_CONFIG_TILEHIST 0x00000040
#define DBE_CONFIG_EXT_ADDR 0x00000080
#define DBE_CONFIG_FBDEV ( DBE_CONFIG_VDAC_ENABLE | \
DBE_CONFIG_VDAC_GSYNC | \
DBE_CONFIG_VDAC_PBLANK | \
DBE_CONFIG_LENDIAN | \
DBE_CONFIG_EXT_ADDR )
/*
* Available Video Timings and Corresponding Indices
*/
typedef enum {
DBE_VT_640_480_60,
DBE_VT_800_600_60,
DBE_VT_800_600_75,
DBE_VT_800_600_120,
DBE_VT_1024_768_50,
DBE_VT_1024_768_60,
DBE_VT_1024_768_75,
DBE_VT_1024_768_85,
DBE_VT_1024_768_120,
DBE_VT_1280_1024_50,
DBE_VT_1280_1024_60,
DBE_VT_1280_1024_75,
DBE_VT_1280_1024_85,
DBE_VT_1600_1024_53,
DBE_VT_1600_1024_60,
DBE_VT_1600_1200_50,
DBE_VT_1600_1200_60,
DBE_VT_1600_1200_75,
DBE_VT_1920_1080_50,
DBE_VT_1920_1080_60,
DBE_VT_1920_1080_72,
DBE_VT_1920_1200_50,
DBE_VT_1920_1200_60,
DBE_VT_1920_1200_66,
DBE_VT_UNKNOWN
} dbe_timing_t;
/*
* Crime Video Timing Data Structure
*/
struct dbe_timing_info
{
dbe_timing_t type;
int flags;
short width; /* Monitor resolution */
short height;
int fields_sec; /* fields/sec (Hz -3 dec. places */
int cfreq; /* pixel clock frequency (MHz -3 dec. places) */
short htotal; /* Horizontal total pixels */
short hblank_start; /* Horizontal blank start */
short hblank_end; /* Horizontal blank end */
short hsync_start; /* Horizontal sync start */
short hsync_end; /* Horizontal sync end */
short vtotal; /* Vertical total lines */
short vblank_start; /* Vertical blank start */
short vblank_end; /* Vertical blank end */
short vsync_start; /* Vertical sync start */
short vsync_end; /* Vertical sync end */
short pll_m; /* PLL M parameter */
short pll_n; /* PLL P parameter */
short pll_p; /* PLL N parameter */
};
/* Defines for dbe_vof_info_t flags */
#define DBE_VOF_UNKNOWNMON 1
#define DBE_VOF_STEREO 2
#define DBE_VOF_DO_GENSYNC 4 /* enable incoming sync */
#define DBE_VOF_SYNC_ON_GREEN 8 /* sync on green */
#define DBE_VOF_FLATPANEL 0x1000 /* FLATPANEL Timing */
#define DBE_VOF_MAGICKEY 0x2000 /* Backdoor key */
/*
* DBE Timing Tables
*/
#ifdef INCLUDE_TIMING_TABLE_DATA
struct dbe_timing_info dbeVTimings[] = {
{
DBE_VT_640_480_60,
/* flags, width, height, fields_sec, cfreq */
0, 640, 480, 59940, 25175,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
800, 640, 800, 656, 752,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
525, 480, 525, 490, 492,
/* pll_m, pll_n, pll_p */
15, 2, 3
},
{
DBE_VT_800_600_60,
/* flags, width, height, fields_sec, cfreq */
0, 800, 600, 60317, 40000,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1056, 800, 1056, 840, 968,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
628, 600, 628, 601, 605,
/* pll_m, pll_n, pll_p */
3, 1, 1
},
{
DBE_VT_800_600_75,
/* flags, width, height, fields_sec, cfreq */
0, 800, 600, 75000, 49500,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1056, 800, 1056, 816, 896,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
625, 600, 625, 601, 604,
/* pll_m, pll_n, pll_p */
11, 3, 1
},
{
DBE_VT_800_600_120,
/* flags, width, height, fields_sec, cfreq */
DBE_VOF_STEREO, 800, 600, 119800, 82978,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1040, 800, 1040, 856, 976,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
666, 600, 666, 637, 643,
/* pll_m, pll_n, pll_p */
31, 5, 1
},
{
DBE_VT_1024_768_50,
/* flags, width, height, fields_sec, cfreq */
0, 1024, 768, 50000, 54163,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1344, 1024, 1344, 1048, 1184,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
806, 768, 806, 771, 777,
/* pll_m, pll_n, pll_p */
4, 1, 1
},
{
DBE_VT_1024_768_60,
/* flags, width, height, fields_sec, cfreq */
0, 1024, 768, 60004, 65000,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1344, 1024, 1344, 1048, 1184,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
806, 768, 806, 771, 777,
/* pll_m, pll_n, pll_p */
12, 5, 0
},
{
DBE_VT_1024_768_75,
/* flags, width, height, fields_sec, cfreq */
0, 1024, 768, 75029, 78750,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1312, 1024, 1312, 1040, 1136,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
800, 768, 800, 769, 772,
/* pll_m, pll_n, pll_p */
29, 5, 1
},
{
DBE_VT_1024_768_85,
/* flags, width, height, fields_sec, cfreq */
0, 1024, 768, 84997, 94500,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1376, 1024, 1376, 1072, 1168,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
808, 768, 808, 769, 772,
/* pll_m, pll_n, pll_p */
7, 2, 0
},
{
DBE_VT_1024_768_120,
/* flags, width, height, fields_sec, cfreq */
DBE_VOF_STEREO, 1024, 768, 119800, 133195,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1376, 1024, 1376, 1072, 1168,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
808, 768, 808, 769, 772,
/* pll_m, pll_n, pll_p */
5, 1, 0
},
{
DBE_VT_1280_1024_50,
/* flags, width, height, fields_sec, cfreq */
0, 1280, 1024, 50000, 89460,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1680, 1280, 1680, 1360, 1480,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1065, 1024, 1065, 1027, 1030,
/* pll_m, pll_n, pll_p */
10, 3, 0
},
{
DBE_VT_1280_1024_60,
/* flags, width, height, fields_sec, cfreq */
0, 1280, 1024, 60020, 108000,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1688, 1280, 1688, 1328, 1440,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1066, 1024, 1066, 1025, 1028,
/* pll_m, pll_n, pll_p */
4, 1, 0
},
{
DBE_VT_1280_1024_75,
/* flags, width, height, fields_sec, cfreq */
0, 1280, 1024, 75025, 135000,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1688, 1280, 1688, 1296, 1440,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1066, 1024, 1066, 1025, 1028,
/* pll_m, pll_n, pll_p */
5, 1, 0
},
{
DBE_VT_1280_1024_85,
/* flags, width, height, fields_sec, cfreq */
0, 1280, 1024, 85024, 157500,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1728, 1280, 1728, 1344, 1504,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1072, 1024, 1072, 1025, 1028,
/* pll_m, pll_n, pll_p */
29, 5, 0
},
{
DBE_VT_1600_1024_53,
/* flags, width, height, fields_sec, cfreq */
DBE_VOF_FLATPANEL | DBE_VOF_MAGICKEY,
1600, 1024, 53000, 107447,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1900, 1600, 1900, 1630, 1730,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1067, 1024, 1067, 1027, 1030,
/* pll_m, pll_n, pll_p */
4, 1, 0
},
{
DBE_VT_1600_1024_60,
/* flags, width, height, fields_sec, cfreq */
DBE_VOF_FLATPANEL, 1600, 1024, 60000, 106913,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
1670, 1600, 1670, 1630, 1650,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1067, 1024, 1067, 1027, 1030,
/* pll_m, pll_n, pll_p */
4, 1, 0
},
{
DBE_VT_1600_1200_50,
/* flags, width, height, fields_sec, cfreq */
0, 1600, 1200, 50000, 130500,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2088, 1600, 2088, 1644, 1764,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1250, 1200, 1250, 1205, 1211,
/* pll_m, pll_n, pll_p */
24, 5, 0
},
{
DBE_VT_1600_1200_60,
/* flags, width, height, fields_sec, cfreq */
0, 1600, 1200, 59940, 162000,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2160, 1600, 2160, 1644, 1856,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1250, 1200, 1250, 1201, 1204,
/* pll_m, pll_n, pll_p */
6, 1, 0
},
{
DBE_VT_1600_1200_75,
/* flags, width, height, fields_sec, cfreq */
0, 1600, 1200, 75000, 202500,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2160, 1600, 2160, 1644, 1856,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1250, 1200, 1250, 1201, 1204,
/* pll_m, pll_n, pll_p */
15, 2, 0
},
{
DBE_VT_1920_1080_50,
/* flags, width, height, fields_sec, cfreq */
0, 1920, 1080, 50000, 133200,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2368, 1920, 2368, 1952, 2096,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1125, 1080, 1125, 1083, 1086,
/* pll_m, pll_n, pll_p */
5, 1, 0
},
{
DBE_VT_1920_1080_60,
/* flags, width, height, fields_sec, cfreq */
0, 1920, 1080, 59940, 159840,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2368, 1920, 2368, 1952, 2096,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1125, 1080, 1125, 1083, 1086,
/* pll_m, pll_n, pll_p */
6, 1, 0
},
{
DBE_VT_1920_1080_72,
/* flags, width, height, fields_sec, cfreq */
0, 1920, 1080, 72000, 216023,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2560, 1920, 2560, 1968, 2184,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1172, 1080, 1172, 1083, 1086,
/* pll_m, pll_n, pll_p */
8, 1, 0
},
{
DBE_VT_1920_1200_50,
/* flags, width, height, fields_sec, cfreq */
0, 1920, 1200, 50000, 161500,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2584, 1920, 2584, 1984, 2240,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1250, 1200, 1250, 1203, 1206,
/* pll_m, pll_n, pll_p */
6, 1, 0
},
{
DBE_VT_1920_1200_60,
/* flags, width, height, fields_sec, cfreq */
0, 1920, 1200, 59940, 193800,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2584, 1920, 2584, 1984, 2240,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1250, 1200, 1250, 1203, 1206,
/* pll_m, pll_n, pll_p */
29, 4, 0
},
{
DBE_VT_1920_1200_66,
/* flags, width, height, fields_sec, cfreq */
0, 1920, 1200, 66000, 213180,
/* htotal, hblank_start, hblank_end, hsync_start, hsync_end */
2584, 1920, 2584, 1984, 2240,
/* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */
1250, 1200, 1250, 1203, 1206,
/* pll_m, pll_n, pll_p */
8, 1, 0
}
};
#define DBE_VT_SIZE (sizeof(dbeVTimings)/sizeof(dbeVTimings[0]))
#endif // INCLUDE_TIMING_TABLE_DATA
#endif // ! __SGIVWFB_H__

224
include/video/sisfb.h Normal file
View File

@@ -0,0 +1,224 @@
/*
* sisfb.h - definitions for the SiS framebuffer driver
*
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the named License,
* or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*/
#ifndef _LINUX_SISFB_H_
#define _LINUX_SISFB_H_
#include <asm/ioctl.h>
#include <asm/types.h>
/**********************************************/
/* PUBLIC */
/**********************************************/
/* vbflags, public (others in sis.h) */
#define CRT2_DEFAULT 0x00000001
#define CRT2_LCD 0x00000002
#define CRT2_TV 0x00000004
#define CRT2_VGA 0x00000008
#define TV_NTSC 0x00000010
#define TV_PAL 0x00000020
#define TV_HIVISION 0x00000040
#define TV_YPBPR 0x00000080
#define TV_AVIDEO 0x00000100
#define TV_SVIDEO 0x00000200
#define TV_SCART 0x00000400
#define TV_PALM 0x00001000
#define TV_PALN 0x00002000
#define TV_NTSCJ 0x00001000
#define TV_CHSCART 0x00008000
#define TV_CHYPBPR525I 0x00010000
#define CRT1_VGA 0x00000000
#define CRT1_LCDA 0x00020000
#define VGA2_CONNECTED 0x00040000
#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */
#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
/* Aliases: */
#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
/* Only if TV_YPBPR is set: */
#define TV_YPBPR525I TV_NTSC
#define TV_YPBPR525P TV_PAL
#define TV_YPBPR750P TV_PALM
#define TV_YPBPR1080I TV_PALN
#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
#define VB_DISPTYPE_DISP2 CRT2_ENABLE
#define VB_DISPTYPE_CRT2 CRT2_ENABLE
#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
#define VB_DISPMODE_SINGLE VB_SINGLE_MODE
#define VB_DISPMODE_MIRROR VB_MIRROR_MODE
#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
/* Structure argument for SISFB_GET_INFO ioctl */
struct sisfb_info {
__u32 sisfb_id; /* for identifying sisfb */
#ifndef SISFB_ID
#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
#endif
__u32 chip_id; /* PCI-ID of detected chip */
__u32 memory; /* total video memory in KB */
__u32 heapstart; /* heap start offset in KB */
__u8 fbvidmode; /* current sisfb mode */
__u8 sisfb_version;
__u8 sisfb_revision;
__u8 sisfb_patchlevel;
__u8 sisfb_caps; /* sisfb capabilities */
__u32 sisfb_tqlen; /* turbo queue length (in KB) */
__u32 sisfb_pcibus; /* The card's PCI ID */
__u32 sisfb_pcislot;
__u32 sisfb_pcifunc;
__u8 sisfb_lcdpdc; /* PanelDelayCompensation */
__u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */
__u32 sisfb_vbflags;
__u32 sisfb_currentvbflags;
__u32 sisfb_scalelcd;
__u32 sisfb_specialtiming;
__u8 sisfb_haveemi;
__u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
__u8 sisfb_haveemilcd;
__u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */
__u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
__u32 sisfb_heapsize; /* heap size (in KB) */
__u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */
__u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */
__u32 sisfb_curdstn;
__u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */
__u32 sisfb_vbflags2; /* ivideo->vbflags2 */
__u8 sisfb_can_post; /* sisfb can POST this card */
__u8 sisfb_card_posted; /* card is POSTED */
__u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */
__u8 reserved[183]; /* for future use */
};
#define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */
#define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */
/* more to come */
#define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */
#define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */
#define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */
#define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */
#define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */
/* more to come */
#define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */
#define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */
/* Argument for SISFB_CMD ioctl */
struct sisfb_cmd {
__u32 sisfb_cmd;
__u32 sisfb_arg[16];
__u32 sisfb_result[4];
};
/* Addtional IOCTLs for communication sisfb <> X driver */
/* If changing this, vgatypes.h must also be changed (for X driver) */
/* ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
#define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info)
/* ioctrl to get current vertical retrace status */
#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
/* ioctl for internal sisfb commands (sisfbctrl) */
#define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd)
/* ioctl for locking sisfb (no register access during lock) */
/* As of now, only used to avoid register access during
* the ioctls listed above.
*/
#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
/* ioctls 0xF3 up to 0x3F reserved for sisfb */
/****************************************************************/
/* The following are deprecated and should not be used anymore: */
/****************************************************************/
/* ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
/* ioctrl to get current vertical retrace status */
#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
#define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
#define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
/****************************************************************/
/* End of deprecated ioctl numbers */
/****************************************************************/
/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
struct sis_memreq {
__u32 offset;
__u32 size;
};
/**********************************************/
/* PRIVATE */
/* (for IN-KERNEL usage only) */
/**********************************************/
#ifdef __KERNEL__
#include <linux/pci.h>
#define UNKNOWN_VGA 0
#define SIS_300_VGA 1
#define SIS_315_VGA 2
#define SISFB_HAVE_MALLOC_NEW
extern void sis_malloc(struct sis_memreq *req);
extern void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req);
extern void sis_free(u32 base);
extern void sis_free_new(struct pci_dev *pdev, u32 base);
#endif
#endif

356
include/video/sstfb.h Normal file
View File

@@ -0,0 +1,356 @@
/*
* linux/drivers/video/sstfb.h -- voodoo graphics frame buffer
*
* Copyright (c) 2000,2001 Ghozlane Toumi <gtoumi@messel.emse.fr>
*
* Created 28 Aug 2001 by Ghozlane Toumi
*/
#ifndef _SSTFB_H_
#define _SSTFB_H_
/*
*
* Debug Stuff
*
*/
#ifdef SST_DEBUG
# define dprintk(X...) printk("sstfb: " X)
# define SST_DEBUG_REG 1
# define SST_DEBUG_FUNC 1
# define SST_DEBUG_VAR 1
#else
# define dprintk(X...)
# define SST_DEBUG_REG 0
# define SST_DEBUG_FUNC 0
# define SST_DEBUG_VAR 0
#endif
#if (SST_DEBUG_REG > 0)
# define r_dprintk(X...) dprintk(X)
#else
# define r_dprintk(X...)
#endif
#if (SST_DEBUG_REG > 1)
# define r_ddprintk(X...) dprintk(" " X)
#else
# define r_ddprintk(X...)
#endif
#if (SST_DEBUG_FUNC > 0)
# define f_dprintk(X...) dprintk(X)
#else
# define f_dprintk(X...)
#endif
#if (SST_DEBUG_FUNC > 1)
# define f_ddprintk(X...) dprintk(" " X)
#else
# define f_ddprintk(X...)
#endif
#if (SST_DEBUG_FUNC > 2)
# define f_dddprintk(X...) dprintk(" " X)
#else
# define f_dddprintk(X...)
#endif
#if (SST_DEBUG_VAR > 0)
# define v_dprintk(X...) dprintk(X)
# define print_var(V, X...) \
{ \
dprintk(X); \
printk(" :\n"); \
sst_dbg_print_var(V); \
}
#else
# define v_dprintk(X...)
# define print_var(X,Y...)
#endif
#define BIT(x) (1ul<<(x))
#define POW2(x) (1ul<<(x))
/*
*
* Const
*
*/
/* pci stuff */
#define PCI_INIT_ENABLE 0x40
# define PCI_EN_INIT_WR BIT(0)
# define PCI_EN_FIFO_WR BIT(1)
# define PCI_REMAP_DAC BIT(2)
#define PCI_VCLK_ENABLE 0xc0 /* enable video */
#define PCI_VCLK_DISABLE 0xe0
/* register offsets from memBaseAddr */
#define STATUS 0x0000
# define STATUS_FBI_BUSY BIT(7)
#define FBZMODE 0x0110
# define EN_CLIPPING BIT(0) /* enable clipping */
# define EN_RGB_WRITE BIT(9) /* enable writes to rgb area */
# define EN_ALPHA_WRITE BIT(10)
# define ENGINE_INVERT_Y BIT(17) /* invert Y origin (pipe) */
#define LFBMODE 0x0114
# define LFB_565 0 /* bits 3:0 .16 bits RGB */
# define LFB_888 4 /* 24 bits RGB */
# define LFB_8888 5 /* 32 bits ARGB */
# define WR_BUFF_FRONT 0 /* write buf select (front) */
# define WR_BUFF_BACK (1 << 4) /* back */
# define RD_BUFF_FRONT 0 /* read buff select (front) */
# define RD_BUFF_BACK (1 << 6) /* back */
# define EN_PXL_PIPELINE BIT(8) /* pixel pipeline (clip..)*/
# define LFB_WORD_SWIZZLE_WR BIT(11) /* enable write-wordswap (big-endian) */
# define LFB_BYTE_SWIZZLE_WR BIT(12) /* enable write-byteswap (big-endian) */
# define LFB_INVERT_Y BIT(13) /* invert Y origin (LFB) */
# define LFB_WORD_SWIZZLE_RD BIT(15) /* enable read-wordswap (big-endian) */
# define LFB_BYTE_SWIZZLE_RD BIT(16) /* enable read-byteswap (big-endian) */
#define CLIP_LEFT_RIGHT 0x0118
#define CLIP_LOWY_HIGHY 0x011c
#define NOPCMD 0x0120
#define FASTFILLCMD 0x0124
#define SWAPBUFFCMD 0x0128
#define FBIINIT4 0x0200 /* misc controls */
# define FAST_PCI_READS 0 /* 1 waitstate */
# define SLOW_PCI_READS BIT(0) /* 2 ws */
# define LFB_READ_AHEAD BIT(1)
#define BACKPORCH 0x0208
#define VIDEODIMENSIONS 0x020c
#define FBIINIT0 0x0210 /* misc+fifo controls */
# define DIS_VGA_PASSTHROUGH BIT(0)
# define FBI_RESET BIT(1)
# define FIFO_RESET BIT(2)
#define FBIINIT1 0x0214 /* PCI + video controls */
# define VIDEO_MASK 0x8080010f /* masks video related bits V1+V2*/
# define FAST_PCI_WRITES 0 /* 0 ws */
# define SLOW_PCI_WRITES BIT(1) /* 1 ws */
# define EN_LFB_READ BIT(3)
# define TILES_IN_X_SHIFT 4
# define VIDEO_RESET BIT(8)
# define EN_BLANKING BIT(12)
# define EN_DATA_OE BIT(13)
# define EN_BLANK_OE BIT(14)
# define EN_HVSYNC_OE BIT(15)
# define EN_DCLK_OE BIT(16)
# define SEL_INPUT_VCLK_2X 0 /* bit 17 */
# define SEL_INPUT_VCLK_SLAVE BIT(17)
# define SEL_SOURCE_VCLK_SLAVE 0 /* bits 21:20 */
# define SEL_SOURCE_VCLK_2X_DIV2 (0x01 << 20)
# define SEL_SOURCE_VCLK_2X_SEL (0x02 << 20)
# define EN_24BPP BIT(22)
# define TILES_IN_X_MSB_SHIFT 24 /* v2 */
# define VCLK_2X_SEL_DEL_SHIFT 27 /* vclk out delay 0,4,6,8ns */
# define VCLK_DEL_SHIFT 29 /* vclk in delay */
#define FBIINIT2 0x0218 /* Dram controls */
# define EN_FAST_RAS_READ BIT(5)
# define EN_DRAM_OE BIT(6)
# define EN_FAST_RD_AHEAD_WR BIT(7)
# define VIDEO_OFFSET_SHIFT 11 /* unit: #rows tile 64x16/2 */
# define SWAP_DACVSYNC 0
# define SWAP_DACDATA0 (1 << 9)
# define SWAP_FIFO_STALL (2 << 9)
# define EN_RD_AHEAD_FIFO BIT(21)
# define EN_DRAM_REFRESH BIT(22)
# define DRAM_REFRESH_16 (0x30 << 23) /* dram 16 ms */
#define DAC_READ FBIINIT2 /* in remap mode */
#define FBIINIT3 0x021c /* fbi controls */
# define DISABLE_TEXTURE BIT(6)
# define Y_SWAP_ORIGIN_SHIFT 22 /* Y swap substraction value */
#define HSYNC 0x0220
#define VSYNC 0x0224
#define DAC_DATA 0x022c
# define DAC_READ_CMD BIT(11) /* set read dacreg mode */
#define FBIINIT5 0x0244 /* v2 specific */
# define FBIINIT5_MASK 0xfa40ffff /* mask video bits*/
# define HDOUBLESCAN BIT(20)
# define VDOUBLESCAN BIT(21)
# define HSYNC_HIGH BIT(23)
# define VSYNC_HIGH BIT(24)
# define INTERLACE BIT(26)
#define FBIINIT6 0x0248 /* v2 specific */
# define TILES_IN_X_LSB_SHIFT 30 /* v2 */
#define FBIINIT7 0x024c /* v2 specific */
#define BLTSRCBASEADDR 0x02c0 /* BitBLT Source base address */
#define BLTDSTBASEADDR 0x02c4 /* BitBLT Destination base address */
#define BLTXYSTRIDES 0x02c8 /* BitBLT Source and Destination strides */
#define BLTSRCCHROMARANGE 0x02cc /* BitBLT Source Chroma key range */
#define BLTDSTCHROMARANGE 0x02d0 /* BitBLT Destination Chroma key range */
#define BLTCLIPX 0x02d4 /* BitBLT Min/Max X clip values */
#define BLTCLIPY 0x02d8 /* BitBLT Min/Max Y clip values */
#define BLTSRCXY 0x02e0 /* BitBLT Source starting XY coordinates */
#define BLTDSTXY 0x02e4 /* BitBLT Destination starting XY coordinates */
#define BLTSIZE 0x02e8 /* BitBLT width and height */
#define BLTROP 0x02ec /* BitBLT Raster operations */
# define BLTROP_COPY 0x0cccc
# define BLTROP_INVERT 0x05555
# define BLTROP_XOR 0x06666
#define BLTCOLOR 0x02f0 /* BitBLT and foreground background colors */
#define BLTCOMMAND 0x02f8 /* BitBLT command mode (v2 specific) */
# define BLT_SCR2SCR_BITBLT 0 /* Screen-to-Screen BitBLT */
# define BLT_CPU2SCR_BITBLT 1 /* CPU-to-screen BitBLT */
# define BLT_RECFILL_BITBLT 2 /* BitBLT Rectangle Fill */
# define BLT_16BPP_FMT 2 /* 16 BPP (5-6-5 RGB) */
#define BLTDATA 0x02fc /* BitBLT data for CPU-to-Screen BitBLTs */
# define LAUNCH_BITBLT BIT(31) /* Launch BitBLT in BltCommand, bltDstXY or bltSize */
/* Dac Registers */
#define DACREG_WMA 0x0 /* pixel write mode address */
#define DACREG_LUT 0x01 /* color value */
#define DACREG_RMR 0x02 /* pixel mask */
#define DACREG_RMA 0x03 /* pixel read mode address */
/*Dac registers in indexed mode (TI, ATT dacs) */
#define DACREG_ADDR_I DACREG_WMA
#define DACREG_DATA_I DACREG_RMR
#define DACREG_RMR_I 0x00
#define DACREG_CR0_I 0x01
# define DACREG_CR0_EN_INDEXED BIT(0) /* enable indexec mode */
# define DACREG_CR0_8BIT BIT(1) /* set dac to 8 bits/read */
# define DACREG_CR0_PWDOWN BIT(3) /* powerdown dac */
# define DACREG_CR0_16BPP 0x30 /* mode 3 */
# define DACREG_CR0_24BPP 0x50 /* mode 5 */
#define DACREG_CR1_I 0x05
#define DACREG_CC_I 0x06
# define DACREG_CC_CLKA BIT(7) /* clk A controled by regs */
# define DACREG_CC_CLKA_C (2<<4) /* clk A uses reg C */
# define DACREG_CC_CLKB BIT(3) /* clk B controled by regs */
# define DACREG_CC_CLKB_D 3 /* clkB uses reg D */
#define DACREG_AC0_I 0x48 /* clock A reg C */
#define DACREG_AC1_I 0x49
#define DACREG_BD0_I 0x6c /* clock B reg D */
#define DACREG_BD1_I 0x6d
/* identification constants */
#define DACREG_MIR_TI 0x97
#define DACREG_DIR_TI 0x09
#define DACREG_MIR_ATT 0x84
#define DACREG_DIR_ATT 0x09
/* ics dac specific registers */
#define DACREG_ICS_PLLWMA 0x04 /* PLL write mode address */
#define DACREG_ICS_PLLDATA 0x05 /* PLL data /parameter */
#define DACREG_ICS_CMD 0x06 /* command */
# define DACREG_ICS_CMD_16BPP 0x50 /* ics color mode 6 (16bpp bypass)*/
# define DACREG_ICS_CMD_24BPP 0x70 /* ics color mode 7 (24bpp bypass)*/
# define DACREG_ICS_CMD_PWDOWN BIT(0) /* powerdown dac */
#define DACREG_ICS_PLLRMA 0x07 /* PLL read mode address */
/*
* pll parameter register:
* indexed : write addr to PLLWMA, write data in PLLDATA.
* for reads use PLLRMA .
* 8 freq registers (0-7) for video clock (CLK0)
* 2 freq registers (a-b) for graphic clock (CLK1)
*/
#define DACREG_ICS_PLL_CLK0_1_INI 0x55 /* initial pll M value for freq f1 */
#define DACREG_ICS_PLL_CLK0_7_INI 0x71 /* f7 */
#define DACREG_ICS_PLL_CLK1_B_INI 0x79 /* fb */
#define DACREG_ICS_PLL_CTRL 0x0e
# define DACREG_ICS_CLK0 BIT(5)
# define DACREG_ICS_CLK0_0 0
# define DACREG_ICS_CLK1_A 0 /* bit4 */
/* sst default init registers */
#define FBIINIT0_DEFAULT DIS_VGA_PASSTHROUGH
#define FBIINIT1_DEFAULT \
( \
FAST_PCI_WRITES \
/* SLOW_PCI_WRITES*/ \
| VIDEO_RESET \
| 10 << TILES_IN_X_SHIFT\
| SEL_SOURCE_VCLK_2X_SEL\
| EN_LFB_READ \
)
#define FBIINIT2_DEFAULT \
( \
SWAP_DACVSYNC \
| EN_DRAM_OE \
| DRAM_REFRESH_16 \
| EN_DRAM_REFRESH \
| EN_FAST_RAS_READ \
| EN_RD_AHEAD_FIFO \
| EN_FAST_RD_AHEAD_WR \
)
#define FBIINIT3_DEFAULT \
( DISABLE_TEXTURE )
#define FBIINIT4_DEFAULT \
( \
FAST_PCI_READS \
/* SLOW_PCI_READS*/ \
| LFB_READ_AHEAD \
)
/* Careful with this one : writing back the data just read will trash the DAC
reading some fields give logic value on pins, but setting this field will
set the source signal driving the pin. conclusion : just use the default
as a base before writing back .
*/
#define FBIINIT6_DEFAULT (0x0)
/*
*
* Misc Const
*
*/
/* ioctl to enable/disable VGA passthrough */
#define SSTFB_SET_VGAPASS _IOW('F', 0xdd, __u32)
#define SSTFB_GET_VGAPASS _IOR('F', 0xdd, __u32)
/* used to know witch clock to set */
enum {
VID_CLOCK=0,
GFX_CLOCK=1,
};
/* freq max */
#define DAC_FREF 14318 /* DAC reference freq (Khz) */
#define VCO_MAX 260000
/*
* driver structs
*/
struct pll_timing {
unsigned int m;
unsigned int n;
unsigned int p;
};
struct dac_switch {
const char *name;
int (*detect) (struct fb_info *info);
int (*set_pll) (struct fb_info *info, const struct pll_timing *t, const int clock);
void (*set_vidmod) (struct fb_info *info, const int bpp);
};
struct sst_spec {
char * name;
int default_gfx_clock; /* 50000 for voodoo1, 75000 for voodoo2 */
int max_gfxclk; /* ! in Mhz ie 60 for voodoo 1 */
};
struct sstfb_par {
u32 palette[16];
unsigned int yDim;
unsigned int hSyncOn; /* hsync_len */
unsigned int hSyncOff; /* left_margin + xres + right_margin */
unsigned int hBackPorch;/* left_margin */
unsigned int vSyncOn;
unsigned int vSyncOff;
unsigned int vBackPorch;
struct pll_timing pll;
unsigned int tiles_in_X;/* num of tiles in X res */
u8 __iomem *mmio_vbase;
struct dac_switch dac_sw; /* dac specific functions */
struct pci_dev *dev;
int type;
u8 revision;
u8 vgapass; /* VGA pass through: 1=enabled, 0=disabled */
};
#endif /* _SSTFB_H_ */

194
include/video/tdfx.h Normal file
View File

@@ -0,0 +1,194 @@
#ifndef _TDFX_H
#define _TDFX_H
/* membase0 register offsets */
#define STATUS 0x00
#define PCIINIT0 0x04
#define SIPMONITOR 0x08
#define LFBMEMORYCONFIG 0x0c
#define MISCINIT0 0x10
#define MISCINIT1 0x14
#define DRAMINIT0 0x18
#define DRAMINIT1 0x1c
#define AGPINIT 0x20
#define TMUGBEINIT 0x24
#define VGAINIT0 0x28
#define VGAINIT1 0x2c
#define DRAMCOMMAND 0x30
#define DRAMDATA 0x34
/* reserved 0x38 */
/* reserved 0x3c */
#define PLLCTRL0 0x40
#define PLLCTRL1 0x44
#define PLLCTRL2 0x48
#define DACMODE 0x4c
#define DACADDR 0x50
#define DACDATA 0x54
#define RGBMAXDELTA 0x58
#define VIDPROCCFG 0x5c
#define HWCURPATADDR 0x60
#define HWCURLOC 0x64
#define HWCURC0 0x68
#define HWCURC1 0x6c
#define VIDINFORMAT 0x70
#define VIDINSTATUS 0x74
#define VIDSERPARPORT 0x78
#define VIDINXDELTA 0x7c
#define VIDININITERR 0x80
#define VIDINYDELTA 0x84
#define VIDPIXBUFTHOLD 0x88
#define VIDCHRMIN 0x8c
#define VIDCHRMAX 0x90
#define VIDCURLIN 0x94
#define VIDSCREENSIZE 0x98
#define VIDOVRSTARTCRD 0x9c
#define VIDOVRENDCRD 0xa0
#define VIDOVRDUDX 0xa4
#define VIDOVRDUDXOFF 0xa8
#define VIDOVRDVDY 0xac
/* ... */
#define VIDOVRDVDYOFF 0xe0
#define VIDDESKSTART 0xe4
#define VIDDESKSTRIDE 0xe8
#define VIDINADDR0 0xec
#define VIDINADDR1 0xf0
#define VIDINADDR2 0xf4
#define VIDINSTRIDE 0xf8
#define VIDCUROVRSTART 0xfc
#define INTCTRL (0x00100000 + 0x04)
#define CLIP0MIN (0x00100000 + 0x08)
#define CLIP0MAX (0x00100000 + 0x0c)
#define DSTBASE (0x00100000 + 0x10)
#define DSTFORMAT (0x00100000 + 0x14)
#define SRCBASE (0x00100000 + 0x34)
#define COMMANDEXTRA_2D (0x00100000 + 0x38)
#define CLIP1MIN (0x00100000 + 0x4c)
#define CLIP1MAX (0x00100000 + 0x50)
#define SRCFORMAT (0x00100000 + 0x54)
#define SRCSIZE (0x00100000 + 0x58)
#define SRCXY (0x00100000 + 0x5c)
#define COLORBACK (0x00100000 + 0x60)
#define COLORFORE (0x00100000 + 0x64)
#define DSTSIZE (0x00100000 + 0x68)
#define DSTXY (0x00100000 + 0x6c)
#define COMMAND_2D (0x00100000 + 0x70)
#define LAUNCH_2D (0x00100000 + 0x80)
#define COMMAND_3D (0x00200000 + 0x120)
/* register bitfields (not all, only as needed) */
#define BIT(x) (1UL << (x))
/* COMMAND_2D reg. values */
#define TDFX_ROP_COPY 0xcc // src
#define TDFX_ROP_INVERT 0x55 // NOT dst
#define TDFX_ROP_XOR 0x66 // src XOR dst
#define AUTOINC_DSTX BIT(10)
#define AUTOINC_DSTY BIT(11)
#define COMMAND_2D_FILLRECT 0x05
#define COMMAND_2D_S2S_BITBLT 0x01 // screen to screen
#define COMMAND_2D_H2S_BITBLT 0x03 // host to screen
#define COMMAND_3D_NOP 0x00
#define STATUS_RETRACE BIT(6)
#define STATUS_BUSY BIT(9)
#define MISCINIT1_CLUT_INV BIT(0)
#define MISCINIT1_2DBLOCK_DIS BIT(15)
#define DRAMINIT0_SGRAM_NUM BIT(26)
#define DRAMINIT0_SGRAM_TYPE BIT(27)
#define DRAMINIT0_SGRAM_TYPE_MASK (BIT(27)|BIT(28)|BIT(29))
#define DRAMINIT0_SGRAM_TYPE_SHIFT 27
#define DRAMINIT1_MEM_SDRAM BIT(30)
#define VGAINIT0_VGA_DISABLE BIT(0)
#define VGAINIT0_EXT_TIMING BIT(1)
#define VGAINIT0_8BIT_DAC BIT(2)
#define VGAINIT0_EXT_ENABLE BIT(6)
#define VGAINIT0_WAKEUP_3C3 BIT(8)
#define VGAINIT0_LEGACY_DISABLE BIT(9)
#define VGAINIT0_ALT_READBACK BIT(10)
#define VGAINIT0_FAST_BLINK BIT(11)
#define VGAINIT0_EXTSHIFTOUT BIT(12)
#define VGAINIT0_DECODE_3C6 BIT(13)
#define VGAINIT0_SGRAM_HBLANK_DISABLE BIT(22)
#define VGAINIT1_MASK 0x1fffff
#define VIDCFG_VIDPROC_ENABLE BIT(0)
#define VIDCFG_CURS_X11 BIT(1)
#define VIDCFG_INTERLACE BIT(3)
#define VIDCFG_HALF_MODE BIT(4)
#define VIDCFG_DESK_ENABLE BIT(7)
#define VIDCFG_CLUT_BYPASS BIT(10)
#define VIDCFG_2X BIT(26)
#define VIDCFG_HWCURSOR_ENABLE BIT(27)
#define VIDCFG_PIXFMT_SHIFT 18
#define DACMODE_2X BIT(0)
/* VGA rubbish, need to change this for multihead support */
#define MISC_W 0x3c2
#define MISC_R 0x3cc
#define SEQ_I 0x3c4
#define SEQ_D 0x3c5
#define CRT_I 0x3d4
#define CRT_D 0x3d5
#define ATT_IW 0x3c0
#define IS1_R 0x3da
#define GRA_I 0x3ce
#define GRA_D 0x3cf
#ifdef __KERNEL__
struct banshee_reg {
/* VGA rubbish */
unsigned char att[21];
unsigned char crt[25];
unsigned char gra[ 9];
unsigned char misc[1];
unsigned char seq[ 5];
/* Banshee extensions */
unsigned char ext[2];
unsigned long vidcfg;
unsigned long vidpll;
unsigned long mempll;
unsigned long gfxpll;
unsigned long dacmode;
unsigned long vgainit0;
unsigned long vgainit1;
unsigned long screensize;
unsigned long stride;
unsigned long cursloc;
unsigned long curspataddr;
unsigned long cursc0;
unsigned long cursc1;
unsigned long startaddr;
unsigned long clip0min;
unsigned long clip0max;
unsigned long clip1min;
unsigned long clip1max;
unsigned long srcbase;
unsigned long dstbase;
unsigned long miscinit0;
};
struct tdfx_par {
u32 max_pixclock;
u32 palette[16];
void __iomem *regbase_virt;
unsigned long iobase;
u32 baseline;
struct {
int w,u,d;
unsigned long enable,disable;
struct timer_list timer;
} hwcursor;
spinlock_t DAClock;
};
#endif /* __KERNEL__ */
#endif /* _TDFX_H */

238
include/video/tgafb.h Normal file
View File

@@ -0,0 +1,238 @@
/*
* linux/drivers/video/tgafb.h -- DEC 21030 TGA frame buffer device
*
* Copyright (C) 1999,2000 Martin Lucina, Tom Zerucha
*
* $Id: tgafb.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#ifndef TGAFB_H
#define TGAFB_H
/*
* TGA hardware description (minimal)
*/
#define TGA_TYPE_8PLANE 0
#define TGA_TYPE_24PLANE 1
#define TGA_TYPE_24PLUSZ 3
/*
* Offsets within Memory Space
*/
#define TGA_ROM_OFFSET 0x0000000
#define TGA_REGS_OFFSET 0x0100000
#define TGA_8PLANE_FB_OFFSET 0x0200000
#define TGA_24PLANE_FB_OFFSET 0x0804000
#define TGA_24PLUSZ_FB_OFFSET 0x1004000
#define TGA_FOREGROUND_REG 0x0020
#define TGA_BACKGROUND_REG 0x0024
#define TGA_PLANEMASK_REG 0x0028
#define TGA_PIXELMASK_ONESHOT_REG 0x002c
#define TGA_MODE_REG 0x0030
#define TGA_RASTEROP_REG 0x0034
#define TGA_PIXELSHIFT_REG 0x0038
#define TGA_DEEP_REG 0x0050
#define TGA_PIXELMASK_REG 0x005c
#define TGA_CURSOR_BASE_REG 0x0060
#define TGA_HORIZ_REG 0x0064
#define TGA_VERT_REG 0x0068
#define TGA_BASE_ADDR_REG 0x006c
#define TGA_VALID_REG 0x0070
#define TGA_CURSOR_XY_REG 0x0074
#define TGA_INTR_STAT_REG 0x007c
#define TGA_DATA_REG 0x0080
#define TGA_RAMDAC_SETUP_REG 0x00c0
#define TGA_BLOCK_COLOR0_REG 0x0140
#define TGA_BLOCK_COLOR1_REG 0x0144
#define TGA_BLOCK_COLOR2_REG 0x0148
#define TGA_BLOCK_COLOR3_REG 0x014c
#define TGA_BLOCK_COLOR4_REG 0x0150
#define TGA_BLOCK_COLOR5_REG 0x0154
#define TGA_BLOCK_COLOR6_REG 0x0158
#define TGA_BLOCK_COLOR7_REG 0x015c
#define TGA_COPY64_SRC 0x0160
#define TGA_COPY64_DST 0x0164
#define TGA_CLOCK_REG 0x01e8
#define TGA_RAMDAC_REG 0x01f0
#define TGA_CMD_STAT_REG 0x01f8
/*
* Useful defines for managing the registers
*/
#define TGA_HORIZ_ODD 0x80000000
#define TGA_HORIZ_POLARITY 0x40000000
#define TGA_HORIZ_ACT_MSB 0x30000000
#define TGA_HORIZ_BP 0x0fe00000
#define TGA_HORIZ_SYNC 0x001fc000
#define TGA_HORIZ_FP 0x00007c00
#define TGA_HORIZ_ACT_LSB 0x000001ff
#define TGA_VERT_SE 0x80000000
#define TGA_VERT_POLARITY 0x40000000
#define TGA_VERT_RESERVED 0x30000000
#define TGA_VERT_BP 0x0fc00000
#define TGA_VERT_SYNC 0x003f0000
#define TGA_VERT_FP 0x0000f800
#define TGA_VERT_ACTIVE 0x000007ff
#define TGA_VALID_VIDEO 0x01
#define TGA_VALID_BLANK 0x02
#define TGA_VALID_CURSOR 0x04
#define TGA_MODE_SBM_8BPP 0x000
#define TGA_MODE_SBM_24BPP 0x300
#define TGA_MODE_SIMPLE 0x00
#define TGA_MODE_SIMPLEZ 0x10
#define TGA_MODE_OPAQUE_STIPPLE 0x01
#define TGA_MODE_OPAQUE_FILL 0x21
#define TGA_MODE_TRANSPARENT_STIPPLE 0x03
#define TGA_MODE_TRANSPARENT_FILL 0x23
#define TGA_MODE_BLOCK_STIPPLE 0x0d
#define TGA_MODE_BLOCK_FILL 0x2d
#define TGA_MODE_COPY 0x07
#define TGA_MODE_DMA_READ_COPY_ND 0x17
#define TGA_MODE_DMA_READ_COPY_D 0x37
#define TGA_MODE_DMA_WRITE_COPY 0x1f
/*
* Useful defines for managing the ICS1562 PLL clock
*/
#define TGA_PLL_BASE_FREQ 14318 /* .18 */
#define TGA_PLL_MAX_FREQ 230000
/*
* Useful defines for managing the BT485 on the 8-plane TGA
*/
#define BT485_READ_BIT 0x01
#define BT485_WRITE_BIT 0x00
#define BT485_ADDR_PAL_WRITE 0x00
#define BT485_DATA_PAL 0x02
#define BT485_PIXEL_MASK 0x04
#define BT485_ADDR_PAL_READ 0x06
#define BT485_ADDR_CUR_WRITE 0x08
#define BT485_DATA_CUR 0x0a
#define BT485_CMD_0 0x0c
#define BT485_ADDR_CUR_READ 0x0e
#define BT485_CMD_1 0x10
#define BT485_CMD_2 0x12
#define BT485_STATUS 0x14
#define BT485_CMD_3 0x14
#define BT485_CUR_RAM 0x16
#define BT485_CUR_LOW_X 0x18
#define BT485_CUR_HIGH_X 0x1a
#define BT485_CUR_LOW_Y 0x1c
#define BT485_CUR_HIGH_Y 0x1e
/*
* Useful defines for managing the BT463 on the 24-plane TGAs
*/
#define BT463_ADDR_LO 0x0
#define BT463_ADDR_HI 0x1
#define BT463_REG_ACC 0x2
#define BT463_PALETTE 0x3
#define BT463_CUR_CLR_0 0x0100
#define BT463_CUR_CLR_1 0x0101
#define BT463_CMD_REG_0 0x0201
#define BT463_CMD_REG_1 0x0202
#define BT463_CMD_REG_2 0x0203
#define BT463_READ_MASK_0 0x0205
#define BT463_READ_MASK_1 0x0206
#define BT463_READ_MASK_2 0x0207
#define BT463_READ_MASK_3 0x0208
#define BT463_BLINK_MASK_0 0x0209
#define BT463_BLINK_MASK_1 0x020a
#define BT463_BLINK_MASK_2 0x020b
#define BT463_BLINK_MASK_3 0x020c
#define BT463_WINDOW_TYPE_BASE 0x0300
/*
* The framebuffer driver private data.
*/
struct tga_par {
/* PCI device. */
struct pci_dev *pdev;
/* Device dependent information. */
void __iomem *tga_mem_base;
void __iomem *tga_fb_base;
void __iomem *tga_regs_base;
u8 tga_type; /* TGA_TYPE_XXX */
u8 tga_chip_rev; /* dc21030 revision */
/* Remember blank mode. */
u8 vesa_blanked;
/* Define the video mode. */
u32 xres, yres; /* resolution in pixels */
u32 htimings; /* horizontal timing register */
u32 vtimings; /* vertical timing register */
u32 pll_freq; /* pixclock in mhz */
u32 bits_per_pixel; /* bits per pixel */
u32 sync_on_green; /* set if sync is on green */
};
/*
* Macros for reading/writing TGA and RAMDAC registers
*/
static inline void
TGA_WRITE_REG(struct tga_par *par, u32 v, u32 r)
{
writel(v, par->tga_regs_base +r);
}
static inline u32
TGA_READ_REG(struct tga_par *par, u32 r)
{
return readl(par->tga_regs_base +r);
}
static inline void
BT485_WRITE(struct tga_par *par, u8 v, u8 r)
{
TGA_WRITE_REG(par, r, TGA_RAMDAC_SETUP_REG);
TGA_WRITE_REG(par, v | (r << 8), TGA_RAMDAC_REG);
}
static inline void
BT463_LOAD_ADDR(struct tga_par *par, u16 a)
{
TGA_WRITE_REG(par, BT463_ADDR_LO<<2, TGA_RAMDAC_SETUP_REG);
TGA_WRITE_REG(par, (BT463_ADDR_LO<<10) | (a & 0xff), TGA_RAMDAC_REG);
TGA_WRITE_REG(par, BT463_ADDR_HI<<2, TGA_RAMDAC_SETUP_REG);
TGA_WRITE_REG(par, (BT463_ADDR_HI<<10) | (a >> 8), TGA_RAMDAC_REG);
}
static inline void
BT463_WRITE(struct tga_par *par, u32 m, u16 a, u8 v)
{
BT463_LOAD_ADDR(par, a);
TGA_WRITE_REG(par, m << 2, TGA_RAMDAC_SETUP_REG);
TGA_WRITE_REG(par, m << 10 | v, TGA_RAMDAC_REG);
}
#endif /* TGAFB_H */

175
include/video/trident.h Normal file
View File

@@ -0,0 +1,175 @@
#ifndef TRIDENTFB_DEBUG
#define TRIDENTFB_DEBUG 0
#endif
#if TRIDENTFB_DEBUG
#define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a);mdelay(1000);
#else
#define debug(f,a...)
#endif
#define output(f, a...) pr_info("tridentfb: " f, ## a)
#define Kb (1024)
#define Mb (Kb*Kb)
/* PCI IDS of supported cards temporarily here */
#define CYBER9320 0x9320
#define CYBER9388 0x9388
#define CYBER9382 0x9382 /* the real PCI id for this is 9660 */
#define CYBER9385 0x9385 /* ditto */
#define CYBER9397 0x9397
#define CYBER9397DVD 0x939A
#define CYBER9520 0x9520
#define CYBER9525DVD 0x9525
#define TGUI9660 0x9660
#define IMAGE975 0x9750
#define IMAGE985 0x9850
#define BLADE3D 0x9880
#define CYBERBLADEE4 0x9540
#define CYBERBLADEi7 0x8400
#define CYBERBLADEi7D 0x8420
#define CYBERBLADEi1 0x8500
#define CYBERBLADEi1D 0x8520
#define CYBERBLADEAi1 0x8600
#define CYBERBLADEAi1D 0x8620
#define CYBERBLADEXPAi1 0x8820
#define CYBERBLADEXPm8 0x9910
#define CYBERBLADEXPm16 0x9930
/* acceleration families */
#define IMAGE 0
#define BLADE 1
#define XP 2
#define is_image(id)
#define is_xp(id) ((id == CYBERBLADEXPAi1) ||\
(id == CYBERBLADEXPm8) ||\
(id == CYBERBLADEXPm16))
#define is_blade(id) ((id == BLADE3D) ||\
(id == CYBERBLADEE4) ||\
(id == CYBERBLADEi7) ||\
(id == CYBERBLADEi7D) ||\
(id == CYBERBLADEi1) ||\
(id == CYBERBLADEi1D) ||\
(id == CYBERBLADEAi1) ||\
(id == CYBERBLADEAi1D))
/* these defines are for 'lcd' variable */
#define LCD_STRETCH 0
#define LCD_CENTER 1
#define LCD_BIOS 2
/* display types */
#define DISPLAY_CRT 0
#define DISPLAY_FP 1
#define flatpanel (displaytype == DISPLAY_FP)
/* General Registers */
#define SPR 0x1F /* Software Programming Register (videoram) */
/* 3C4 */
#define RevisionID 0x09
#define OldOrNew 0x0B
#define ConfPort1 0x0C
#define ConfPort2 0x0C
#define NewMode2 0x0D
#define NewMode1 0x0E
#define Protection 0x11
#define MCLKLow 0x16
#define MCLKHigh 0x17
#define ClockLow 0x18
#define ClockHigh 0x19
#define SSetup 0x20
#define SKey 0x37
#define SPKey 0x57
/* 0x3x4 */
#define CRTHTotal 0x00
#define CRTHDispEnd 0x01
#define CRTHBlankStart 0x02
#define CRTHBlankEnd 0x03
#define CRTHSyncStart 0x04
#define CRTHSyncEnd 0x05
#define CRTVTotal 0x06
#define CRTVDispEnd 0x12
#define CRTVBlankStart 0x15
#define CRTVBlankEnd 0x16
#define CRTVSyncStart 0x10
#define CRTVSyncEnd 0x11
#define CRTOverflow 0x07
#define CRTPRowScan 0x08
#define CRTMaxScanLine 0x09
#define CRTModeControl 0x17
#define CRTLineCompare 0x18
/* 3x4 */
#define StartAddrHigh 0x0C
#define StartAddrLow 0x0D
#define Offset 0x13
#define Underline 0x14
#define CRTCMode 0x17
#define CRTCModuleTest 0x1E
#define FIFOControl 0x20
#define LinearAddReg 0x21
#define DRAMTiming 0x23
#define New32 0x23
#define RAMDACTiming 0x25
#define CRTHiOrd 0x27
#define AddColReg 0x29
#define InterfaceSel 0x2A
#define HorizOverflow 0x2B
#define GETest 0x2D
#define Performance 0x2F
#define GraphEngReg 0x36
#define I2C 0x37
#define PixelBusReg 0x38
#define PCIReg 0x39
#define DRAMControl 0x3A
#define MiscContReg 0x3C
#define CursorXLow 0x40
#define CursorXHigh 0x41
#define CursorYLow 0x42
#define CursorYHigh 0x43
#define CursorLocLow 0x44
#define CursorLocHigh 0x45
#define CursorXOffset 0x46
#define CursorYOffset 0x47
#define CursorFG1 0x48
#define CursorFG2 0x49
#define CursorFG3 0x4A
#define CursorFG4 0x4B
#define CursorBG1 0x4C
#define CursorBG2 0x4D
#define CursorBG3 0x4E
#define CursorBG4 0x4F
#define CursorControl 0x50
#define PCIRetry 0x55
#define PreEndControl 0x56
#define PreEndFetch 0x57
#define PCIMaster 0x60
#define Enhancement0 0x62
#define NewEDO 0x64
#define TVinterface 0xC0
#define TVMode 0xC1
#define ClockControl 0xCF
/* 3CE */
#define MiscExtFunc 0x0F
#define PowerStatus 0x23
#define MiscIntContReg 0x2F
#define CyberControl 0x30
#define CyberEnhance 0x31
#define FPConfig 0x33
#define VertStretch 0x52
#define HorStretch 0x53
#define BiosMode 0x5c
#define BiosReg 0x5d

62
include/video/tx3912.h Normal file
View File

@@ -0,0 +1,62 @@
/*
* linux/include/video/tx3912.h
*
* Copyright (C) 2001 Steven Hill (sjhill@realitydiluted.com)
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*
* Includes for TMPR3912/05 and PR31700 LCD controller registers
*/
#include <asm/tx3912.h>
#define VidCtrl1 REG_AT(0x028)
#define VidCtrl2 REG_AT(0x02C)
#define VidCtrl3 REG_AT(0x030)
#define VidCtrl4 REG_AT(0x034)
#define VidCtrl5 REG_AT(0x038)
#define VidCtrl6 REG_AT(0x03C)
#define VidCtrl7 REG_AT(0x040)
#define VidCtrl8 REG_AT(0x044)
#define VidCtrl9 REG_AT(0x048)
#define VidCtrl10 REG_AT(0x04C)
#define VidCtrl11 REG_AT(0x050)
#define VidCtrl12 REG_AT(0x054)
#define VidCtrl13 REG_AT(0x058)
#define VidCtrl14 REG_AT(0x05C)
/* Video Control 1 Register */
#define LINECNT 0xffc00000
#define LINECNT_SHIFT 22
#define LOADDLY BIT(21)
#define BAUDVAL (BIT(20) | BIT(19) | BIT(18) | BIT(17) | BIT(16))
#define BAUDVAL_SHIFT 16
#define VIDDONEVAL (BIT(15) | BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9))
#define VIDDONEVAL_SHIFT 9
#define ENFREEZEFRAME BIT(8)
#define TX3912_VIDCTRL1_BITSEL_MASK 0x000000c0
#define TX3912_VIDCTRL1_2BIT_GRAY 0x00000040
#define TX3912_VIDCTRL1_4BIT_GRAY 0x00000080
#define TX3912_VIDCTRL1_8BIT_COLOR 0x000000c0
#define BITSEL_SHIFT 6
#define DISPSPLIT BIT(5)
#define DISP8 BIT(4)
#define DFMODE BIT(3)
#define INVVID BIT(2)
#define DISPON BIT(1)
#define ENVID BIT(0)
/* Video Control 2 Register */
#define VIDRATE_MASK 0xffc00000
#define VIDRATE_SHIFT 22
#define HORZVAL_MASK 0x001ff000
#define HORZVAL_SHIFT 12
#define LINEVAL_MASK 0x000001ff
/* Video Control 3 Register */
#define TX3912_VIDCTRL3_VIDBANK_MASK 0xfff00000
#define TX3912_VIDCTRL3_VIDBASEHI_MASK 0x000ffff0
/* Video Control 4 Register */
#define TX3912_VIDCTRL4_VIDBASELO_MASK 0x000ffff0

481
include/video/vga.h Normal file
View File

@@ -0,0 +1,481 @@
/*
* linux/include/video/vga.h -- standard VGA chipset interaction
*
* Copyright 1999 Jeff Garzik <jgarzik@pobox.com>
*
* Copyright history from vga16fb.c:
* Copyright 1999 Ben Pfaff and Petr Vandrovec
* Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
* Based on VESA framebuffer (c) 1998 Gerd Knorr
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*
*/
#ifndef __linux_video_vga_h__
#define __linux_video_vga_h__
#include <linux/types.h>
#include <asm/io.h>
#ifndef CONFIG_AMIGA
#include <asm/vga.h>
#else
/*
* FIXME
* Ugh, we don't have PCI space, so map readb() and friends to use Zorro space
* for MMIO accesses. This should make cirrusfb work again on Amiga
*/
#undef inb_p
#undef inw_p
#undef outb_p
#undef outw
#undef readb
#undef writeb
#undef writew
#define inb_p(port) 0
#define inw_p(port) 0
#define outb_p(port, val) do { } while (0)
#define outw(port, val) do { } while (0)
#define readb z_readb
#define writeb z_writeb
#define writew z_writew
#endif
#include <asm/byteorder.h>
/* Some of the code below is taken from SVGAlib. The original,
unmodified copyright notice for that code is below. */
/* VGAlib version 1.2 - (c) 1993 Tommy Frandsen */
/* */
/* This library is free software; you can redistribute it and/or */
/* modify it without any restrictions. This library is distributed */
/* in the hope that it will be useful, but without any warranty. */
/* Multi-chipset support Copyright 1993 Harm Hanemaayer */
/* partially copyrighted (C) 1993 by Hartmut Schirmer */
/* VGA data register ports */
#define VGA_CRT_DC 0x3D5 /* CRT Controller Data Register - color emulation */
#define VGA_CRT_DM 0x3B5 /* CRT Controller Data Register - mono emulation */
#define VGA_ATT_R 0x3C1 /* Attribute Controller Data Read Register */
#define VGA_ATT_W 0x3C0 /* Attribute Controller Data Write Register */
#define VGA_GFX_D 0x3CF /* Graphics Controller Data Register */
#define VGA_SEQ_D 0x3C5 /* Sequencer Data Register */
#define VGA_MIS_R 0x3CC /* Misc Output Read Register */
#define VGA_MIS_W 0x3C2 /* Misc Output Write Register */
#define VGA_FTC_R 0x3CA /* Feature Control Read Register */
#define VGA_IS1_RC 0x3DA /* Input Status Register 1 - color emulation */
#define VGA_IS1_RM 0x3BA /* Input Status Register 1 - mono emulation */
#define VGA_PEL_D 0x3C9 /* PEL Data Register */
#define VGA_PEL_MSK 0x3C6 /* PEL mask register */
/* EGA-specific registers */
#define EGA_GFX_E0 0x3CC /* Graphics enable processor 0 */
#define EGA_GFX_E1 0x3CA /* Graphics enable processor 1 */
/* VGA index register ports */
#define VGA_CRT_IC 0x3D4 /* CRT Controller Index - color emulation */
#define VGA_CRT_IM 0x3B4 /* CRT Controller Index - mono emulation */
#define VGA_ATT_IW 0x3C0 /* Attribute Controller Index & Data Write Register */
#define VGA_GFX_I 0x3CE /* Graphics Controller Index */
#define VGA_SEQ_I 0x3C4 /* Sequencer Index */
#define VGA_PEL_IW 0x3C8 /* PEL Write Index */
#define VGA_PEL_IR 0x3C7 /* PEL Read Index */
/* standard VGA indexes max counts */
#define VGA_CRT_C 0x19 /* Number of CRT Controller Registers */
#define VGA_ATT_C 0x15 /* Number of Attribute Controller Registers */
#define VGA_GFX_C 0x09 /* Number of Graphics Controller Registers */
#define VGA_SEQ_C 0x05 /* Number of Sequencer Registers */
#define VGA_MIS_C 0x01 /* Number of Misc Output Register */
/* VGA misc register bit masks */
#define VGA_MIS_COLOR 0x01
#define VGA_MIS_ENB_MEM_ACCESS 0x02
#define VGA_MIS_DCLK_28322_720 0x04
#define VGA_MIS_ENB_PLL_LOAD (0x04 | 0x08)
#define VGA_MIS_SEL_HIGH_PAGE 0x20
/* VGA CRT controller register indices */
#define VGA_CRTC_H_TOTAL 0
#define VGA_CRTC_H_DISP 1
#define VGA_CRTC_H_BLANK_START 2
#define VGA_CRTC_H_BLANK_END 3
#define VGA_CRTC_H_SYNC_START 4
#define VGA_CRTC_H_SYNC_END 5
#define VGA_CRTC_V_TOTAL 6
#define VGA_CRTC_OVERFLOW 7
#define VGA_CRTC_PRESET_ROW 8
#define VGA_CRTC_MAX_SCAN 9
#define VGA_CRTC_CURSOR_START 0x0A
#define VGA_CRTC_CURSOR_END 0x0B
#define VGA_CRTC_START_HI 0x0C
#define VGA_CRTC_START_LO 0x0D
#define VGA_CRTC_CURSOR_HI 0x0E
#define VGA_CRTC_CURSOR_LO 0x0F
#define VGA_CRTC_V_SYNC_START 0x10
#define VGA_CRTC_V_SYNC_END 0x11
#define VGA_CRTC_V_DISP_END 0x12
#define VGA_CRTC_OFFSET 0x13
#define VGA_CRTC_UNDERLINE 0x14
#define VGA_CRTC_V_BLANK_START 0x15
#define VGA_CRTC_V_BLANK_END 0x16
#define VGA_CRTC_MODE 0x17
#define VGA_CRTC_LINE_COMPARE 0x18
#define VGA_CRTC_REGS VGA_CRT_C
/* VGA CRT controller bit masks */
#define VGA_CR11_LOCK_CR0_CR7 0x80 /* lock writes to CR0 - CR7 */
#define VGA_CR17_H_V_SIGNALS_ENABLED 0x80
/* VGA attribute controller register indices */
#define VGA_ATC_PALETTE0 0x00
#define VGA_ATC_PALETTE1 0x01
#define VGA_ATC_PALETTE2 0x02
#define VGA_ATC_PALETTE3 0x03
#define VGA_ATC_PALETTE4 0x04
#define VGA_ATC_PALETTE5 0x05
#define VGA_ATC_PALETTE6 0x06
#define VGA_ATC_PALETTE7 0x07
#define VGA_ATC_PALETTE8 0x08
#define VGA_ATC_PALETTE9 0x09
#define VGA_ATC_PALETTEA 0x0A
#define VGA_ATC_PALETTEB 0x0B
#define VGA_ATC_PALETTEC 0x0C
#define VGA_ATC_PALETTED 0x0D
#define VGA_ATC_PALETTEE 0x0E
#define VGA_ATC_PALETTEF 0x0F
#define VGA_ATC_MODE 0x10
#define VGA_ATC_OVERSCAN 0x11
#define VGA_ATC_PLANE_ENABLE 0x12
#define VGA_ATC_PEL 0x13
#define VGA_ATC_COLOR_PAGE 0x14
#define VGA_AR_ENABLE_DISPLAY 0x20
/* VGA sequencer register indices */
#define VGA_SEQ_RESET 0x00
#define VGA_SEQ_CLOCK_MODE 0x01
#define VGA_SEQ_PLANE_WRITE 0x02
#define VGA_SEQ_CHARACTER_MAP 0x03
#define VGA_SEQ_MEMORY_MODE 0x04
/* VGA sequencer register bit masks */
#define VGA_SR01_CHAR_CLK_8DOTS 0x01 /* bit 0: character clocks 8 dots wide are generated */
#define VGA_SR01_SCREEN_OFF 0x20 /* bit 5: Screen is off */
#define VGA_SR02_ALL_PLANES 0x0F /* bits 3-0: enable access to all planes */
#define VGA_SR04_EXT_MEM 0x02 /* bit 1: allows complete mem access to 256K */
#define VGA_SR04_SEQ_MODE 0x04 /* bit 2: directs system to use a sequential addressing mode */
#define VGA_SR04_CHN_4M 0x08 /* bit 3: selects modulo 4 addressing for CPU access to display memory */
/* VGA graphics controller register indices */
#define VGA_GFX_SR_VALUE 0x00
#define VGA_GFX_SR_ENABLE 0x01
#define VGA_GFX_COMPARE_VALUE 0x02
#define VGA_GFX_DATA_ROTATE 0x03
#define VGA_GFX_PLANE_READ 0x04
#define VGA_GFX_MODE 0x05
#define VGA_GFX_MISC 0x06
#define VGA_GFX_COMPARE_MASK 0x07
#define VGA_GFX_BIT_MASK 0x08
/* VGA graphics controller bit masks */
#define VGA_GR06_GRAPHICS_MODE 0x01
/* macro for composing an 8-bit VGA register index and value
* into a single 16-bit quantity */
#define VGA_OUT16VAL(v, r) (((v) << 8) | (r))
/* decide whether we should enable the faster 16-bit VGA register writes */
#ifdef __LITTLE_ENDIAN
#define VGA_OUTW_WRITE
#endif
/* VGA State Save and Restore */
#define VGA_SAVE_FONT0 1 /* save/restore plane 2 fonts */
#define VGA_SAVE_FONT1 2 /* save/restore plane 3 fonts */
#define VGA_SAVE_TEXT 4 /* save/restore plane 0/1 fonts */
#define VGA_SAVE_FONTS 7 /* save/restore all fonts */
#define VGA_SAVE_MODE 8 /* save/restore video mode */
#define VGA_SAVE_CMAP 16 /* save/restore color map/DAC */
struct vgastate {
void __iomem *vgabase; /* mmio base, if supported */
unsigned long membase; /* VGA window base, 0 for default - 0xA000 */
__u32 memsize; /* VGA window size, 0 for default 64K */
__u32 flags; /* what state[s] to save (see VGA_SAVE_*) */
__u32 depth; /* current fb depth, not important */
__u32 num_attr; /* number of att registers, 0 for default */
__u32 num_crtc; /* number of crt registers, 0 for default */
__u32 num_gfx; /* number of gfx registers, 0 for default */
__u32 num_seq; /* number of seq registers, 0 for default */
void *vidstate;
};
extern int save_vga(struct vgastate *state);
extern int restore_vga(struct vgastate *state);
/*
* generic VGA port read/write
*/
static inline unsigned char vga_io_r (unsigned short port)
{
return inb_p(port);
}
static inline void vga_io_w (unsigned short port, unsigned char val)
{
outb_p(val, port);
}
static inline void vga_io_w_fast (unsigned short port, unsigned char reg,
unsigned char val)
{
outw(VGA_OUT16VAL (val, reg), port);
}
static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
{
return readb (regbase + port);
}
static inline void vga_mm_w (void __iomem *regbase, unsigned short port, unsigned char val)
{
writeb (val, regbase + port);
}
static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val)
{
writew (VGA_OUT16VAL (val, reg), regbase + port);
}
static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
{
if (regbase)
return vga_mm_r (regbase, port);
else
return vga_io_r (port);
}
static inline void vga_w (void __iomem *regbase, unsigned short port, unsigned char val)
{
if (regbase)
vga_mm_w (regbase, port, val);
else
vga_io_w (port, val);
}
static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val)
{
if (regbase)
vga_mm_w_fast (regbase, port, reg, val);
else
vga_io_w_fast (port, reg, val);
}
/*
* VGA CRTC register read/write
*/
static inline unsigned char vga_rcrt (void __iomem *regbase, unsigned char reg)
{
vga_w (regbase, VGA_CRT_IC, reg);
return vga_r (regbase, VGA_CRT_DC);
}
static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_w_fast (regbase, VGA_CRT_IC, reg, val);
#else
vga_w (regbase, VGA_CRT_IC, reg);
vga_w (regbase, VGA_CRT_DC, val);
#endif /* VGA_OUTW_WRITE */
}
static inline unsigned char vga_io_rcrt (unsigned char reg)
{
vga_io_w (VGA_CRT_IC, reg);
return vga_io_r (VGA_CRT_DC);
}
static inline void vga_io_wcrt (unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_io_w_fast (VGA_CRT_IC, reg, val);
#else
vga_io_w (VGA_CRT_IC, reg);
vga_io_w (VGA_CRT_DC, val);
#endif /* VGA_OUTW_WRITE */
}
static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg)
{
vga_mm_w (regbase, VGA_CRT_IC, reg);
return vga_mm_r (regbase, VGA_CRT_DC);
}
static inline void vga_mm_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_mm_w_fast (regbase, VGA_CRT_IC, reg, val);
#else
vga_mm_w (regbase, VGA_CRT_IC, reg);
vga_mm_w (regbase, VGA_CRT_DC, val);
#endif /* VGA_OUTW_WRITE */
}
/*
* VGA sequencer register read/write
*/
static inline unsigned char vga_rseq (void __iomem *regbase, unsigned char reg)
{
vga_w (regbase, VGA_SEQ_I, reg);
return vga_r (regbase, VGA_SEQ_D);
}
static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_w_fast (regbase, VGA_SEQ_I, reg, val);
#else
vga_w (regbase, VGA_SEQ_I, reg);
vga_w (regbase, VGA_SEQ_D, val);
#endif /* VGA_OUTW_WRITE */
}
static inline unsigned char vga_io_rseq (unsigned char reg)
{
vga_io_w (VGA_SEQ_I, reg);
return vga_io_r (VGA_SEQ_D);
}
static inline void vga_io_wseq (unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_io_w_fast (VGA_SEQ_I, reg, val);
#else
vga_io_w (VGA_SEQ_I, reg);
vga_io_w (VGA_SEQ_D, val);
#endif /* VGA_OUTW_WRITE */
}
static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg)
{
vga_mm_w (regbase, VGA_SEQ_I, reg);
return vga_mm_r (regbase, VGA_SEQ_D);
}
static inline void vga_mm_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_mm_w_fast (regbase, VGA_SEQ_I, reg, val);
#else
vga_mm_w (regbase, VGA_SEQ_I, reg);
vga_mm_w (regbase, VGA_SEQ_D, val);
#endif /* VGA_OUTW_WRITE */
}
/*
* VGA graphics controller register read/write
*/
static inline unsigned char vga_rgfx (void __iomem *regbase, unsigned char reg)
{
vga_w (regbase, VGA_GFX_I, reg);
return vga_r (regbase, VGA_GFX_D);
}
static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_w_fast (regbase, VGA_GFX_I, reg, val);
#else
vga_w (regbase, VGA_GFX_I, reg);
vga_w (regbase, VGA_GFX_D, val);
#endif /* VGA_OUTW_WRITE */
}
static inline unsigned char vga_io_rgfx (unsigned char reg)
{
vga_io_w (VGA_GFX_I, reg);
return vga_io_r (VGA_GFX_D);
}
static inline void vga_io_wgfx (unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_io_w_fast (VGA_GFX_I, reg, val);
#else
vga_io_w (VGA_GFX_I, reg);
vga_io_w (VGA_GFX_D, val);
#endif /* VGA_OUTW_WRITE */
}
static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg)
{
vga_mm_w (regbase, VGA_GFX_I, reg);
return vga_mm_r (regbase, VGA_GFX_D);
}
static inline void vga_mm_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
{
#ifdef VGA_OUTW_WRITE
vga_mm_w_fast (regbase, VGA_GFX_I, reg, val);
#else
vga_mm_w (regbase, VGA_GFX_I, reg);
vga_mm_w (regbase, VGA_GFX_D, val);
#endif /* VGA_OUTW_WRITE */
}
/*
* VGA attribute controller register read/write
*/
static inline unsigned char vga_rattr (void __iomem *regbase, unsigned char reg)
{
vga_w (regbase, VGA_ATT_IW, reg);
return vga_r (regbase, VGA_ATT_R);
}
static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
{
vga_w (regbase, VGA_ATT_IW, reg);
vga_w (regbase, VGA_ATT_W, val);
}
static inline unsigned char vga_io_rattr (unsigned char reg)
{
vga_io_w (VGA_ATT_IW, reg);
return vga_io_r (VGA_ATT_R);
}
static inline void vga_io_wattr (unsigned char reg, unsigned char val)
{
vga_io_w (VGA_ATT_IW, reg);
vga_io_w (VGA_ATT_W, val);
}
static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg)
{
vga_mm_w (regbase, VGA_ATT_IW, reg);
return vga_mm_r (regbase, VGA_ATT_R);
}
static inline void vga_mm_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
{
vga_mm_w (regbase, VGA_ATT_IW, reg);
vga_mm_w (regbase, VGA_ATT_W, val);
}
#endif /* __linux_video_vga_h__ */

150
include/video/w100fb.h Normal file
View File

@@ -0,0 +1,150 @@
/*
* Support for the w100 frame buffer.
*
* Copyright (c) 2004-2005 Richard Purdie
* Copyright (c) 2005 Ian Molton
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#define W100_GPIO_PORT_A 0
#define W100_GPIO_PORT_B 1
#define CLK_SRC_XTAL 0
#define CLK_SRC_PLL 1
struct w100fb_par;
unsigned long w100fb_gpio_read(int port);
void w100fb_gpio_write(int port, unsigned long value);
unsigned long w100fb_get_hsynclen(struct device *dev);
/* LCD Specific Routines and Config */
struct w100_tg_info {
void (*change)(struct w100fb_par*);
void (*suspend)(struct w100fb_par*);
void (*resume)(struct w100fb_par*);
};
/* General Platform Specific w100 Register Values */
struct w100_gen_regs {
unsigned long lcd_format;
unsigned long lcdd_cntl1;
unsigned long lcdd_cntl2;
unsigned long genlcd_cntl1;
unsigned long genlcd_cntl2;
unsigned long genlcd_cntl3;
};
struct w100_gpio_regs {
unsigned long init_data1;
unsigned long init_data2;
unsigned long gpio_dir1;
unsigned long gpio_oe1;
unsigned long gpio_dir2;
unsigned long gpio_oe2;
};
/* Optional External Memory Configuration */
struct w100_mem_info {
unsigned long ext_cntl;
unsigned long sdram_mode_reg;
unsigned long ext_timing_cntl;
unsigned long io_cntl;
unsigned int size;
};
struct w100_bm_mem_info {
unsigned long ext_mem_bw;
unsigned long offset;
unsigned long ext_timing_ctl;
unsigned long ext_cntl;
unsigned long mode_reg;
unsigned long io_cntl;
unsigned long config;
};
/* LCD Mode definition */
struct w100_mode {
unsigned int xres;
unsigned int yres;
unsigned short left_margin;
unsigned short right_margin;
unsigned short upper_margin;
unsigned short lower_margin;
unsigned long crtc_ss;
unsigned long crtc_ls;
unsigned long crtc_gs;
unsigned long crtc_vpos_gs;
unsigned long crtc_rev;
unsigned long crtc_dclk;
unsigned long crtc_gclk;
unsigned long crtc_goe;
unsigned long crtc_ps1_active;
char pll_freq;
char fast_pll_freq;
int sysclk_src;
int sysclk_divider;
int pixclk_src;
int pixclk_divider;
int pixclk_divider_rotated;
};
struct w100_pll_info {
uint16_t freq; /* desired Fout for PLL (Mhz) */
uint8_t M; /* input divider */
uint8_t N_int; /* VCO multiplier */
uint8_t N_fac; /* VCO multiplier fractional part */
uint8_t tfgoal;
uint8_t lock_time;
};
/* Initial Video mode orientation flags */
#define INIT_MODE_ROTATED 0x1
#define INIT_MODE_FLIPPED 0x2
/*
* This structure describes the machine which we are running on.
* It is set by machine specific code and used in the probe routine
* of drivers/video/w100fb.c
*/
struct w100fb_mach_info {
/* General Platform Specific Registers */
struct w100_gen_regs *regs;
/* Table of modes the LCD is capable of */
struct w100_mode *modelist;
unsigned int num_modes;
/* Hooks for any platform specific tg/lcd code (optional) */
struct w100_tg_info *tg;
/* External memory definition (if present) */
struct w100_mem_info *mem;
/* Additional External memory definition (if present) */
struct w100_bm_mem_info *bm_mem;
/* GPIO definitions (optional) */
struct w100_gpio_regs *gpio;
/* Initial Mode flags */
unsigned int init_mode;
/* Xtal Frequency */
unsigned int xtal_freq;
/* Enable Xtal input doubler (1 == enable) */
unsigned int xtal_dbl;
};
/* General frame buffer data structure */
struct w100fb_par {
unsigned int chip_id;
unsigned int xres;
unsigned int yres;
unsigned int extmem_active;
unsigned int flip;
unsigned int blanked;
unsigned int fastpll_mode;
unsigned long hsync_len;
struct w100_mode *mode;
struct w100_pll_info *pll_table;
struct w100fb_mach_info *mach;
uint32_t *saved_intmem;
uint32_t *saved_extmem;
};