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.web10.51.1686684569675082877 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 032D7260A95; 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 10XabRQlaPco; 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 2EC0526007E; Tue, 13 Jun 2023 21:29:22 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Marcin Juszkiewicz Subject: [PATCH edk2-platforms 0/3] WIP: SbsaQemu: make PCIe dynamic Date: Tue, 13 Jun 2023 21:28:57 +0200 Message-Id: <20230613192900.158022-1-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable # Introduction Out plan is to clean SbsaQemu machine from hardcoded variables. There were patches posted for GIC data, we have ones for GIC ITS and this is my attempt on making PCIe data configurable. The goal is: - QEMU provides PCIe variables in DeviceTree - TF-A parses DT and provides PCIe variables via SMC - EDK2 calls SMC to get PCIe variables # Reason But for this we need PCIe variables to be dynamic. I lack EDK2 knowledge. I curse and complain while working with it but some work needs to be done and it is hard to find someone who would do it. This patchset is dump of my work-in-progress. It breaks the platform and I lack ideas why. # Description First patch replaces calls to FixedPcd*() in DSDT and PciHostBridge initialization with expected values. So far no changes in behaviour. Second change creates MCFG table using C to not use FixedPcd*() calls in ASLC source. So far no changes in behaviour. MCFG table is exactly the same. Third patch moves all PCIe variables from being Fixed to being Dynamic. And it 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)) Any ideas? Marcin Juszkiewicz (3): WIP: SbsaQemu: make PCIe variables dynamic (part 1) WIP: SbsaQemu: make PCIe variables dynamic (part 2) WIP: SbsaQemu: make PCIe variables dynamic (part 3) Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 2 +- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 53 ++++++------- .../Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 23 +++--- .../SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 9 +++ .../SbsaQemuPciHostBridgeLib.inf | 2 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 74 +++++++++++++++++++ .../SbsaQemuPciHostBridgeLib.c | 16 ++-- Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 38 +++++----- Silicon/Qemu/SbsaQemu/AcpiTables/Mcfg.aslc | 43 ----------- 9 files changed, 150 insertions(+), 110 deletions(-) delete mode 100644 Silicon/Qemu/SbsaQemu/AcpiTables/Mcfg.aslc --=20 2.40.1