// VARIABLE_STORE_HEADER\r
//\r
VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + FirmwareVolumeHeader->HeaderLength);\r
- CopyGuid (&VariableStoreHeader->Signature, mNorFlashVariableGuid);\r
+ CopyGuid (&VariableStoreHeader->Signature, &gEfiAuthenticatedVariableGuid);\r
VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - FirmwareVolumeHeader->HeaderLength;\r
VariableStoreHeader->Format = VARIABLE_STORE_FORMATTED;\r
VariableStoreHeader->State = VARIABLE_STORE_HEALTHY;\r
VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + FwVolHeader->HeaderLength);\r
\r
// Check the Variable Store Guid\r
- if (!CompareGuid (&VariableStoreHeader->Signature, mNorFlashVariableGuid)) {\r
+ if (!CompareGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid) &&\r
+ !CompareGuid (&VariableStoreHeader->Signature, &gEfiAuthenticatedVariableGuid)) {\r
DEBUG ((EFI_D_INFO, "%a: Variable Store Guid non-compatible\n",\r
__FUNCTION__));\r
return EFI_NOT_FOUND;\r
UINTN RuntimeMmioRegionSize;\r
\r
DEBUG((DEBUG_BLKIO,"NorFlashFvbInitialize\n"));\r
+ ASSERT((Instance != NULL));\r
+\r
+ //\r
+ // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME\r
+ //\r
+\r
+ // Note: all the NOR Flash region needs to be reserved into the UEFI Runtime memory;\r
+ // even if we only use the small block region at the top of the NOR Flash.\r
+ // The reason is when the NOR Flash memory is set into program mode, the command\r
+ // is written as the base of the flash region (ie: Instance->DeviceBaseAddress)\r
+ RuntimeMmioRegionSize = (Instance->RegionBaseAddress - Instance->DeviceBaseAddress) + Instance->Size;\r
+\r
+ Status = gDS->AddMemorySpace (\r
+ EfiGcdMemoryTypeMemoryMappedIo,\r
+ Instance->DeviceBaseAddress, RuntimeMmioRegionSize,\r
+ EFI_MEMORY_UC | EFI_MEMORY_RUNTIME\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ Status = gDS->SetMemorySpaceAttributes (\r
+ Instance->DeviceBaseAddress, RuntimeMmioRegionSize,\r
+ EFI_MEMORY_UC | EFI_MEMORY_RUNTIME);\r
+ ASSERT_EFI_ERROR (Status);\r
\r
Instance->Initialized = TRUE;\r
mFlashNvStorageVariableBase = FixedPcdGet32 (PcdFlashNvStorageVariableBase);\r
}\r
}\r
\r
- //\r
- // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME\r
- //\r
-\r
- // Note: all the NOR Flash region needs to be reserved into the UEFI Runtime memory;\r
- // even if we only use the small block region at the top of the NOR Flash.\r
- // The reason is when the NOR Flash memory is set into program mode, the command\r
- // is written as the base of the flash region (ie: Instance->DeviceBaseAddress)\r
- RuntimeMmioRegionSize = (Instance->RegionBaseAddress - Instance->DeviceBaseAddress) + Instance->Size;\r
-\r
- Status = gDS->AddMemorySpace (\r
- EfiGcdMemoryTypeMemoryMappedIo,\r
- Instance->DeviceBaseAddress, RuntimeMmioRegionSize,\r
- EFI_MEMORY_UC | EFI_MEMORY_RUNTIME\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- Status = gDS->SetMemorySpaceAttributes (\r
- Instance->DeviceBaseAddress, RuntimeMmioRegionSize,\r
- EFI_MEMORY_UC | EFI_MEMORY_RUNTIME);\r
- ASSERT_EFI_ERROR (Status);\r
-\r
//\r
// Register for the virtual address change event\r
//\r