patch-2.1.97 linux/arch/ppc/boot/vreset.c

Next file: linux/arch/ppc/chrp_defconfig
Previous file: linux/arch/ppc/boot/misc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.96/linux/arch/ppc/boot/vreset.c linux/arch/ppc/boot/vreset.c
@@ -434,16 +434,15 @@
 {
 	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 @@
 	return (1);  /* 'CRT' I/O supported */
 }
 
-static int
-NOP(int x)
-{
-}
-
 /*
  * Write to VGA Attribute registers.  
  */
@@ -852,166 +846,5 @@
 		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 */
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov