public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] CorebootPayloadPkg: Allow PciLib instance selection
@ 2016-11-17  3:40 Maurice Ma
  2016-11-17  3:42 ` [PATCH 2/2] CorebootPayloadPkg/CbSupportPei: Fix the memory map issue Maurice Ma
  0 siblings, 1 reply; 2+ messages in thread
From: Maurice Ma @ 2016-11-17  3:40 UTC (permalink / raw)
  To: edk2-devel; +Cc: Maurice Ma, Prince Agyeman

On old platform without PCIe express support, the PciLib needs to
be mapped to PciLibCf8 instance to make it work.  On new platform
with PCIe express support, the PciLib needs to be mapped to
PciLibPciExpress to allow access to extended PCIe configuration
space. This patch allows to select the PciLib instance between
PciLibCf8 and PciLibPciExpress using the PCIE_BASE macro through
build command line.

Cc: Prince Agyeman <prince.agyeman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc    | 5 +++++
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index ad1a6dcf603c..460a721a4882 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -129,8 +129,13 @@
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+!if $(PCIE_BASE) == 0
+  PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
+  PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
+!else
   PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
   PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
+!endif
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index c06cccbf889a..e68d7173b0ca 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -131,8 +131,13 @@
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+!if $(PCIE_BASE) == 0
+  PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
+  PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
+!else
   PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
   PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
+!endif
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
-- 
2.7.4.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] CorebootPayloadPkg/CbSupportPei: Fix the memory map issue
  2016-11-17  3:40 [PATCH 1/2] CorebootPayloadPkg: Allow PciLib instance selection Maurice Ma
@ 2016-11-17  3:42 ` Maurice Ma
  0 siblings, 0 replies; 2+ messages in thread
From: Maurice Ma @ 2016-11-17  3:42 UTC (permalink / raw)
  To: edk2-devel; +Cc: Maurice Ma, Prince Agyeman

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>
---
 CorebootModulePkg/CbSupportPei/CbSupportPei.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
index 8fa0ac5c1efa..831de89b21d1 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) {
-- 
2.7.4.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-17  3:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17  3:40 [PATCH 1/2] CorebootPayloadPkg: Allow PciLib instance selection Maurice Ma
2016-11-17  3:42 ` [PATCH 2/2] CorebootPayloadPkg/CbSupportPei: Fix the memory map issue Maurice Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox