public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] SueCreek Bypass
@ 2017-11-15  5:03 zwei4
  0 siblings, 0 replies; only message in thread
From: zwei4 @ 2017-11-15  5:03 UTC (permalink / raw)
  To: edk2-devel

Add code in ACPI table for TI audio codec under I2C5.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: zwei4 <david.wei@intel.com>
---
 .../BensonGlacier/BoardInitPostMem/BoardInit.c     |  33 +++++++++++++++-
 .../BoardInitPostMem/BoardInitPostMem.inf          |   1 +
 .../Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c     |   4 +-
 .../Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf       |   1 +
 .../Common/Acpi/AcpiTablesPCAT/GloblNvs.asl        |   1 +
 .../PlatformSsdt/Audio/AudioCodec10TI3100.asl      |  44 +++++++++++++++++++++
 .../AcpiTablesPCAT/PlatformSsdt/PlatformSsdt.asl   |   2 +
 .../Common/Include/Guid/SetupVariable.h            |   3 +-
 .../PlatformSetupDxe/SouthClusterConfig.vfi        |   7 ++++
 .../PlatformSettings/PlatformSetupDxe/UqiList.uni  | Bin 126596 -> 126916 bytes
 .../PlatformSetupDxe/VfrStrings.uni                | Bin 305486 -> 305886 bytes
 Platform/BroxtonPlatformPkg/PlatformPkg.dec        |   3 +-
 .../NorthCluster/Include/Protocol/GlobalNvsArea.h  |   3 +-
 13 files changed, 96 insertions(+), 6 deletions(-)
 create mode 100644 Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/Audio/AudioCodec10TI3100.asl

diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c
index 07246c155..324baf9ad 100644
--- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c
+++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c
@@ -51,6 +51,29 @@ BensonGlacierPostMemInitCallback (
   UINT8                            ResetType;
   UINTN                            BufferSize;
   UINT8                            MaxPkgCState;
+  UINTN                            VariableSize;
+  EFI_PEI_READ_ONLY_VARIABLE2_PPI  *VariableServices;
+  SYSTEM_CONFIGURATION             SystemConfiguration;
+
+  VariableSize = sizeof (SYSTEM_CONFIGURATION);
+  ZeroMem (&SystemConfiguration, sizeof (SYSTEM_CONFIGURATION));
+
+ (*PeiServices)->LocatePpi (
+                    PeiServices,
+                    &gEfiPeiReadOnlyVariable2PpiGuid,
+                    0,
+                    NULL,
+                    (VOID **) &VariableServices
+                     );
+
+  VariableServices->GetVariable (
+                      VariableServices,
+                      PLATFORM_SETUP_VARIABLE_NAME,
+                      &gEfiSetupVariableGuid,
+                      NULL,
+                      &VariableSize,
+                      &SystemConfiguration
+                      );
 
   Status = PeiServicesLocatePpi (
              &gBoardPostMemInitDoneGuid,
@@ -91,7 +114,15 @@ BensonGlacierPostMemInitCallback (
   //
   // Set PcdSueCreek
   //
-  PcdSetBool (PcdSueCreek, TRUE);
+  if (SystemConfiguration.SueCreekBypass) {
+    PcdSetBool (PcdSueCreek, FALSE);
+    PcdSetBool (PcdTi3100AudioCodecEnable, TRUE);
+    DEBUG ((EFI_D_INFO,  "Bypass SueCreek \n"));
+  } else {
+    PcdSetBool (PcdSueCreek, TRUE);
+    PcdSetBool (PcdTi3100AudioCodecEnable, FALSE); 
+    DEBUG ((EFI_D_INFO,  "Use SueCreek \n"));
+  }
 
   //
   // Set PcdMaxPkgCState
diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf
index 55ec5b75f..e15e61293 100644
--- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf
+++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf
@@ -65,6 +65,7 @@
   gPlatformModuleTokenSpaceGuid.PcdBoardVbtFileGuid
   gPlatformModuleTokenSpaceGuid.PcdSueCreek
   gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState
+  gPlatformModuleTokenSpaceGuid.PcdTi3100AudioCodecEnable
 
 [Guids]
   gEfiPlatformInfoGuid
diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c
index d0c668ef5..c18753b61 100644
--- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c
+++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c
@@ -1439,8 +1439,8 @@ AcpiPlatformEntryPoint (
     mGlobalNvsArea.Area->BatteryCapacity0           = 100;
     mGlobalNvsArea.Area->Mmio32Base                 = (MmioRead32 ((UINTN) PcdGet64 (PcdPciExpressBaseAddress) + 0xBC) & 0xFFF00000);;
     mGlobalNvsArea.Area->Mmio32Length               = ACPI_MMIO_BASE_ADDRESS - mGlobalNvsArea.Area->Mmio32Base;
-    mGlobalNvsArea.Area->SueCreekEnable               = PcdGetBool(PcdSueCreek);
-
+    mGlobalNvsArea.Area->SueCreekEnable             = PcdGetBool(PcdSueCreek);
+    mGlobalNvsArea.Area->Ti3100AudioCodecEnable     = PcdGetBool(PcdTi3100AudioCodecEnable );
     //
     // Initialize IGD state by checking if IGD Device 2 Function 0 is enabled in the chipset
     //
diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
index 9d451f598..21ce93822 100644
--- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -88,6 +88,7 @@
   gPlatformModuleTokenSpaceGuid.PcdResetType
   gPlatformModuleTokenSpaceGuid.PcdSueCreek
   gPlatformModuleTokenSpaceGuid.PcdBtDevice
+  gPlatformModuleTokenSpaceGuid.PcdTi3100AudioCodecEnable
 
 [Depex]
   gEfiAcpiSupportProtocolGuid        AND
diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/GloblNvs.asl b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/GloblNvs.asl
index 78416f67a..c54d21db3 100644
--- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/GloblNvs.asl
+++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/GloblNvs.asl
@@ -480,5 +480,6 @@
     HTTP,    8,     //   (921) HotThermalTripPointSen2
     CRTP,    8,     //   (922) CriticalThermalTripPointSen2
     SUCE,    8,     //   (923) SueCreekEnable: 0: disabled; 1: enabled
+    ISCT,    8,     //   (924) TI3100 Audio Codec: 0:Disable; 1:Enable
 }
 
diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/Audio/AudioCodec10TI3100.asl b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/Audio/AudioCodec10TI3100.asl
new file mode 100644
index 000000000..06d2dcfb4
--- /dev/null
+++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/Audio/AudioCodec10TI3100.asl
@@ -0,0 +1,44 @@
+/** @file
+  Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+External(\ISCT, IntObj)
+
+Scope(\_SB.PCI0.I2C5)
+{
+    Device (ACDT)  // Audio Codec driver I2C
+    {
+      Name (_ADR, 0x18)
+      Name (_HID, "10TI3100")
+      Name (_CID, "10TI3100")
+      Name (_DDN, "Intel(R) Smart Sound Technology Audio Codec" )
+      Name (_UID, 1)
+
+      Method(_CRS, 0x0, Serialized)
+      {
+        Name(SBUF,ResourceTemplate ()
+        {
+          I2CSerialBus (0x18, ControllerInitiated, 400000, AddressingMode7Bit, "\\_SB.PCI0.I2C5",0x00, ResourceConsumer,,)
+        })
+        Return (SBUF)
+      }
+
+      Method (_STA, 0x0, NotSerialized)
+      {
+        If (LEqual (ISCT, 1)) {
+          Return (0xF)  // I2S Codec Enabled
+        }
+        Return (0)
+      }
+    } // Device (ACDT)
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/PlatformSsdt.asl b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/PlatformSsdt.asl
index 1f9da7678..a967a8407 100644
--- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/PlatformSsdt.asl
+++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiTablesPCAT/PlatformSsdt/PlatformSsdt.asl
@@ -25,6 +25,7 @@ DefinitionBlock (
   External(\_SB.PCI0.I2C2, DeviceObj)
   External(\_SB.PCI0.I2C3, DeviceObj)
   External(\_SB.PCI0.I2C4, DeviceObj)
+  External(\_SB.PCI0.I2C5, DeviceObj)
   External(\_SB.PCI0.I2C7, DeviceObj)
   External(\_SB.PCI0.URT1, DeviceObj)
   External(\_SB.PCI0.URT2, DeviceObj)
@@ -44,6 +45,7 @@ DefinitionBlock (
 
   include ("Audio/AudioCodec_INT34C1.asl")
   include ("Audio/AudioCodec_INT343A.asl")
+  include ("Audio/AudioCodec10TI3100.asl")
 
   If (LEqual(IPUD, 1)) {
     include ("Camera/Camera_INT3471.asl")
diff --git a/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h b/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h
index c6ced4616..e511a02a8 100644
--- a/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h
+++ b/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h
@@ -1133,7 +1133,8 @@ typedef struct {
   UINT8         CriticalThermalTripPointSen2;
   UINT8         CriticalThermalTripPointSen2S3;
   UINT8         HotThermalTripPointSen2;
-
+  
+  UINT8         SueCreekBypass;
 } SYSTEM_CONFIGURATION;
 #pragma pack(pop)
 
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi
index 448105c92..3dbc2f313 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi
@@ -209,6 +209,13 @@ endif;
     option text = STRING_TOKEN(STR_DISABLE), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;
     option text = STRING_TOKEN(STR_ENABLE), value = 1, flags = RESET_REQUIRED;
   endoneof;
+  
+  oneof varid   = Setup.SueCreekBypass,
+    prompt      = STRING_TOKEN(STR_SUE_CREEK_BYPASS_PROMPT),
+    help        = STRING_TOKEN(STR_SUE_CREEK_BYPASS_HELP),
+    option text = STRING_TOKEN(STR_DISABLE), value = 0, flags = DEFAULT | MANUFACTURING | RESET_REQUIRED;
+    option text = STRING_TOKEN(STR_ENABLE), value = 1, flags = RESET_REQUIRED;
+  endoneof;
 
   oneof varid   = Setup.I2cNfc,
     prompt      = STRING_TOKEN(STR_I2C_DEVICE_NFC_PROMPT),
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/UqiList.uni b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/UqiList.uni
index df597460ee925f6cd4500fbf9dc0a27cc2b0c0c0..4666b9a6a5b2b365750f5afdbc1ce1810c62b1e4 100644
GIT binary patch
delta 111
zcmZp<%YNiOd&3sSmUq)r9y7|w1~Y^*xH7~uI5PwRX;%hsAlr!{k|BV>ks)|;p|SOJ
ihu4f6(=Q!ml*6xfdZ8Pm@#F*%4zLC`3kD?yE(QSDe;cO&

delta 11
ScmX?dpS|TSd&3sSmUjRn3I)0V

diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/VfrStrings.uni b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/VfrStrings.uni
index f728cf26f90f8aed7a41b5501be77a962db0f622..163b750c3b0c54bd54a0760effffcc6c8296ebe1 100644
GIT binary patch
delta 157
zcmX?iN$B2Hp@tU5ElhLXiH0(`GQ=}DGXw!?R|an&+le7^`oqag_R}}aU{sN;WGG-r
zWGDtg1%_aTQifEZ+9DvCIz8|VqoQ;$16BhV0vH^pGrnQ6o^EiG(M{Tk0k<&+Z!)U3
O&w9tSebzhXExP~>Mk>z$

delta 23
fcmcb2Rp{I$p@tU5ElhLXwd;If+OG3~dDAWcj(ZEF

diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.dec b/Platform/BroxtonPlatformPkg/PlatformPkg.dec
index d6a175b8c..1de762f79 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkg.dec
+++ b/Platform/BroxtonPlatformPkg/PlatformPkg.dec
@@ -190,7 +190,8 @@
   gPlatformModuleTokenSpaceGuid.PcdBtDevice|0x00|UINT8|0x80000017
   ## This PCD used to select MaxPkgCState
   gPlatformModuleTokenSpaceGuid.PcdMaxPkgCState|0x00|UINT8|0x80000018
-
+  ## This PCD used to select TI3100 Audio Codec
+  gPlatformModuleTokenSpaceGuid.PcdTi3100AudioCodecEnable|FALSE|BOOLEAN|0x80000019
   ## MemoryCheck value for checking memory before boot OS.
   ## To save the boot performance, the default MemoryCheck is set to 0.
   gClientCommonModuleTokenSpaceGuid.PcdPlatformMemoryCheck|0|UINT8|0x40000005
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/NorthCluster/Include/Protocol/GlobalNvsArea.h b/Silicon/BroxtonSoC/BroxtonSiPkg/NorthCluster/Include/Protocol/GlobalNvsArea.h
index e8319ce0f..22b738ae8 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/NorthCluster/Include/Protocol/GlobalNvsArea.h
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/NorthCluster/Include/Protocol/GlobalNvsArea.h
@@ -506,7 +506,8 @@ typedef struct {
   UINT8       CriticalThermalTripPointSen2S3;         ///<   (920) CriticalThermalTripPointSen2S3
   UINT8       HotThermalTripPointSen2;                ///<   (921) HotThermalTripPointSen2
   UINT8       CriticalThermalTripPointSen2;           ///<   (922) CriticalThermalTripPointSen2
-  UINT8       SueCreekEnable;                         ///<   (923) SueCreekEnable: 0: disabled; 1: enabled                         
+  UINT8       SueCreekEnable;                         ///<   (923) SueCreekEnable: 0: disabled; 1: enabled
+  UINT8       Ti3100AudioCodecEnable;                 ///<   (924) TI3100 Audio Codec: 0:Disable; 1:Enable
 } EFI_GLOBAL_NVS_AREA;
 #pragma pack ()
 
-- 
2.14.1.windows.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-15  4:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15  5:03 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] SueCreek Bypass zwei4

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox