summaryrefslogtreecommitdiff
path: root/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem
diff options
context:
space:
mode:
authorlushifex <shifeix.a.lu@intel.com>2017-11-30 13:22:39 +0800
committerGuo Mang <mang.guo@intel.com>2017-11-30 15:42:54 +0800
commitd57df3843be8676f705aa7597c9cbdbba8bb8a94 (patch)
treef238d7f4653f521904c45a4719a615acf76f50b0 /Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem
parent30b522fdbc1d0de841ade63fdab97fd9cd8d9c37 (diff)
downloadedk2-platforms-d57df3843be8676f705aa7597c9cbdbba8bb8a94.tar.xz
Set eMMCHost Speed.
Add a temporary platform workaround to downgrade eMMC host from HS400 to HS200 on MinnowBoard 3 FAB B and MinnowBoard 3 Next Pre-production board. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: lushifex <shifeix.a.lu@intel.com>
Diffstat (limited to 'Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem')
-rw-r--r--Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c35
-rw-r--r--Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitMiscs.h7
-rw-r--r--Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf1
3 files changed, 43 insertions, 0 deletions
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c
index 6ee7e3d3ff..c1ee6b9c98 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInit.c
@@ -59,6 +59,30 @@ MinnowBoard3PostMemInitCallback (
UINT8 ResetType;
UINT8 BtDevice;
UINTN BufferSize;
+ UINT8 MaxSpeed;
+ UINTN VariableSize;
+ EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
+ SYSTEM_CONFIGURATION SystemConfiguration;
+
+ VariableSize = sizeof (SYSTEM_CONFIGURATION);
+ ZeroMem (&SystemConfiguration, sizeof (SYSTEM_CONFIGURATION));
+
+ (*PeiServices)->LocatePpi (
+ (CONST EFI_PEI_SERVICES **)PeiServices,
+ &gEfiPeiReadOnlyVariable2PpiGuid,
+ 0,
+ NULL,
+ (VOID **) &VariableServices
+ );
+
+ VariableServices->GetVariable (
+ VariableServices,
+ PLATFORM_SETUP_VARIABLE_NAME,
+ &gEfiSetupVariableGuid,
+ NULL,
+ &VariableSize,
+ &SystemConfiguration
+ );
Status = PeiServicesLocatePpi (
&gBoardPostMemInitDoneGuid,
@@ -113,6 +137,17 @@ MinnowBoard3PostMemInitCallback (
PcdSetBool (PcdLogoDisplay, TRUE);
//
+ // Set PcdeMMCHostMaxSpeed
+ //
+ if ((SystemConfiguration.ScceMMCHostMaxSpeed == 0) || (SystemConfiguration.ScceMMCHostMaxSpeed == 1)) {
+ MaxSpeed = EMMC_HS200_MODE;
+ PcdSet8 (PcdeMMCHostMaxSpeed, (UINT8) MaxSpeed);
+ } else {
+ MaxSpeed = EMMC_DDR50_MODE;
+ PcdSet8 (PcdeMMCHostMaxSpeed, (UINT8) MaxSpeed);
+ }
+
+ //
// Add init steps here
//
//
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitMiscs.h b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitMiscs.h
index 37faf87493..3392a0341d 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitMiscs.h
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitMiscs.h
@@ -94,6 +94,13 @@
#define SUBSYSTEM_DEVICE_ID 0x1234
#define SUBSYSTEM_SVID_SSID (SUBSYSTEM_VENDOR_ID + (SUBSYSTEM_DEVICE_ID << 16))
+//
+// eMMCHostMaxSpeed identifier.
+//
+#define EMMC_HS400_MODE 0x00
+#define EMMC_HS200_MODE 0x01
+#define EMMC_DDR50_MODE 0x02
+
EFI_STATUS
Minnow3GetPlatformInfoHob (
IN CONST EFI_PEI_SERVICES **PeiServices,
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf
index 665a557696..801c47f141 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf
@@ -62,6 +62,7 @@
gPlatformModuleTokenSpaceGuid.PcdSueCreek
gPlatformModuleTokenSpaceGuid.PcdLogoDisplay
gPlatformModuleTokenSpaceGuid.PcdBtDevice
+ gPlatformModuleTokenSpaceGuid.PcdeMMCHostMaxSpeed
[Guids]
gEfiPlatformInfoGuid