public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pete Batard" <pete@akeo.ie>
To: devel@edk2.groups.io
Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com,
	awarkentin@vmware.com
Subject: [edk2-platforms][PATCH 2/6] Platform/RPi/AcpiTables: Replace VendorLong () blobs with PinFunction ()
Date: Thu, 26 Mar 2020 11:53:18 +0000	[thread overview]
Message-ID: <20200326115322.2880-3-pete@akeo.ie> (raw)
In-Reply-To: <20200326115322.2880-1-pete@akeo.ie>

From: Andrei Warkentin <andrey.warkentin@gmail.com>

Per https://github.com/MicrosoftDocs/windows-uwp/issues/1751,
MsftFunctionConfig () calls can be replaced by PinFunction () calls.

Since these had been converted to VendorLong () blobs due to lack of
implementation of MsftFunctionConfig (), we replace them back now
that PinFunction () is available.

Signed-off-by: Pete Batard <pete@akeo.ie>
---
 Platform/RaspberryPi/AcpiTables/Dsdt.asl | 94 ++------------------
 Platform/RaspberryPi/AcpiTables/Uart.asl | 16 +---
 2 files changed, 7 insertions(+), 103 deletions(-)

diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
index 2aa7d10bd40c..2e63091cdba0 100644
--- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl
+++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl
@@ -338,22 +338,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2)
       {
         MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM)
         Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_I2C1_INTERRUPT }
-
-        //
-        // MsftFunctionConfig is encoded as the VendorLong.
-        //
-        // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer,) {2, 3}
-        //
-        VendorLong ()      // Length = 0x31
-        {
-          /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-          /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-          /* 0010 */  0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x01,  // /.......
-          /* 0018 */  0x04, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20,  // ........
-          /* 0020 */  0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x5C,  // ........
-          /* 0028 */  0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30,  // _SB.GPI0
-          /* 0030 */  0x00                                             // .
-        }
+        PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 2, 3 }
       })
       Method (_CRS, 0x0, Serialized)
       {
@@ -401,49 +386,9 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2)
       {
         MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM)
         Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_SPI0_INTERRUPT }
-
-        //
-        // MsftFunctionConfig is encoded as the VendorLong.
-        //
-        // MsftFunctionConfig (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, ) {9, 10, 11} // MISO, MOSI, SCLK
-        VendorLong ()      // Length = 0x33
-        {
-          /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-          /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-          /* 0010 */  0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02,  // /.......
-          /* 0018 */  0x04, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22,  // ......."
-          /* 0020 */  0x00, 0x00, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B,  // ........
-          /* 0028 */  0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50,  // .\_SB.GP
-          /* 0030 */  0x49, 0x30, 0x00                                 // I0.
-        }
-
-        //
-        // MsftFunctionConfig is encoded as the VendorLong.
-        //
-        // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, ) {8}     // CE0
-        VendorLong ()      // Length = 0x2F
-        {
-          /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-          /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-          /* 0010 */  0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01,  // /.......
-          /* 0018 */  0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E,  // ........
-          /* 0020 */  0x00, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x5F, 0x53,  // .....\_S
-          /* 0028 */  0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00         // B.GPI0.
-        }
-
-        //
-        // MsftFunctionConfig is encoded as the VendorLong.
-        //
-        // MsftFunctionConfig (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, ) {7}     // CE1
-        VendorLong ()      // Length = 0x2F
-        {
-          /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-          /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-          /* 0010 */  0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x01,  // /.......
-          /* 0018 */  0x04, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E,  // ........
-          /* 0020 */  0x00, 0x00, 0x00, 0x07, 0x00, 0x5C, 0x5F, 0x53,  // .....\_S
-          /* 0028 */  0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00         // B.GPI0.
-        }
+        PinFunction (Exclusive, PullDown, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 9, 10, 11 } // MISO, MOSI, SCLK
+        PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 8 } // CE0
+        PinFunction (Exclusive, PullUp, BCM_ALT0, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 7 } // CE1
       })
 
       Method (_CRS, 0x0, Serialized)
@@ -468,35 +413,8 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2)
       {
         MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM)
         Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836_SPI1_INTERRUPT }
-
-        //
-        // MsftFunctionConfig is encoded as the VendorLong.
-        //
-        // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceConsumer, ) {19, 20, 21} // MISO, MOSI, SCLK
-        VendorLong ()      // Length = 0x33
-        {
-          /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-          /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-          /* 0010 */  0x2F, 0x8D, 0x1F, 0x00, 0x01, 0x10, 0x00, 0x02,  // /.......
-          /* 0018 */  0x03, 0x00, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22,  // ......."
-          /* 0020 */  0x00, 0x00, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15,  // ........
-          /* 0028 */  0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50,  // .\_SB.GP
-          /* 0030 */  0x49, 0x30, 0x00                                 // I0.
-        }
-
-        //
-        // MsftFunctionConfig is encoded as the VendorLong.
-        //
-        // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceConsumer, ) {16} // CE2
-        VendorLong ()      // Length = 0x2F
-        {
-          /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-          /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-          /* 0010 */  0x2F, 0x8D, 0x1B, 0x00, 0x01, 0x10, 0x00, 0x02,  // /.......
-          /* 0018 */  0x03, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E,  // ........
-          /* 0020 */  0x00, 0x00, 0x00, 0x10, 0x00, 0x5C, 0x5F, 0x53,  // .....\_S
-          /* 0028 */  0x42, 0x2E, 0x47, 0x50, 0x49, 0x30, 0x00         // B.GPI0.
-        }
+        PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 19, 20, 21 } // MISO, MOSI, SCLK
+        PinFunction (Exclusive, PullDown, BCM_ALT4, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 16 } // CE2
       })
 
       Method (_CRS, 0x0, Serialized)
diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryPi/AcpiTables/Uart.asl
index c466247bb33b..f6a14d6fd069 100644
--- a/Platform/RaspberryPi/AcpiTables/Uart.asl
+++ b/Platform/RaspberryPi/AcpiTables/Uart.asl
@@ -77,21 +77,7 @@ Device (URTM)
     // the kernel debugger is enabled to prevent another client
     // from muxing the pins away.
 
-    //
-    // MsftFunctionConfig is encoded as the VendorLong.
-    //
-    // MsftFunctionConfig(Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, ResourceConsumer, ) {14, 15}
-    // VendorLong  ()      // Length = 0x31
-    // {
-    //   /* 0000 */  0x00, 0x60, 0x44, 0xD5, 0xF3, 0x1F, 0x11, 0x60,  // .`D....`
-    //   /* 0008 */  0x4A, 0xB8, 0xB0, 0x9C, 0x2D, 0x23, 0x30, 0xDD,  // J...-#0.
-    //   /* 0010 */  0x2F, 0x8D, 0x1D, 0x00, 0x01, 0x10, 0x00, 0x02,  // /.......
-    //   /* 0018 */  0x02, 0x00, 0x12, 0x00, 0x00, 0x16, 0x00, 0x20,  // .......
-    //   /* 0020 */  0x00, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x5C,  // .......\
-    //   /* 0028 */  0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x49, 0x30,  // _SB.GPI0
-    //   /* 0030 */  0x00                                             // .
-    //}
-
+    // PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 14, 15 }
   })
   Method (_CRS, 0x0, Serialized)
   {
-- 
2.21.0.windows.1


  parent reply	other threads:[~2020-03-26 11:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 11:53 [edk2-platforms][PATCH 0/6] Platforms/RPi/AcpiTables: ACPI platform improvements Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 1/6] Platform/RPi/AcpiTables: Fix Pi 4 interrupts values Pete Batard
2020-03-26 11:53 ` Pete Batard [this message]
2020-03-26 11:53 ` [edk2-platforms][PATCH 3/6] Platform/RPi/AcpiTables: Use PCDs in MADT Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 4/6] Platform/RPi/AcpiTables: Clean up ACPI IDs Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 5/6] Platform/RPi/AcpiTables: Move GPU devices into a separate ASL file Pete Batard
2020-03-26 11:53 ` [edk2-platforms][PATCH 6/6] Platform/RPi/AcpiTables: Describe DMA constraints for devices behind GPU Pete Batard
2020-03-26 14:06 ` [edk2-platforms][PATCH 0/6] Platforms/RPi/AcpiTables: ACPI platform improvements Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200326115322.2880-3-pete@akeo.ie \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox