[coreboot-gerrit] Patch set updated for coreboot: f0bd464 AMD Geode LX: add get_top_of_ram()

Christian Gmeiner (christian.gmeiner@gmail.com) gerrit at coreboot.org
Wed May 29 10:54:49 CEST 2013


Christian Gmeiner (christian.gmeiner at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3322

-gerrit

commit f0bd4644a8255ba6feb8f33ce863ce46dd6504f1
Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Wed May 29 11:20:37 2013 +0200

    AMD Geode LX: add get_top_of_ram()
    
    get_top_of_ram() is needed for EARLY_CBMEM_INIT. We are reading the
    RCONF_DEFAULT_MSR (0x1808) msr. It contains SYSTOP [27:8], which
    is the top of system memory that is available for general processor
    use.
    
    Here is a short calucation demo:
    CPU_RCONF_DEFAULT (1808): 0x25FFFC02:0x10FFDF00
    
    0x25FFFC0210FFDF00 & 0xFFFFF00 = 0xFFDF00
    0xFFDF00 << 8 = 0xFFDF0000
    
    Change-Id: Iadde6aab85ab2adc526f1ef3c5fc22e0f5b06d51
    Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
 src/northbridge/amd/lx/raminit.c | 7 +++++++
 src/northbridge/amd/lx/raminit.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/northbridge/amd/lx/raminit.c b/src/northbridge/amd/lx/raminit.c
index 9a53e9e..db9fa61 100644
--- a/src/northbridge/amd/lx/raminit.c
+++ b/src/northbridge/amd/lx/raminit.c
@@ -774,3 +774,10 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
 	print_info("RAM DLL lock\n");
 
 }
+
+unsigned long get_top_of_ram(void)
+{
+	msr_t msr = rdmsr(CPU_RCONF_DEFAULT);
+	uint32_t systop = (msr.lo & 0xFFFFF00) << 8;
+	return (unsigned long)systop;
+}
diff --git a/src/northbridge/amd/lx/raminit.h b/src/northbridge/amd/lx/raminit.h
index 3d4d4c6..8c11525 100644
--- a/src/northbridge/amd/lx/raminit.h
+++ b/src/northbridge/amd/lx/raminit.h
@@ -28,5 +28,6 @@ struct mem_controller {
 };
 
 void sdram_initialize(int controllers, const struct mem_controller *ctrl);
+unsigned long get_top_of_ram(void);
 
 #endif



More information about the coreboot-gerrit mailing list