UDK2018 eMMC driver may fail to switch eMMC to HS400 mode. This platform 
temporary solution limits eMMC controller to maximal HS200 mode.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: David Wei <david....@intel.com>
CC: Mike Wu  <mike...@intel.com>
CC: Mang Guo <mang....@intel.com>
---
 .../Board/LeafHill/BoardInitPostMem/BoardInit.c              | 12 ++++++++++--
 .../Board/LeafHill/BoardInitPostMem/BoardInitMiscs.h         | 10 +++++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git 
a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit.c 
b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInit.c
index 729b15f966..f0f89f3867 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
@@ -60,6 +60,7 @@ LeafHillPostMemInitCallback (
   UINT8                            ResetType;
   UINTN                            BufferSize;
   UINT8                            MaxPkgCState;
+  UINT8                            MaxSpeed;
   UINTN                            VariableSize;
   EFI_PEI_READ_ONLY_VARIABLE2_PPI  *VariableServices;
   SYSTEM_CONFIGURATION             SystemConfiguration;
@@ -135,7 +136,14 @@ LeafHillPostMemInitCallback (
   //
   // Set PcdeMMCHostMaxSpeed
   //
-  PcdSet8 (PcdeMMCHostMaxSpeed, (UINT8) 
(SystemConfiguration.ScceMMCHostMaxSpeed));
+
+  if ((SystemConfiguration.ScceMMCHostMaxSpeed == 0) || 
(SystemConfiguration.ScceMMCHostMaxSpeed == 1)) {
+    MaxSpeed = EMMC_HS200_MODE;
+    PcdSet8 (PcdeMMCHostMaxSpeed, (UINT8) MaxSpeed);
+  } else {
+    MaxSpeed = EMMC_DDR50_MODE;
+    PcdSet8 (PcdeMMCHostMaxSpeed, (UINT8) MaxSpeed);
+  }
 
   //
   // HDA audio verb table
diff --git 
a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitMiscs.h 
b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitMiscs.h
index c1ba128709..da7ccd39ba 100644
--- 
a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitMiscs.h
+++ 
b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPostMem/BoardInitMiscs.h
@@ -2,7 +2,7 @@
   Multiplatform initialization header file.
   This file includes package header files, library classes.
 
-  Copyright (c) 2010 - 2016, 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
@@ -92,6 +92,14 @@
 #define MAX_PKG_CSTATE_C0 0x00
 #define MAX_PKG_CSTATE_C1 0x01
 #define MAX_PKG_CSTATE_C2 0x02
+
+//
+// eMMCHostMaxSpeed identifier.
+//
+#define EMMC_HS400_MODE   0x00
+#define EMMC_HS200_MODE   0x01
+#define EMMC_DDR50_MODE   0x02
+
 EFI_STATUS
 LeafHillGetPlatformInfoHob (
   IN CONST EFI_PEI_SERVICES     **PeiServices,
-- 
2.14.1.windows.1

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

Reply via email to