mainboards/amdfam10: Copy DIMM information to cbmem after romstage
src/northbridge/amd/amdfam10: Add amdmct_cbmem_store_info() function. Change-Id: I07376e276e3e9e3247d2576a09e58780d32a3a76 Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: http://review.coreboot.org/9138 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@gmail.com>
This commit is contained in:
parent
3e91cffd89
commit
22564088c7
|
@ -210,6 +210,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -208,6 +208,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -210,6 +210,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -322,6 +322,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -210,6 +210,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -353,6 +353,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
printk(BIOS_DEBUG, "disable_spd()\n");
|
||||
ck804_control(ctrl_conf_disable_spd, ARRAY_SIZE(ctrl_conf_disable_spd), CK804_DEVN_BASE);
|
||||
|
||||
|
|
|
@ -212,6 +212,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -212,6 +212,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -207,6 +207,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -211,6 +211,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -207,6 +207,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -207,6 +207,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -210,6 +210,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -214,6 +214,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
bcm5785_early_setup();
|
||||
|
||||
timestamp_add_now(TS_END_ROMSTAGE);
|
||||
|
|
|
@ -210,6 +210,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -215,6 +215,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -241,6 +241,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
timestamp_add_now(TS_END_ROMSTAGE);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy then execute LB.
|
||||
|
|
|
@ -238,6 +238,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
timestamp_add_now(TS_END_ROMSTAGE);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy + execute stage 2
|
||||
|
|
|
@ -301,6 +301,8 @@ post_code(0x40);
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
timestamp_add_now(TS_END_ROMSTAGE);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy then execute LB.
|
||||
|
|
|
@ -222,6 +222,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
/*
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 0), 0, 0x200);
|
||||
dump_pci_device_range(PCI_DEV(0, 0x18, 1), 0, 0x200);
|
||||
|
|
|
@ -237,6 +237,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
|
|||
cbmem_initialize_empty();
|
||||
post_code(0x41);
|
||||
|
||||
amdmct_cbmem_store_info(sysinfo);
|
||||
|
||||
timestamp_add_now(TS_END_ROMSTAGE);
|
||||
|
||||
post_cache_as_ram(); // BSP switch stack to ram, copy then execute LB.
|
||||
|
|
|
@ -204,3 +204,43 @@ static void raminit_amdmct(struct sys_info *sysinfo)
|
|||
|
||||
printk(BIOS_DEBUG, "raminit_amdmct end:\n");
|
||||
}
|
||||
|
||||
static void amdmct_cbmem_store_info(struct sys_info *sysinfo)
|
||||
{
|
||||
/* Save memory info structures for use in ramstage */
|
||||
size_t i;
|
||||
struct MCTStatStruc *pMCTstat = &(sysinfo->MCTstat);
|
||||
struct DCTStatStruc *pDCTstatA = NULL;
|
||||
|
||||
if (pMCTstat && sysinfo->DCTstatA) {
|
||||
/* Allocate memory */
|
||||
struct amdmct_memory_info* mem_info;
|
||||
mem_info = cbmem_add(CBMEM_ID_AMDMCT_MEMINFO, sizeof(struct amdmct_memory_info));
|
||||
if (!mem_info)
|
||||
return;
|
||||
|
||||
printk(BIOS_DEBUG, "%s: Storing AMDMCT configuration in CBMEM\n", __func__);
|
||||
|
||||
/* Initialize memory */
|
||||
memset(mem_info, 0, sizeof(struct amdmct_memory_info));
|
||||
|
||||
/* Copy data */
|
||||
memcpy(&mem_info->mct_stat, &(sysinfo->MCTstat), sizeof(struct MCTStatStruc));
|
||||
for (i = 0; i < MAX_NODES_SUPPORTED; i++) {
|
||||
pDCTstatA = sysinfo->DCTstatA + i;
|
||||
memcpy(&mem_info->dct_stat[i], pDCTstatA, sizeof(struct DCTStatStruc));
|
||||
}
|
||||
mem_info->ecc_enabled = mctGet_NVbits(NV_ECC_CAP);
|
||||
mem_info->ecc_scrub_rate = mctGet_NVbits(NV_DramBKScrub);
|
||||
|
||||
/* Zero out invalid/unused pointers */
|
||||
#if IS_ENABLED(CONFIG_DIMM_DDR3)
|
||||
|
||||
for (i = 0; i < MAX_NODES_SUPPORTED; i++) {
|
||||
mem_info->dct_stat[i].C_MCTPtr = NULL;
|
||||
mem_info->dct_stat[i].C_DCTPtr[0] = NULL;
|
||||
mem_info->dct_stat[i].C_DCTPtr[1] = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue