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>
-#\r
-# Default flash size is 2MB.\r
-#\r
-# Defining FD_SIZE_1MB on the build command line can override this.\r
-#\r
-\r
DEFINE BLOCK_SIZE = 0x1000\r
DEFINE VARS_SIZE = 0x20000\r
DEFINE VARS_BLOCKS = 0x20\r
\r
DEFINE BLOCK_SIZE = 0x1000\r
DEFINE VARS_SIZE = 0x20000\r
DEFINE VARS_BLOCKS = 0x20\r
\r
-!ifdef $(FD_SIZE_1MB)\r
-\r
+!if $(FD_SIZE_IN_KB) == 1024\r
DEFINE FW_BASE_ADDRESS = 0xFFF00000\r
DEFINE FW_SIZE = 0x00100000\r
DEFINE FW_BLOCKS = 0x100\r
DEFINE FW_BASE_ADDRESS = 0xFFF00000\r
DEFINE FW_SIZE = 0x00100000\r
DEFINE FW_BLOCKS = 0x100\r
DEFINE FVMAIN_SIZE = 0x000CC000\r
DEFINE SECFV_OFFSET = 0x000EC000\r
DEFINE SECFV_SIZE = 0x14000\r
DEFINE FVMAIN_SIZE = 0x000CC000\r
DEFINE SECFV_OFFSET = 0x000EC000\r
DEFINE SECFV_SIZE = 0x14000\r
+!if $(FD_SIZE_IN_KB) == 2048\r
DEFINE FW_BASE_ADDRESS = 0xFFE00000\r
DEFINE FW_SIZE = 0x00200000\r
DEFINE FW_BLOCKS = 0x200\r
DEFINE FW_BASE_ADDRESS = 0xFFE00000\r
DEFINE FW_SIZE = 0x00200000\r
DEFINE FW_BLOCKS = 0x200\r
DEFINE FVMAIN_SIZE = 0x001AC000\r
DEFINE SECFV_OFFSET = 0x001CC000\r
DEFINE SECFV_SIZE = 0x34000\r
DEFINE FVMAIN_SIZE = 0x001AC000\r
DEFINE SECFV_OFFSET = 0x001CC000\r
DEFINE SECFV_SIZE = 0x34000\r
!endif\r
\r
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS)\r
!endif\r
\r
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS)\r
DEFINE SMM_REQUIRE = FALSE\r
DEFINE TLS_ENABLE = FALSE\r
\r
DEFINE SMM_REQUIRE = FALSE\r
DEFINE TLS_ENABLE = FALSE\r
\r
+ #\r
+ # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to\r
+ # one of the supported values, in place of any of the convenience macros, is\r
+ # permitted.\r
+ #\r
+!ifdef $(FD_SIZE_1MB)\r
+ DEFINE FD_SIZE_IN_KB = 1024\r
+!else\r
+!ifdef $(FD_SIZE_2MB)\r
+ DEFINE FD_SIZE_IN_KB = 2048\r
+!else\r
+ DEFINE FD_SIZE_IN_KB = 2048\r
+!endif\r
+!endif\r
+\r
[BuildOptions]\r
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
[BuildOptions]\r
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
DEFINE SMM_REQUIRE = FALSE\r
DEFINE TLS_ENABLE = FALSE\r
\r
DEFINE SMM_REQUIRE = FALSE\r
DEFINE TLS_ENABLE = FALSE\r
\r
+ #\r
+ # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to\r
+ # one of the supported values, in place of any of the convenience macros, is\r
+ # permitted.\r
+ #\r
+!ifdef $(FD_SIZE_1MB)\r
+ DEFINE FD_SIZE_IN_KB = 1024\r
+!else\r
+!ifdef $(FD_SIZE_2MB)\r
+ DEFINE FD_SIZE_IN_KB = 2048\r
+!else\r
+ DEFINE FD_SIZE_IN_KB = 2048\r
+!endif\r
+!endif\r
+\r
[BuildOptions]\r
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
[BuildOptions]\r
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
DEFINE SMM_REQUIRE = FALSE\r
DEFINE TLS_ENABLE = FALSE\r
\r
DEFINE SMM_REQUIRE = FALSE\r
DEFINE TLS_ENABLE = FALSE\r
\r
+ #\r
+ # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to\r
+ # one of the supported values, in place of any of the convenience macros, is\r
+ # permitted.\r
+ #\r
+!ifdef $(FD_SIZE_1MB)\r
+ DEFINE FD_SIZE_IN_KB = 1024\r
+!else\r
+!ifdef $(FD_SIZE_2MB)\r
+ DEFINE FD_SIZE_IN_KB = 2048\r
+!else\r
+ DEFINE FD_SIZE_IN_KB = 2048\r
+!endif\r
+!endif\r
+\r
[BuildOptions]\r
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
[BuildOptions]\r
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r