ArmVirtKvmTool.fdf 8.9 KB

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