summaryrefslogtreecommitdiff
path: root/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c')
-rw-r--r--Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
index a23500dd35..a94373bb4b 100644
--- a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
+++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
@@ -22,9 +22,7 @@
#include <Protocol/AmdIscpDxeProtocol.h>
-STATIC CONST UINT64 mFlashOffset = FixedPcdGet64 (PcdFvBaseAddress) -
- FixedPcdGet64 (PcdFdBaseAddress);
-STATIC CONST UINT64 mFlashMaxSize = FixedPcdGet64 (PcdFvSize);
+STATIC CONST UINT64 mFlashMaxSize = FixedPcdGet64 (PcdFdSize);
STATIC CONST UINTN mBlockSize = SIZE_64KB;
@@ -77,12 +75,10 @@ PerformFlashWrite (
return EFI_INVALID_PARAMETER;
}
- if (FlashAddress < mFlashOffset ||
- (FlashAddress + Length) > (mFlashOffset + mFlashMaxSize)) {
+ if ((FlashAddress + Length) > mFlashMaxSize) {
DEBUG ((DEBUG_ERROR,
- "%a: updated region [0x%lx, 0x%lx) outside of FV region [0x%lx, 0x%lx)\n",
- __FUNCTION__, FlashAddress, FlashAddress + Length, mFlashOffset,
- mFlashOffset + mFlashMaxSize));
+ "%a: updated region [0x%lx, 0x%lx) outside of FV region [0x0, 0x%lx)\n",
+ __FUNCTION__, FlashAddress, FlashAddress + Length, mFlashMaxSize));
return EFI_INVALID_PARAMETER;
}