summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/OvmfPkg.fdf.inc
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2017-05-03 17:54:49 +0200
committerLaszlo Ersek <lersek@redhat.com>2017-05-05 00:55:40 +0200
commit210270730c0e29d3b3381b519017ec5b3f347144 (patch)
tree8ebe759e1df6b37174fd9be272c55b2e4ca998ba /OvmfPkg/OvmfPkg.fdf.inc
parent4bf3b994e8b207fc919958b4a212a8342aaaa749 (diff)
downloadedk2-210270730c0e29d3b3381b519017ec5b3f347144.tar.gz
edk2-210270730c0e29d3b3381b519017ec5b3f347144.tar.bz2
edk2-210270730c0e29d3b3381b519017ec5b3f347144.zip
OvmfPkg: introduce the FD_SIZE_IN_KB macro / build flag
FD_SIZE_xMB defines have existed for flash size selection. They can be passed as "-D FD_SIZE_xMB" on the command line. Passing multiple of them at the same time has never been supported; earlier settings on the command line cannot be overridden. Introduce the integer valued FD_SIZE_IN_KB macro, which provides the following improvements: - several instances of it are permitted on the command line, with the last one taking effect, - conditional statements in the DSC and FDF files need only check a single macro, and multiple values can be checked in a single !if with the || operator, - nested !ifdef / !else ladders can be replaced with flat equality tests, - in the future, flash sizes can be expressed with a finer than MB granularity, if necessary. For now, we're going to preserve the FD_SIZE_xMB defines as convenience wrappers for FD_SIZE_IN_KB. FD_SIZE_IN_KB is being added to the DSC files because this way we can depend on it in both the DSC and FDF files. Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/OvmfPkg.fdf.inc')
-rw-r--r--OvmfPkg/OvmfPkg.fdf.inc14
1 files changed, 3 insertions, 11 deletions
diff --git a/OvmfPkg/OvmfPkg.fdf.inc b/OvmfPkg/OvmfPkg.fdf.inc
index 9cc0578d64..f12d61c2b6 100644
--- a/OvmfPkg/OvmfPkg.fdf.inc
+++ b/OvmfPkg/OvmfPkg.fdf.inc
@@ -15,18 +15,11 @@
#
##
-#
-# Default flash size is 2MB.
-#
-# Defining FD_SIZE_1MB on the build command line can override this.
-#
-
DEFINE BLOCK_SIZE = 0x1000
DEFINE VARS_SIZE = 0x20000
DEFINE VARS_BLOCKS = 0x20
-!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 +29,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 +41,6 @@ DEFINE CODE_BLOCKS = 0x1E0
DEFINE FVMAIN_SIZE = 0x001AC000
DEFINE SECFV_OFFSET = 0x001CC000
DEFINE SECFV_SIZE = 0x34000
-
!endif
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS)