summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2014-03-12 17:23:33 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-12 17:23:33 +0000
commitcb77b48ad9ee73acfb78c1d800ace7417fb7a24e (patch)
tree236984310baa63a42501111597630f9f97e5c71a /ArmPlatformPkg
parent0698723204155fd5b9710e6a1de445782443b191 (diff)
downloadedk2-cb77b48ad9ee73acfb78c1d800ace7417fb7a24e.zip
edk2-cb77b48ad9ee73acfb78c1d800ace7417fb7a24e.tar.gz
edk2-cb77b48ad9ee73acfb78c1d800ace7417fb7a24e.tar.bz2
ArmPlatformPkg/BootMonFs: Added support for new revision of the NOR Flash file system
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15324 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-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 3ebb5ba..c1bef75 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 7d3e901..aadc0c7 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 908393f..778af38 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;