public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] DMIC NHLT Entry.
@ 2018-01-11  6:20 zwei4
  0 siblings, 0 replies; only message in thread
From: zwei4 @ 2018-01-11  6:20 UTC (permalink / raw)
  To: edk2-devel

Customize DMIC NHLT entry for boards.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: zwei4 <david.wei@intel.com>
---
 .../Board/AuroraGlacier/BoardInitPostMem/BoardInit.c             | 5 +++++
 .../Board/AuroraGlacier/BoardInitPostMem/BoardInitPostMem.inf    | 3 ++-
 .../Board/BensonGlacier/BoardInitPostMem/BoardInit.c             | 7 ++++++-
 .../Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf    | 3 ++-
 .../Board/LeafHill/BoardInitPostMem/BoardInit.c                  | 9 +++++++--
 .../Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf         | 3 ++-
 .../Board/MinnowBoard3/BoardInitPostMem/BoardInit.c              | 7 ++++++-
 .../Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf     | 3 ++-
 .../PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi     | 6 +++---
 Silicon/BroxtonSoC/BroxtonSiPkg/BroxtonSiPkg.dec                 | 8 ++++++--
 Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScHda.c  | 6 +++++-
 .../BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScInitDxe.inf           | 4 +++-
 12 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInit.c
index 2f33bfe21..5ede1f114 100644
--- a/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInit.c
+++ b/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInit.c
@@ -144,6 +144,11 @@ AuroraGlacierPostMemInitCallback (
   PcdSet8(HdaEndpointI2sRenderHPVirtualBusId, 1);  // I2S2
   PcdSet8(HdaEndpointI2sCaptureVirtualBusId, 1);   // I2S2
 
+  //
+  // DMIC
+  //
+  PcdSet8(NhltEndpointDmic, (UINT8) SystemConfiguration.ScHdAudioNhltEndpointDmic);
+
   //
   // Add init steps here
   //
diff --git a/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInitPostMem.inf
index f47cb4f28..ec30b262c 100644
--- a/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInitPostMem.inf
+++ b/Platform/BroxtonPlatformPkg/Board/AuroraGlacier/BoardInitPostMem/BoardInitPostMem.inf
@@ -72,7 +72,8 @@
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderSKPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderHPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sCaptureVirtualBusId
-
+  gEfiBxtTokenSpaceGuid.NhltEndpointDmic
+  
 [Guids]
   gEfiPlatformInfoGuid
   gEfiAuthenticatedVariableGuid
diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c
index aabb350e8..deb36c610 100644
--- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c
+++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInit.c
@@ -1,7 +1,7 @@
 /** @file
   Board Init driver.
 
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -143,6 +143,11 @@ BensonGlacierPostMemInitCallback (
   PcdSet8(HdaEndpointI2sRenderSKPVirtualBusId, 1); // I2S2
   PcdSet8(HdaEndpointI2sRenderHPVirtualBusId, 1);  // I2S2
   PcdSet8(HdaEndpointI2sCaptureVirtualBusId, 1);   // I2S2
+  
+  //
+  // DMIC
+  //
+  PcdSet8(NhltEndpointDmic, (UINT8) SystemConfiguration.ScHdAudioNhltEndpointDmic);
 
   //
   // Add init steps here
diff --git a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf
index c7499b564..53fa6756f 100644
--- a/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf
+++ b/Platform/BroxtonPlatformPkg/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf
@@ -2,7 +2,7 @@
 #  Board detected module for Intel(R) Atom(TM) x5 Processor Series.
 #  It will detect the board ID.
 #
-#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2014 - 2018, 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
@@ -72,6 +72,7 @@
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderSKPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderHPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sCaptureVirtualBusId
+  gEfiBxtTokenSpaceGuid.NhltEndpointDmic
 
 [Guids]
   gEfiPlatformInfoGuid
diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit.c
index fdf2c7eaa..fdd6b4de6 100644
--- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit.c
+++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit.c
@@ -1,7 +1,7 @@
 /** @file
   Board Init driver.
 
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -150,7 +150,12 @@ LeafHillPostMemInitCallback (
   PcdSet8(HdaEndpointI2sRenderSKPVirtualBusId, 5); //I2S6
   PcdSet8(HdaEndpointI2sRenderHPVirtualBusId, 5);  //I2S6
   PcdSet8(HdaEndpointI2sCaptureVirtualBusId, 5);   //I2S6
-  
+
+  //
+  // DMIC
+  //
+  PcdSet8(NhltEndpointDmic, (UINT8) SystemConfiguration.ScHdAudioNhltEndpointDmic);
+    
   //
   // Add init steps here
   //
diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf
index 9b6b3c93d..b66e33332 100644
--- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf
+++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf
@@ -3,7 +3,7 @@
 #
 #  It will detect the board ID.
 #
-#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2014 - 2018, 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
@@ -72,6 +72,7 @@
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderSKPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderHPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sCaptureVirtualBusId
+  gEfiBxtTokenSpaceGuid.NhltEndpointDmic
   
 [Guids]
   gEfiPlatformInfoGuid
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c
index 666a0bfdf..bc342230c 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c
@@ -1,7 +1,7 @@
 /** @file
   Board Init driver.
 
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, 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
@@ -156,6 +156,11 @@ MinnowBoard3PostMemInitCallback (
   PcdSet8(HdaEndpointI2sRenderHPVirtualBusId, 0);  // I2S1
   PcdSet8(HdaEndpointI2sCaptureVirtualBusId, 0);   // I2S1
 
+  //
+  // DMIC
+  //
+  PcdSet8(NhltEndpointDmic, (UINT8) SystemConfiguration.ScHdAudioNhltEndpointDmic);
+
   //
   // Add init steps here
   //
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf
index 9cf90c637..863a0c358 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf
@@ -2,7 +2,7 @@
 #  Board detected module for Intel(R) Atom(TM) x5 Processor Series.
 #  It will detect the board ID.
 #
-#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2014 - 2018, 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
@@ -68,6 +68,7 @@
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderSKPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sRenderHPVirtualBusId
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sCaptureVirtualBusId
+  gEfiBxtTokenSpaceGuid.NhltEndpointDmic
 
 [Guids]
   gEfiPlatformInfoGuid
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi
index f45d47a82..7f90f8faf 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SouthClusterConfig.vfi
@@ -1,7 +1,7 @@
 // /** @file
 //  South Cluster Setup formset.
 //
-//  Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>
+//  Copyright (c) 1999 - 2018, 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
@@ -2765,8 +2765,8 @@ form formid     = HDAUDIO_OPTIONS_FORM_ID,
     oneof varid     = Setup.ScHdAudioNhltEndpointDmic,
            prompt      = STRING_TOKEN(STR_HDA_NHLT_ENDPOINT_DMIC),
            help        = STRING_TOKEN(STR_HDA_NHLT_ENDPOINT_DMIC_HELP),
-           option text = STRING_TOKEN(STR_DISABLE),  value = 0, flags = DEFAULT | RESET_REQUIRED;
-           option text = STRING_TOKEN(STR_HDA_DMIC_2CH), value = 1, flags = RESET_REQUIRED;
+           option text = STRING_TOKEN(STR_DISABLE),  value = 0, flags = RESET_REQUIRED;
+           option text = STRING_TOKEN(STR_HDA_DMIC_2CH), value = 1, flags = DEFAULT | RESET_REQUIRED;
            option text = STRING_TOKEN(STR_HDA_DMIC_4CH), value = 2, flags = RESET_REQUIRED;
     endoneof;
 
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/BroxtonSiPkg.dec b/Silicon/BroxtonSoC/BroxtonSiPkg/BroxtonSiPkg.dec
index a28765f23..2a2fcbf9a 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/BroxtonSiPkg.dec
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/BroxtonSiPkg.dec
@@ -5,7 +5,7 @@
 #  DSC and EDK II INF files to generate AutoGen.c and AutoGen.h files
 #  for the EDK II build infrastructure.
 #
-#  Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2004 - 2018, 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
@@ -332,7 +332,8 @@
   gEfiBxtTokenSpaceGuid.PcdSetCoreCount|0|UINT32|0x10000223
   gEfiBxtTokenSpaceGuid.PcdVtdGfxBaseAddress|0xFED64000|UINT32|0x10000224
   gSiPkgTokenSpaceGuid.PcdForceVolatileVariable|FALSE|BOOLEAN|0x30000012
-  
+
+
   ## I2S Audio Configuration
   ## Blue Tooth Render
   gEfiBxtTokenSpaceGuid.HdaEndpointBtRenderVirtualBusId|0x0F|UINT8|0x80000001
@@ -345,6 +346,9 @@
   ## Headphone Capture
   gEfiBxtTokenSpaceGuid.HdaEndpointI2sCaptureVirtualBusId|0x0F|UINT8|0x80000005
 
+  ## DMIC
+  gEfiBxtTokenSpaceGuid.NhltEndpointDmic|0x01|UINT8|0x80000006
+  
 [PcdsFeatureFlag]
   gBxtRefCodePkgTokenSpaceGuid.PcdCeAtaSupport|FALSE|BOOLEAN|0x12
   gBxtRefCodePkgTokenSpaceGuid.PcdMmcSdMultiBlockSupport|TRUE|BOOLEAN|0x13
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScHda.c b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScHda.c
index 4600b5326..9c411732b 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScHda.c
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScHda.c
@@ -1,7 +1,7 @@
 /** @file
   Initializes the HD-Audio Controller and Codec.
 
-  Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 1999 - 2018, 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
@@ -266,12 +266,16 @@ ConfigureHdaAtBoot (
   Status = GetConfigBlock ((VOID *) ScPolicy, &gHdAudioConfigGuid, (VOID *) &HdaConfig);
   ASSERT_EFI_ERROR (Status);
 
+  //
+  // Workaround: Restore HdaConfig because FSP may set them into incorrect value. 
+  //
   if ((HdaConfig->IoBufferOwnership == ScHdaIoBufOwnerHdaLinkI2sPort) || \
       (HdaConfig->IoBufferOwnership == ScHdaIoBufOwnerI2sPort)) {    
     HdaConfig->DspEndpointBluetooth = TRUE;
     HdaConfig->DspEndpointI2sSkp = TRUE;
     HdaConfig->DspEndpointI2sHp = TRUE;
   }
+  HdaConfig->DspEndpointDmic = PcdGet8(NhltEndpointDmic);
   
   DEBUG ((DEBUG_INFO, "------------------ HD-Audio Config ------------------\n"));
   DEBUG ((DEBUG_INFO, " HDA Enable                   = %x\n", HdaConfig->Enable));
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScInitDxe.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScInitDxe.inf
index 5b31b18fa..7c4d8f544 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScInitDxe.inf
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/ScInit/Dxe/ScInitDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  SC Initialization driver
 #
-#  Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2012 - 2018, 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
@@ -98,6 +98,8 @@
   gPlatformModuleTokenSpaceGuid.PcdFlashIbbRegionSize
   gPlatformModuleTokenSpaceGuid.PcdFlashObbRegionMappedBase
   gPlatformModuleTokenSpaceGuid.PcdFlashObbRegionSize
+  
+  gEfiBxtTokenSpaceGuid.NhltEndpointDmic
 
 [Depex]
   gEfiSmmControl2ProtocolGuid
-- 
2.14.1.windows.1



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

only message in thread, other threads:[~2018-01-11  6:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-11  6:20 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] DMIC NHLT Entry zwei4

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