From d773fd370a92a6da2f7dbf91c085eb0df1f6f30d Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 20 Nov 2010 20:23:08 +0000 Subject: Some more DIMM0 related cleanups and deduplication. - VIA VT8235: Do the shift in smbus_read_byte() as all other chipsets do. - spd.h: Move RC00-RC63 #defines here, they were duplicated in lots of romstage.c files and lots of spd_addr.h files. Don't even bother for those spd_addr.h which aren't even actually used, drop them right away. - Replace various 0x50 hardcoded numbers with DIMM0, 0x51 with DIMM1, and 0xa0 with (DIMM0 << 1) where appropriate. - Various debug.c files: Replace SMBUS_MEM_DEVICE_START with DIMM0, SMBUS_MEM_DEVICE_END with DIMM7, and drop useless SMBUS_MEM_DEVICE_INC. - VIA VX800: Drop unused SMBUS_ADDR_CH* #defines. - VIA VT8623: Do the shift in smbus_read_byte() as all other chipsets do. Then, replace 0xa0 (which now becomes 0x50) with DIMM0. - alix1c/romstage.c, alix2d/romstage.c: Adapt to recent bit shift changes. - Various files: Drop DIMM_SPD_BASE and/or replace it with DIMM0. Signed-off-by: Uwe Hermann Acked-by: Patrick Georgi git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6100 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdk8/raminit_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/amdk8/raminit_test.c b/src/northbridge/amd/amdk8/raminit_test.c index 5700c522a2..e2a13a3c6d 100644 --- a/src/northbridge/amd/amdk8/raminit_test.c +++ b/src/northbridge/amd/amdk8/raminit_test.c @@ -268,11 +268,11 @@ static int spd_read_byte(unsigned device, unsigned address) { int result; spd_count++; - if ((device < 0x50) || (device >= (0x50 +MAX_DIMMS))) { + if ((device < DIMM0) || (device >= (DIMM0 + MAX_DIMMS))) { result = -1; } else { - device -= 0x50; + device -= DIMM0; /* 0x50 */ if (address > 256) { result = -1; @@ -324,8 +324,8 @@ static void raminit_main(void) .f1 = PCI_DEV(0, 0x18, 1), .f2 = PCI_DEV(0, 0x18, 2), .f3 = PCI_DEV(0, 0x18, 3), - .channel0 = { 0x50+0, 0x50+2, 0x50+4, 0x50+6 }, - .channel1 = { 0x50+1, 0x50+3, 0x50+5, 0x50+7 }, + .channel0 = { DIMM0+0, DIMM0+2, DIMM0+4, DIMM0+6 }, + .channel1 = { DIMM0+1, DIMM0+3, DIMM0+5, DIMM0+7 }, }, #endif #if SECOND_CPU @@ -335,8 +335,8 @@ static void raminit_main(void) .f1 = PCI_DEV(0, 0x19, 1), .f2 = PCI_DEV(0, 0x19, 2), .f3 = PCI_DEV(0, 0x19, 3), - .channel0 = { 0x50+8, 0x50+10, 0x50+12, 0x50+14 }, - .channel1 = { 0x50+9, 0x50+11, 0x50+13, 0x50+15 }, + .channel0 = { DIMM0+8, DIMM0+10, DIMM0+12, DIMM0+14 }, + .channel1 = { DIMM0+9, DIMM0+11, DIMM0+13, DIMM0+15 }, }, #endif }; -- cgit v1.2.3