Skip to content

Commit

Permalink
AmpereAltraPkg: Support rebootless in-band firmware update
Browse files Browse the repository at this point in the history
This implements the in-band firmware update without rebooting via UEFI
runtime services. The FW update service is hooked into the UEFI variable
with the variable GUID gAmpereFWUpgradeGuid. Users in the operating
system can download the update image to the service by setting
continuously a chunk of the image via the variable. And, poll the status
by getting the same variable.

There are four type of the firmware image supported:
- UpgradeSCPRequest: Upgrade SCP.
- UpgradeATFUEFIRequest: Upgrade full FW including ATF, board config and UEFI.
- UpgradeCFGUEFIRequest: Upgrade only board config and UEFI.
- UpgradeUEFIRequest: Upgrade only UEFI.

Signed-off-by: Nhi Pham <[email protected]>
  • Loading branch information
nhivp committed Oct 11, 2024
1 parent 535c3c0 commit 1a176da
Show file tree
Hide file tree
Showing 14 changed files with 1,117 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Platform/Ampere/JadePkg/Jade.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,8 @@
SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.inf
SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.inf
MdeModulePkg/Application/CapsuleApp/CapsuleApp.inf

#
# System Firmware Update
#
Silicon/Ampere/AmpereAltraPkg/Drivers/SystemFirmwareUpdateDxe/SystemFirmwareUpdateDxe.inf
5 changes: 5 additions & 0 deletions Platform/Ampere/JadePkg/Jade.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ APRIORI DXE {
SECTION UI = "Pkcs7TestRoot"
}

#
# System Firmware Update
#
INF Silicon/Ampere/AmpereAltraPkg/Drivers/SystemFirmwareUpdateDxe/SystemFirmwareUpdateDxe.inf

[FV.SystemFirmwareDescriptor]
FvAlignment = 8
ERASE_POLARITY = 1
Expand Down
8 changes: 8 additions & 0 deletions Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,11 @@

## PCIe Hot Plug GUID
gPcieHotPlugGuid = { 0x5598273c, 0x11ea, 0xa496, { 0x42, 0x02, 0x37, 0xbb, 0x02, 0x00, 0x13, 0xac } }

## FWupdate MM GUID
gFwUpdateMmGuid = { 0x452240CD, 0xB3B3, 0x4695, { 0x9A, 0x63, 0xDF, 0xEC, 0x50, 0x82, 0xE7, 0x7A } }

#
# Ampere FW upgrade EFI variables GUID
#
gAmpereFWUpgradeGuid = { 0x38B9ED29, 0xD7C6, 0x4BF4, { 0x96, 0x78, 0x9D, 0xA0, 0x58, 0xBD, 0x2E, 0x99 } }
2 changes: 2 additions & 0 deletions Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
MmCommunicationLib|Silicon/Ampere/AmpereAltraPkg/Library/MmCommunicationLib/MmCommunicationLib.inf
FlashLib|Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/FlashLib.inf
ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
FirmwareUpdateLib|Silicon/Ampere/AmpereAltraPkg/Library/SystemFirmwareUpdateLib/SystemFirmwareUpdateLib.inf

#
# ARM PL011 UART Driver
Expand Down Expand Up @@ -284,6 +285,7 @@
FlashLib|Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/RuntimeFlashLib.inf
MailboxInterfaceLib|Silicon/Ampere/AmpereAltraPkg/Library/MailboxInterfaceLib/RuntimeMailboxInterfaceLib.inf
SystemFirmwareInterfaceLib|Silicon/Ampere/AmpereAltraPkg/Library/SystemFirmwareInterfaceLib/RuntimeSystemFirmwareInterfaceLib.inf
FirmwareUpdateLib|Silicon/Ampere/AmpereAltraPkg/Library/SystemFirmwareUpdateLib/RuntimeSystemFirmwareUpdateLib.inf

[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
SmbusLib|MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf
Expand Down
Loading

0 comments on commit 1a176da

Please sign in to comment.