diff options
author | lushifex <shifeix.a.lu@intel.com> | 2017-11-30 13:22:39 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-11-30 15:42:54 +0800 |
commit | d57df3843be8676f705aa7597c9cbdbba8bb8a94 (patch) | |
tree | f238d7f4653f521904c45a4719a615acf76f50b0 /Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next | |
parent | 30b522fdbc1d0de841ade63fdab97fd9cd8d9c37 (diff) | |
download | edk2-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/MinnowBoard3Next')
3 files changed, 43 insertions, 0 deletions
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInit.c b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInit.c index cf8523adf2..cafc777fba 100644 --- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInit.c +++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInit.c @@ -58,6 +58,30 @@ MinnowBoard3NextPostMemInitCallback ( UINT8 FabId;
UINT8 ResetType;
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,
@@ -98,6 +122,17 @@ MinnowBoard3NextPostMemInitCallback ( PcdSetPtr(PcdBoardVbtFileGuid, &BufferSize, (UINT8 *)&gPeiMinnow3NextVbtGuid);
//
+ // 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/MinnowBoard3Next/BoardInitPostMem/BoardInitMiscs.h b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitMiscs.h index fd4d08646c..c1ced3491e 100644 --- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitMiscs.h +++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitMiscs.h @@ -87,6 +87,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
Minnow3NextGetPlatformInfoHob (
IN CONST EFI_PEI_SERVICES **PeiServices,
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitPostMem.inf b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitPostMem.inf index be32f93ec1..1a4cc28736 100644 --- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitPostMem.inf +++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Next/BoardInitPostMem/BoardInitPostMem.inf @@ -60,6 +60,7 @@ gPlatformModuleTokenSpaceGuid.PcdFabId
gPlatformModuleTokenSpaceGuid.PcdResetType
gPlatformModuleTokenSpaceGuid.PcdBoardVbtFileGuid
+ gPlatformModuleTokenSpaceGuid.PcdeMMCHostMaxSpeed
[Guids]
gEfiPlatformInfoGuid
|