summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/quark/memmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/soc/intel/quark/memmap.c b/src/soc/intel/quark/memmap.c
index 71e478433e..351fab7f1c 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;
}