EmbeddedPkg: add DtPlatformDtbLoaderLib library class
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 31 Mar 2017 10:32:36 +0000 (11:32 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 31 Mar 2017 12:17:55 +0000 (13:17 +0100)
To abstract the way a platform reasons about which DTB is appropriate,
and the way it ultimately supplies the DTB image, introduce a new library
class to encapsulate this functionality.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
EmbeddedPkg/EmbeddedPkg.dec
EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h [new file with mode: 0644]

index 871fc5f..0bed273 100644 (file)
@@ -45,6 +45,7 @@
   GdbSerialLib|Include/Library/GdbSerialLib.h\r
   DebugAgentTimerLib|Include/Library/DebugAgentTimerLib.h\r
 \r
+  DtPlatformDtbLoaderLib|Include/Library/DtPlatformDtbLoaderLib.h\r
 \r
 [Guids.common]\r
   gEmbeddedTokenSpaceGuid       = { 0xe0d8ca17, 0x4276, 0x4386, { 0xbb, 0x79, 0x48, 0xcb, 0x81, 0x3d, 0x3c, 0x4f }}\r
diff --git a/EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h b/EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h
new file mode 100644 (file)
index 0000000..b2fbf4a
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+*\r
+*  Copyright (c) 2017, Linaro, Ltd. All rights reserved.\r
+*\r
+*  This program and the accompanying materials\r
+*  are licensed and made available under the terms and conditions of the BSD License\r
+*  which accompanies this distribution.  The full text of the license may be found at\r
+*  http://opensource.org/licenses/bsd-license.php\r
+*\r
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#ifndef __DT_PLATFORM_DTB_LOADER_LIB_H__\r
+#define __DT_PLATFORM_DTB_LOADER_LIB_H__\r
+\r
+#include <Uefi/UefiBaseType.h>\r
+\r
+/**\r
+  Return a pool allocated copy of the DTB image that is appropriate for\r
+  booting the current platform via DT.\r
+\r
+  @param[out]   Dtb                   Pointer to the DTB copy\r
+  @param[out]   DtbSize               Size of the DTB copy\r
+\r
+  @retval       EFI_SUCCESS           Operation completed successfully\r
+  @retval       EFI_NOT_FOUND         No suitable DTB image could be located\r
+  @retval       EFI_OUT_OF_RESOURCES  No pool memory available\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DtPlatformLoadDtb (\r
+  OUT   VOID        **Dtb,\r
+  OUT   UINTN       *DtbSize\r
+  );\r
+\r
+#endif\r