]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/ArmJunoDxe: don't register OnEndOfDxe event on rev R0
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 4 Apr 2017 11:58:58 +0000 (12:58 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 5 Apr 2017 13:56:10 +0000 (14:56 +0100)
The ArmJunoDxe driver code registers a callback for the EndOfDxe event,
at which time it does some manipulation of the PCI peripherals on the
board. Given that R0 has no working PCIe, instead of conditionally
performing these operations, omit the registration of the
callback altogether on that platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c

index 14ff189a3078886215366fbc4892c34297a36c80..f7e33961b4e724f75d9680011428dcef0b0ffb35 100644 (file)
@@ -379,7 +379,6 @@ OnEndOfDxe (
   EFI_DEVICE_PATH_PROTOCOL* PciRootComplexDevicePath;\r
   EFI_HANDLE                Handle;\r
   EFI_STATUS                Status;\r
-  UINT32                    JunoRevision;\r
 \r
   //\r
   // PCI Root Complex initialization\r
@@ -395,13 +394,9 @@ OnEndOfDxe (
   Status = gBS->ConnectController (Handle, NULL, PciRootComplexDevicePath, FALSE);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  GetJunoRevision (JunoRevision);\r
-\r
-  if (JunoRevision != JUNO_REVISION_R0) {\r
-    Status = ArmJunoSetNicMacAddress ();\r
-    if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_ERROR, "ArmJunoDxe: Failed to set Marvell Yukon NIC MAC address\n"));\r
-    }\r
+  Status = ArmJunoSetNicMacAddress ();\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((DEBUG_ERROR, "ArmJunoDxe: Failed to set Marvell Yukon NIC MAC address\n"));\r
   }\r
 }\r
 \r
@@ -511,22 +506,6 @@ ArmJunoEntryPoint (
     }\r
   }\r
 \r
-  //\r
-  // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.\r
-  // The "OnEndOfDxe()" function is declared as the call back function.\r
-  // It will be called at the end of the DXE phase when an event of the\r
-  // same group is signalled to inform about the end of the DXE phase.\r
-  // Install the INSTALL_FDT_PROTOCOL protocol.\r
-  //\r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
-                  OnEndOfDxe,\r
-                  NULL,\r
-                  &gEfiEndOfDxeEventGroupGuid,\r
-                  &EndOfDxeEvent\r
-                  );\r
-\r
   // Install dynamic Shell command to run baremetal binaries.\r
   Status = ShellDynCmdRunAxfInstall (ImageHandle);\r
   if (EFI_ERROR (Status)) {\r
@@ -555,6 +534,22 @@ ArmJunoEntryPoint (
     // Enable PCI enumeration\r
     PcdSetBool (PcdPciDisableBusEnumeration, FALSE);\r
 \r
+    //\r
+    // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.\r
+    // The "OnEndOfDxe()" function is declared as the call back function.\r
+    // It will be called at the end of the DXE phase when an event of the\r
+    // same group is signalled to inform about the end of the DXE phase.\r
+    // Install the INSTALL_FDT_PROTOCOL protocol.\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EVT_NOTIFY_SIGNAL,\r
+                    TPL_CALLBACK,\r
+                    OnEndOfDxe,\r
+                    NULL,\r
+                    &gEfiEndOfDxeEventGroupGuid,\r
+                    &EndOfDxeEvent\r
+                    );\r
+\r
     // Declare the related ACPI Tables\r
     EfiCreateProtocolNotifyEvent (\r
         &gEfiAcpiTableProtocolGuid,\r