[edk2] [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] UART COM INT3511

zwei4 posted 1 patch 5 years, 9 months ago
Failed in applying to current master (apply log)
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/GloblNvs.asl   |   2 +-
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchLpss.asl    |  81 +++++++++------------
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c      |   2 +-
Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h     |   2 +-
Vlv2TbltDevicePkg/Include/Protocol/GlobalNvsArea.h |   2 +-
.../PlatformSetupDxe/SouthClusterConfig.vfi        |   6 +-
Vlv2TbltDevicePkg/PlatformSetupDxe/UqiList.uni     | Bin 67184 -> 67184 bytes
Vlv2TbltDevicePkg/PlatformSetupDxe/VfrStrings.uni  | Bin 216530 -> 216550 bytes
8 files changed, 43 insertions(+), 52 deletions(-)
[edk2] [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] UART COM INT3511
Posted by zwei4 5 years, 9 months ago
Add sub-device under HS-UART 1 controller to report HS-UART as COM port. The _HID of the sub-device is INT3511.
The design follows below Intel white paper:
https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/enabling-multi-com-port-white-paper.pdf

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: zwei4 <david.wei@intel.com>
---
 Vlv2DeviceRefCodePkg/AcpiTablesPCAT/GloblNvs.asl   |   2 +-
 Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchLpss.asl    |  81 +++++++++------------
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c      |   2 +-
 Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h     |   2 +-
 Vlv2TbltDevicePkg/Include/Protocol/GlobalNvsArea.h |   2 +-
 .../PlatformSetupDxe/SouthClusterConfig.vfi        |   6 +-
 Vlv2TbltDevicePkg/PlatformSetupDxe/UqiList.uni     | Bin 67184 -> 67184 bytes
 Vlv2TbltDevicePkg/PlatformSetupDxe/VfrStrings.uni  | Bin 216530 -> 216550 bytes
 8 files changed, 43 insertions(+), 52 deletions(-)

diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/GloblNvs.asl b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/GloblNvs.asl
index 0373e935b7..827d01acb2 100644
--- a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/GloblNvs.asl
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/GloblNvs.asl
@@ -350,6 +350,6 @@ Field(GNVS,AnyAcc,Lock,Preserve)
   IOT,      8,      //(794) MinnowBoard Max JP1 is configured for MSFT IOT project.
   BATT,     8,      //(795) The Flag of RTC Battery Prensent.  
   LPAD,     8,      //(796) 
-  U1CM,     8,      //(797) Report UART1 as PNP0501 COM. 
+  U1CM,     8,      //(797) Report UART1 as COM. 
 }
 
diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchLpss.asl b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchLpss.asl
index 5018b05346..14ae6f8899 100644
--- a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchLpss.asl
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchLpss.asl
@@ -225,13 +225,6 @@ Device(URT1)
       Return (0x0)
     }
 
-    //
-    // Is UART 1 is reported as PNP0501 COM?
-    //
-    If(LEqual(U1CM, One)) {
-      Return (0x0)   
-    }
-
     Return (0xF)
   }
 
@@ -253,48 +246,46 @@ Device(URT1)
     Offset (0x84),
     PSAT,   32
   }
-}//  Device (URT1)
-
-Device(U1CO) // UART 1 as COM
-{
-  Name(_HID, EISAID("PNP0501"))
-  Name(_UID,2) // _UID must not conflict wit _UID of LPC COM.
-
-  Name (RBUF, ResourceTemplate ()
-  {
-    Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
-    Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {39}  // HS-UART #1 IRQ
-
-    FixedDMA(0x2, 0x2, Width32Bit, )
-    FixedDMA(0x3, 0x3, Width32Bit, )
-  })
   
-  Method (_CRS, 0x0, NotSerialized)
-  {
-    CreateDwordField(^RBUF, ^BAR0._BAS, B0BA)
-    CreateDwordField(^RBUF, ^BAR0._LEN, B0LN)
-    Store(U10A, B0BA)
-    Store(U10L, B0LN)
-    Return (RBUF)
-  }
+  //
+  // Virtual COM port for HSUART1
+  //
+  Device (VUT0) {
   
-  Method(_STA,0,Serialized)
-  {  
-     If (LOr(LEqual(U10A, 0), LEqual(L13D, 1)))
-    {
-      Return (0x0000)
-    }
+    Name (_HID, "INT3511")
     
-    //
-    // Is UART 1 reported as PNP0501 COM?
-    //
-    If(LEqual(U1CM, One)) {
-       Return(0x000F)
-    } Else {
-       Return(0x0000)
+    Method (_STA, 0x0, NotSerialized)
+    {
+      If(LEqual(U1CM, 1)) {
+        Return(0xf)
+      } else {
+        Return(0x0)
+      }
     }
-  }
-}
+
+    Method (_CRS, 0, NotSerialized) {
+      Name (BBUF, ResourceTemplate () {
+        UartSerialBus (
+        0x0001C200, 
+        DataBitsEight, 
+        StopBitsOne, 
+        0xFC, 
+        LittleEndian, 
+        ParityTypeNone, 
+        FlowControlHardware,
+        0x0020, 
+        0x0020, 
+        "\\_SB.URT1",
+        0x00, 
+        ResourceConsumer, 
+        ,
+        )
+     })
+     Return (BBUF)
+   }
+
+  } //Device (VUT0)
+}//  Device (URT1)
 
 //
 // LPIO1 HS-UART #2
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index adb79e0fd2..58c1dc1402 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -1146,7 +1146,7 @@ AcpiPlatformEntryPoint (
   //
   // Report UART1 as PNP0501 COM.
   //
-  mGlobalNvsArea.Area->Uart1Pnp0501Com = mSystemConfiguration.Uart1Pnp0501Com;
+  mGlobalNvsArea.Area->Uart1Int3511Com = mSystemConfiguration.Uart1Int3511Com;
 
   //
   // SIO related option.
diff --git a/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h b/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h
index fc2fc86f77..f0319b6c58 100644
--- a/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h
+++ b/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h
@@ -1310,7 +1310,7 @@ typedef struct {
   UINT8   GpioWakeCapability;
   UINT8   RtcBattery;
   UINT8   LpeAudioReportedByDSDT;
-  UINT8   Uart1Pnp0501Com; // Report UART1 as PNP0501 COM
+  UINT8   Uart1Int3511Com; // Report UART1 as COM with _HID INT3511
 
 } SYSTEM_CONFIGURATION;
 #pragma pack()
diff --git a/Vlv2TbltDevicePkg/Include/Protocol/GlobalNvsArea.h b/Vlv2TbltDevicePkg/Include/Protocol/GlobalNvsArea.h
index 03468f9357..ca67d67d1b 100644
--- a/Vlv2TbltDevicePkg/Include/Protocol/GlobalNvsArea.h
+++ b/Vlv2TbltDevicePkg/Include/Protocol/GlobalNvsArea.h
@@ -473,7 +473,7 @@ typedef struct {
   UINT8       MicrosoftIoT;                      // (794)JP1 pins are for Microsoft IoT project.
   UINT8       RtcBattery;                        // (795) The Flag of RTC Battery Present.
   UINT8       LpeAudioReportedByDSDT;            // (796)
-  UINT8       Uart1Pnp0501Com;                   // (797) Report UART 1 as PNP0501 COM.
+  UINT8       Uart1Int3511Com;                   // (797) Report UART 1 as INT3511 COM.
 } EFI_GLOBAL_NVS_AREA;
 #pragma pack ()
 
diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SouthClusterConfig.vfi b/Vlv2TbltDevicePkg/PlatformSetupDxe/SouthClusterConfig.vfi
index 10ff008da5..a0cb102b8f 100644
--- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SouthClusterConfig.vfi
+++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SouthClusterConfig.vfi
@@ -587,9 +587,9 @@ endif;     // grayoutif NOT ideqval Setup.LpssSdcardEnabled == 0x1;
   endif;
   
   grayoutif ideqval Setup.LpssHsuart0Enabled == 0x00;
-  oneof varid   = Setup.Uart1Pnp0501Com,
-    prompt      = STRING_TOKEN(STR_LPSS_HSUART1_PNP0501_PROMPT),
-    help        = STRING_TOKEN(STR_LPSS_HSUART1_PNP0501_HELP_ENBDT_DEV_LIST),
+  oneof varid   = Setup.Uart1Int3511Com,
+    prompt      = STRING_TOKEN(STR_LPSS_HSUART1_INT3511_PROMPT),
+    help        = STRING_TOKEN(STR_LPSS_HSUART1_INT3511_HELP_ENBDT_DEV_LIST),
     option text = STRING_TOKEN(STR_DISABLE), value=0, flags=0 |DEFAULT | RESET_REQUIRED;
     option text = STRING_TOKEN(STR_ENABLE), value=1, flags= MANUFACTURING | RESET_REQUIRED;
   endoneof;
diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/UqiList.uni b/Vlv2TbltDevicePkg/PlatformSetupDxe/UqiList.uni
index d6e5ccd05a1ba303329e083d673342cddb4cef9c..f392fd250b13da70acd64dc64f46796a9417c1fe 100644
GIT binary patch
delta 49
vcmey+!}6hrrC|$W5-YbSgC9c(gE50CgW+VxAmix^SQ%501*h|~F(v{4R<;X+

delta 49
vcmey+!}6hrrC|$W5-WEAgC9cxg8_pngTZ9RAmix^SQ%501*h|~F(v{4R@n=I

diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/VfrStrings.uni b/Vlv2TbltDevicePkg/PlatformSetupDxe/VfrStrings.uni
index af716784d740092f6b6f725ec43bff4ab2a84b1a..ad4cf64405e100f8f554d26badb01eb2d38a3128 100644
GIT binary patch
delta 157
zcmcaKoA=pl-i9rV5zn|i8T=SR7>pTA84Ra0&R{g0o^YE{Z+hQzMgeg{1_cHrX$BDA
znZbW@;!nlt7oIbUZC7~CxQU+^Magu-PmKE0`Mxtw(*!DI@C9lqXUJqIVaNco;u$=E
Y2D+ddJGn4Nwf)|A#_jjMGkpmK00+V<0ssI2

delta 137
zcmaDhoA=Ue-i9rV5zn{-82lIl7z`Lp84RW~&R{g0p75N}PTY_|0VoQWVF2-+8T=<F
z{#2ZP;W?w&c7^ARoA`NAluS4L#Hc@=?>pl(Q512ARtDe6g*mFz8-6l!wEz0fxc%36
HrZ=Gg?-(Zn

-- 
2.14.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel