This patch makes several CMOS/NVRAM reads dependent on whether there's a table to...
authorMyles Watson <mylesgw@gmail.com>
Fri, 27 Feb 2009 17:51:16 +0000 (17:51 +0000)
committerMyles Watson <mylesgw@gmail.com>
Fri, 27 Feb 2009 17:51:16 +0000 (17:51 +0000)
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3959 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

src/cpu/amd/dualcore/dualcore.c
src/cpu/amd/model_fxx/init_cpus.c
src/northbridge/amd/amdk8/coherent_ht.c
src/northbridge/amd/amdk8/raminit.c

index 51ef6034f7efb7e83cf3dad10da7f8cddfa7f4cd..5a61fac699c00c84250d17ec4d6cee7c787aeb60 100644 (file)
@@ -56,9 +56,10 @@ static inline void start_other_cores(void)
        unsigned nodes;
        unsigned nodeid;
 
-        if(read_option(CMOS_VSTART_dual_core, CMOS_VLEN_dual_core, 0) != 0)  { // disable dual_core
-                return;
-        }
+       if (HAVE_OPTION_TABLE &&
+           read_option(CMOS_VSTART_dual_core, CMOS_VLEN_dual_core, 0) != 0)  {
+               return; // disable dual_core
+       }
 
         nodes = get_nodes();
 
index e341b97b64ad85a6e92d3068d51a6a070f7993eb..8b613a624ee53fb3518f5798acd9daa2e0557754 100644 (file)
@@ -72,7 +72,7 @@ static void for_each_ap(unsigned bsp_apicid, unsigned core_range, process_ap_t p
        nodes = get_nodes();
 
         disable_siblings = !CONFIG_LOGICAL_CPUS;
-#if CONFIG_LOGICAL_CPUS == 1
+#if CONFIG_LOGICAL_CPUS == 1 && HAVE_OPTION_TABLE == 1
         if(read_option(CMOS_VSTART_dual_core, CMOS_VLEN_dual_core, 0) != 0) { // 0 mean dual core
                 disable_siblings = 1;
         }
index a224f5d7a6bbd83221e68c8598d86f88c224b598..d24a83c68f86981286d2a59b4c093af37d975892 100644 (file)
@@ -1597,7 +1597,8 @@ static void coherent_ht_finalize(unsigned nodes)
 #if CONFIG_LOGICAL_CPUS==1
        unsigned total_cpus;
 
-       if(read_option(CMOS_VSTART_dual_core, CMOS_VLEN_dual_core, 0) == 0) { /* dual_core */
+       if ((!HAVE_OPTION_TABLE) ||
+           read_option(CMOS_VSTART_dual_core, CMOS_VLEN_dual_core, 0) == 0) { /* dual_core */
                total_cpus = verify_dualcore(nodes);
        }
        else {
index 4b4b0e9c82760177852dfab566cfe51ba63649f8..ea706b8e0581d65d1fd8f563a3224930613da9ed 100644 (file)
@@ -598,11 +598,11 @@ static void hw_enable_ecc(const struct mem_controller *ctrl)
        if (nbcap & NBCAP_ECC) {
                dcl |= DCL_DimmEccEn;
        }
-       if (read_option(CMOS_VSTART_ECC_memory, CMOS_VLEN_ECC_memory, 1) == 0) {
+       if (HAVE_OPTION_TABLE &&
+           read_option(CMOS_VSTART_ECC_memory, CMOS_VLEN_ECC_memory, 1) == 0) {
                dcl &= ~DCL_DimmEccEn;
        }
        pci_write_config32(ctrl->f2, DRAM_CONFIG_LOW, dcl);
-
 }
 
 static int is_dual_channel(const struct mem_controller *ctrl)
@@ -1146,7 +1146,8 @@ static void order_dimms(const struct mem_controller *ctrl)
 {
        unsigned long tom_k, base_k;
 
-       if (read_option(CMOS_VSTART_interleave_chip_selects, CMOS_VLEN_interleave_chip_selects, 1) != 0) {
+       if ((!HAVE_OPTION_TABLE) ||
+           read_option(CMOS_VSTART_interleave_chip_selects, CMOS_VLEN_interleave_chip_selects, 1) != 0) {
                tom_k = interleave_chip_selects(ctrl);
        } else {
                print_debug("Interleaving disabled\r\n");
@@ -1450,7 +1451,7 @@ static struct spd_set_memclk_result spd_set_memclk(const struct mem_controller *
        min_cycle_time = min_cycle_times[(value >> NBCAP_MEMCLK_SHIFT) & NBCAP_MEMCLK_MASK];
        bios_cycle_time = min_cycle_times[
                read_option(CMOS_VSTART_max_mem_clock, CMOS_VLEN_max_mem_clock, 0)];
-       if (bios_cycle_time > min_cycle_time) {
+       if (HAVE_OPTION_TABLE && bios_cycle_time > min_cycle_time) {
                min_cycle_time = bios_cycle_time;
        }
        min_latency = 2;