soc/amd/common: Factor out InitPost printed results to function

Make a static function that can report the AmdInitPost() results.  This
makes it easier to keep lines within 80 columns.  Clean up surrounding
source.

BUG=b:62240746
TEST=Build and boot Kahlee

Change-Id: I6d288e76e7510528659436e61fdfa1d5db01f06c
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/22887
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Marshall Dawson 2017-12-14 09:08:02 -07:00 committed by Martin Roth
parent 2942db6d6d
commit 972f826935
1 changed files with 42 additions and 25 deletions

View File

@ -129,6 +129,39 @@ AGESA_STATUS agesawrapper_amdinitearly(void)
return status;
}
static void print_init_post_settings(AMD_POST_PARAMS *parms)
{
u64 syslimit, bottomio, uma_size, uma_start;
const char *mode;
switch (parms->MemConfig.UmaMode) {
case UMA_AUTO:
mode = "UMA_AUTO";
break;
case UMA_SPECIFIED:
mode = "UMA_SPECIFIED";
break;
case UMA_NONE:
mode = "UMA_NONE";
break;
default:
mode = "unknown!";
break;
}
syslimit = (u64)parms->MemConfig.SysLimit * 64 * KiB;
bottomio = (u64)parms->MemConfig.BottomIo * 64 * KiB;
uma_size = (u64)parms->MemConfig.UmaSize * 64 * KiB;
uma_start = (u64)parms->MemConfig.UmaBase * 64 * KiB;
printk(BIOS_SPEW, "AGESA set: umamode %s\n", mode);
printk(BIOS_SPEW, " : syslimit 0x%llx, bottomio 0x%08llx\n",
syslimit, bottomio);
printk(BIOS_SPEW, " : uma size %lluMB, uma start 0x%08llx\n",
uma_size / MiB, uma_start);
}
AGESA_STATUS agesawrapper_amdinitpost(void)
{
AGESA_STATUS status;
@ -164,35 +197,19 @@ AGESA_STATUS agesawrapper_amdinitpost(void)
status = AmdInitPost (PostParams);
timestamp_add_now(TS_AGESA_INIT_POST_DONE);
/* If UMA is enabled we currently have it below TOP_MEM as well.
/*
* If UMA is enabled we currently have it below TOP_MEM as well.
* UMA may or may not be cacheable, so Sub4GCacheTop could be
* higher than UmaBase. With UMA_NONE we see UmaBase==0. */
* higher than UmaBase. With UMA_NONE we see UmaBase==0.
*/
uintptr_t top;
if (PostParams->MemConfig.UmaBase)
backup_top_of_low_cacheable(PostParams->MemConfig.UmaBase << 16);
top = PostParams->MemConfig.UmaBase << 16;
else
backup_top_of_low_cacheable(PostParams->MemConfig.Sub4GCacheTop);
top = PostParams->MemConfig.Sub4GCacheTop;
backup_top_of_low_cacheable(top);
printk(
BIOS_SPEW,
"setup_uma_memory: umamode %s\n",
(PostParams->MemConfig.UmaMode == UMA_AUTO) ? "UMA_AUTO" :
(PostParams->MemConfig.UmaMode == UMA_SPECIFIED) ? "UMA_SPECIFIED" :
(PostParams->MemConfig.UmaMode == UMA_NONE) ? "UMA_NONE" :
"unknown"
);
printk(
BIOS_SPEW,
"setup_uma_memory: syslimit 0x%08llX, bottomio 0x%08lx\n",
(unsigned long long)(PostParams->MemConfig.SysLimit) << 16,
(unsigned long)(PostParams->MemConfig.BottomIo) << 16
);
printk(
BIOS_SPEW,
"setup_uma_memory: uma size %luMB, uma start 0x%08lx\n",
(unsigned long)(PostParams->MemConfig.UmaSize) >> (20 - 16),
(unsigned long)(PostParams->MemConfig.UmaBase) << 16
);
print_init_post_settings(PostParams);
if (status != AGESA_SUCCESS)
agesawrapper_readeventlog(PostParams->StdHeader.HeapStatus);