From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=david.wei@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5E1F42034BBF5 for ; Tue, 14 Nov 2017 20:59:32 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2017 21:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,398,1505804400"; d="scan'208";a="173670660" Received: from zwei4-mobl1.ccr.corp.intel.com ([10.239.193.132]) by orsmga005.jf.intel.com with ESMTP; 14 Nov 2017 21:03:39 -0800 From: zwei4 To: edk2-devel@lists.01.org Date: Wed, 15 Nov 2017 13:03:35 +0800 Message-Id: <20171115050335.1076-1-david.wei@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] SueCreek Bypass X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 04:59:33 -0000 Add code in ACPI table for TI audio codec under I2C5. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: zwei4 --- .../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.
+ + 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