Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/coreboot/+/58055 )
Change subject: util/cbfstool: Add support for ARM64 UefiPayload ......................................................................
util/cbfstool: Add support for ARM64 UefiPayload
UEFI payload is supported on some ARM64 platforms, for example MT8195. As a result, add MACHINE_TYPE_ARM64 to support ARM SystemReady.
Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Change-Id: I4c0c6e263bd2f518a62ff9db44d72dd31086756a Reviewed-on: https://review.coreboot.org/c/coreboot/+/58055 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com Reviewed-by: Stefan Reinauer stefan.reinauer@coreboot.org Reviewed-by: Hung-Te Lin hungte@chromium.org --- M util/cbfstool/cbfs-mkpayload.c M util/cbfstool/coff.h 2 files changed, 3 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved Hung-Te Lin: Looks good to me, but someone else must approve Yu-Ping Wu: Looks good to me, approved
diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c index 5341337..e1a3272 100644 --- a/util/cbfstool/cbfs-mkpayload.c +++ b/util/cbfstool/cbfs-mkpayload.c @@ -359,7 +359,7 @@
loadaddress = ph->image_addr - dh_offset; entrypoint = ph->image_addr + ph->entry_point; - } else if (ch->machine == MACHINE_TYPE_X64) { + } else if (ch->machine == MACHINE_TYPE_X64 || ch->machine == MACHINE_TYPE_ARM64) { pe_opt_header_64_t *ph; ph = (pe_opt_header_64_t *)&ch[1]; if (ph->signature != PE_HDR_64_MAGIC) { @@ -372,7 +372,7 @@ loadaddress = ph->image_addr - dh_offset; entrypoint = ph->image_addr + ph->entry_point; } else { - ERROR("Machine type not x86 or x64.\n"); + ERROR("Machine type not x86, x64, or arm64.\n"); return -1; }
diff --git a/util/cbfstool/coff.h b/util/cbfstool/coff.h index 316bfd3..37cbfd3 100644 --- a/util/cbfstool/coff.h +++ b/util/cbfstool/coff.h @@ -25,6 +25,7 @@
#define MACHINE_TYPE_X86 0x014c #define MACHINE_TYPE_X64 0x8664 +#define MACHINE_TYPE_ARM64 0xAA64 typedef struct { uint8_t signature[4]; uint16_t machine;