diff options
Diffstat (limited to 'MdeModulePkg/Universal/Fdt')
-rw-r--r-- | MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.c | 33 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.inf | 48 |
2 files changed, 81 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.c b/MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.c new file mode 100644 index 0000000000..c9b8b4c424 --- /dev/null +++ b/MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.c @@ -0,0 +1,33 @@ +
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DxeServicesLib.h>
+
+#include <Guid/FdtTable.h>
+
+EFI_STATUS
+EFIAPI
+InitializeFdtTableDxe (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ VOID *FdtImageData;
+ UINTN FdtImageSize;
+
+ Status = GetSectionFromAnyFv(PcdGetPtr(PcdFdtImage), EFI_SECTION_RAW, 0,
+ &FdtImageData, &FdtImageSize);
+ if (EFI_ERROR(Status))
+ return Status;
+
+ DEBUG((EFI_D_ERROR, "InitializeFdtTableDxe: DTB @ 0x%08x\n", FdtImageData));
+
+ return gBS->InstallConfigurationTable(&gEfiFdtTableGuid, FdtImageData);
+}
diff --git a/MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.inf b/MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.inf new file mode 100644 index 0000000000..993b778b8f --- /dev/null +++ b/MdeModulePkg/Universal/Fdt/FdtTableDxe/FdtTableDxe.inf @@ -0,0 +1,48 @@ +## @file
+# FDT Table Protocol Driver
+#
+# Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
+# This program and the accompanying materials are
+# licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = FdtTableDxe
+ FILE_GUID = 261F9737-CDF6-46CE-A9E2-5DD16B957413
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+
+ ENTRY_POINT = InitializeFdtTableDxe
+
+[Sources]
+ FdtTableDxe.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+ BaseLib
+ PcdLib
+ UefiDriverEntryPoint
+ DxeServicesLib
+
+[Guids]
+ gEfiFdtTableGuid
+
+[FeaturePcd]
+
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFdtImage
+
+[Protocols]
+
+[Depex]
+ TRUE
|