1## @file
2#  FDF include file that defines the main macros and sets the dependent PCDs.
3#
4#  Copyright (C) 2014, Red Hat, Inc.
5#  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
6#
7#  SPDX-License-Identifier: BSD-2-Clause-Patent
8#
9##
10
11DEFINE BLOCK_SIZE        = 0x1000
12
13#
14# A firmware binary built with FD_SIZE_IN_KB=1024, and a firmware binary built
15# with FD_SIZE_IN_KB=2048, use the same variable store layout.
16#
17# Setting FD_SIZE_IN_KB to 4096 results in a different (much larger) variable
18# store structure that is incompatible with both of the above-mentioned
19# firmware binaries.
20#
21!if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)
22DEFINE VARS_SIZE         = 0x20000
23DEFINE VARS_BLOCKS       = 0x20
24DEFINE VARS_LIVE_SIZE    = 0xE000
25DEFINE VARS_SPARE_SIZE   = 0x10000
26!endif
27
28!if $(FD_SIZE_IN_KB) == 1024
29DEFINE FW_BASE_ADDRESS   = 0xFFF00000
30DEFINE FW_SIZE           = 0x00100000
31DEFINE FW_BLOCKS         = 0x100
32DEFINE CODE_BASE_ADDRESS = 0xFFF20000
33DEFINE CODE_SIZE         = 0x000E0000
34DEFINE CODE_BLOCKS       = 0xE0
35DEFINE FVMAIN_SIZE       = 0x000CC000
36DEFINE SECFV_OFFSET      = 0x000EC000
37DEFINE SECFV_SIZE        = 0x14000
38!endif
39
40!if $(FD_SIZE_IN_KB) == 2048
41DEFINE FW_BASE_ADDRESS   = 0xFFE00000
42DEFINE FW_SIZE           = 0x00200000
43DEFINE FW_BLOCKS         = 0x200
44DEFINE CODE_BASE_ADDRESS = 0xFFE20000
45DEFINE CODE_SIZE         = 0x001E0000
46DEFINE CODE_BLOCKS       = 0x1E0
47DEFINE FVMAIN_SIZE       = 0x001AC000
48DEFINE SECFV_OFFSET      = 0x001CC000
49DEFINE SECFV_SIZE        = 0x34000
50!endif
51
52!if $(FD_SIZE_IN_KB) == 4096
53DEFINE VARS_SIZE         = 0x84000
54DEFINE VARS_BLOCKS       = 0x84
55DEFINE VARS_LIVE_SIZE    = 0x40000
56DEFINE VARS_SPARE_SIZE   = 0x42000
57
58DEFINE FW_BASE_ADDRESS   = 0xFFC00000
59DEFINE FW_SIZE           = 0x00400000
60DEFINE FW_BLOCKS         = 0x400
61DEFINE CODE_BASE_ADDRESS = 0xFFC84000
62DEFINE CODE_SIZE         = 0x0037C000
63DEFINE CODE_BLOCKS       = 0x37C
64DEFINE FVMAIN_SIZE       = 0x00348000
65DEFINE SECFV_OFFSET      = 0x003CC000
66DEFINE SECFV_SIZE        = 0x34000
67!endif
68
69SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress     = $(FW_BASE_ADDRESS)
70SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize    = $(FW_SIZE)
71SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize = $(BLOCK_SIZE)
72
73SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase = $(FW_BASE_ADDRESS)
74SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize = $(VARS_LIVE_SIZE)
75
76SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
77SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize = $(BLOCK_SIZE)
78
79SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize
80SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = $(BLOCK_SIZE)
81
82SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
83SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(VARS_SPARE_SIZE)
84
85DEFINE MEMFD_BASE_ADDRESS = 0x800000
86