Remove the dump of sm712 initialisation sequence.
* include/grub/pci.h (GRUB_PCI_CLASS_SUBCLASS_VGA): New const. * include/grub/vga.h (GRUB_VGA_IO_ARX_READ): New register. (GRUB_VGA_IO_MISC_WRITE): Likewise. (GRUB_VGA_CR_*): Added many registers. (GRUB_VGA_SR_*): Likewise. (GRUB_VGA_GR_*): Likewise. (grub_vga_write_arx): New function. (grub_video_hw_config): New struct. (grub_vga_set_geometry): New function. * kern/i386/qemu/init.c (load_palette): Use grub_vga_write_arx and GRUB_PCI_CLASS_SUBCLASS_VGA. * video/cirrus.c (grub_video_cirrus_setup): Use grub_vga_set_geometry. * video/sm712.c (grub_sm712_write_reg): New function (grub_sm712_read_reg): Likewise. (grub_sm712_sr_write): Likewise. (grub_sm712_gr_write): Likewise. (grub_sm712_cr_write): Likewise. (grub_sm712_write_arx): Likewise. (grub_sm712_cr_shadow_write): Likewise. (grub_sm712_write_dda_lookup): Likewise. (grub_video_sm712_setup): Initialise the video rather then blindly replay the dump. (main) [TEST]: Add a routine to be able to compile as standalone for tests. * video/sm712_init.c (sm712_init): Removed. (sm712_sr_seq1): New array. (sm712_sr_seq2): Likewise.
This commit is contained in:
parent
f0206638bf
commit
f947ab49b0
7 changed files with 772 additions and 604 deletions
|
@ -69,10 +69,7 @@ load_palette (void)
|
|||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
grub_outb (i, GRUB_VGA_IO_ARX);
|
||||
grub_outb (i, GRUB_VGA_IO_ARX);
|
||||
}
|
||||
grub_vga_write_arx (i, i);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE (colors); i++)
|
||||
grub_vga_palette_write (i, colors[i].r, colors[i].g, colors[i].b);
|
||||
|
@ -90,7 +87,7 @@ grub_qemu_init_cirrus (void)
|
|||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
|
||||
class = grub_pci_read (addr);
|
||||
|
||||
if (((class >> 16) & 0xffff) != 0x0300)
|
||||
if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA)
|
||||
return 0;
|
||||
|
||||
/* FIXME: chooose addresses dynamically. */
|
||||
|
@ -110,7 +107,7 @@ grub_qemu_init_cirrus (void)
|
|||
|
||||
grub_pci_iterate (find_card);
|
||||
|
||||
grub_outb (1, 0x3c2);
|
||||
grub_outb (GRUB_VGA_IO_MISC_COLOR, GRUB_VGA_IO_MISC_WRITE);
|
||||
|
||||
load_font ();
|
||||
|
||||
|
@ -137,10 +134,8 @@ grub_qemu_init_cirrus (void)
|
|||
|
||||
load_palette ();
|
||||
|
||||
grub_outb (0x10, 0x3c0);
|
||||
grub_outb (0, 0x3c1);
|
||||
grub_outb (0x14, 0x3c0);
|
||||
grub_outb (0, 0x3c1);
|
||||
grub_vga_write_arx (GRUB_VGA_ARX_MODE_TEXT, GRUB_VGA_ARX_MODE);
|
||||
grub_vga_write_arx (0, GRUB_VGA_ARX_COLOR_SELECT);
|
||||
|
||||
grub_vga_sr_write (GRUB_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK,
|
||||
GRUB_VGA_SR_CLOCKING_MODE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue