summaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot/vreset.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /arch/ppc/boot/vreset.c
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'arch/ppc/boot/vreset.c')
-rw-r--r--arch/ppc/boot/vreset.c173
1 files changed, 3 insertions, 170 deletions
diff --git a/arch/ppc/boot/vreset.c b/arch/ppc/boot/vreset.c
index 3bc3936c6..6086372a0 100644
--- a/arch/ppc/boot/vreset.c
+++ b/arch/ppc/boot/vreset.c
@@ -434,16 +434,15 @@ vga_init(unsigned char *ISA_mem)
{
int slot;
struct VgaRegs *VgaTextRegs;
-
+#if 0
if ((_get_PVR()>>16) == PPC_601) {
return(old_vga_init(ISA_mem));
}
-
-#if 1
+#endif
+
/* See if VGA already in TEXT mode - exit if so! */
outb(0x3CE, 0x06);
if ((inb(0x3CF) & 0x01) == 0){puts("VGA already in text mode\n"); return;}
-#endif
/* If no VGA responding in text mode, then we have some work to do...
*/
@@ -522,11 +521,6 @@ vga_init(unsigned char *ISA_mem)
return (1); /* 'CRT' I/O supported */
}
-static int
-NOP(int x)
-{
-}
-
/*
* Write to VGA Attribute registers.
*/
@@ -852,166 +846,5 @@ void printslots(void)
puts(" Vendor ID: ");
puthex(PCIVendor(i)); puts("\n");
#endif
-
- }
-}
-
-/*
- * OLD vreset.c
- *
- * Initialize the VGA control registers to 80x25 text mode.
- *
- * Adapted from a program by:
- * Steve Sellgren
- * San Francisco Indigo Company
- * sfindigo!sellgren@uunet.uu.net
- */
-
-unsigned char CRTC[24] = {
- 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F,
- 0x00, 0x4F, 0x0D, 0x0E, 0x00, 0x00, 0x00, 0x00, /*0x07, 0x80, */
- 0x9C, 0xAE, 0x8F, 0x28, 0x1F, 0x96, 0xB9, 0xA3};
-unsigned char SEQ[5] = {0x3, 0x0, 0x3, 0x0, 0x2};
-unsigned char GC[9] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0xE, 0x0, 0xFF};
-
-#if 0
-static const unsigned char color_LUT[] =
- {
- 0x00, 0x00, 0x00, /* 0 - black */
- 0x00, 0x00, 0x2A, /* 1 - blue */
- 0x00, 0x2A, 0x00, /* 2 - green */
- 0x00, 0x2A, 0x2A, /* 3 - cyan */
- 0x2A, 0x00, 0x00, /* 4 - red */
- 0x2A, 0x00, 0x2A, /* 5 - magenta */
- 0x2A, 0x2A, 0x00, /* 6 - brown */
- 0x2A, 0x2A, 0x2A, /* 7 - white */
- 0x00, 0x00, 0x15, /* 8 - gray */
- 0x00, 0x00, 0x3F, /* 9 - light blue */
- 0x00, 0x2A, 0x15, /* 10 - light green */
- 0x00, 0x2A, 0x3F, /* 11 - light cyan */
- 0x2A, 0x00, 0x15, /* 12 - light red */
- 0x2A, 0x00, 0x3F, /* 13 - light magenta */
- 0x2A, 0x2A, 0x15, /* 14 - yellow */
- 0x2A, 0x2A, 0x3F, /* 15 - bright white */
- };
-#endif
-
-old_vga_init(unsigned char *ISA_mem)
-{
- int i, j;
- int value;
- unsigned char *font_page = (unsigned char *) &ISA_mem[0xA0000];
-
- /* See if VGA already in TEXT mode - exit if so! */
- outb(0x3CE, 0x06);
- if ((inb(0x3CF) & 0x01) == 0) return;
-
- /* From the S3 manual */
- outb(0x46E8, 0x10); /* Put into setup mode */
- outb(0x3C3, 0x10);
- outb(0x102, 0x01); /* Enable registers */
- outb(0x46E8, 0x08); /* Enable video */
- outb(0x3C3, 0x08);
- outb(0x4AE8, 0x00);
-
-#if 0
- outb(0x42E8, 0x80); /* Reset graphics engine? */
-#endif
-
- outb(0x3D4, 0x38); /* Unlock all registers */
- outb(0x3D5, 0x48);
- outb(0x3D4, 0x39);
- outb(0x3D5, 0xA5);
- outb(0x3D4, 0x40);
- outb(0x3D5, inb(0x3D5)|0x01);
- outb(0x3D4, 0x33);
- outb(0x3D5, inb(0x3D5)&~0x52);
- outb(0x3D4, 0x35);
- outb(0x3D5, inb(0x3D5)&~0x30);
- outb(0x3D4, 0x3A);
- outb(0x3D5, 0x00);
- outb(0x3D4, 0x53);
- outb(0x3D5, 0x00);
- outb(0x3D4, 0x31);
- outb(0x3D5, inb(0x3D5)&~0x4B);
- outb(0x3D4, 0x58);
- outb(0x3D5, 0);
-
- outb(0x3D4, 0x54);
- outb(0x3D5, 0x38);
- outb(0x3D4, 0x60);
- outb(0x3D5, 0x07);
- outb(0x3D4, 0x61);
- outb(0x3D5, 0x80);
- outb(0x3D4, 0x62);
- outb(0x3D5, 0xA1);
- outb(0x3D4, 0x69); /* High order bits for cursor address */
- outb(0x3D5, 0);
-
- outb(0x3D4, 0x32);
- outb(0x3D5, inb(0x3D5)&~0x10);
-
- outb(0x3C2, 0x67);
-
-#if 0
- /* Initialize DAC */
- outb(0x3C6,0xFF);
- inb(0x3C7);
- outb(0x3C8,0x00);
- inb(0x3C7);
- for (i=0; i<sizeof(color_LUT); i++) {
- outb(0x3C9, color_LUT[i]);
- }
- for (i; i<768; i += 3) {
- outb(0x3C9, 0x3F); /* White? */
- outb(0x3C9, 0x3F); /* White? */
- outb(0x3C9, 0x3F); /* White? */
- }
-
- /* Load font */
- NOP(inb(0x3DA)); /* Reset Address/Data FlipFlop for Attribute ctlr */
- outb(0x3C0,0x30); outb(0x3C0, 0x01); /* graphics mode */
- outw(0x3C4, 0x0001); /* reset sequencer */
- outw(0x3C4, 0x0204); /* write to plane 2 */
- outw(0x3C4, 0x0407); /* enable plane graphics */
- outw(0x3C4, 0x0003); /* reset sequencer */
- outw(0x3CE, 0x0402); /* read plane 2 */
- outw(0x3CE, 0x0500); /* write mode 0, read mode 0 */
- outw(0x3CE, 0x0600); /* set graphics */
- for (i = 0; i < sizeof(font); i += 16) {
- for (j = 0; j < 16; j++) {
- font_page[(2*i)+j] = font[i+j];
- }
- }
-#else
- outw(0x3C4, 0x0120); /* disable video */
- setTextCLUT(2); /* load color lookup table */
- loadFont(ISA_mem); /* load font */
-#endif
-
- for (i = 0; i < 24; i++) {
- outb(0x3D4, i);
- outb(0x3D5, CRTC[i]);
- }
- for (i = 0; i < 5; i++) {
- outb(0x3C4, i);
- outb(0x3C5, SEQ[i]);
- }
- for (i = 0; i < 9; i++) {
- outb(0x3CE, i);
- outb(0x3CF, GC[i]);
- }
- value = inb(0x3DA); /* reset flip-flop */
- for (i = 0; i < 16; i++) {
- outb(0x3C0, i);
- outb(0x3C0, AC[i]);
- }
- for (i = 16; i < 21; i++) {
- outb(0x3C0, i | 0x20);
- outb(0x3C0, AC[i]);
}
- clearVideoMemory();
- outw(0x3C4, 0x0100); /* re-enable video */
- outb(0x3C2, 0x23);
- return (1); /* Keyboard should work */
}