This driver will report some MMIO/IO resources to dxe core, extract smbios and acpi\r
tables from bootloader.\r
\r
- Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
EFI_HOB_GUID_TYPE *GuidHob;\r
SYSTEM_TABLE_INFO *SystemTableInfo;\r
EFI_PEI_GRAPHICS_INFO_HOB *GfxInfo;\r
+ ACPI_BOARD_INFO *AcpiBoardInfo;\r
\r
Status = EFI_SUCCESS;\r
//\r
ASSERT_EFI_ERROR (Status);\r
}\r
\r
+ //\r
+ // Set PcdPciExpressBaseAddress by HOB info\r
+ //\r
+ GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid);\r
+ if (GuidHob != NULL) {\r
+ AcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);\r
+ Status = PcdSet64S (PcdPciExpressBaseAddress, AcpiBoardInfo->PcieBaseAddress);\r
+ ASSERT_EFI_ERROR (Status);\r
+ }\r
+\r
return EFI_SUCCESS;\r
}\r
\r
#\r
# Report some MMIO/IO resources to dxe core, extract smbios and acpi tables\r
#\r
-# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>\r
#\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution\r
+ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress\r
\r
[Depex]\r
TRUE\r
--- /dev/null
+/** @file\r
+ PCI Segment Information Library that returns one segment whose\r
+ segment base address is retrieved from AcpiBoardInfo HOB.\r
+\r
+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include <PiDxe.h>\r
+#include <Guid/AcpiBoardInfoGuid.h>\r
+\r
+#include <Library/HobLib.h>\r
+#include <Library/PciSegmentInfoLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+STATIC PCI_SEGMENT_INFO mPciSegment0 = {\r
+ 0, // Segment number\r
+ 0, // To be fixed later\r
+ 0, // Start bus number\r
+ 255 // End bus number\r
+};\r
+\r
+/**\r
+ Return an array of PCI_SEGMENT_INFO holding the segment information.\r
+\r
+ Note: The returned array/buffer is owned by callee.\r
+\r
+ @param Count Return the count of segments.\r
+\r
+ @retval A callee owned array holding the segment information.\r
+**/\r
+PCI_SEGMENT_INFO *\r
+EFIAPI\r
+GetPciSegmentInfo (\r
+ UINTN *Count\r
+ )\r
+{\r
+ EFI_HOB_GUID_TYPE *GuidHob;\r
+ ACPI_BOARD_INFO *AcpiBoardInfo;\r
+\r
+ ASSERT (Count != NULL);\r
+ if (Count == NULL) {\r
+ return NULL;\r
+ }\r
+\r
+ if (mPciSegment0.BaseAddress == 0) {\r
+ //\r
+ // Find the acpi board information guid hob\r
+ //\r
+ GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid);\r
+ ASSERT (GuidHob != NULL);\r
+\r
+ AcpiBoardInfo = (ACPI_BOARD_INFO *) GET_GUID_HOB_DATA (GuidHob);\r
+ mPciSegment0.BaseAddress = AcpiBoardInfo->PcieBaseAddress;\r
+ }\r
+ *Count = 1;\r
+ return &mPciSegment0;\r
+}\r
--- /dev/null
+## @file\r
+# PCI Segment Information Library that returns one segment whose\r
+# segment base address is retrieved from AcpiBoardInfo HOB.\r
+#\r
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+#\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PciSegmentInfoLibAcpiBoardInfo\r
+ FILE_GUID = 0EA82AA2-6C36-4FD5-BC90-FFA3ECB5E0CE\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = PciSegmentInfoLib | DXE_DRIVER\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 EBC\r
+#\r
+\r
+[Sources]\r
+ PciSegmentInfoLibAcpiBoardInfo.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ UefiPayloadPkg/UefiPayloadPkg.dec\r
+\r
+[LibraryClasses]\r
+ PcdLib\r
+ HobLib\r
+ DebugLib\r
#\r
# PCI options\r
#\r
- DEFINE PCIE_BASE = 0xE0000000\r
+ DEFINE PCIE_BASE_SUPPORT = TRUE\r
\r
#\r
# Serial port set up\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
-!if $(PCIE_BASE) == 0\r
+!if $(PCIE_BASE_SUPPORT) == FALSE\r
PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf\r
!else\r
PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf\r
PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf\r
!endif\r
- PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf\r
+ PciSegmentLib|MdePkg/Library/PciSegmentLibSegmentInfo/BasePciSegmentLibSegmentInfo.inf\r
+ PciSegmentInfoLib|UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAcpiBoardInfo.inf\r
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100\r
+ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0\r
\r
################################################################################\r
#\r
#\r
# PCI options\r
#\r
- DEFINE PCIE_BASE = 0xE0000000\r
+ DEFINE PCIE_BASE_SUPPORT = TRUE\r
\r
#\r
# Serial port set up\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
-!if $(PCIE_BASE) == 0\r
+!if $(PCIE_BASE_SUPPORT) == FALSE\r
PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf\r
!else\r
PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf\r
PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf\r
!endif\r
- PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf\r
+ PciSegmentLib|MdePkg/Library/PciSegmentLibSegmentInfo/BasePciSegmentLibSegmentInfo.inf\r
+ PciSegmentInfoLib|UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAcpiBoardInfo.inf\r
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|TRUE\r
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }\r
\r
- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE)\r
\r
!if $(SOURCE_DEBUG_ENABLE)\r
gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100\r
+ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0\r
\r
################################################################################\r
#\r