ArmVirtXen.fdf 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. #
  2. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
  3. # Copyright (c) 2014, Linaro Limited. All rights reserved.
  4. # Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>
  5. #
  6. # SPDX-License-Identifier: BSD-2-Clause-Patent
  7. #
  8. ################################################################################
  9. #
  10. # FD Section
  11. # The [FD] Section is made up of the definition statements and a
  12. # description of what goes into the Flash Device Image. Each FD section
  13. # defines one flash "device" image. A flash device image may be one of
  14. # the following: Removable media bootable image (like a boot floppy
  15. # image,) an Option ROM image (that would be "flashed" into an add-in
  16. # card,) a System "Flash" image (that would be burned into a system's
  17. # flash) or an Update ("Capsule") image that will be used to update and
  18. # existing system flash.
  19. #
  20. ################################################################################
  21. [Defines]
  22. !if $(FD_SIZE_IN_MB) == 2
  23. DEFINE FVMAIN_COMPACT_SIZE = 0x1fe000
  24. !endif
  25. !if $(FD_SIZE_IN_MB) == 3
  26. DEFINE FVMAIN_COMPACT_SIZE = 0x2fe000
  27. !endif
  28. [FD.XEN_EFI]
  29. BaseAddress = 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress
  30. Size = $(FD_SIZE)|gArmTokenSpaceGuid.PcdFdSize
  31. ErasePolarity = 1
  32. # This one is tricky, it must be: BlockSize * NumBlocks = Size
  33. BlockSize = 0x00001000
  34. NumBlocks = $(FD_NUM_BLOCKS)
  35. ################################################################################
  36. #
  37. # Following are lists of FD Region layout which correspond to the locations of different
  38. # images within the flash device.
  39. #
  40. # Regions must be defined in ascending order and may not overlap.
  41. #
  42. # A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
  43. # the pipe "|" character, followed by the size of the region, also in hex with the leading
  44. # "0x" characters. Like:
  45. # Offset|Size
  46. # PcdOffsetCName|PcdSizeCName
  47. # RegionType <FV, DATA, or FILE>
  48. #
  49. ################################################################################
  50. #
  51. # Implement the Linux kernel header layout so that the Xen loader will identify
  52. # it as something bootable, and execute it with a FDT pointer in x0 or r2.
  53. # This area will be reused to store a copy of the FDT so round it up to 8 KB.
  54. #
  55. 0x00000000|0x00002000
  56. DATA = {
  57. !if $(ARCH) == AARCH64
  58. 0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
  59. 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
  60. 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
  61. !if $(FD_SIZE_IN_MB) == 2
  62. 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
  63. !endif
  64. !if $(FD_SIZE_IN_MB) == 3
  65. 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 3 MB
  66. !endif
  67. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
  68. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res2
  69. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res3
  70. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res4
  71. 0x41, 0x52, 0x4d, 0x64, # magic: "ARM\x64"
  72. 0x00, 0x00, 0x00, 0x00 # res5
  73. !else
  74. 0x08, 0x10, 0x4f, 0xe2, # adr r1, .
  75. 0x02, 0x00, 0xa0, 0xe1, # mov r0, r2 (DTB)
  76. 0x00, 0x00, 0xa0, 0xe1, # nop
  77. 0x00, 0x00, 0xa0, 0xe1, # nop
  78. 0x00, 0x00, 0xa0, 0xe1, # nop
  79. 0x00, 0x00, 0xa0, 0xe1, # nop
  80. 0x00, 0x00, 0xa0, 0xe1, # nop
  81. 0x00, 0x00, 0xa0, 0xe1, # nop
  82. 0xf6, 0x07, 0x00, 0xea, # b 0x2000
  83. 0x18, 0x28, 0x6f, 0x01, # magic
  84. 0x00, 0x00, 0x00, 0x00, # start
  85. !if $(FD_SIZE_IN_MB) == 2
  86. 0x00, 0x00, 0x20, 0x00, # image size: 2 MB
  87. !endif
  88. !if $(FD_SIZE_IN_MB) == 3
  89. 0x00, 0x00, 0x30, 0x00, # image size: 3 MB
  90. !endif
  91. 0x01, 0x02, 0x03, 0x04 # endiannness flag
  92. !endif
  93. }
  94. 0x00002000|$(FVMAIN_COMPACT_SIZE)
  95. gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
  96. FV = FVMAIN_COMPACT
  97. ################################################################################
  98. #
  99. # FV Section
  100. #
  101. # [FV] section is used to define what components or modules are placed within a flash
  102. # device file. This section also defines order the components and modules are positioned
  103. # within the image. The [FV] section consists of define statements, set statements and
  104. # module statements.
  105. #
  106. ################################################################################
  107. [FV.FvMain]
  108. FvNameGuid = 4d2d8743-6337-4c3f-a1d9-7cc7efd283db
  109. BlockSize = 0x40
  110. NumBlocks = 0 # This FV gets compressed so make it just big enough
  111. FvAlignment = 16 # FV alignment and FV attributes setting.
  112. ERASE_POLARITY = 1
  113. MEMORY_MAPPED = TRUE
  114. STICKY_WRITE = TRUE
  115. LOCK_CAP = TRUE
  116. LOCK_STATUS = TRUE
  117. WRITE_DISABLED_CAP = TRUE
  118. WRITE_ENABLED_CAP = TRUE
  119. WRITE_STATUS = TRUE
  120. WRITE_LOCK_CAP = TRUE
  121. WRITE_LOCK_STATUS = TRUE
  122. READ_DISABLED_CAP = TRUE
  123. READ_ENABLED_CAP = TRUE
  124. READ_STATUS = TRUE
  125. READ_LOCK_CAP = TRUE
  126. READ_LOCK_STATUS = TRUE
  127. INF MdeModulePkg/Core/Dxe/DxeMain.inf
  128. INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
  129. INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
  130. INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
  131. #
  132. # PI DXE Drivers producing Architectural Protocols (EFI Services)
  133. #
  134. INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
  135. INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
  136. INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
  137. INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
  138. INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
  139. INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
  140. INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
  141. INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
  142. INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
  143. INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
  144. #
  145. # Multiple Console IO support
  146. #
  147. INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
  148. INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
  149. INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
  150. INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
  151. INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
  152. INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
  153. #
  154. # FAT filesystem + GPT/MBR partitioning
  155. #
  156. INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
  157. INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
  158. INF FatPkg/EnhancedFatDxe/Fat.inf
  159. INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
  160. INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
  161. INF ShellPkg/Application/Shell/Shell.inf
  162. INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
  163. INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
  164. INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
  165. #
  166. # Bds
  167. #
  168. INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
  169. INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
  170. INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
  171. INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
  172. INF MdeModulePkg/Application/UiApp/UiApp.inf
  173. INF OvmfPkg/XenBusDxe/XenBusDxe.inf
  174. INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf
  175. #
  176. # ACPI support
  177. #
  178. INF ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf
  179. !if $(ARCH) == AARCH64
  180. INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
  181. INF ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf
  182. !endif
  183. #
  184. # Ramdisk support
  185. #
  186. INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
  187. [FV.FVMAIN_COMPACT]
  188. FvAlignment = 16
  189. ERASE_POLARITY = 1
  190. MEMORY_MAPPED = TRUE
  191. STICKY_WRITE = TRUE
  192. LOCK_CAP = TRUE
  193. LOCK_STATUS = TRUE
  194. WRITE_DISABLED_CAP = TRUE
  195. WRITE_ENABLED_CAP = TRUE
  196. WRITE_STATUS = TRUE
  197. WRITE_LOCK_CAP = TRUE
  198. WRITE_LOCK_STATUS = TRUE
  199. READ_DISABLED_CAP = TRUE
  200. READ_ENABLED_CAP = TRUE
  201. READ_STATUS = TRUE
  202. READ_LOCK_CAP = TRUE
  203. READ_LOCK_STATUS = TRUE
  204. INF RuleOverride = SELF_RELOC ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
  205. FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
  206. SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
  207. SECTION FV_IMAGE = FVMAIN
  208. }
  209. }
  210. !include ArmVirtRules.fdf.inc