linux/include/video/vga.h

/*
 * linux/include/video/vga.h -- standard VGA chipset interaction
 *
 * Copyright 1999 Jeff Garzik <[email protected]>
 *
 * Copyright history from vga16fb.c:
 *	Copyright 1999 Ben Pfaff and Petr Vandrovec
 *	Based on VGA info at http://www.osdever.net/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 <linux/io.h>
#include <asm/vga.h>
#include <asm/byteorder.h>

#define VGA_FB_PHYS_BASE
#define VGA_FB_PHYS_SIZE

/* 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
#define VGA_CRT_DM
#define VGA_ATT_R
#define VGA_ATT_W
#define VGA_GFX_D
#define VGA_SEQ_D
#define VGA_MIS_R
#define VGA_MIS_W
#define VGA_FTC_R
#define VGA_IS1_RC
#define VGA_IS1_RM
#define VGA_PEL_D
#define VGA_PEL_MSK

/* EGA-specific registers */
#define EGA_GFX_E0
#define EGA_GFX_E1

/* VGA index register ports */
#define VGA_CRT_IC
#define VGA_CRT_IM
#define VGA_ATT_IW
#define VGA_GFX_I
#define VGA_SEQ_I
#define VGA_PEL_IW
#define VGA_PEL_IR

/* standard VGA indexes max counts */
#define VGA_CRT_C
#define VGA_ATT_C
#define VGA_GFX_C
#define VGA_SEQ_C
#define VGA_MIS_C

/* VGA misc register bit masks */
#define VGA_MIS_COLOR
#define VGA_MIS_ENB_MEM_ACCESS
#define VGA_MIS_DCLK_28322_720
#define VGA_MIS_ENB_PLL_LOAD
#define VGA_MIS_SEL_HIGH_PAGE

/* VGA CRT controller register indices */
#define VGA_CRTC_H_TOTAL
#define VGA_CRTC_H_DISP
#define VGA_CRTC_H_BLANK_START
#define VGA_CRTC_H_BLANK_END
#define VGA_CRTC_H_SYNC_START
#define VGA_CRTC_H_SYNC_END
#define VGA_CRTC_V_TOTAL
#define VGA_CRTC_OVERFLOW
#define VGA_CRTC_PRESET_ROW
#define VGA_CRTC_MAX_SCAN
#define VGA_CRTC_CURSOR_START
#define VGA_CRTC_CURSOR_END
#define VGA_CRTC_START_HI
#define VGA_CRTC_START_LO
#define VGA_CRTC_CURSOR_HI
#define VGA_CRTC_CURSOR_LO
#define VGA_CRTC_V_SYNC_START
#define VGA_CRTC_V_SYNC_END
#define VGA_CRTC_V_DISP_END
#define VGA_CRTC_OFFSET
#define VGA_CRTC_UNDERLINE
#define VGA_CRTC_V_BLANK_START
#define VGA_CRTC_V_BLANK_END
#define VGA_CRTC_MODE
#define VGA_CRTC_LINE_COMPARE
#define VGA_CRTC_REGS

/* VGA CRT controller bit masks */
#define VGA_CR11_LOCK_CR0_CR7
#define VGA_CR17_H_V_SIGNALS_ENABLED

/* VGA attribute controller register indices */
#define VGA_ATC_PALETTE0
#define VGA_ATC_PALETTE1
#define VGA_ATC_PALETTE2
#define VGA_ATC_PALETTE3
#define VGA_ATC_PALETTE4
#define VGA_ATC_PALETTE5
#define VGA_ATC_PALETTE6
#define VGA_ATC_PALETTE7
#define VGA_ATC_PALETTE8
#define VGA_ATC_PALETTE9
#define VGA_ATC_PALETTEA
#define VGA_ATC_PALETTEB
#define VGA_ATC_PALETTEC
#define VGA_ATC_PALETTED
#define VGA_ATC_PALETTEE
#define VGA_ATC_PALETTEF
#define VGA_ATC_MODE
#define VGA_ATC_OVERSCAN
#define VGA_ATC_PLANE_ENABLE
#define VGA_ATC_PEL
#define VGA_ATC_COLOR_PAGE

#define VGA_AR_ENABLE_DISPLAY

/* VGA sequencer register indices */
#define VGA_SEQ_RESET
#define VGA_SEQ_CLOCK_MODE
#define VGA_SEQ_PLANE_WRITE
#define VGA_SEQ_CHARACTER_MAP
#define VGA_SEQ_MEMORY_MODE

/* VGA sequencer register bit masks */
#define VGA_SR01_CHAR_CLK_8DOTS
#define VGA_SR01_SCREEN_OFF
#define VGA_SR02_ALL_PLANES
#define VGA_SR04_EXT_MEM
#define VGA_SR04_SEQ_MODE
#define VGA_SR04_CHN_4M

/* VGA graphics controller register indices */
#define VGA_GFX_SR_VALUE
#define VGA_GFX_SR_ENABLE
#define VGA_GFX_COMPARE_VALUE
#define VGA_GFX_DATA_ROTATE
#define VGA_GFX_PLANE_READ
#define VGA_GFX_MODE
#define VGA_GFX_MISC
#define VGA_GFX_COMPARE_MASK
#define VGA_GFX_BIT_MASK

/* VGA graphics controller bit masks */
#define VGA_GR06_GRAPHICS_MODE

/* macro for composing an 8-bit VGA register index and value
 * into a single 16-bit quantity */
#define VGA_OUT16VAL(v, 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
#define VGA_SAVE_FONT1
#define VGA_SAVE_TEXT
#define VGA_SAVE_FONTS
#define VGA_SAVE_MODE
#define VGA_SAVE_CMAP

struct vgastate {};

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)
{}

static inline void vga_io_w (unsigned short port, unsigned char val)
{}

static inline void vga_io_w_fast (unsigned short port, unsigned char reg,
				  unsigned char val)
{}

static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
{}

static inline void vga_mm_w (void __iomem *regbase, unsigned short port, unsigned char val)
{}

static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
				  unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
{}

static inline void vga_w (void __iomem *regbase, unsigned short port, unsigned char val)
{}


static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
			       unsigned char reg, unsigned char val)
{}


/*
 * VGA CRTC register read/write
 */

static inline unsigned char vga_rcrt (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_io_rcrt (unsigned char reg)
{}

static inline void vga_io_wcrt (unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_mm_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
{}


/*
 * VGA sequencer register read/write
 */

static inline unsigned char vga_rseq (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_io_rseq (unsigned char reg)
{}

static inline void vga_io_wseq (unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_mm_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
{}

/*
 * VGA graphics controller register read/write
 */

static inline unsigned char vga_rgfx (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_io_rgfx (unsigned char reg)
{}

static inline void vga_io_wgfx (unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_mm_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
{}


/*
 * VGA attribute controller register read/write
 */

static inline unsigned char vga_rattr (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_io_rattr (unsigned char reg)
{}

static inline void vga_io_wattr (unsigned char reg, unsigned char val)
{}

static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg)
{}

static inline void vga_mm_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
{}

#endif /* __linux_video_vga_h__ */