From 5aad3ba0d02cf1906112f917d48084f3e5727ced Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Mon, 8 Mar 2004 16:28:57 +0000 Subject: [PATCH] from dave ashley. ron --- src/arch/i386/lib/idt.c | 9 ++ src/arch/i386/lib/vgabios.c | 10 ++ src/mainboard/via/epia-m/Config | 4 +- src/mainboard/via/epia-m/mainboard.c | 121 ++++++++++++++++++++++++- src/northbridge/via/vt8623/raminit.inc | 102 +++++++++++++++------ 5 files changed, 210 insertions(+), 36 deletions(-) diff --git a/src/arch/i386/lib/idt.c b/src/arch/i386/lib/idt.c index 81ddf1c4d7..bc815eebd4 100644 --- a/src/arch/i386/lib/idt.c +++ b/src/arch/i386/lib/idt.c @@ -190,9 +190,18 @@ biosint( eax = 64 * 1024; ret = 0; break; +#ifdef CONFIG_INT21HANDLER + case 0x15: + ret=handleint21( &edi, &esi, &ebp, &esp, + &ebx, &edx, &ecx, &eax, &flags); + break; +#endif default: printk_info(__FUNCTION__ ": Unsupport int #0x%x\n", intnumber); +#ifdef CONFIG_UNSUPPORTINT_RECOVER + unsupportint_recover(); +#endif break; } if (ret) diff --git a/src/arch/i386/lib/vgabios.c b/src/arch/i386/lib/vgabios.c index 29c226aba8..6b8943778b 100644 --- a/src/arch/i386/lib/vgabios.c +++ b/src/arch/i386/lib/vgabios.c @@ -159,6 +159,13 @@ __asm__ ( " ret\n" ); +#ifdef CONFIG_UNSUPPORTINT_RECOVER +void unsupportint_recover(void) +{ + __asm__ __volatile__ ( " jmp vgarestart \n" ); +} +#endif + void do_vgabios(void) { @@ -192,6 +199,9 @@ do_vgabios(void) if ((buf[0] == 0x55) && (buf[1] == 0xaa)) { memcpy((void *) 0xc0000, buf, size); +#ifdef VGABIOS_WRITE_PROTECT + write_protect_vgabios(); +#endif for(i = 0; i < 16; i++) printk_debug("0x%x ", buf[i]); diff --git a/src/mainboard/via/epia-m/Config b/src/mainboard/via/epia-m/Config index 5ce413acad..eb40f3d6f8 100644 --- a/src/mainboard/via/epia-m/Config +++ b/src/mainboard/via/epia-m/Config @@ -44,4 +44,6 @@ cpu p6 option MAINBOARD_PART_NUMBER=EPIA-M option MAINBOARD_VENDOR=VIA - +option CONFIG_INT21HANDLER=1 +option VGABIOS_WRITE_PROTECT=1 +option CONFIG_UNSUPPORTINT_RECOVER=1 diff --git a/src/mainboard/via/epia-m/mainboard.c b/src/mainboard/via/epia-m/mainboard.c index f5af5102c5..8a4b6e0392 100644 --- a/src/mainboard/via/epia-m/mainboard.c +++ b/src/mainboard/via/epia-m/mainboard.c @@ -10,7 +10,7 @@ static const unsigned char enetIrqs[4] = { 11, 5, 10, 12 }; static const unsigned char slotIrqs[4] = { 10, 12, 5, 11 }; static const unsigned char firewireIrqs[4] = {10, 12, 5, 11 }; static const unsigned char vt8235Irqs[4] = { 5,10, 12, 11 }; - +static const unsigned char vgaIrqs[4] = { 11, 5, 12, 10 }; /* Our IDSEL mappings are as follows @@ -28,8 +28,8 @@ static void pci_routing_fixup(void) * on the PCB routing of PINTA-D * * PINTA = IRQ11 - * PINTB = IRQ12 - * PINTC = IRQ10 + * PINTB = IRQ10 + * PINTC = IRQ12 * PINTD = IRQ5 */ pci_write_config_byte(dev, 0x55, 0xb0); @@ -46,10 +46,18 @@ static void pci_routing_fixup(void) printk_info("setting usb\n"); pci_assign_irqs(0, 0x10, usbIrqs); + // VT8235 + sound hardware + printk_info("setting vt8235\n"); + pci_assign_irqs(0, 0x11, vt8235Irqs); + // Ethernet built into southbridge printk_info("setting ethernet\n"); pci_assign_irqs(0, 0x12, enetIrqs); + // VGA + printk_info("setting vga\n"); + pci_assign_irqs(1, 0x00, vgaIrqs); + // PCI slot printk_info("setting pci slot\n"); pci_assign_irqs(0, 0x14, slotIrqs); @@ -59,10 +67,27 @@ static void pci_routing_fixup(void) pci_assign_irqs(0, 0x11, vt8235Irqs); } +static unsigned char vt1211hwmonitorinits[]={ + 0x10,0x3, 0x11,0x10, 0x12,0xd, 0x13,0x7f, + 0x14,0x21, 0x15,0x81, 0x16,0xbd, 0x17,0x8a, + 0x18,0x0, 0x19,0x0, 0x1a,0x0, 0x1b,0x0, + 0x1d,0xff, 0x1e,0x0, 0x1f,0x73, 0x20,0x67, + 0x21,0xc1, 0x22,0xca, 0x23,0x74, 0x24,0xc2, + 0x25,0xc7, 0x26,0xc9, 0x27,0x7f, 0x29,0x0, + 0x2a,0x0, 0x2b,0xff, 0x2c,0x0, 0x2d,0xff, + 0x2e,0x0, 0x2f,0xff, 0x30,0x0, 0x31,0xff, + 0x32,0x0, 0x33,0xff, 0x34,0x0, 0x39,0xff, + 0x3a,0x0, 0x3b,0xff, 0x3c,0xff, 0x3d,0xff, + 0x3e,0x0, 0x3f,0xb0, 0x43,0xff, 0x44,0xff, + 0x46,0xff, 0x47,0x50, 0x4a,0x3, 0x4b,0xc0, + 0x4c,0x0, 0x4d,0x0, 0x4e,0xf, 0x5d,0x77, + 0x5c,0x0, 0x5f,0x33, 0x40,0x1}; void mainboard_fixup() { + struct pci_dev *dev; + int i; printk_info("Mainboard fixup\n"); northbridge_fixup(); @@ -74,8 +99,64 @@ final_southbridge_fixup() { printk_info("Southbridge fixup\n"); - nvram_on(); - pci_routing_fixup(); + // nvram_on(); + // pci_routing_fixup(); + northbridge_fixup(); + southbridge_fixup(); + + dev = pci_find_device(PCI_VENDOR_ID_VIA, 0x3123, 0); + if(dev) { + // enable shadow RAM for c0000-cffff + pci_write_config_byte(dev, 0x61, 0xff); + // enable 2x + 4x agp + pci_write_config_byte(dev, 0xac, 0x2f); + pci_write_config_byte(dev, 0xae, 0x04); + } + + + // Activate the vt1211 hardware monitor + outb(0x87,0x2e); // enter config mode part a + outb(0x87,0x2e); // enter config mode part b + outb(7,0x2e); // device index# + outb(0x0b,0x2f); // select hardware monitor LDN + outb(0x30,0x2e); // activate index# + outb(1,0x2f); + outb(0xaa,0x2e); // exit config mode + + + // initialize vt1211 hardware monitor registers, which are at 0xECXX + for(i=0;i