summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Ma <maurice.ma@intel.com>2016-11-16 19:22:32 -0800
committerMaurice Ma <maurice.ma@intel.com>2016-11-17 14:49:11 -0800
commit4e7872d2f71f511df155a9048f06761afce751da (patch)
treee4e73e8597264eb7cd3aff697b86ef0d58cb928c
parent28b3a713b66998a8be3e8558eb85f18699e15b2e (diff)
downloadedk2-platforms-4e7872d2f71f511df155a9048f06761afce751da.tar.xz
CorebootPayloadPkg/CbSupportPei: Fix the memory map issue
When coreboot reports memory range across 1MB, the current code cannot handle it properly. In this case the range should be adjusted to start from 1MB instead since the memory resource below 1MB has been preprocessed by CbSupportPei module. This patch fixed the coreboot + UEFI payload hang issue when running on QEMU due to incorrect memory map. Cc: Prince Agyeman <prince.agyeman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
-rwxr-xr-xCorebootModulePkg/CbSupportPei/CbSupportPei.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
index 8fa0ac5c1e..831de89b21 100755
--- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c
+++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
@@ -169,6 +169,11 @@ CbMemInfoCallback (
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;
+ if ((Base < 0x100000) && ((Base + Size) > 0x100000)) {
+ Size -= (0x100000 - Base);
+ Base = 0x100000;
+ }
+
MemInfo = (CB_MEM_INFO *)Param;
if (Base >= 0x100000) {
if (Type == CB_MEM_RAM) {