diff options
author | Luc Verhaegen <libv@skynet.be> | 2009-05-29 03:04:16 +0000 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2009-05-29 03:04:16 +0000 |
commit | 5c5beb765dce9e5ded2ea1332d86d288ba347dce (patch) | |
tree | 2ac82209a29b6af718caf0813b83443f1363034a /src/include/pc80/vga_io.h | |
parent | 195f5cd66674433cf06dbfe57e0b9bd98bb3549c (diff) |
Implement native VGA Support.
This code brings a rather complete set of VGA IO routines for whoever wants it.
These consist of the by now familiar read/write/mask sets. Due to the crazy
nature of VGA, an ancient standard with bits all over the place, it makes no
sense to define individual registers. You need a vga register spec at hand if
you want to do anything anyway. These IO routines are always exposed.
It also provides code to natively set up a 640x400 VGA textmode with an 8x16
font. The native VGA mode code is behind the OPTION_VGA option, as the font
really adds to the size of the compiled/compressed rom. The font is the one
also present in the linux kernel, but this file is unlicensed. Another copy of
this is also present in coreboot in the deprecated console/btext code.
The vga console code has been cleaned up, but it still has some TODO's left
open, but that's for when i finally have found the remaining issue with the
epia-m. Right now, it is important to get parts of my work out already and to
make the remainder managable again.
Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4321 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include/pc80/vga_io.h')
-rw-r--r-- | src/include/pc80/vga_io.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/include/pc80/vga_io.h b/src/include/pc80/vga_io.h new file mode 100644 index 0000000000..64c62c7697 --- /dev/null +++ b/src/include/pc80/vga_io.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2007 Luc Verhaegen <libv@skynet.be> + * + * 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 License, or (at your option) + * 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., 51 + * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef VGA_IO_H +#define VGA_IO_H + +/* + * All IO necessary to poke VGA registers. + */ + +/* VGA Enable */ +unsigned char vga_enable_read(void); +void vga_enable_write(unsigned char value); +void vga_enable_mask(unsigned char value, unsigned char mask); + +/* Miscellaneous register */ +unsigned char vga_misc_read(void); +void vga_misc_write(unsigned char value); +void vga_misc_mask(unsigned char value, unsigned char mask); + +/* Sequencer registers. */ +unsigned char vga_sr_read(unsigned char index); +void vga_sr_write(unsigned char index, unsigned char value); +void vga_sr_mask(unsigned char index, unsigned char value, unsigned char mask); + +/* CR registers. */ +unsigned char vga_cr_read(unsigned char index); +void vga_cr_write(unsigned char index, unsigned char value); +void vga_cr_mask(unsigned char index, unsigned char value, unsigned char mask); + +/* Attribute registers. */ +unsigned char vga_ar_read(unsigned char index); +void vga_ar_write(unsigned char index, unsigned char value); +void vga_ar_mask(unsigned char index, unsigned char value, unsigned char mask); + +/* Graphics registers. */ +unsigned char vga_gr_read(unsigned char index); +void vga_gr_write(unsigned char index, unsigned char value); +void vga_gr_mask(unsigned char index, unsigned char value, unsigned char mask); + +/* DAC functions. */ +void vga_palette_enable(void); +void vga_palette_disable(void); +unsigned char vga_dac_mask_read(void); +void vga_dac_mask_write(unsigned char mask); +void vga_dac_read_address(unsigned char address); +void vga_dac_write_address(unsigned char address); +unsigned char vga_dac_data_read(void); +void vga_dac_data_write(unsigned char data); + +#endif /* VGA_IO_H */ |