# Copyright (C) 2014, Red Hat, Inc.\r
# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
-# This program and the accompanying materials are licensed and made available\r
-# under the terms and conditions of the BSD License which accompanies this\r
-# distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR\r
-# IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
##\r
\r
DEFINE BLOCK_SIZE = 0x1000\r
+\r
+#\r
+# A firmware binary built with FD_SIZE_IN_KB=1024, and a firmware binary built\r
+# with FD_SIZE_IN_KB=2048, use the same variable store layout.\r
+#\r
+# Setting FD_SIZE_IN_KB to 4096 results in a different (much larger) variable\r
+# store structure that is incompatible with both of the above-mentioned\r
+# firmware binaries.\r
+#\r
+!if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)\r
DEFINE VARS_SIZE = 0x20000\r
DEFINE VARS_BLOCKS = 0x20\r
DEFINE VARS_LIVE_SIZE = 0xE000\r
DEFINE VARS_SPARE_SIZE = 0x10000\r
+!endif\r
\r
!if $(FD_SIZE_IN_KB) == 1024\r
DEFINE FW_BASE_ADDRESS = 0xFFF00000\r
DEFINE SECFV_SIZE = 0x34000\r
!endif\r
\r
+!if $(FD_SIZE_IN_KB) == 4096\r
+DEFINE VARS_SIZE = 0x84000\r
+DEFINE VARS_BLOCKS = 0x84\r
+DEFINE VARS_LIVE_SIZE = 0x40000\r
+DEFINE VARS_SPARE_SIZE = 0x42000\r
+\r
+DEFINE FW_BASE_ADDRESS = 0xFFC00000\r
+DEFINE FW_SIZE = 0x00400000\r
+DEFINE FW_BLOCKS = 0x400\r
+DEFINE CODE_BASE_ADDRESS = 0xFFC84000\r
+DEFINE CODE_SIZE = 0x0037C000\r
+DEFINE CODE_BLOCKS = 0x37C\r
+DEFINE FVMAIN_SIZE = 0x00348000\r
+DEFINE SECFV_OFFSET = 0x003CC000\r
+DEFINE SECFV_SIZE = 0x34000\r
+!endif\r
+\r
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS)\r
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize = $(FW_SIZE)\r
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize = $(BLOCK_SIZE)\r