summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/ArmJunoPkg/Drivers
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2015-05-11 17:52:03 +0000
committeroliviermartin <oliviermartin@Edk2>2015-05-11 17:52:03 +0000
commit1bb1f35f2e55d2edc96d65a0a43cb3f619c6acd2 (patch)
tree5a3ff49d2bca84668bf7eca7ef0514fccc4407a4 /ArmPlatformPkg/ArmJunoPkg/Drivers
parentf63424474e8b022c0b7675d282c9b4c255a95ff4 (diff)
downloadedk2-platforms-1bb1f35f2e55d2edc96d65a0a43cb3f619c6acd2.tar.xz
ArmPlatformPkg/ArmJunoPkg: Enable PCI and SATA support
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17414 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/ArmJunoPkg/Drivers')
-rw-r--r--ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c80
-rw-r--r--ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf1
2 files changed, 81 insertions, 0 deletions
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 51686c4616..f2855512cc 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -16,7 +16,9 @@
#include <ArmPlatform.h>
#include <Protocol/DevicePathFromText.h>
+#include <Protocol/PciRootBridgeIo.h>
+#include <Guid/EventGroup.h>
#include <Guid/GlobalVariable.h>
#include <Library/ArmShellCmdLib.h>
@@ -54,6 +56,28 @@ STATIC EFI_STATUS SetJunoR1DefaultBootEntries (
// This GUID must match the FILE_GUID in ArmPlatformPkg/ArmJunoPkg/AcpiTables/AcpiTables.inf
STATIC CONST EFI_GUID mJunoAcpiTableFile = { 0xa1dd808e, 0x1e95, 0x4399, { 0xab, 0xc0, 0x65, 0x3c, 0x82, 0xe8, 0x53, 0x0c } };
+typedef struct {
+ ACPI_HID_DEVICE_PATH AcpiDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
+} EFI_PCI_ROOT_BRIDGE_DEVICE_PATH;
+
+STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mPciRootComplexDevicePath = {
+ {
+ { ACPI_DEVICE_PATH,
+ ACPI_DP,
+ { (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),
+ (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) }
+ },
+ EISA_PNP_ID (0x0A03),
+ 0
+ },
+ {
+ END_DEVICE_PATH_TYPE,
+ END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ { END_DEVICE_PATH_LENGTH, 0 }
+ }
+};
+
/**
* Build and Set UEFI Variable Boot####
*
@@ -123,6 +147,46 @@ BootOptionCreate (
);
}
+/**
+ Notification function of the event defined as belonging to the
+ EFI_END_OF_DXE_EVENT_GROUP_GUID event group that was created in
+ the entry point of the driver.
+
+ This function is called when an event belonging to the
+ EFI_END_OF_DXE_EVENT_GROUP_GUID event group is signalled. Such an
+ event is signalled once at the end of the dispatching of all
+ drivers (end of the so called DXE phase).
+
+ @param[in] Event Event declared in the entry point of the driver whose
+ notification function is being invoked.
+ @param[in] Context NULL
+**/
+STATIC
+VOID
+OnEndOfDxe (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_DEVICE_PATH_PROTOCOL* PciRootComplexDevicePath;
+ EFI_HANDLE Handle;
+ EFI_STATUS Status;
+
+ //
+ // PCI Root Complex initialization
+ // At the end of the DXE phase, we should get all the driver dispatched.
+ // Force the PCI Root Complex to be initialized. It allows the OS to skip
+ // this step.
+ //
+ PciRootComplexDevicePath = (EFI_DEVICE_PATH_PROTOCOL*) &mPciRootComplexDevicePath;
+ Status = gBS->LocateDevicePath (&gEfiPciRootBridgeIoProtocolGuid,
+ &PciRootComplexDevicePath,
+ &Handle);
+
+ Status = gBS->ConnectController (Handle, NULL, PciRootComplexDevicePath, FALSE);
+ ASSERT_EFI_ERROR (Status);
+}
+
EFI_STATUS
EFIAPI
ArmJunoEntryPoint (
@@ -183,6 +247,22 @@ ArmJunoEntryPoint (
}
}
+ //
+ // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.
+ // The "OnEndOfDxe()" function is declared as the call back function.
+ // It will be called at the end of the DXE phase when an event of the
+ // same group is signalled to inform about the end of the DXE phase.
+ // Install the INSTALL_FDT_PROTOCOL protocol.
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ OnEndOfDxe,
+ NULL,
+ &gEfiEndOfDxeEventGroupGuid,
+ &EndOfDxeEvent
+ );
+
// Install dynamic Shell command to run baremetal binaries.
Status = ShellDynCmdRunAxfInstall (ImageHandle);
if (EFI_ERROR (Status)) {
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
index ea1738ba75..56ab62b31d 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
@@ -57,6 +57,7 @@
gEfiBlockIoProtocolGuid
gEfiDevicePathFromTextProtocolGuid
gEfiPciIoProtocolGuid
+ gEfiPciRootBridgeIoProtocolGuid
gEfiSimpleFileSystemProtocolGuid
[FixedPcd]