From d93af23d6aa69e2b8534fabcd8b123d751b65fd8 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sun, 11 Apr 2010 18:54:47 +0000 Subject: simplify ram_read32 on i82830 Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5404 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/intel/i82830/raminit.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/northbridge/intel/i82830/raminit.c b/src/northbridge/intel/i82830/raminit.c index 93371c9ebc..8d75c42189 100644 --- a/src/northbridge/intel/i82830/raminit.c +++ b/src/northbridge/intel/i82830/raminit.c @@ -75,25 +75,18 @@ static void do_ram_command(u32 command) static void ram_read32(u8 dimm_start, u32 offset) { -#if CONFIG_DEBUG_RAM_SETUP - if (offset == 0x55aa55aa) { - PRINTK_DEBUG(" Reading RAM at 0x%08x => 0x%08x\n", (dimm_start * 32 * 1024 * 1024), read32(dimm_start * 32 * 1024 * 1024)); - PRINTK_DEBUG(" Writing RAM at 0x%08x <= 0x%08x\n", (dimm_start * 32 * 1024 * 1024), offset); - write32(dimm_start * 32 * 1024 * 1024, offset); - PRINTK_DEBUG(" Reading RAM at 0x%08x => 0x%08x\n", (dimm_start * 32 * 1024 * 1024), read32(dimm_start * 32 * 1024 * 1024)); - } else { - PRINTK_DEBUG(" to 0x%08x\n", (dimm_start * 32 * 1024 * 1024) + offset); - read32((dimm_start * 32 * 1024 * 1024) + offset); - } -#else + u32 reg32, base_addr = 32 * 1024 * 1024 * dimm_start; if (offset == 0x55aa55aa) { - read32(dimm_start * 32 * 1024 * 1024); - write32(dimm_start * 32 * 1024 * 1024, offset); - read32(dimm_start * 32 * 1024 * 1024); + reg32 = read32(base_addr); + PRINTK_DEBUG(" Reading RAM at 0x%08x => 0x%08x\n", base_addr, reg32); + PRINTK_DEBUG(" Writing RAM at 0x%08x <= 0x%08x\n", base_addr, offset); + write32(base_addr, offset); + reg32 = read32(base_addr); + PRINTK_DEBUG(" Reading RAM at 0x%08x => 0x%08x\n", base_addr, reg32); } else { - read32((dimm_start * 32 * 1024 * 1024) + offset); + PRINTK_DEBUG(" to 0x%08x\n", base_addr + offset); + read32(base_addr + offset); } -#endif } static void initialize_dimm_rows(void) -- cgit v1.2.3