OvmfPkgDefines.fdf.inc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. DEFINE BLOCK_SIZE = 0x1000
  11. DEFINE VARS_OFFSET = 0
  12. #
  13. # A firmware binary built with FD_SIZE_IN_KB=1024, and a firmware binary built
  14. # with FD_SIZE_IN_KB=2048, use the same variable store layout.
  15. #
  16. # Setting FD_SIZE_IN_KB to 4096 results in a different (much larger) variable
  17. # store structure that is incompatible with both of the above-mentioned
  18. # firmware binaries.
  19. #
  20. !if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)
  21. DEFINE VARS_SIZE = 0x20000
  22. DEFINE VARS_BLOCKS = 0x20
  23. DEFINE VARS_LIVE_SIZE = 0xE000
  24. DEFINE VARS_SPARE_SIZE = 0x10000
  25. !endif
  26. !if $(FD_SIZE_IN_KB) == 1024
  27. DEFINE FW_BASE_ADDRESS = 0xFFF00000
  28. DEFINE FW_SIZE = 0x00100000
  29. DEFINE FW_BLOCKS = 0x100
  30. DEFINE CODE_BASE_ADDRESS = 0xFFF20000
  31. DEFINE CODE_SIZE = 0x000E0000
  32. DEFINE CODE_BLOCKS = 0xE0
  33. DEFINE FVMAIN_SIZE = 0x000CC000
  34. DEFINE SECFV_OFFSET = 0x000EC000
  35. DEFINE SECFV_SIZE = 0x14000
  36. !endif
  37. !if $(FD_SIZE_IN_KB) == 2048
  38. DEFINE FW_BASE_ADDRESS = 0xFFE00000
  39. DEFINE FW_SIZE = 0x00200000
  40. DEFINE FW_BLOCKS = 0x200
  41. DEFINE CODE_BASE_ADDRESS = 0xFFE20000
  42. DEFINE CODE_SIZE = 0x001E0000
  43. DEFINE CODE_BLOCKS = 0x1E0
  44. DEFINE FVMAIN_SIZE = 0x001AC000
  45. DEFINE SECFV_OFFSET = 0x001CC000
  46. DEFINE SECFV_SIZE = 0x34000
  47. !endif
  48. !if $(FD_SIZE_IN_KB) == 4096
  49. DEFINE VARS_SIZE = 0x84000
  50. DEFINE VARS_BLOCKS = 0x84
  51. DEFINE VARS_LIVE_SIZE = 0x40000
  52. DEFINE VARS_SPARE_SIZE = 0x42000
  53. DEFINE FW_BASE_ADDRESS = 0xFFC00000
  54. DEFINE FW_SIZE = 0x00400000
  55. DEFINE FW_BLOCKS = 0x400
  56. DEFINE CODE_BASE_ADDRESS = 0xFFC84000
  57. DEFINE CODE_SIZE = 0x0037C000
  58. DEFINE CODE_BLOCKS = 0x37C
  59. DEFINE FVMAIN_SIZE = 0x00348000
  60. DEFINE SECFV_OFFSET = 0x003CC000
  61. DEFINE SECFV_SIZE = 0x34000
  62. !endif
  63. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress = $(FW_BASE_ADDRESS)
  64. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize = $(FW_SIZE)
  65. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize = $(BLOCK_SIZE)
  66. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase = $(FW_BASE_ADDRESS)
  67. SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize = $(VARS_LIVE_SIZE)
  68. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
  69. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize = $(BLOCK_SIZE)
  70. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize
  71. SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = $(BLOCK_SIZE)
  72. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
  73. SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(VARS_SPARE_SIZE)
  74. # The OVMF WorkArea contains a fixed size header followed by the actual data.
  75. # The size of header is accessed through a fixed PCD in the reset vector code.
  76. # The value need to be kept in sync with the any changes to the Confidential
  77. # Computing Work Area header defined in the Include/WorkArea.h
  78. SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader = 4
  79. SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvBase = $(FW_BASE_ADDRESS)
  80. SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataOffset = $(VARS_OFFSET)
  81. SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataSize = $(VARS_SIZE)
  82. SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvBase = $(CODE_BASE_ADDRESS)
  83. SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataOffset = $(VARS_SIZE)
  84. SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataSize = $(CODE_SIZE)
  85. !if $(SMM_REQUIRE) == TRUE
  86. SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase
  87. SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase
  88. SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase
  89. !endif
  90. DEFINE MEMFD_BASE_ADDRESS = 0x800000