public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] Leaf Hill eMMC Speed.
@ 2018-09-11  8:34 zwei4
  0 siblings, 0 replies; only message in thread
From: zwei4 @ 2018-09-11  8:34 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Mike Wu, Mang Guo

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.wei@intel.com>
CC: Mike Wu  <mike.wu@intel.com>
CC: Mang Guo <mang.guo@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



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

only message in thread, other threads:[~2018-09-11  8:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11  8:34 [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] Leaf Hill eMMC Speed zwei4

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