[coreboot-gerrit] New patch to review for coreboot: fbd410a AMD Geode LX: add get_top_of_ram()

Christian Gmeiner (christian.gmeiner@gmail.com) gerrit at coreboot.org
Tue May 28 11:45:28 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 fbd410a3032591f6c55548d914c16b87c04682f4
Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Tue May 28 12:11:13 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..21ceae3 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);
+	u32 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