AMD Northbridge LX: simplify get_top_of_ram()
Get rid of not needed dependency to gliu0table. This change is needed to move get_top_of_ram() to raminit.c - as needed for EARLY_CBMEM_INIT. Boot tested on a Bachmann OT200. Change-Id: I0bfe40c366a3537775d5c1ff8e0b1f5ac94320b7 Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-on: http://review.coreboot.org/3380 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
parent
b82a74c7ff
commit
bd7e8d8d2b
|
@ -716,25 +716,13 @@ static void setup_lx_cache(void)
|
||||||
|
|
||||||
unsigned long get_top_of_ram(void)
|
unsigned long get_top_of_ram(void)
|
||||||
{
|
{
|
||||||
struct gliutable *gl = 0;
|
|
||||||
uint32_t systop;
|
uint32_t systop;
|
||||||
msr_t msr;
|
msr_t msr;
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; gliu0table[i].desc_name != GL_END; i++) {
|
msr = rdmsr(MSR_GLIU0_SYSMEM);
|
||||||
if (gliu0table[i].desc_type == R_SYSMEM) {
|
systop = ((msr.hi & 0xFF) << 24) | ((msr.lo & 0xFFF00000) >> 8);
|
||||||
gl = &gliu0table[i];
|
systop += 0x1000; /* 4K */
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (gl) {
|
|
||||||
msr = rdmsr(gl->desc_name);
|
|
||||||
systop = ((msr.hi & 0xFF) << 24) | ((msr.lo & 0xFFF00000) >> 8);
|
|
||||||
systop += 0x1000; /* 4K */
|
|
||||||
} else {
|
|
||||||
systop =
|
|
||||||
((sizeram() - CONFIG_VIDEO_MB) * 1024) - SMM_SIZE - 1024;
|
|
||||||
}
|
|
||||||
return systop;
|
return systop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue