summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsHw.h4
-rw-r--r--ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsImages.c14
-rw-r--r--ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsOpenClose.c5
3 files changed, 18 insertions, 5 deletions
diff --git a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsHw.h b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsHw.h
index 3ebb5ba54a..c1bef755ae 100644
--- a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsHw.h
+++ b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsHw.h
@@ -19,9 +19,13 @@
#define HW_IMAGE_FOOTER_SIGNATURE_1 0x464C5348
#define HW_IMAGE_FOOTER_SIGNATURE_2 0x464F4F54
+
#define HW_IMAGE_FOOTER_VERSION 1
#define HW_IMAGE_FOOTER_OFFSET 92
+#define HW_IMAGE_FOOTER_VERSION2 2
+#define HW_IMAGE_FOOTER_OFFSET2 96
+
typedef struct {
CHAR8 Filename[MAX_NAME_LENGTH];
UINT32 Offset;
diff --git a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsImages.c b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsImages.c
index 7d3e901903..aadc0c7f93 100644
--- a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsImages.c
+++ b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsImages.c
@@ -109,11 +109,15 @@ BootMonFsImageInThisBlock (
return FALSE;
}
- if (Ptr->Version != HW_IMAGE_FOOTER_VERSION) {
- return FALSE;
- }
-
- if (Ptr->Offset != HW_IMAGE_FOOTER_OFFSET) {
+ if (Ptr->Version == HW_IMAGE_FOOTER_VERSION) {
+ if (Ptr->Offset != HW_IMAGE_FOOTER_OFFSET) {
+ return FALSE;
+ }
+ } else if (Ptr->Version == HW_IMAGE_FOOTER_VERSION2) {
+ if (Ptr->Offset != HW_IMAGE_FOOTER_OFFSET2) {
+ return FALSE;
+ }
+ } else {
return FALSE;
}
diff --git a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsOpenClose.c b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsOpenClose.c
index 908393fa53..778af389a0 100644
--- a/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsOpenClose.c
+++ b/ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsOpenClose.c
@@ -100,8 +100,13 @@ FlushAppendRegion (
Description->BlockEnd = Description->BlockStart + (NewFileSize / BlockSize);
Description->Footer.FooterSignature1 = HW_IMAGE_FOOTER_SIGNATURE_1;
Description->Footer.FooterSignature2 = HW_IMAGE_FOOTER_SIGNATURE_2;
+#ifdef MDE_CPU_ARM
Description->Footer.Version = HW_IMAGE_FOOTER_VERSION;
Description->Footer.Offset = HW_IMAGE_FOOTER_OFFSET;
+#else
+ Description->Footer.Version = HW_IMAGE_FOOTER_VERSION2;
+ Description->Footer.Offset = HW_IMAGE_FOOTER_OFFSET2;
+#endif
Description->RegionCount = 1;
Description->Region[0].Checksum = 0;
Description->Region[0].Offset = Description->BlockStart * BlockSize;