From 5a19770667d7156dbf37c175497d06d704e9db44 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 16 Apr 2008 16:40:45 +0000 Subject: [PATCH] northbridge/amd/geodelx/raminit.c:auto_size_dimm() checks for the mathematically impossible condition of a value being above and below the specified range at the same time. Change it to check for out-of-range. arch/x86/geodelx/geodelx.c:set_delay_control() is missing a break, it will keep going and mess up DRAM timings. Signed-off-by: Carl-Daniel Hailfinger Both changes look right to me. Acked-by: Marc Jones The raminit in v2 was fixed in r2899 | rminnich | 2007-10-26 with this log: > The lxraminit change fixes a bug (&& used instead of ||) [...] > Signed-off-by: Ronald G. Minnich > Acked-by: Peter Stuge git-svn-id: svn://coreboot.org/repository/coreboot-v3@659 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/geodelx/geodelx.c | 1 + northbridge/amd/geodelx/raminit.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/geodelx/geodelx.c b/arch/x86/geodelx/geodelx.c index 99a8f59b43..e97b5fb070 100644 --- a/arch/x86/geodelx/geodelx.c +++ b/arch/x86/geodelx/geodelx.c @@ -386,6 +386,7 @@ static void set_delay_control(u8 dimm0, u8 dimm1) msr.hi |= delay_control_table[i].fast_hi; msr.lo |= delay_control_table[i].fast_low; } + break; } } wrmsr(GLCP_DELAY_CONTROLS, msr); diff --git a/northbridge/amd/geodelx/raminit.c b/northbridge/amd/geodelx/raminit.c index 2feda2f908..13161f6278 100644 --- a/northbridge/amd/geodelx/raminit.c +++ b/northbridge/amd/geodelx/raminit.c @@ -113,7 +113,7 @@ static void auto_size_dimm(unsigned int dimm, u8 dimm0, u8 dimm1) /* EEPROM byte usage: (5) Number of DIMM Banks */ banner(BIOS_DEBUG, "MODBANKS"); spd_byte = spd_read_byte(dimm, SPD_NUM_DIMM_BANKS); - if ((MIN_MOD_BANKS > spd_byte) && (spd_byte > MAX_MOD_BANKS)) { + if ((MIN_MOD_BANKS > spd_byte) || (spd_byte > MAX_MOD_BANKS)) { printk(BIOS_EMERG, "Number of module banks not compatible\n"); post_code(ERROR_BANK_SET); hlt(); @@ -124,7 +124,7 @@ static void auto_size_dimm(unsigned int dimm, u8 dimm0, u8 dimm1) /* EEPROM byte usage: (17) Number of Banks on SDRAM Device */ banner(BIOS_DEBUG, "FIELDBANKS"); spd_byte = spd_read_byte(dimm, SPD_NUM_BANKS_PER_SDRAM); - if ((MIN_DEV_BANKS > spd_byte) && (spd_byte > MAX_DEV_BANKS)) { + if ((MIN_DEV_BANKS > spd_byte) || (spd_byte > MAX_DEV_BANKS)) { printk(BIOS_EMERG, "Number of device banks not compatible\n"); post_code(ERROR_BANK_SET); hlt();