From 7adc148590263ffe614d3e5bbb139323122bdc0b Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Sat, 27 Jan 2018 10:16:18 +0000 Subject: 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 Reviewed-by: Leif Lindholm --- .../StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c | 12 ++++-------- .../StyxPlatformFlashAccessLib.inf | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'Silicon') 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 -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 -- cgit v1.2.3