V2 EPIA - IDE compat mode, RAM init, and early MTRR

SONE Takeshi ts1 at tsn.or.jp
Tue Oct 21 05:31:00 CEST 2003


On Mon, Oct 20, 2003 at 03:48:18PM -0600, ron minnich wrote:
> Takeshi, I have put your changes in (earlymtrr.c, etc.) except for 
> raminit. We should talk about that offline, but I want to better 
> understand what you are doing, since two slots was working for me.

Besides raminit, some important fixes are still missing in the
current CVS.

src/mainboard/via/epia/Config.lb: 
    * chooses COMPATIBILITY mode rather than native mode
    * more appropriate romcc options

src/southbridge/via/vt8231/vt8231.c:
    * proper interpretation of enable_native_ide
    
src/mainboard/via/epia/auto.c:
    * really call early mtrr
    
Attached patch also includes random minor fixes.
-- 
Takeshi




? targets/epia
? targets/via/epia/epia
Index: src/cpu/p6/earlymtrr.c
===================================================================
RCS file: /cvsroot/freebios/freebios2/src/cpu/p6/earlymtrr.c,v
retrieving revision 1.1
diff -u -r1.1 earlymtrr.c
--- src/cpu/p6/earlymtrr.c	20 Oct 2003 19:57:35 -0000	1.1
+++ src/cpu/p6/earlymtrr.c	21 Oct 2003 09:28:39 -0000
@@ -37,7 +37,6 @@
 	const unsigned long *msr_addr;
 	unsigned long cr0;
 
-	print_err("Disabling cache\n");
 	/* Just to be sure, take all the steps to disable the cache.
 	 * This may not be needed, but C3's may...
 	 * Invalidate the cache */
@@ -56,7 +55,6 @@
 	/* Invalidate the cache again */
 	asm volatile ("invd");
 
-	print_err("Clearing mtrr\n");
 
 	/* Inialize all of the relevant msrs to 0 */
 	msr.lo = 0;
@@ -81,7 +79,6 @@
 	wrmsr(0x201, msr);
 
 #if defined(XIP_ROM_SIZE) && defined(XIP_ROM_BASE)
-	print_err("Setting XIP\n");
 	/* enable write through caching so we can do execute in place
 	 * on the flash rom.
 	 */
@@ -104,5 +101,5 @@
 	cr0 = read_cr0();
 	cr0 &= 0x9fffffff;
 	write_cr0(cr0);
-	print_err("Enabled the cache\n");
+	print_err("Enabled the cache\r\n");
 }
Index: src/mainboard/via/epia/Config.lb
===================================================================
RCS file: /cvsroot/freebios/freebios2/src/mainboard/via/epia/Config.lb,v
retrieving revision 1.5
diff -u -r1.5 Config.lb
--- src/mainboard/via/epia/Config.lb	1 Oct 2003 23:18:14 -0000	1.5
+++ src/mainboard/via/epia/Config.lb	21 Oct 2003 09:28:39 -0000
@@ -53,8 +53,8 @@
 ##
 ## Clean up the motherboard id strings
 ##
-option MAINBOARD_PART_NUMBER="HDAMA"
-option MAINBOARD_VENDOR="ARIMA"
+option MAINBOARD_PART_NUMBER="EPIA"
+option MAINBOARD_VENDOR="VIA"
 
 ###
 ### LinuxBIOS layout values
@@ -137,7 +137,7 @@
 
 makerule ./failover.inc
 	depends "./failover.E ./romcc"
-	action "./romcc -O -o failover.inc --label-prefix=failover ./failover.E"
+	action "./romcc -O2 -mcpu=c3 -o failover.inc --label-prefix=failover ./failover.E"
 end
 
 makerule ./auto.E 
@@ -146,7 +146,7 @@
 end
 makerule ./auto.inc 
 	depends "./auto.E ./romcc"
-	action	"./romcc   -O ./auto.E > auto.inc"
+	action	"./romcc -O2 -mcpu=c3 -o auto.inc ./auto.E"
 end
 
 ##
@@ -220,7 +220,7 @@
 #		pci 0:11.6
 #		pci 0:12.0
 		register "enable_usb" = "0"
-		register "enable_native_ide" = "1"
+		register "enable_native_ide" = "0"
 		register "enable_com_ports" = "1"
 		register "enable_keyboard" = "0"
 		register "enable_nvram" = "1"
@@ -236,4 +236,3 @@
 ##
 mainboardinit pc80/serial.inc
 mainboardinit arch/i386/lib/console.inc
-
Index: src/mainboard/via/epia/auto.c
===================================================================
RCS file: /cvsroot/freebios/freebios2/src/mainboard/via/epia/auto.c,v
retrieving revision 1.14
diff -u -r1.14 auto.c
--- src/mainboard/via/epia/auto.c	17 Oct 2003 22:21:07 -0000	1.14
+++ src/mainboard/via/epia/auto.c	21 Oct 2003 09:28:39 -0000
@@ -11,6 +11,7 @@
 #include "arch/i386/lib/console.c"
 #include "ram/ramtest.c"
 #include "northbridge/via/vt8601/raminit.h"
+#include "cpu/p6/earlymtrr.c"
 /*
  */
 void udelay(int usecs) 
@@ -100,10 +101,10 @@
 	outb(5, 0x80);
 	
 	enable_vt8231_serial();
-	enable_mainboard_devices();
 	uart_init();
 	console_init();
 	
+	enable_mainboard_devices();
 	enable_smbus();
 	enable_shadow_ram();
 	/*
@@ -135,4 +136,5 @@
 		ram_check(check_addrs[i].lo, check_addrs[i].hi);
 	}
 #endif
+	early_mtrr_init();
 }
Index: src/southbridge/via/vt8231/vt8231.c
===================================================================
RCS file: /cvsroot/freebios/freebios2/src/southbridge/via/vt8231/vt8231.c,v
retrieving revision 1.7
diff -u -r1.7 vt8231.c
--- src/southbridge/via/vt8231/vt8231.c	11 Oct 2003 06:20:22 -0000	1.7
+++ src/southbridge/via/vt8231/vt8231.c	21 Oct 2003 09:28:39 -0000
@@ -335,11 +335,11 @@
 	//
 	// IDE setup
 	//
-	if (conf->enable_native_ide) {
+	if (!conf->enable_native_ide) {
 		// Run the IDE controller in 'compatiblity mode - i.e. don't use PCI
 		// interrupts.  Using PCI ints confuses linux for some reason.
 		
-		printk_info("%s: enabling native IDE addresses\n", __FUNCTION__);
+		printk_info("%s: enabling compatibility IDE addresses\n", __FUNCTION__);
 		enables = pci_read_config8(dev1, 0x42);
 		printk_debug("enables in reg 0x42 0x%x\n", enables);
 		enables &= ~0xc0;		// compatability mode
@@ -442,7 +442,6 @@
 		
 		break;
 	case CONF_PASS_PRE_BOOT:
-		pci_routing_fixup();
 		dump_south();
 		break;
 		
Index: targets/via/epia/Config.filo.lb
===================================================================
RCS file: /cvsroot/freebios/freebios2/targets/via/epia/Config.filo.lb,v
retrieving revision 1.1
diff -u -r1.1 Config.filo.lb
--- targets/via/epia/Config.filo.lb	15 Oct 2003 20:05:11 -0000	1.1
+++ targets/via/epia/Config.filo.lb	21 Oct 2003 09:28:39 -0000
@@ -1,6 +1,5 @@
-# Sample config file for Motorola Sandpoint X3 Demo Board with
-# the Arima HDAMA
-# This will make a target directory of ./hdama
+# Sample config file for VIA EPIA mini-ITX
+# This will make a target directory of ./epia
 
 loadoptions
 
@@ -52,8 +51,8 @@
 option CONFIG_CHIP_CONFIGURE=1
 option CONFIG_KEYBOARD=1
 
-option  MAXIMUM_CONSOLE_LOGLEVEL=10
-option  DEFAULT_CONSOLE_LOGLEVEL=10
+option  MAXIMUM_CONSOLE_LOGLEVEL=8
+option  DEFAULT_CONSOLE_LOGLEVEL=8
 option  CONFIG_CONSOLE_SERIAL8250=1
 
 option CPU_FIXUP=1
Index: targets/via/epia/Config.lb
===================================================================
RCS file: /cvsroot/freebios/freebios2/targets/via/epia/Config.lb,v
retrieving revision 1.8
diff -u -r1.8 Config.lb
--- targets/via/epia/Config.lb	15 Oct 2003 20:05:11 -0000	1.8
+++ targets/via/epia/Config.lb	21 Oct 2003 09:28:39 -0000
@@ -1,6 +1,5 @@
-# Sample config file for Motorola Sandpoint X3 Demo Board with
-# the Arima HDAMA
-# This will make a target directory of ./hdama
+# Sample config file for VIA EPIA mini-ITX
+# This will make a target directory of ./epia
 
 loadoptions
 



More information about the coreboot mailing list