<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Jeremy,</div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">Reviewed-by: Andrei Warkentin <awarkentin@vmware.com></span><br>
</div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">MADT -> MCFG</span></div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
Root port registers would be NonCacheable just like the outbound mapping. (Also, with <a href="https://mantis.uefi.org/mantis/view.php?id=2220" id="LPlnk370766">https://mantis.uefi.org/mantis/view.php?id=2220</a>, _MEM attributes aside from  NonCacheable and
 Prefetchable are effectively deprecated).</div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="margin:0px;font-size:12pt">Note: I really wish we had sorted out the HID/CID story for the PCIe RC... i.e. at least to make the HID custom for non-ECAM implementations and push PNP0A08/PNP0A03 in the CID... this would make linux,pcie-quirk unnecessary,
 using standard ACPI driver binding mechanisms to separate quirks from proper ECAM. Sadly, I think the train to do that has long left the station (with so many ACPI Arm systems out there and non-ECAM or not-quite-ECAM RCs using <span style="background-color:rgb(255, 255, 255);display:inline !important">PNP0A08/PNP0A03
 alone. ESXi, for example, ends up keying on the Table Ids (which is arguably even worse than the DT props)</span></span><br>
</div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="margin:0px;font-size:12pt"><span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></span></div>
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="margin:0px;font-size:12pt"><span style="background-color:rgb(255, 255, 255);display:inline !important">Note 2: Given that DT has users in U-Boot and the BSDs (and potentially anywhere else), there's a long term hope to make DT bindings separate
 from Linux. To that end "linux,pcie-quirk" and "linux,pcie-nomsi" should probably be named something else (although I recognise that you're probably just wiring up something that already exists).</span></span></div>
<div>
<div id="Signature">
<div></div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<br>
</div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
--</div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
Andrei Warkentin,</div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
Arm Enablement Architect,</div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
Cloud Platform Business Unit, VMware</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Jeremy Linton <jeremy.linton@arm.com><br>
<b>Sent:</b> Thursday, August 5, 2021 7:40 PM<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc:</b> pete@akeo.ie <pete@akeo.ie>; ardb+tianocore@kernel.org <ardb+tianocore@kernel.org>; Andrei Warkentin <awarkentin@vmware.com>; Sunny.Wang@arm.com <Sunny.Wang@arm.com>; samer.el-haj-mahmoud@arm.com <samer.el-haj-mahmoud@arm.com>; Jeremy Linton <jeremy.linton@arm.com><br>
<b>Subject:</b> [PATCH 1/1] Platform/RaspberryPi: Add linux quirk support</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Linux, for the time being has refused to support the Arm<br>
standard SMCCC for PCIe configuration. Instead they<br>
want to continue to maintain per device "quirks".<br>
<br>
As the RPI isn't really ECAM this is a bit more<br>
involved because the MADT can't really describe<br>
the root port+config registers situation. Further<br>
platforms which support the SMCCC shouldn't have<br>
a MADT, so we need an additional way to tell linux<br>
what it needs to know about this platform.<br>
<br>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com><br>
---<br>
 Platform/RaspberryPi/AcpiTables/Pci.asl | 21 +++++++++++++++++++++<br>
 1 file changed, 21 insertions(+)<br>
<br>
diff --git a/Platform/RaspberryPi/AcpiTables/Pci.asl b/Platform/RaspberryPi/AcpiTables/Pci.asl<br>
index 34474f13ef..3e7fd0d5b7 100644<br>
--- a/Platform/RaspberryPi/AcpiTables/Pci.asl<br>
+++ b/Platform/RaspberryPi/AcpiTables/Pci.asl<br>
@@ -123,6 +123,15 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4PCIE", 2)<br>
         Name(_BBN, Zero) // PCI Base Bus Number<br>
         Name(_CCA, 0)    // Mark the PCI noncoherent<br>
 <br>
+        Name (_DSD, Package () {<br>
+          ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),<br>
+            Package () {<br>
+              Package () { "linux,pcie-quirk", "bcm2711" },<br>
+              Package () { "linux,pcie-nomsi", 1 },<br>
+            }<br>
+        })<br>
+<br>
+<br>
         // Root Complex 0<br>
         Device (RP0) {<br>
          Name(_ADR, 0xF0000000)    // Dev 0, Func 0<br>
@@ -176,6 +185,18 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4PCIE", 2)<br>
               2                               // SANITIZED_PCIE_MMIO_LEN + 1<br>
               ,,,MMI1,,TypeTranslation<br>
             )<br>
+<br>
+            QWordMemory ( // Root port registers, not to be used if SMCCC is utilized<br>
+              ResourceConsumer, ,<br>
+              MinFixed, MaxFixed,<br>
+              NonCacheable, ReadWrite,        // cacheable? is that right?<br>
+              0x00000000,                     // Granularity<br>
+              0xFD500000,                     // Root port begin<br>
+              0xFD509FFF,                     // Root port end<br>
+              0x00000000,                     // no translation<br>
+              0x0000A000,                     // size<br>
+              ,,<br>
+            )<br>
           }) // end Name(RBUF)<br>
 <br>
           // Work around ASL's inability to add in a resource definition<br>
-- <br>
2.13.7<br>
<br>
</div>
</span></font></div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/78812">View/Reply Online (#78812)</a> |    |  <a target="_blank" href="https://groups.io/mt/84688820/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>