[LinuxBIOS] LNXI Merge: lnxi-patch-12/16

jason schildt jschildt at lnxi.com
Sat Sep 3 00:03:31 CEST 2005


DESCRIPTION:
-------------------------------------------------
## lnxi-patch-12 ## (20)files

src/mainboard/{all_opteron_boards}/auto.c
		/Iwill/DK8S2/auto.c:
		/Iwill/DK8X/auto.c:
		/arima/hdama/auto.c:
		/newisys/khepri/auto.c:
		/amd/quartet/auto.c:
		/amd/serenade/auto.c:
		/amd/solo/auto.c:
		/ibm/e326/auto.c:
		/ibm/e325/auto.c:
		/island/aruma/auto.c:
		/tyan/s2880/auto.c:
		/tyan/s2881/auto.c:
		/tyan/s2882/auto.c:
		/tyan/s2891/auto.c:
		/tyan/s4880/auto.c:
		/tyan/s2892/auto.c:
		/tyan/s2875/auto.c:
		/tyan/s4882/auto.c:
		/tyan/s2885/auto.c:
		/tyan/s2895/auto.c:

	Substituded:
	k8_init_and_stop_secondaries() for old k8 Preamble.




DIFFSTAT:
-------------------------------------------------
Iwill/DK8S2/auto.c    |   16 +--------
  Iwill/DK8X/auto.c     |   15 +--------
  amd/quartet/auto.c    |   17 +---------
  amd/serenade/auto.c   |   16 +--------
  amd/solo/auto.c       |   20 +-----------
  arima/hdama/auto.c    |   24 ++++----------
  ibm/e325/auto.c       |   17 +---------
  ibm/e326/auto.c       |   17 +---------
  island/aruma/auto.c   |   55 +++++++++------------------------
  newisys/khepri/auto.c |   17 +---------
  tyan/s2875/auto.c     |   50 +-----------------------------
  tyan/s2880/auto.c     |   45 +--------------------------
  tyan/s2881/auto.c     |   43 +-------------------------
  tyan/s2882/auto.c     |   45 +--------------------------
  tyan/s2885/auto.c     |   77  
+---------------------------------------------
  tyan/s2891/auto.c     |   53 +++-----------------------------
  tyan/s2892/auto.c     |   54 ++------------------------------
  tyan/s2895/auto.c     |   82  
+-------------------------------------------------
  tyan/s4880/auto.c     |   50 +-----------------------------
  tyan/s4882/auto.c     |   74 +--------------------------------------------
  20 files changed, 68 insertions(+), 719 deletions(-)




PATCH:
-------------------------------------------------

Index: Iwill/DK8S2/auto.c
===================================================================
--- Iwill/DK8S2/auto.c	(revision 1105)
+++ Iwill/DK8S2/auto.c	(working copy)
@@ -23,7 +23,9 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

+
  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

  static void hard_reset(void)
@@ -161,19 +163,7 @@
          unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+		k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */	
  	w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: Iwill/DK8X/auto.c
===================================================================
--- Iwill/DK8X/auto.c	(revision 1105)
+++ Iwill/DK8X/auto.c	(working copy)
@@ -20,9 +20,11 @@
  #include "northbridge/amd/amdk8/reset_test.c"
  #include "northbridge/amd/amdk8/debug.c"
  #include "northbridge/amd/amdk8/cpu_rev.c"
+
  #include "superio/NSC/pc87360/pc87360_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87360_SP1)

@@ -163,18 +165,7 @@
          unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	pc87360_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: arima/hdama/auto.c
===================================================================
--- arima/hdama/auto.c	(revision 1105)
+++ arima/hdama/auto.c	(working copy)
@@ -22,6 +22,7 @@
  #include "superio/NSC/pc87360/pc87360_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87360_SP1)

@@ -135,7 +136,7 @@
  	};

  	if (maxnodes > 2) {
-		print_debug("this mainboard is only designed for 2 cpus\r\n");
+		print_spew("this mainboard is only designed for 2 cpus\r\n");
  		maxnodes = 2;
  	}

@@ -165,6 +166,8 @@
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
+
+
  static void main(unsigned long bist)
  {
  	static const struct mem_controller cpu[] = {
@@ -194,21 +197,7 @@

  	int needs_reset;
  	if (bist == 0) {
-		unsigned nodeid;
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-		nodeid = lapicid() & 0xf;
-
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+		k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	pc87360_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -235,12 +224,13 @@

  	memreset_setup();
  	sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
-
+	
  #if 0
  	dump_pci_devices();
  #endif
  #if 0
  	dump_pci_device(PCI_DEV(0, 0x18, 2));
+	dump_pci_device(PCI_DEV(0, 0x18, 3));
  #endif

  #if 0
Index: newisys/khepri/auto.c
===================================================================
--- newisys/khepri/auto.c	(revision 1105)
+++ newisys/khepri/auto.c	(working copy)
@@ -23,6 +23,7 @@
  #include "superio/NSC/pc87360/pc87360_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87360_SP1)

@@ -111,21 +112,7 @@
          unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-
-                nodeid = lapicid() & 0xf;
-
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	pc87360_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: amd/quartet/auto.c
===================================================================
--- amd/quartet/auto.c	(revision 1105)
+++ amd/quartet/auto.c	(working copy)
@@ -26,6 +26,7 @@
  #include "superio/NSC/pc87360/pc87360_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87360_SP1)

@@ -212,21 +213,7 @@
  	unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-		nodeid = lapicid() & 0xf;
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-
-		distinguish_cpu_resets(nodeid);
-
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	pc87360_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: amd/serenade/auto.c
===================================================================
--- amd/serenade/auto.c	(revision 1105)
+++ amd/serenade/auto.c	(working copy)
@@ -25,6 +25,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -163,20 +164,7 @@
  	int needs_reset;
  	unsigned nodeid;
  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-		nodeid = lapicid() & 0xf;
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: amd/solo/auto.c
===================================================================
--- amd/solo/auto.c	(revision 1105)
+++ amd/solo/auto.c	(working copy)
@@ -23,6 +23,7 @@
  #include "superio/NSC/pc87360/pc87360_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87360_SP1)

@@ -111,24 +112,7 @@
  	unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		
-		enable_lapic();
-		init_timer();
-
-		nodeid = lapicid() & 0xf;
-		
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-
-		distinguish_cpu_resets(nodeid);
-		
-		if (!boot_cpu()) {
-			/* This LinuxBIOS image is built for UP only */
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}

  	/* Setup the console */
Index: ibm/e325/auto.c
===================================================================
--- ibm/e325/auto.c	(revision 1105)
+++ ibm/e325/auto.c	(working copy)
@@ -25,6 +25,7 @@
  #include "superio/NSC/pc87366/pc87366_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87366_SP1)

@@ -161,21 +162,7 @@
          unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-
-                nodeid = lapicid() & 0xf;
-
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	pc87366_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: ibm/e326/auto.c
===================================================================
--- ibm/e326/auto.c	(revision 1105)
+++ ibm/e326/auto.c	(working copy)
@@ -25,6 +25,7 @@
  #include "superio/NSC/pc87366/pc87366_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, PC87366_SP1)

@@ -161,21 +162,7 @@
          unsigned nodeid;

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-
-                nodeid = lapicid() & 0xf;
-
-		/* Has this cpu already booted? */
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	pc87366_enable_serial(SERIAL_DEV, TTYS0_BASE);
Index: island/aruma/auto.c
===================================================================
--- island/aruma/auto.c	(revision 1105)
+++ island/aruma/auto.c	(working copy)
@@ -25,6 +25,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -128,31 +129,7 @@
  	int needs_reset;

  	if (bist == 0) {
-		unsigned nodeid;
-		
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-		enable_lapic();
-		init_timer();
-
-		nodeid=lapicid() & 0xf;
-
-		
-#if ENABLE_APIC_EXT_ID == 1
-                enable_apic_ext_id(nodeid);
-                if(nodeid != 0) {
-			/* CPU apicid is from 0x10 */
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID)
-						| (APIC_ID_OFFSET<<24) ) );
-                }
-#endif
-		if (cpu_init_detected(nodeid)) {
-			asm volatile ("jmp __cpu_reset");
-		}
-		distinguish_cpu_resets(nodeid);
-		if (!boot_cpu()) {
-			stop_this_cpu();
-		}
+	    	k8_init_and_stop_secondaries();
  	}
  	/* Setup the console */
  	w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -173,20 +150,20 @@
          print_pci_devices();
  #endif
  	
-#if (ALLOW_HT_OVERCLOCKING==1) && (USE_FALLBACK_IMAGE==0)
-	if(read_option(CMOS_VSTART_amdk8_1GHz, CMOS_VLEN_amdk8_1GHz, 0))
-	{
-		print_debug("AMDK8 allowed at 1GHz\r\n");
-	} else {
-		print_debug("AMDK8 allowed at 800Hz only\r\n");
-	}
-	if(read_option(CMOS_VSTART_amd8131_800MHz, CMOS_VLEN_amd8131_800MHz, 0))
-	{
-		print_debug("AMD8131 allowed at 800MHz\r\n");
-	} else {
-		print_debug("AMD8131 allowed at 600Hz only\r\n");
-	}
-#endif
+//#if (ALLOW_HT_OVERCLOCKING==1) && (USE_FALLBACK_IMAGE==0)
+//	if(read_option(CMOS_VSTART_amdk8_1GHz, CMOS_VLEN_amdk8_1GHz, 0))
+//	{
+//		print_debug("AMDK8 allowed at 1GHz\r\n");
+//	} else {
+//		print_debug("AMDK8 allowed at 800Hz only\r\n");
+//	}
+//	if(read_option(CMOS_VSTART_amd8131_800MHz, CMOS_VLEN_amd8131_800MHz,  
0))
+//	{
+//		print_debug("AMD8131 allowed at 800MHz\r\n");
+//	} else {
+//		print_debug("AMD8131 allowed at 600Hz only\r\n");
+//	}
+//#endif
  	if (needs_reset) {
  		print_info("HyperT reset -\r\n");
  		soft_reset();
Index: tyan/s2880/auto.c
===================================================================
--- tyan/s2880/auto.c	(revision 1105)
+++ tyan/s2880/auto.c	(working copy)
@@ -24,6 +24,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -149,46 +150,8 @@
  	};
          int needs_reset;

-#if CONFIG_LOGICAL_CPUS==1
-        struct node_core_id id;
-#else
-        unsigned nodeid;
-#endif
-
          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+	    	k8_init_and_stop_secondaries();
          }

          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -201,10 +164,6 @@
          setup_default_resource_map();
          needs_reset = setup_coherent_ht_domain();

-#if CONFIG_LOGICAL_CPUS==1
-        start_other_cores();
-#endif
-
          needs_reset |= ht_setup_chain(PCI_DEV(0, 0x18, 0), 0x80);
          if (needs_reset) {
                  print_info("ht reset -\r\n");
Index: tyan/s2881/auto.c
===================================================================
--- tyan/s2881/auto.c	(revision 1105)
+++ tyan/s2881/auto.c	(working copy)
@@ -24,6 +24,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -114,11 +115,6 @@
   /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
@@ -156,39 +152,7 @@
  #endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+                k8_init_and_stop_secondaries();
          }

          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -200,9 +164,6 @@

          setup_s2881_resource_map();
          needs_reset = setup_coherent_ht_domain();
-#if CONFIG_LOGICAL_CPUS==1
-        start_other_cores();
-#endif
          // automatically set that for you, but you might meet tight space
          needs_reset |= ht_setup_chains_x();
          if (needs_reset) {
Index: tyan/s2882/auto.c
===================================================================
--- tyan/s2882/auto.c	(revision 1105)
+++ tyan/s2882/auto.c	(working copy)
@@ -24,6 +24,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -113,11 +114,6 @@
  #include "northbridge/amd/amdk8/coherent_ht.c"
  #include "sdram/generic_sdram.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
@@ -160,41 +156,9 @@
  #endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
+        	k8_init_and_stop_secondaries();
+	}

-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
-        }
-
          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
          uart_init();
          console_init();
@@ -204,9 +168,6 @@

          setup_default_resource_map();
          needs_reset = setup_coherent_ht_domain();
-#if CONFIG_LOGICAL_CPUS==1
-        start_other_cores();
-#endif
          needs_reset |= ht_setup_chains_x();
          if (needs_reset) {
                  print_info("ht reset -\r\n");
Index: tyan/s2891/auto.c
===================================================================
--- tyan/s2891/auto.c	(revision 1105)
+++ tyan/s2891/auto.c	(working copy)
@@ -26,6 +26,7 @@

  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #include "northbridge/amd/amdk8/setup_resource_map.c"

@@ -77,11 +78,6 @@
   /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
@@ -125,45 +121,10 @@
  #endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                post_code(0x31);
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+	    	k8_init_and_stop_secondaries();
          }

-	post_code(0x32);
+	// post_code(0x32);
  	
   	w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
          uart_init();
@@ -175,13 +136,9 @@
          setup_s2891_resource_map();

  	needs_reset = setup_coherent_ht_domain();
+
+	needs_reset |= ht_setup_chains_x();

-#if CONFIG_LOGICAL_CPUS==1
-        // It is said that we should start core1 after all core0 launched
-        start_other_cores();
-#endif
-        needs_reset |= ht_setup_chains_x();
-
          needs_reset |= ck804_early_setup_x();

         	if (needs_reset) {
Index: tyan/s4880/auto.c
===================================================================
--- tyan/s4880/auto.c	(revision 1105)
+++ tyan/s4880/auto.c	(working copy)
@@ -24,6 +24,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -125,11 +126,6 @@
   /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1

@@ -202,47 +198,9 @@
  	};
  	int i;
          int needs_reset;
-#if CONFIG_LOGICAL_CPUS==1
-        struct node_core_id id;
-#else
-        unsigned nodeid;
-#endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-//                        start_other_core(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+	    	k8_init_and_stop_secondaries();
          }

          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -256,10 +214,6 @@

          needs_reset = setup_coherent_ht_domain();

-#if CONFIG_LOGICAL_CPUS==1
-        start_other_cores();
-#endif
-
          needs_reset |= ht_setup_chains_x();
  	
          if (needs_reset) {
Index: tyan/s2892/auto.c
===================================================================
--- tyan/s2892/auto.c	(revision 1105)
+++ tyan/s2892/auto.c	(working copy)
@@ -26,6 +26,7 @@

  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #include "northbridge/amd/amdk8/setup_resource_map.c"

@@ -76,11 +77,6 @@
   /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
@@ -125,47 +121,9 @@
  	};

          int needs_reset;
-#if CONFIG_LOGICAL_CPUS==1
-        struct node_core_id id;
-#else
-        unsigned nodeid;
-#endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-//                        start_other_core(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+	    	k8_init_and_stop_secondaries();
          }

  	
@@ -179,13 +137,9 @@
          setup_s2892_resource_map();

  	needs_reset = setup_coherent_ht_domain();
+
+	needs_reset |= ht_setup_chains_x();

-#if CONFIG_LOGICAL_CPUS==1
-        // It is said that we should start core1 after all core0 launched
-        start_other_cores();
-#endif
-        needs_reset |= ht_setup_chains_x();
-
  	needs_reset |= ck804_early_setup_x();

         	if (needs_reset) {
Index: tyan/s2875/auto.c
===================================================================
--- tyan/s2875/auto.c	(revision 1105)
+++ tyan/s2875/auto.c	(working copy)
@@ -24,6 +24,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -112,11 +113,6 @@
  #include "sdram/generic_sdram.c"
  #include "northbridge/amd/amdk8/resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
@@ -149,47 +145,8 @@

          int needs_reset;

-#if CONFIG_LOGICAL_CPUS==1
-        struct node_core_id id;
-#else
-        unsigned nodeid;
-#endif
-
          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-                id = get_node_core_id_x();
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-//                        start_other_core(id.nodeid);
-                }
-#else
-                nodeid = lapicid();
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+		k8_init_and_stop_secondaries();
          }

          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -202,9 +159,6 @@
          setup_default_resource_map();
          needs_reset = setup_coherent_ht_domain();

-#if CONFIG_LOGICAL_CPUS==1
-        start_other_cores();
-#endif
          needs_reset |= ht_setup_chain(PCI_DEV(0, 0x18, 0), 0x80);
          if (needs_reset) {
                  print_info("ht reset -\r\n");
Index: tyan/s4882/auto.c
===================================================================
--- tyan/s4882/auto.c	(revision 1105)
+++ tyan/s4882/auto.c	(working copy)
@@ -23,6 +23,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -129,13 +130,6 @@
   /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#else
-#include "cpu/amd/model_fxx/node_id.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1

@@ -208,68 +202,9 @@
  	};
  	int i;
          int needs_reset;
-#if CONFIG_LOGICAL_CPUS==1
-        struct node_core_id id;
-#else
-        unsigned nodeid;
-#endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-
-                id = get_node_core_id_x(); // that is initid
-        #if ENABLE_APIC_EXT_ID == 1
-                if(id.coreid == 0) {
-                        enable_apic_ext_id(id.nodeid);
-                }
-        #endif
-#else
-                nodeid = get_node_id();
-        #if ENABLE_APIC_EXT_ID == 1
-                enable_apic_ext_id(nodeid);
-        #endif
-#endif
-
-                enable_lapic();
-                init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-        #if ENABLE_APIC_EXT_ID == 1
-            #if LIFT_BSP_APIC_ID == 0
-                if( id.nodeid != 0 ) //all except cores in node0
-            #endif
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID) |  
(APIC_ID_OFFSET<<24) ) );
-        #endif
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-#else
-        #if ENABLE_APIC_EXT_ID == 1
-            #if LIFT_BSP_APIC_ID == 0
-                if(nodeid != 0)
-            #endif
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID) |  
(APIC_ID_OFFSET<<24) ) ); // CPU apicid is from 0x10
-        #endif
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+		k8_init_and_stop_secondaries();
          }

          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -283,11 +218,6 @@

          needs_reset = setup_coherent_ht_domain();

-#if CONFIG_LOGICAL_CPUS==1
-        // It is said that we should start core1 after all core0 launched
-        start_other_cores();
-#endif
-
          needs_reset |= ht_setup_chains_x();
          if (needs_reset) {
                  print_info("ht reset -\r\n");
Index: tyan/s2885/auto.c
===================================================================
--- tyan/s2885/auto.c	(revision 1105)
+++ tyan/s2885/auto.c	(working copy)
@@ -23,6 +23,7 @@
  #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)

@@ -121,13 +122,6 @@
  /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#else
-#include "cpu/amd/model_fxx/node_id.c"
-#endif
-
  #define FIRST_CPU  1
  #define SECOND_CPU 1
  #define TOTAL_CPUS (FIRST_CPU + SECOND_CPU)
@@ -160,72 +154,9 @@
          };

          int needs_reset;
-#if CONFIG_LOGICAL_CPUS==1
-	struct node_core_id id;
-#else
-	unsigned nodeid;
-#endif

  	if (bist == 0) {
-		/* Skip this if there was a built in self test failure */
-		amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-
-                id = get_node_core_id_x(); // that is initid
-        #if ENABLE_APIC_EXT_ID == 1
-                if(id.coreid == 0) {
-                        enable_apic_ext_id(id.nodeid);
-                }
-        #endif
-#else
-                nodeid = get_node_id();
-        #if ENABLE_APIC_EXT_ID == 1
-                enable_apic_ext_id(nodeid);
-        #endif
-#endif
-
-	        enable_lapic();
-        	init_timer();
-
-#if CONFIG_LOGICAL_CPUS==1
-        #if ENABLE_APIC_EXT_ID == 1
-            #if LIFT_BSP_APIC_ID == 0
-                if( id.nodeid != 0 ) //all except cores in node0
-            #endif
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID) |  
(APIC_ID_OFFSET<<24) ) );
-        #endif
-
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-
-#else
-        #if ENABLE_APIC_EXT_ID == 1
-            #if LIFT_BSP_APIC_ID == 0
-                if(nodeid != 0)
-            #endif
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID) |  
(APIC_ID_OFFSET<<24) ) ); // CPU apicid is from 0x10
-
-        #endif
-
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-        	if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-			|| (id.coreid != 0)
-#endif
-		) {
-                	stop_this_cpu(); // it will stop all cores except core0  
of cpu0
-        	}
+	    	k8_init_and_stop_secondaries();
  	}
  	
          w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
@@ -238,10 +169,6 @@
          setup_s2885_resource_map();
          needs_reset = setup_coherent_ht_domain();

-#if CONFIG_LOGICAL_CPUS==1
-        start_other_cores();
-#endif
-
  	// automatically set that for you, but you might meet tight space
          needs_reset |= ht_setup_chains_x();

Index: tyan/s2895/auto.c
===================================================================
--- tyan/s2895/auto.c	(revision 1105)
+++ tyan/s2895/auto.c	(working copy)
@@ -28,6 +28,7 @@

  #include "cpu/amd/mtrr/amd_earlymtrr.c"
  #include "cpu/x86/bist.h"
+#include "cpu/amd/dualcore/dualcore.c"

  #include "superio/smsc/lpc47b397/lpc47b397_early_gpio.c"

@@ -106,12 +107,6 @@
  /* tyan does not want the default */
  #include "resourcemap.c"

-#if CONFIG_LOGICAL_CPUS==1
-#define SET_NB_CFG_54 1
-#include "cpu/amd/dualcore/dualcore.c"
-#else
-#include "cpu/amd/model_fxx/node_id.c"
-#endif

  #define FIRST_CPU  1
  #define SECOND_CPU 1
@@ -163,79 +158,12 @@
  	};

          int needs_reset;
-#if CONFIG_LOGICAL_CPUS==1
-        struct node_core_id id;
-#else
-        unsigned nodeid;
-#endif

          if (bist == 0) {
-                /* Skip this if there was a built in self test failure */
-                amd_early_mtrr_init();
-
-#if CONFIG_LOGICAL_CPUS==1
-                set_apicid_cpuid_lo();
-
-                id = get_node_core_id_x(); // that is initid
-        #if ENABLE_APIC_EXT_ID == 1
-                if(id.coreid == 0) {
-                        enable_apic_ext_id(id.nodeid);
-                }
-        #endif
-#else
-                nodeid = get_node_id();
-        #if ENABLE_APIC_EXT_ID == 1
-                enable_apic_ext_id(nodeid);
-        #endif
-#endif
-
-                enable_lapic();
-                init_timer();
-
-                post_code(0x30);
-
-#if CONFIG_LOGICAL_CPUS==1
-        #if ENABLE_APIC_EXT_ID == 1
-            #if LIFT_BSP_APIC_ID == 0
-                if( id.nodeid != 0 ) //all except cores in node0
-            #endif
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID) |  
(APIC_ID_OFFSET<<24) ) );
-        #endif
-
-                if(id.coreid == 0) {
-                        if (cpu_init_detected(id.nodeid)) {
-                                asm volatile ("jmp __cpu_reset");
-                        }
-                        distinguish_cpu_resets(id.nodeid);
-                }
-
-#else
-        #if ENABLE_APIC_EXT_ID == 1
-            #if LIFT_BSP_APIC_ID == 0
-                if(nodeid != 0)
-            #endif
-                        lapic_write(LAPIC_ID, ( lapic_read(LAPIC_ID) |  
(APIC_ID_OFFSET<<24) ) ); // CPU apicid is from 0x10
-
-        #endif
-
-                if (cpu_init_detected(nodeid)) {
-                        asm volatile ("jmp __cpu_reset");
-                }
-                distinguish_cpu_resets(nodeid);
-#endif
-
-                post_code(0x31);
-
-                if (!boot_cpu()
-#if CONFIG_LOGICAL_CPUS==1
-                        || (id.coreid != 0)
-#endif
-                ) {
-                        stop_this_cpu(); // it will stop all cores except  
core0 of cpu0
-                }
+	    	k8_init_and_stop_secondaries();
          }

-	post_code(0x32);
+	// post_code(0x32);

          lpc47b397_enable_serial(SERIAL_DEV, TTYS0_BASE);
          uart_init();
@@ -249,10 +177,6 @@
          setup_s2895_resource_map();

  	needs_reset = setup_coherent_ht_domain();
-#if CONFIG_LOGICAL_CPUS==1
-        // It is said that we should start core1 after all core0 launched
-        start_other_cores();
-#endif

          needs_reset |= ht_setup_chains_x();



-- 
Jason W. Schildt
LinuxBIOS Software Engineer
Linux Networx




More information about the coreboot mailing list