diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2011-05-10 21:53:13 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2011-05-10 21:53:13 +0000 |
commit | b251753b4fae1e827f5398daf679773eba643dce (patch) | |
tree | 3e5f0b12e9a036f36c7c8bdffab8845637748453 /src/northbridge/amd | |
parent | 6649d9740d79b8c52d40218d78393547aaad7548 (diff) |
Change read_option() to a macro that wraps some API uglyness
Simplify
read_option(CMOS_VSTART_foo, CMOS_VLEN_foo, somedefault)
to
read_option(foo, somedefault)
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6565 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r-- | src/northbridge/amd/amdk8/coherent_ht.c | 2 | ||||
-rw-r--r-- | src/northbridge/amd/amdk8/raminit.c | 6 | ||||
-rw-r--r-- | src/northbridge/amd/amdk8/raminit_f.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/northbridge/amd/amdk8/coherent_ht.c b/src/northbridge/amd/amdk8/coherent_ht.c index f66e2cffd6..8b50eed790 100644 --- a/src/northbridge/amd/amdk8/coherent_ht.c +++ b/src/northbridge/amd/amdk8/coherent_ht.c @@ -1599,7 +1599,7 @@ static void coherent_ht_finalize(unsigned nodes) #if CONFIG_LOGICAL_CPUS==1 unsigned total_cpus; - if (read_option(CMOS_VSTART_multi_core, CMOS_VLEN_multi_core, 0) == 0) { /* multi_core */ + if (read_option(multi_core, 0) == 0) { /* multi_core */ total_cpus = verify_dualcore(nodes); } else { diff --git a/src/northbridge/amd/amdk8/raminit.c b/src/northbridge/amd/amdk8/raminit.c index 2b76cffd19..3583dc39b6 100644 --- a/src/northbridge/amd/amdk8/raminit.c +++ b/src/northbridge/amd/amdk8/raminit.c @@ -548,7 +548,7 @@ 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 (read_option(ECC_memory, 1) == 0) { dcl &= ~DCL_DimmEccEn; } pci_write_config32(ctrl->f2, DRAM_CONFIG_LOW, dcl); @@ -1100,7 +1100,7 @@ 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 (read_option(interleave_chip_selects, 1) != 0) { tom_k = interleave_chip_selects(ctrl); } else { printk(BIOS_DEBUG, "Interleaving disabled\n"); @@ -1530,7 +1530,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)]; + read_option(max_mem_clock, 0)]; if (bios_cycle_time > min_cycle_time) { min_cycle_time = bios_cycle_time; } diff --git a/src/northbridge/amd/amdk8/raminit_f.c b/src/northbridge/amd/amdk8/raminit_f.c index 9ccc56b2b2..3e6118dcd8 100644 --- a/src/northbridge/amd/amdk8/raminit_f.c +++ b/src/northbridge/amd/amdk8/raminit_f.c @@ -1108,7 +1108,7 @@ static unsigned long interleave_chip_selects(const struct mem_controller *ctrl, * and if so count them. */ #if defined(CMOS_VSTART_interleave_chip_selects) - if (read_option(CMOS_VSTART_interleave_chip_selects, CMOS_VLEN_interleave_chip_selects, 1) == 0) + if (read_option(interleave_chip_selects, 1) == 0) return 0; #else #if !CONFIG_INTERLEAVE_CHIP_SELECTS @@ -1806,7 +1806,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[ #ifdef CMOS_VSTART_max_mem_clock - read_option(CMOS_VSTART_max_mem_clock, CMOS_VLEN_max_mem_clock, 0) + read_option(max_mem_clock, 0) #else #if defined(CONFIG_MAX_MEM_CLOCK) CONFIG_MAX_MEM_CLOCK @@ -2375,7 +2375,7 @@ static void set_ecc(const struct mem_controller *ctrl, dcl |= DCL_DimmEccEn; } #ifdef CMOS_VSTART_ECC_memory - if (read_option(CMOS_VSTART_ECC_memory, CMOS_VLEN_ECC_memory, 1) == 0) { + if (read_option(ECC_memory, 1) == 0) { dcl &= ~DCL_DimmEccEn; } #else // CMOS_VSTART_ECC_memory not defined |