[coreboot-gerrit] Patch set updated for coreboot: soc/intel/quark: Set CBMEM top from HW register

Lee Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Mon Jul 11 17:30:38 CEST 2016


Lee Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15594

-gerrit

commit 34ae521a89826b0325ac97104459ab3531100c0e
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Sun Jul 10 14:13:19 2016 -0700

    soc/intel/quark: Set CBMEM top from HW register
    
    Properly obtain the top of memory address from the hardware registers
    set by FSP.
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: I7681d32112408b8358b4dad67f8d69581c7dde2e
    Signed-off-by: Lee Leahy <leroy.p.leahy at intel.com>
---
 src/soc/intel/quark/memmap.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/soc/intel/quark/memmap.c b/src/soc/intel/quark/memmap.c
index 71e4784..351fab7 100644
--- a/src/soc/intel/quark/memmap.c
+++ b/src/soc/intel/quark/memmap.c
@@ -15,6 +15,8 @@
 
 #include <cbmem.h>
 #include <fsp/memmap.h>
+#include <soc/QuarkNcSocId.h>
+#include <soc/reg_access.h>
 
 size_t mmap_region_granularity(void)
 {
@@ -24,6 +26,16 @@ size_t mmap_region_granularity(void)
 
 void *cbmem_top(void)
 {
-	/* TODO: Get this dynamically*/
-	return (void *)0x0afd0000;
+	UINT32 top_of_memory;
+
+	/* Determine the TSEG base */
+	top_of_memory = reg_host_bridge_unit_read(QNC_MSG_FSBIC_REG_HSMMC);
+	top_of_memory &= SMM_START_MASK;
+	top_of_memory <<= 16;
+
+	/* Reserve 64 KiB for RMU firmware */
+	top_of_memory -= 0x10000;
+
+	/* Return the top of memory */
+	return (void *)top_of_memory;
 }



More information about the coreboot-gerrit mailing list