From 10ec0fed8e3336d52ab35f8da91a2a9423d3e969 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 25 Sep 2010 10:40:47 +0000 Subject: - Fix race condition in option_table.h generation by moving the include statement to those files that actually need it. This significantly reduces the number of dependencies, so it's no longer extremely ugly to specify them manually (see the src/pc80/Makefile.inc portion) - Add double include guards around option_table.h defines - Also, drop the AMD DBM690T work around for the issue Signed-off-by: Stefan Reinauer Acked-by: Myles Watson git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5838 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdk8/coherent_ht.c | 3 +++ src/northbridge/amd/amdk8/raminit.c | 3 +++ src/northbridge/amd/amdk8/raminit_f.c | 3 +++ src/northbridge/intel/e7520/raminit.c | 11 ++++++++--- src/northbridge/intel/e7525/raminit.c | 9 +++++++-- 5 files changed, 24 insertions(+), 5 deletions(-) (limited to 'src/northbridge') diff --git a/src/northbridge/amd/amdk8/coherent_ht.c b/src/northbridge/amd/amdk8/coherent_ht.c index ad787caabd..f1f5bbc35c 100644 --- a/src/northbridge/amd/amdk8/coherent_ht.c +++ b/src/northbridge/amd/amdk8/coherent_ht.c @@ -69,6 +69,9 @@ #include #include "arch/romcc_io.h" #include +#if CONFIG_HAVE_OPTION_TABLE +#include "option_table.h" +#endif #include "amdk8.h" diff --git a/src/northbridge/amd/amdk8/raminit.c b/src/northbridge/amd/amdk8/raminit.c index efb7738306..a48a835185 100644 --- a/src/northbridge/amd/amdk8/raminit.c +++ b/src/northbridge/amd/amdk8/raminit.c @@ -10,6 +10,9 @@ #include #include "raminit.h" #include "amdk8.h" +#if CONFIG_HAVE_OPTION_TABLE +#include "option_table.h" +#endif #if (CONFIG_RAMTOP & (CONFIG_RAMTOP -1)) != 0 # error "CONFIG_RAMTOP must be a power of 2" diff --git a/src/northbridge/amd/amdk8/raminit_f.c b/src/northbridge/amd/amdk8/raminit_f.c index ff3eb3914d..916f04d67b 100644 --- a/src/northbridge/amd/amdk8/raminit_f.c +++ b/src/northbridge/amd/amdk8/raminit_f.c @@ -28,6 +28,9 @@ #include "raminit.h" #include "amdk8_f.h" #include +#if CONFIG_HAVE_OPTION_TABLE +#include "option_table.h" +#endif #ifndef QRANK_DIMM_SUPPORT #define QRANK_DIMM_SUPPORT 0 diff --git a/src/northbridge/intel/e7520/raminit.c b/src/northbridge/intel/e7520/raminit.c index 7f1b9d500a..0ef73cc026 100644 --- a/src/northbridge/intel/e7520/raminit.c +++ b/src/northbridge/intel/e7520/raminit.c @@ -23,6 +23,9 @@ #include #include "raminit.h" #include "e7520.h" +#if CONFIG_HAVE_OPTION_TABLE +#include "option_table.h" +#endif #define BAR 0x40000000 @@ -619,11 +622,13 @@ static int spd_set_dram_controller_mode(const struct mem_controller *ctrl, } ecc = 2; - if (read_option(CMOS_VSTART_ECC_memory,CMOS_VLEN_ECC_memory,1) == 0) { +#if CONFIG_HAVE_OPTION_TABLE + if (read_option(CMOS_VSTART_ECC_memory, CMOS_VLEN_ECC_memory, 1) == 0) { ecc = 0; /* ECC off in CMOS so disable it */ print_debug("ECC off\n"); - } - else { + } else +#endif + { print_debug("ECC on\n"); } drc &= ~(3 << 20); /* clear the ecc bits */ diff --git a/src/northbridge/intel/e7525/raminit.c b/src/northbridge/intel/e7525/raminit.c index be44434bf5..a33b0c7680 100644 --- a/src/northbridge/intel/e7525/raminit.c +++ b/src/northbridge/intel/e7525/raminit.c @@ -23,6 +23,9 @@ #include #include "raminit.h" #include "e7525.h" +#if CONFIG_HAVE_OPTION_TABLE +#include "option_table.h" +#endif #define BAR 0x40000000 @@ -619,11 +622,13 @@ static int spd_set_dram_controller_mode(const struct mem_controller *ctrl, } ecc = 2; +#if CONFIG_HAVE_OPTION_TABLE if (read_option(CMOS_VSTART_ECC_memory,CMOS_VLEN_ECC_memory,1) == 0) { ecc = 0; /* ECC off in CMOS so disable it */ print_debug("ECC off\n"); - } - else { + } else +#endif + { print_debug("ECC on\n"); } drc &= ~(3 << 20); /* clear the ecc bits */ -- cgit v1.2.3