cpu/amd/model_10xxx: Add support for early cbmem
mainboards/amd/fam10: Initialize cbmem area after raminit When GFXUMA is enabled, CBMEM is placed at TOM - UMASIZE When GFXUMA is disabled, CBMEM is placed at TOM This matches the behaviour present before conversion to early CBMEM. The CBMEM location code implicitly assumes TOM does not change between romstage and ramstage. TOM is set by romstage raminit, and is never changed by romstage or ramstage afterward. As the CBMEM location is positioned at a specific offset from TOM that is known to both romstage and ramstage early CBMEM is safe on Fam10h systems. TEST: Booted ASUS KFSN4-DRE and verified both cbmem timestamp tables from romstage and cbmem log tables from ramstage. Change-Id: Idf9e0245fe91185696ff664b06182c26b376c196 Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: http://review.coreboot.org/8489 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
This commit is contained in:
parent
e24f7d37ce
commit
86f4ca5b4b
|
@ -22,6 +22,8 @@
|
|||
#include <cpu/x86/msr.h>
|
||||
#include <cpu/amd/mtrr.h>
|
||||
|
||||
#include <cbmem.h>
|
||||
|
||||
#include "ram_calc.h"
|
||||
|
||||
uint64_t get_uma_memory_size(uint64_t topmem)
|
||||
|
@ -41,3 +43,10 @@ uint64_t get_uma_memory_size(uint64_t topmem)
|
|||
|
||||
return uma_size;
|
||||
}
|
||||
|
||||
void *cbmem_top(void)
|
||||
{
|
||||
uint32_t topmem = rdmsr(TOP_MEM).lo;
|
||||
|
||||
return (void *) topmem - get_uma_memory_size(topmem);
|
||||
}
|
||||
|
|
|
@ -200,6 +200,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -198,6 +198,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -200,6 +200,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -312,6 +312,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -200,6 +200,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -343,6 +343,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
printk(BIOS_DEBUG, "disable_spd()\n");
|
||||
|
|
|
@ -202,6 +202,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -202,6 +202,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -197,6 +197,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -201,6 +201,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -197,6 +197,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -197,6 +197,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -200,6 +200,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -204,6 +204,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
bcm5785_early_setup();
|
||||
|
|
|
@ -200,6 +200,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -205,6 +205,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -231,6 +231,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy then execute LB.
|
||||
|
|
|
@ -228,6 +228,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy + execute stage 2
|
||||
|
|
|
@ -292,6 +292,7 @@ post_code(0x40);
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy then execute LB.
|
||||
|
|
|
@ -212,6 +212,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
/*
|
||||
|
|
|
@ -227,6 +227,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct()\n");
|
||||
raminit_amdmct(sysinfo);
|
||||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy then execute LB.
|
||||
|
|
|
@ -26,7 +26,6 @@ config NORTHBRIDGE_AMD_AMDFAM10
|
|||
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
||||
select MMCONF_SUPPORT
|
||||
select PER_DEVICE_ACPI_TABLES
|
||||
select LATE_CBMEM_INIT
|
||||
|
||||
if NORTHBRIDGE_AMD_AMDFAM10
|
||||
config AGP_APERTURE_SIZE
|
||||
|
|
|
@ -897,10 +897,7 @@ static void amdfam10_domain_set_resources(device_t dev)
|
|||
}
|
||||
|
||||
#if CONFIG_GFXUMA
|
||||
set_top_of_ram(uma_memory_base);
|
||||
uma_resource(dev, 7, uma_memory_base >> 10, uma_memory_size >> 10);
|
||||
#else
|
||||
set_top_of_ram(bsp_topmem());
|
||||
#endif
|
||||
|
||||
for(link = dev->link_list; link; link = link->next) {
|
||||
|
|
Loading…
Reference in New Issue