[LinuxBIOS] r2590 - trunk/LinuxBIOSv2/src/arch/i386/lib

svn at openbios.org svn at openbios.org
Fri Apr 6 21:57:43 CEST 2007


Author: stepan
Date: 2007-04-06 21:57:42 +0200 (Fri, 06 Apr 2007)
New Revision: 2590

Modified:
   trunk/LinuxBIOSv2/src/arch/i386/lib/c_start.S
   trunk/LinuxBIOSv2/src/arch/i386/lib/console.c
   trunk/LinuxBIOSv2/src/arch/i386/lib/cpu.c
Log:
Part III of YhLu's patch from January 18th

Signed-off-by: Yinghai Lu <yinghai.lu at amd.com>
Signed-off-by: Ed Swierk <eswierk at arastra.com>
Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Ward Vandewege <ward at gnu.org>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/LinuxBIOSv2/src/arch/i386/lib/c_start.S
===================================================================
--- trunk/LinuxBIOSv2/src/arch/i386/lib/c_start.S	2007-04-06 19:51:02 UTC (rev 2589)
+++ trunk/LinuxBIOSv2/src/arch/i386/lib/c_start.S	2007-04-06 19:57:42 UTC (rev 2590)
@@ -263,9 +263,9 @@
 	.word	0x0000, 0x0000		/* dummy */
 	.byte	0x00, 0x00, 0x00, 0x00
 
-	/* selgdt 0x10, flat code segment */
+	/* selgdt 0x10, flat code segment */ 
 	.word	0xffff, 0x0000		
-	.byte	0x00, 0x9b, 0xcf, 0x00	
+	.byte	0x00, 0x9b, 0xcf, 0x00 /* G=1 and 0x0f, So we get 4Gbytes for limit */	
 
 	/* selgdt 0x18, flat data segment */
 	.word	0xffff, 0x0000		

Modified: trunk/LinuxBIOSv2/src/arch/i386/lib/console.c
===================================================================
--- trunk/LinuxBIOSv2/src/arch/i386/lib/console.c	2007-04-06 19:51:02 UTC (rev 2589)
+++ trunk/LinuxBIOSv2/src/arch/i386/lib/console.c	2007-04-06 19:57:42 UTC (rev 2590)
@@ -9,12 +9,16 @@
 #include "console_print.c"
 
 #else  
-/* CONFIG_USE_INIT == 1 */
+/* CONFIG_USE_PRINTK_IN_CAR == 1 */
 
 #include "console_printk.c"
 
-#endif /* CONFIG_USE_INIT */
+// do_printk
+#include "../../../console/vtxprintf.c"
+#include "printk_init.c"
 
+#endif /* CONFIG_USE_PRINTK_IN_CAR */
+
 #ifndef LINUXBIOS_EXTRA_VERSION
 #define LINUXBIOS_EXTRA_VERSION ""
 #endif

Modified: trunk/LinuxBIOSv2/src/arch/i386/lib/cpu.c
===================================================================
--- trunk/LinuxBIOSv2/src/arch/i386/lib/cpu.c	2007-04-06 19:51:02 UTC (rev 2589)
+++ trunk/LinuxBIOSv2/src/arch/i386/lib/cpu.c	2007-04-06 19:57:42 UTC (rev 2590)
@@ -207,7 +207,6 @@
 			}
 		}
 	}
-	die("Unknown cpu");
 	return;
  found:
 	cpu->ops = driver->ops;
@@ -223,7 +222,7 @@
 	struct device *cpu;
 	struct cpu_info *info;
 	struct cpuinfo_x86 c;
-
+	
 	info = cpu_info();
 
 	printk_notice("Initializing CPU #%d\n", info->index);
@@ -233,41 +232,37 @@
 		die("CPU: missing cpu device structure");
 	}
 
-	// Check that we haven't been passed bad information as the result of a race 
-	// (i.e. BSP timed out while waiting for us to load secondary_stack)
+	/* Find what type of cpu we are dealing with */
+	identify_cpu(cpu);
+	printk_debug("CPU: vendor %s device %x\n",
+		cpu_vendor_name(cpu->vendor), cpu->device);
 
-#if CONFIG_SMP  || CONFIG_IOPIC 
-	if (cpu->path.u.apic.apic_id != lapicid()) {
-		printk_err("CPU #%d Initialization FAILED: APIC ID mismatch (%u != %u)\n",
-				   info->index, cpu->path.u.apic.apic_id, lapicid());
-		// return without setting initialized flag
-	} else {
-#endif
-		/* Find what type of cpu we are dealing with */
-		identify_cpu(cpu);
-		printk_debug("CPU: vendor %s device %x\n",
-			cpu_vendor_name(cpu->vendor), cpu->device);
+	get_fms(&c, cpu->device);
 
-	        get_fms(&c, cpu->device);
+	printk_debug("CPU: family %02x, model %02x, stepping %02x\n", c.x86, c.x86_model, c.x86_mask);
+	
+	/* Lookup the cpu's operations */
+	set_cpu_ops(cpu);
 
-	        printk_debug("CPU: family %02x, model %02x, stepping %02x\n", c.x86, c.x86_model, c.x86_mask);
-
-			
-		/* Lookup the cpu's operations */
+	if(!cpu->ops) { 
+		/* mask out the stepping and try again */
+		cpu->device -= c.x86_mask;
 		set_cpu_ops(cpu);
+		cpu->device += c.x86_mask;
+		if(!cpu->ops) die("Unknown cpu");
+		printk_debug("WARNING: Using generic cpu ops\n");
+	}
+	
 
-		/* Initialize the cpu */
-		if (cpu->ops && cpu->ops->init) {
-			cpu->enabled = 1;
-			cpu->initialized = 1;
-			cpu->ops->init(cpu);
-		}
+	/* Initialize the cpu */
+	if (cpu->ops && cpu->ops->init) {
+		cpu->enabled = 1;
+		cpu->initialized = 1;
+		cpu->ops->init(cpu);
+	}
 
-		printk_info("CPU #%d Initialized\n", info->index);
-#if CONFIG_SMP  || CONFIG_IOPIC 
+	printk_info("CPU #%d Initialized\n", info->index);
 
-	}
-#endif
 	return;
 }
 





More information about the coreboot mailing list