summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OvmfPkg/OvmfPkg.fdf.inc14
-rw-r--r--OvmfPkg/OvmfPkgIa32.dsc15
-rw-r--r--OvmfPkg/OvmfPkgIa32X64.dsc15
-rw-r--r--OvmfPkg/OvmfPkgX64.dsc15
4 files changed, 48 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)
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 0796b0db81..5a21840a55 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -40,6 +40,21 @@
DEFINE SMM_REQUIRE = FALSE
DEFINE TLS_ENABLE = FALSE
+ #
+ # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to
+ # one of the supported values, in place of any of the convenience macros, is
+ # permitted.
+ #
+!ifdef $(FD_SIZE_1MB)
+ DEFINE FD_SIZE_IN_KB = 1024
+!else
+!ifdef $(FD_SIZE_2MB)
+ DEFINE FD_SIZE_IN_KB = 2048
+!else
+ DEFINE FD_SIZE_IN_KB = 2048
+!endif
+!endif
+
[BuildOptions]
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 71ac62f023..11866b7207 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -40,6 +40,21 @@
DEFINE SMM_REQUIRE = FALSE
DEFINE TLS_ENABLE = FALSE
+ #
+ # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to
+ # one of the supported values, in place of any of the convenience macros, is
+ # permitted.
+ #
+!ifdef $(FD_SIZE_1MB)
+ DEFINE FD_SIZE_IN_KB = 1024
+!else
+!ifdef $(FD_SIZE_2MB)
+ DEFINE FD_SIZE_IN_KB = 2048
+!else
+ DEFINE FD_SIZE_IN_KB = 2048
+!endif
+!endif
+
[BuildOptions]
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 2ceb31d7ff..2fab544600 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -40,6 +40,21 @@
DEFINE SMM_REQUIRE = FALSE
DEFINE TLS_ENABLE = FALSE
+ #
+ # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to
+ # one of the supported values, in place of any of the convenience macros, is
+ # permitted.
+ #
+!ifdef $(FD_SIZE_1MB)
+ DEFINE FD_SIZE_IN_KB = 1024
+!else
+!ifdef $(FD_SIZE_2MB)
+ DEFINE FD_SIZE_IN_KB = 2048
+!else
+ DEFINE FD_SIZE_IN_KB = 2048
+!endif
+!endif
+
[BuildOptions]
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG