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@intel.com> Reviewed-on: https://review.coreboot.org/15594 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
660c67a01f
commit
f626b9311d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue