summaryrefslogtreecommitdiff
path: root/Silicon
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-01-27 10:16:18 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-02-01 17:07:41 +0000
commit7adc148590263ffe614d3e5bbb139323122bdc0b (patch)
treec559ad94362288f4384e236b2835e9095468e7ef /Silicon
parentd54d40ec2ce72190e1ab4d7f9eea9e9a33b5fd10 (diff)
downloadedk2-platforms-7adc148590263ffe614d3e5bbb139323122bdc0b.tar.xz
Platform/AMD/OverdriveBoard: cover secure firmware in capsule update
Add the first part of the flash device (FD) to the capsule image so we can update the secure and SCP firmware in one go along with the UEFI firmware volume (FV). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Silicon')
-rw-r--r--Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c12
-rw-r--r--Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.inf3
2 files changed, 5 insertions, 10 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;
}
diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.inf b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.inf
index 411173f1f3..b54a2e90ff 100644
--- a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.inf
+++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.inf
@@ -40,8 +40,7 @@
[FixedPcd]
gArmTokenSpaceGuid.PcdFdBaseAddress
- gArmTokenSpaceGuid.PcdFvBaseAddress
- gArmTokenSpaceGuid.PcdFvSize
+ gArmTokenSpaceGuid.PcdFdSize
[Depex]
gAmdIscpDxeProtocolGuid