diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-09-28 09:58:42 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-09-28 09:58:42 +0000 |
commit | 0a6653bc2aecaa621eb42c7137b6f13815a34a92 (patch) | |
tree | 20b450e1bfbdb014095d74786871e23c6e3a5d4b /ArmPkg/Library/BdsLib/BdsLinuxLoader.h | |
parent | 619b3998880e3c28c46d3a20bbbfa879e08b3579 (diff) | |
download | edk2-platforms-0a6653bc2aecaa621eb42c7137b6f13815a34a92.tar.xz |
ArmPkg/BdsLib: Added FDT support for BdsLib
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13768 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library/BdsLib/BdsLinuxLoader.h')
-rw-r--r-- | ArmPkg/Library/BdsLib/BdsLinuxLoader.h | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsLinuxLoader.h b/ArmPkg/Library/BdsLib/BdsLinuxLoader.h index 8d58ce103a..a9b7037d19 100644 --- a/ArmPkg/Library/BdsLib/BdsLinuxLoader.h +++ b/ArmPkg/Library/BdsLib/BdsLinuxLoader.h @@ -16,11 +16,24 @@ #define __BDSLINUXLOADER_H #define LINUX_UIMAGE_SIGNATURE 0x56190527 - -#define LINUX_ATAG_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxAtagMaxOffset)) #define LINUX_KERNEL_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxKernelMaxOffset)) +#define LINUX_ATAG_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxAtagMaxOffset)) +#define LINUX_FDT_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxFdtMaxOffset)) -#define ATAG_MAX_SIZE 0x3000 +// Additional size that could be used for FDT entries added by the UEFI OS Loader +// Estimation based on: EDID (300bytes) + bootargs (200bytes) + initrd region (20bytes) +// + system memory region (20bytes) + mp_core entries (200 bytes) +#define FDT_ADDITIONAL_ENTRIES_SIZE 0x300 + +#define ARM_FDT_MACHINE_TYPE 0xFFFFFFFF + +typedef VOID (*LINUX_KERNEL)(UINT32 Zero, UINT32 Arch, UINTN ParametersBase); + +// +// ATAG Definitions +// + +#define ATAG_MAX_SIZE 0x3000 /* ATAG : list of possible tags */ #define ATAG_NONE 0x00000000 @@ -35,7 +48,9 @@ #define ATAG_CMDLINE 0x54410009 #define ATAG_ARM_MP_CORE 0x5441000A -/* structures for each atag */ +#define next_tag_address(t) ((LINUX_ATAG*)((UINT32)(t) + (((t)->header.size) << 2) )) +#define tag_size(type) ((UINT32)((sizeof(LINUX_ATAG_HEADER) + sizeof(type)) >> 2)) + typedef struct { UINT32 size; /* length of tag in words including this header */ UINT32 type; /* tag type */ @@ -120,9 +135,22 @@ typedef struct { } body; } LINUX_ATAG; -typedef VOID (*LINUX_KERNEL)(UINT32 Zero, UINT32 Arch, UINTN ParametersBase); - -#define next_tag_address(t) ((LINUX_ATAG*)((UINT32)(t) + (((t)->header.size) << 2) )) -#define tag_size(type) ((UINT32)((sizeof(LINUX_ATAG_HEADER) + sizeof(type)) >> 2)) +EFI_STATUS +PrepareAtagList ( + IN CONST CHAR8* CommandLineString, + IN EFI_PHYSICAL_ADDRESS InitrdImage, + IN UINTN InitrdImageSize, + OUT EFI_PHYSICAL_ADDRESS *AtagBase, + OUT UINT32 *AtagSize + ); + +EFI_STATUS +PrepareFdt ( + IN CONST CHAR8* CommandLineArguments, + IN EFI_PHYSICAL_ADDRESS InitrdImage, + IN UINTN InitrdImageSize, + IN OUT EFI_PHYSICAL_ADDRESS *FdtBlobBase, + IN OUT UINT32 *FdtBlobSize + ); #endif |