X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=OvmfPkg%2FOvmfPkg.fdf.inc;h=b3e0c472a1a8414898fe1368f21284e247f1f2d1;hp=9cc0578d64303cee912525a501290368d59e7af6;hb=d5a60558c51aaa5b63e857130172b332e9ab4988;hpb=e3dca1859b2453b9941c66d704bc49d63d9b8d68 diff --git a/OvmfPkg/OvmfPkg.fdf.inc b/OvmfPkg/OvmfPkg.fdf.inc index 9cc0578d64..b3e0c472a1 100644 --- a/OvmfPkg/OvmfPkg.fdf.inc +++ b/OvmfPkg/OvmfPkg.fdf.inc @@ -15,18 +15,24 @@ # ## +DEFINE BLOCK_SIZE = 0x1000 + # -# Default flash size is 2MB. +# A firmware binary built with FD_SIZE_IN_KB=1024, and a firmware binary built +# with FD_SIZE_IN_KB=2048, use the same variable store layout. # -# Defining FD_SIZE_1MB on the build command line can override this. +# Setting FD_SIZE_IN_KB to 4096 results in a different (much larger) variable +# store structure that is incompatible with both of the above-mentioned +# firmware binaries. # - -DEFINE BLOCK_SIZE = 0x1000 +!if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048) DEFINE VARS_SIZE = 0x20000 DEFINE VARS_BLOCKS = 0x20 +DEFINE VARS_LIVE_SIZE = 0xE000 +DEFINE VARS_SPARE_SIZE = 0x10000 +!endif -!ifdef $(FD_SIZE_1MB) - +!if $(FD_SIZE_IN_KB) == 1024 DEFINE FW_BASE_ADDRESS = 0xFFF00000 DEFINE FW_SIZE = 0x00100000 DEFINE FW_BLOCKS = 0x100 @@ -36,9 +42,9 @@ DEFINE CODE_BLOCKS = 0xE0 DEFINE FVMAIN_SIZE = 0x000CC000 DEFINE SECFV_OFFSET = 0x000EC000 DEFINE SECFV_SIZE = 0x14000 +!endif -!else - +!if $(FD_SIZE_IN_KB) == 2048 DEFINE FW_BASE_ADDRESS = 0xFFE00000 DEFINE FW_SIZE = 0x00200000 DEFINE FW_BLOCKS = 0x200 @@ -48,7 +54,23 @@ DEFINE CODE_BLOCKS = 0x1E0 DEFINE FVMAIN_SIZE = 0x001AC000 DEFINE SECFV_OFFSET = 0x001CC000 DEFINE SECFV_SIZE = 0x34000 +!endif +!if $(FD_SIZE_IN_KB) == 4096 +DEFINE VARS_SIZE = 0x84000 +DEFINE VARS_BLOCKS = 0x84 +DEFINE VARS_LIVE_SIZE = 0x40000 +DEFINE VARS_SPARE_SIZE = 0x42000 + +DEFINE FW_BASE_ADDRESS = 0xFFC00000 +DEFINE FW_SIZE = 0x00400000 +DEFINE FW_BLOCKS = 0x400 +DEFINE CODE_BASE_ADDRESS = 0xFFC84000 +DEFINE CODE_SIZE = 0x0037C000 +DEFINE CODE_BLOCKS = 0x37C +DEFINE FVMAIN_SIZE = 0x00348000 +DEFINE SECFV_OFFSET = 0x003CC000 +DEFINE SECFV_SIZE = 0x34000 !endif SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS) @@ -56,7 +78,7 @@ SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize = $(FW_SIZE) SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize = $(BLOCK_SIZE) SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase = $(FW_BASE_ADDRESS) -SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize = 0xE000 +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize = $(VARS_LIVE_SIZE) SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize = $(BLOCK_SIZE) @@ -65,6 +87,6 @@ SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase = gUefiOvmfPk SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = $(BLOCK_SIZE) SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize -SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = 0x10000 +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(VARS_SPARE_SIZE) DEFINE MEMFD_BASE_ADDRESS = 0x800000