2# FDF include file that defines the main macros and sets the dependent PCDs.
4# Copyright (C) 2014, Red Hat, Inc.
5# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
7# SPDX-License-Identifier: BSD-2-Clause-Patent
11DEFINE BLOCK_SIZE = 0x1000
15# A firmware binary built with FD_SIZE_IN_KB=1024, and a firmware binary built
16# with FD_SIZE_IN_KB=2048, use the same variable store layout.
18# Setting FD_SIZE_IN_KB to 4096 results in a different (much larger) variable
19# store structure that is incompatible with both of the above-mentioned
22!
if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)
23DEFINE VARS_SIZE = 0x20000
24DEFINE VARS_BLOCKS = 0x20
25DEFINE VARS_LIVE_SIZE = 0xE000
26DEFINE VARS_SPARE_SIZE = 0x10000
29!
if $(FD_SIZE_IN_KB) == 1024
30DEFINE FW_BASE_ADDRESS = 0xFFF00000
31DEFINE FW_SIZE = 0x00100000
32DEFINE FW_BLOCKS = 0x100
33DEFINE CODE_BASE_ADDRESS = 0xFFF20000
34DEFINE CODE_SIZE = 0x000E0000
35DEFINE CODE_BLOCKS = 0xE0
36DEFINE FVMAIN_SIZE = 0x000CC000
37DEFINE SECFV_OFFSET = 0x000EC000
38DEFINE SECFV_SIZE = 0x14000
41!
if $(FD_SIZE_IN_KB) == 2048
42DEFINE FW_BASE_ADDRESS = 0xFFE00000
43DEFINE FW_SIZE = 0x00200000
44DEFINE FW_BLOCKS = 0x200
45DEFINE CODE_BASE_ADDRESS = 0xFFE20000
46DEFINE CODE_SIZE = 0x001E0000
47DEFINE CODE_BLOCKS = 0x1E0
48DEFINE FVMAIN_SIZE = 0x001AC000
49DEFINE SECFV_OFFSET = 0x001CC000
50DEFINE SECFV_SIZE = 0x34000
53!
if $(FD_SIZE_IN_KB) == 4096
54DEFINE VARS_SIZE = 0x84000
55DEFINE VARS_BLOCKS = 0x84
56DEFINE VARS_LIVE_SIZE = 0x40000
57DEFINE VARS_SPARE_SIZE = 0x42000
59DEFINE FW_BASE_ADDRESS = 0xFFC00000
60DEFINE FW_SIZE = 0x00400000
61DEFINE FW_BLOCKS = 0x400
62DEFINE CODE_BASE_ADDRESS = 0xFFC84000
63DEFINE CODE_SIZE = 0x0037C000
64DEFINE CODE_BLOCKS = 0x37C
65DEFINE FVMAIN_SIZE = 0x00348000
66DEFINE SECFV_OFFSET = 0x003CC000
67DEFINE SECFV_SIZE = 0x34000
70SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS)
71SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize = $(FW_SIZE)
72SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize = $(BLOCK_SIZE)
74SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase = $(FW_BASE_ADDRESS)
75SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize = $(VARS_LIVE_SIZE)
77SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
78SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize = $(BLOCK_SIZE)
80SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize
81SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = $(BLOCK_SIZE)
83SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
84SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(VARS_SPARE_SIZE)
86# The OVMF WorkArea contains a fixed size header followed by the actual data.
87# The size of header is accessed through a fixed PCD in the reset vector code.
88# The value need to be kept in sync with the any changes to the Confidential
89# Computing Work Area header defined in the Include/WorkArea.h
90SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader = 4
92SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvBase = $(FW_BASE_ADDRESS)
93SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataOffset = $(VARS_OFFSET)
94SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataSize = $(VARS_SIZE)
96SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvBase = $(CODE_BASE_ADDRESS)
97SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataOffset = $(VARS_SIZE)
98SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataSize = $(CODE_SIZE)
100!
if $(SMM_REQUIRE) ==
TRUE
101SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase
102SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase
103SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase
106DEFINE MEMFD_BASE_ADDRESS = 0x800000