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.44.1686684569140843584 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 44B4326007E; Tue, 13 Jun 2023 21:29:26 +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 vGx7FDSSQqJN; Tue, 13 Jun 2023 21:29:24 +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 38E0626021A; Tue, 13 Jun 2023 21:29:24 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Marcin Juszkiewicz Subject: [PATCH edk2-platforms 1/3] WIP: SbsaQemu: make PCIe variables dynamic (part 1) Date: Tue, 13 Jun 2023 21:28:58 +0200 Message-Id: <20230613192900.158022-2-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 DSDT and PciHostBridge gets hardcoded values directly instead of using FixedPcd* functions. --- .../SbsaQemuPciHostBridgeLib.c | 16 ++++---- Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 38 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQ= emuPciHostBridgeLib.c b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBrid= geLib/SbsaQemuPciHostBridgeLib.c index 9739c7500def..08e9b23c5b33 100644 --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciH= ostBridgeLib.c +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciH= ostBridgeLib.c @@ -83,31 +83,31 @@ STATIC PCI_ROOT_BRIDGE mRootBridge =3D { { /* PCI_ROOT_BRIDGE_APERTURE Bus; Bus aperture which can be used by = the * root bridge. */ - FixedPcdGet32 (PcdPciBusMin), - FixedPcdGet32 (PcdPciBusMax) + 0, //PcdGet32 (PcdPciBusMin), + 255 //PcdGet32 (PcdPciBusMax) }, =20 /* PCI_ROOT_BRIDGE_APERTURE Io; IO aperture which can be used by the r= oot bridge */ { - FixedPcdGet64 (PcdPciIoBase), - FixedPcdGet64 (PcdPciIoBase) + FixedPcdGet64 (PcdPciIoSize) - 1 + 0, //PcdGet64 (PcdPciIoBase), + 0XFFFF //PcdGet64 (PcdPciIoBase) + PcdGet64 (PcdPciIoSize) - 1 }, =20 /* PCI_ROOT_BRIDGE_APERTURE Mem; MMIO aperture below 4GB which can be = used by the root bridge (gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation as 0x0) */ { - FixedPcdGet32 (PcdPciMmio32Base), - FixedPcdGet32 (PcdPciMmio32Base) + FixedPcdGet32 (PcdPciMmio32Size) = - 1, + 0x80000000, //PcdGet32 (PcdPciMmio32Base), + 0xEFFFFFFF //PcdGet32 (PcdPciMmio32Base) + PcdGet32 (PcdPciMmio32S= ize) - 1, }, =20 /* PCI_ROOT_BRIDGE_APERTURE MemAbove4G; MMIO aperture above 4GB which = can be used by the root bridge. (gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation as 0x0) */ { - FixedPcdGet64 (PcdPciMmio64Base), - FixedPcdGet64 (PcdPciMmio64Base) + FixedPcdGet64 (PcdPciMmio64Size) = - 1 + 0x0100000000, //PcdGet64 (PcdPciMmio64Base), + 0xFFFFFFFFFF //PcdGet64 (PcdPciMmio64Base) + PcdGet64 (PcdPciMmio6= 4Size) - 1 }, =20 /* PCI_ROOT_BRIDGE_APERTURE PMem; Prefetchable MMIO aperture below 4GB= which diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl b/Silicon/Qemu/Sbs= aQemu/AcpiTables/Dsdt.asl index e50772fcf76d..7193c87cdcf2 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl @@ -198,7 +198,7 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", } =20 Method (_CBA, 0, NotSerialized) { - return (FixedPcdGet32 (PcdPciExpressBaseAddress)) + return (0xF0000000) // return (PcdGet32 (PcdPciExpressBaseAddr= ess)) } =20 LINK_DEVICE(0, GSI0, 0x23) @@ -376,8 +376,8 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", ResourceProducer, MinFixed, MaxFixed, PosDecode, 0, // AddressGranularity - FixedPcdGet32 (PcdPciBusMin), // AddressMinimum - Minimum Bus = Number - FixedPcdGet32 (PcdPciBusMax), // AddressMaximum - Maximum Bus = Number + 0, // PcdGet32 (PcdPciBusMin), // AddressMinimum - Minimum B= us Number + 255, // PcdGet32 (PcdPciBusMax), // AddressMaximum - Maximum B= us Number 0, // AddressTranslation - Set to 0 256 // RangeLength - Number of Busses ) @@ -387,10 +387,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", MinFixed, MaxFixed, Cacheable, ReadWrite, 0x00000000, // Granularity - FixedPcdGet32 (PcdPciMmio32Base), // Min Base Address - FixedPcdGet32 (PcdPciMmio32Limit), // Max Base Address - FixedPcdGet32 (PcdPciMmio32Translation), // Translate - FixedPcdGet32 (PcdPciMmio32Size) // Length + 0x80000000, // PcdGet32 (PcdPciMmio32Base), // Min Base= Address + 0xEFFFFFFF, // PcdGet32 (PcdPciMmio32Limit), // Max Base= Address + 0, // PcdGet32 (PcdPciMmio32Translation), // Translat= e + 0x70000000, // PcdGet32 (PcdPciMmio32Size) // Length ) =20 QWordMemory ( // 64-bit BAR Windows @@ -398,10 +398,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", MinFixed, MaxFixed, Cacheable, ReadWrite, 0x00000000, // Granularity - FixedPcdGet64 (PcdPciMmio64Base), // Min Base Address - FixedPcdGet64 (PcdPciMmio64Limit), // Max Base Address - FixedPcdGet64 (PcdPciMmio64Translation), // Translate - FixedPcdGet64 (PcdPciMmio64Size) // Length + 0x100000000, // PcdGet64 (PcdPciMmio64Base), // Min Ba= se Address + 0xFFFFFFFFFF, // PcdGet64 (PcdPciMmio64Limit), // Max Ba= se Address + 0, // PcdGet64 (PcdPciMmio64Translation), // Transl= ate + 0xFF00000000, // PcdGet64 (PcdPciMmio64Size) // Length ) =20 DWordIo ( // IO window @@ -411,10 +411,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", PosDecode, EntireRange, 0x00000000, // Granularity - FixedPcdGet32 (PcdPciIoBase), // Min Base Address - FixedPcdGet32 (PcdPciIoLimit), // Max Base Address - FixedPcdGet32 (PcdPciIoTranslation), // Translate - FixedPcdGet32 (PcdPciIoSize), // Length + 0, // PcdGet32 (PcdPciIoBase), // Min Base= Address + 0x0000ffff, // PcdGet32 (PcdPciIoLimit), // Max Base= Address + 0x7fff0000, // PcdGet32 (PcdPciIoTranslation), // Translat= e + 0x00010000, // PcdGet32 (PcdPciIoSize), // Length ,,,TypeTranslation ) }) // Name(RBUF) @@ -429,10 +429,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", { QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,= NonCacheable, ReadWrite, 0x0000000000000000, // Granularity - FixedPcdGet64 (PcdPciExpressBaseAddress), // Range Minimum - FixedPcdGet64 (PcdPciExpressBarLimit), // Range Maximum - 0x0000000000000000, // Translation Offs= et - FixedPcdGet64 (PcdPciExpressBarSize), // Length + 0xf0000000, // PcdGet64 (PcdPciExpressBaseAddress), /= / Range Minimum + 0xFFFFFFFF, // PcdGet64 (PcdPciExpressBarLimit), /= / Range Maximum + 0x0000000000000000, // Translation Offset + 0x10000000, // PcdGet64 (PcdPciExpressBarSize), /= / Length ,, , AddressRangeMemory, TypeStatic) }) Method (_STA) { --=20 2.40.1