[edk2] [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] UP2 PCIe NIC.

zwei4 posted 1 patch 17 weeks ago
Failed in applying to current master (apply log)
.../Board/UP2/BoardInitDxe/BoardInitDxe.c          | 42 +++++++++++++++++++++-
.../Board/UP2/BoardInitDxe/BoardInitDxe.h          |  1 +
2 files changed, 42 insertions(+), 1 deletion(-)

[edk2] [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] UP2 PCIe NIC.

Posted by zwei4 17 weeks ago
Disable PCIe root port 1 of UP2, which is connected to a onboard RealTek PCIe NIC. If this PCIe NIC is enabled, Windows 10 installation will fail. This patch is a temporary solution.

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/UP2/BoardInitDxe/BoardInitDxe.c          | 42 +++++++++++++++++++++-
 .../Board/UP2/BoardInitDxe/BoardInitDxe.h          |  1 +
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.c b/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.c
index 3b5c5ac566..662d8f1991 100644
--- a/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.c
+++ b/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.c
@@ -17,6 +17,7 @@
 #include "BoardInitDxe.h"
 
 GET_BOARD_NAME mUp2GetBoardNamePtr = Up2GetBoardName;
+SYSTEM_CONFIGURATION  mSystemConfiguration;
 
 CHAR16*
 EFIAPI
@@ -37,7 +38,44 @@ Up2GetBoardName (
   }
 }
 
-
+EFI_STATUS
+UpdateSetupVariable (
+  VOID
+  )
+{
+  UINTN       VarSize;
+  UINT32      VariableAttributes;
+  EFI_STATUS  Status;
+
+  //
+  // Update default value of Setup Variable for PCIe W/A.
+  // PCIe RealTek NIC on root port #1 blocks Windows 10 installation.
+  //
+  
+  VarSize = sizeof (SYSTEM_CONFIGURATION);
+  Status = gRT->GetVariable (
+                    L"Setup",
+                    &gEfiSetupVariableGuid,
+                    &VariableAttributes,
+                    &VarSize,
+                    &mSystemConfiguration
+                    );
+  ASSERT_EFI_ERROR (Status);
+
+  if (Status == EFI_SUCCESS) {
+    mSystemConfiguration.PcieRootPortEn[3]= (UINT8) 0;
+    Status = gRT->SetVariable (
+                    L"Setup",
+                    &gEfiSetupVariableGuid,
+                    VariableAttributes,
+                    VarSize,
+                    &mSystemConfiguration
+                    );
+    ASSERT_EFI_ERROR (Status);
+  }
+  
+  return Status;
+}
 /**
   Set PCDs for board specific functions
 
@@ -62,6 +100,8 @@ Up2BoardInitDxeConstructor (
   }
 
   PcdSet64 (PcdGetBoardNameFunc, (UINT64) mUp2GetBoardNamePtr);
+ 
+  UpdateSetupVariable();
 
   return EFI_SUCCESS;
 }
diff --git a/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.h b/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.h
index 61e66978ac..82e976e7ef 100644
--- a/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.h
+++ b/Platform/BroxtonPlatformPkg/Board/UP2/BoardInitDxe/BoardInitDxe.h
@@ -27,6 +27,7 @@
 #include <Library/PcdLib.h>
 #include <Library/PrintLib.h>
 #include <Guid/PlatformInfo_Aplk.h>
+#include <Guid/SetupVariable.h>
 
 CHAR16*
 EFIAPI
-- 
2.14.1.windows.1

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