From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.45.1686684569532374039 for ; Tue, 13 Jun 2023 12:29:29 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: linaro.org, ip: 213.251.184.221, mailfrom: marcin.juszkiewicz@linaro.org) Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 1ECC3260A8B; Tue, 13 Jun 2023 21:29:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YMxEsRcDH92A; Tue, 13 Jun 2023 21:29:26 +0200 (CEST) Received: from applejack.lan (83.11.39.176.ipv4.supernova.orange.pl [83.11.39.176]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 0D230260A92; Tue, 13 Jun 2023 21:29:25 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Marcin Juszkiewicz Subject: [PATCH edk2-platforms 3/3] WIP: SbsaQemu: make PCIe variables dynamic (part 3) Date: Tue, 13 Jun 2023 21:29:00 +0200 Message-Id: <20230613192900.158022-4-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230613192900.158022-1-marcin.juszkiewicz@linaro.org> References: <20230613192900.158022-1-marcin.juszkiewicz@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Make those PCIe variables dynamic. But this breaks things: InstallProtocolInterface: 18A031AB-B443-4D1A-A5C0-0C09261E9F71 100FB86619= 0 InstallProtocolInterface: 107A772C-D5E1-11D4-9A46-0090273FC14D 100FB86617= 8 InstallProtocolInterface: 6A7A5CFF-E8D9-4F70-BADA-75AB3025CE14 100FB86616= 0 [Bds] Entry... [BdsDxe] Locate Variable Policy protocol - Success Variable Driver Auto Update PlatformLang, PlatformLang:en, Lang:eng Statu= s: Success [Variable]END_OF_DXE is signaled Initialize variable error flag (FF) PCI Bus First Scanning PciBus: Discovered PCI @ [00|00|00] [VID =3D 0x1B36, DID =3D 0x8] FATAL ERROR - RaiseTpl with OldTpl(0x1F) > NewTpl(0x10) ASSERT [DxeCore] /home/marcin/devel/linaro/sbsa-qemu/code/edk2/MdeModuleP= kg/Core/Dxe/Event/Tpl.c(66): ((BOOLEAN)(0=3D=3D1)) --- Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 2 +- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 53 ++++++++++--------- .../Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 22 ++++---- .../SbsaQemuPciHostBridgeLib.inf | 2 +- 4 files changed, 40 insertions(+), 39 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec b/Silicon/Qemu/SbsaQemu/S= bsaQemu.dec index 9448852967b6..3fdf23b77a08 100644 --- a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec +++ b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec @@ -36,6 +36,7 @@ [PcdsFixedAtBuild.common] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize|0x10000|UIN= T32|0x00000004 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress|0x1000= 0000000|UINT64|0x00000005 =20 +[PcdsDynamic.common] # PCDs complementing PCIe layout pulled into ACPI tables # Limit =3D Base + Size - 1 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciIoLimit|0x0000ffff|UINT32= |0x00000006 @@ -47,7 +48,6 @@ [PcdsFixedAtBuild.common] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarSize|0x10000000= |UINT64|0x00000009 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit|0xFFFFFFF= F|UINT64|0x00000010 =20 -[PcdsDynamic.common] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount|0x1|UINT32|0x00000= 100 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdClusterCount|0x1|UINT32|0x00= 000101 =20 diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu= /SbsaQemu.dsc index 0bd0df4f0239..3cc0f2a270ba 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc @@ -459,32 +459,6 @@ [PcdsFixedAtBuild.common] # point only, for entry point versions >=3D 3.0. gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosEntryPointProvideMethod|0x2 =20 - # - # PLDA PCI Root Complex - # - # ECAM size =3D=3D 0x10000000 - gArmTokenSpaceGuid.PcdPciBusMin|0 - gArmTokenSpaceGuid.PcdPciBusMax|255 - gArmTokenSpaceGuid.PcdPciIoBase|0x0 - gArmTokenSpaceGuid.PcdPciIoSize|0x00010000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciIoLimit|0x0000ffff - gArmTokenSpaceGuid.PcdPciMmio32Base|0x80000000 - gArmTokenSpaceGuid.PcdPciMmio32Size|0x70000000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio32Limit|0xEFFFFFFF - gArmTokenSpaceGuid.PcdPciMmio64Base|0x100000000 - gArmTokenSpaceGuid.PcdPciMmio64Size|0xFF00000000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio64Limit|0xFFFFFFFFFF - - # set PcdPciExpressBaseAddress to MAX_UINT64, which signifies that thi= s - # PCD and PcdPciDisableBusEnumeration have not been assigned yet - # TODO: PcdPciExpressBaseAddress set to max_uint64 - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xf0000000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarSize|0x10000000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit|0xFFFFFFF= F - - gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x7fff0000 - gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0 - gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0 ## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI # enumeration to complete before installing ACPI tables. gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE @@ -523,6 +497,33 @@ [PcdsDynamicDefault.common] gArmTokenSpaceGuid.PcdGicDistributorBase|0x40060000 gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x40080000 =20 + # + # PLDA PCI Root Complex + # + # ECAM size =3D=3D 0x10000000 + gArmTokenSpaceGuid.PcdPciBusMin|0 + gArmTokenSpaceGuid.PcdPciBusMax|255 + gArmTokenSpaceGuid.PcdPciIoBase|0x0 + gArmTokenSpaceGuid.PcdPciIoSize|0x00010000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciIoLimit|0x0000ffff + gArmTokenSpaceGuid.PcdPciMmio32Base|0x80000000 + gArmTokenSpaceGuid.PcdPciMmio32Size|0x70000000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio32Limit|0xEFFFFFFF + gArmTokenSpaceGuid.PcdPciMmio64Base|0x100000000 + gArmTokenSpaceGuid.PcdPciMmio64Size|0xFF00000000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio64Limit|0xFFFFFFFFFF + + # set PcdPciExpressBaseAddress to MAX_UINT64, which signifies that thi= s + # PCD and PcdPciDisableBusEnumeration have not been assigned yet + # TODO: PcdPciExpressBaseAddress set to max_uint64 + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xf0000000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarSize|0x10000000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit|0xFFFFFFF= F + + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x7fff0000 + gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0 + gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0 + # # Set video resolution for boot options # PlatformDxe can set the former at runtime. diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qe= mu/SbsaQemu/AcpiTables/AcpiTables.inf index 5607878c2040..a8300fd355fd 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -42,6 +42,17 @@ [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision =20 + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase + + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciBase + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize + +[Pcd] + gArmTokenSpaceGuid.PcdGicDistributorBase + gArmTokenSpaceGuid.PcdGicRedistributorsBase + gArmTokenSpaceGuid.PcdPciBusMin gArmTokenSpaceGuid.PcdPciBusMax =20 @@ -63,14 +74,3 @@ [FixedPcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarSize gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit - - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase - - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciBase - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize - -[Pcd] - gArmTokenSpaceGuid.PcdGicDistributorBase - gArmTokenSpaceGuid.PcdGicRedistributorsBase diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQ= emuPciHostBridgeLib.inf b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBr= idgeLib/SbsaQemuPciHostBridgeLib.inf index 9d6791ff7dc2..6bc78ac108f0 100644 --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciH= ostBridgeLib.inf +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciH= ostBridgeLib.inf @@ -33,7 +33,7 @@ [Packages] [LibraryClasses] DebugLib =20 -[FixedPcd] +[Pcd] gArmTokenSpaceGuid.PcdPciBusMin gArmTokenSpaceGuid.PcdPciBusMax gArmTokenSpaceGuid.PcdPciIoBase --=20 2.40.1