mirror of https://github.com/acidanthera/audk.git
Add 64-bit versions of FLASH Base addressess as it is legal to have them >4G. For backward compatability if the new 64-bit base addresses are zero use the old 32-bit base addressess.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10684 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5fc3b5d6c8
commit
92a4f6f3c7
|
@ -376,6 +376,15 @@
|
||||||
## Base address of the FTW working block range in flash device.
|
## Base address of the FTW working block range in flash device.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x0|UINT32|0x30000010
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x0|UINT32|0x30000010
|
||||||
|
|
||||||
|
## 64-bit Base address of the NV variable range in flash device
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0x0|UINT64|0x80000001
|
||||||
|
|
||||||
|
## 64-bit Base address of the FTW spare block range in flash device.
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0x0|UINT64|0x80000013
|
||||||
|
|
||||||
|
## 64-bit Base address of the FTW working block range in flash device.
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0x0|UINT64|0x80000010
|
||||||
|
|
||||||
## This PCD defines the print string.
|
## This PCD defines the print string.
|
||||||
# This PCD is a sample to explain String typed PCD usage.
|
# This PCD is a sample to explain String typed PCD usage.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004
|
||||||
|
|
|
@ -899,8 +899,16 @@ FvbNotificationEvent (
|
||||||
FvbHandle = NULL;
|
FvbHandle = NULL;
|
||||||
Fvb = NULL;
|
Fvb = NULL;
|
||||||
|
|
||||||
|
FtwDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet64 (PcdFlashNvStorageFtwWorkingBase64);
|
||||||
|
if (FtwDevice->WorkSpaceAddress == 0) {
|
||||||
FtwDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);
|
FtwDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
FtwDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet64 (PcdFlashNvStorageFtwSpareBase64);
|
||||||
|
if (FtwDevice->SpareAreaAddress == 0) {
|
||||||
FtwDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);
|
FtwDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Locate all handles of Fvb protocol
|
// Locate all handles of Fvb protocol
|
||||||
|
|
|
@ -59,8 +59,10 @@
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
|
|
|
@ -428,7 +428,11 @@ FindVariable (
|
||||||
if ((IndexTable->StartPtr != NULL) || (IndexTable->EndPtr != NULL)) {
|
if ((IndexTable->StartPtr != NULL) || (IndexTable->EndPtr != NULL)) {
|
||||||
Variable = IndexTable->StartPtr;
|
Variable = IndexTable->StartPtr;
|
||||||
} else {
|
} else {
|
||||||
|
VariableBase = (UINT8 *) (UINTN) PcdGet64 (PcdFlashNvStorageVariableBase64);
|
||||||
|
if (VariableBase == NULL) {
|
||||||
VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);
|
VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);
|
||||||
|
}
|
||||||
|
|
||||||
VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \
|
VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \
|
||||||
((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);
|
((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## CONSUMES
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CONSUMES
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
|
|
@ -2303,7 +2303,11 @@ VariableCommonInitialize (
|
||||||
// Get non volatile varaible store
|
// Get non volatile varaible store
|
||||||
//
|
//
|
||||||
|
|
||||||
|
TempVariableStoreHeader = (EFI_PHYSICAL_ADDRESS) PcdGet64 (PcdFlashNvStorageVariableBase64);
|
||||||
|
if (TempVariableStoreHeader == 0) {
|
||||||
TempVariableStoreHeader = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageVariableBase);
|
TempVariableStoreHeader = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageVariableBase);
|
||||||
|
}
|
||||||
|
|
||||||
VariableStoreBase = TempVariableStoreHeader + \
|
VariableStoreBase = TempVariableStoreHeader + \
|
||||||
(((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)(TempVariableStoreHeader)) -> HeaderLength);
|
(((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)(TempVariableStoreHeader)) -> HeaderLength);
|
||||||
VariableStoreLength = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize) - \
|
VariableStoreLength = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize) - \
|
||||||
|
@ -2534,7 +2538,11 @@ FvbNotificationEvent (
|
||||||
}
|
}
|
||||||
|
|
||||||
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) FvbBaseAddress);
|
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) FvbBaseAddress);
|
||||||
|
NvStorageVariableBase = (EFI_PHYSICAL_ADDRESS) PcdGet64 (PcdFlashNvStorageVariableBase64);
|
||||||
|
if (NvStorageVariableBase == 0) {
|
||||||
NvStorageVariableBase = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageVariableBase);
|
NvStorageVariableBase = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageVariableBase);
|
||||||
|
}
|
||||||
|
|
||||||
if ((NvStorageVariableBase >= FvbBaseAddress) && (NvStorageVariableBase < (FvbBaseAddress + FwVolHeader->FvLength))) {
|
if ((NvStorageVariableBase >= FvbBaseAddress) && (NvStorageVariableBase < (FvbBaseAddress + FwVolHeader->FvLength))) {
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
|
||||||
|
|
Loading…
Reference in New Issue