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

Christian Gmeiner (christian.gmeiner@gmail.com) gerrit at coreboot.org
Tue May 28 16:38:17 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 3cd0f1d471c01ce879403f019e0892aea4caf259
Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Tue May 28 17:09:29 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.
    
    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..4ab19e7 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) >> 7;
+	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