]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtXen: add ARM support
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 17 Dec 2015 17:11:33 +0000 (17:11 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Thu, 17 Dec 2015 17:11:33 +0000 (17:11 +0000)
This adds ARM support to the ArmVirtXen platform. As is the case for
AARCH64, the ARM port adheres to the ARM Linux boot protocol, i.e.,
it expects the address of a DTB describing the platform to be passed
in r2, and relocates itself at runtime to the actual load time memory
offset.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19333 6f19259b-4bc3-4df7-8a09-765794883524

ArmVirtPkg/ArmVirtXen.dsc
ArmVirtPkg/ArmVirtXen.fdf

index dc4ce284ff388f7ac4dc0efc5bc78dc1efdc3a65..43f093a63f3e4e8f9553a99b5085c1fdacde6f90 100644 (file)
@@ -24,7 +24,7 @@
   PLATFORM_VERSION               = 0.1\r
   DSC_SPECIFICATION              = 0x00010005\r
   OUTPUT_DIRECTORY               = Build/ArmVirtXen-$(ARCH)\r
-  SUPPORTED_ARCHITECTURES        = AARCH64\r
+  SUPPORTED_ARCHITECTURES        = AARCH64|ARM\r
   BUILD_TARGETS                  = DEBUG|RELEASE\r
   SKUID_IDENTIFIER               = DEFAULT\r
   FLASH_DEFINITION               = ArmVirtPkg/ArmVirtXen.fdf\r
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
 \r
 [LibraryClasses.AARCH64.SEC]\r
-  ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibSec.inf\r
+  ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibPrePi.inf\r
 \r
 [LibraryClasses.ARM.SEC]\r
-  ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf\r
+  ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf\r
 \r
 [BuildOptions]\r
   RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmVirtPkg/Include\r
       PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
       HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf\r
       PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf\r
-      ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibPrePi.inf\r
       MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf\r
       SerialPortLib|OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.inf\r
   }\r
index 729014753fa13c60b4182fefa38df709a311d1a4..d7d4612de2ef94f6f590c348a2c896793243f9d8 100644 (file)
@@ -53,11 +53,12 @@ NumBlocks     = 0x200
 \r
 #\r
 # Implement the Linux kernel header layout so that the Xen loader will identify\r
-# it as something bootable, and execute it with a FDT pointer in x0. This area\r
-# will be reused to store a copy of the FDT so round it up to 8 KB.\r
+# it as something bootable, and execute it with a FDT pointer in x0 or r2.\r
+# This area will be reused to store a copy of the FDT so round it up to 8 KB.\r
 #\r
 0x00000000|0x00002000\r
 DATA = {\r
+!if $(ARCH) == AARCH64\r
   0x01, 0x00, 0x00, 0x10,                         # code0: adr x1, .\r
   0xff, 0x07, 0x00, 0x14,                         # code1: b 0x2000\r
   0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB\r
@@ -68,6 +69,22 @@ DATA = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res4\r
   0x41, 0x52, 0x4d, 0x64,                         # magic: "ARM\x64"\r
   0x00, 0x00, 0x00, 0x00                          # res5\r
+!else\r
+  0x08, 0x10, 0x4f, 0xe2, # adr r1, .\r
+  0x02, 0x00, 0xa0, 0xe1, # mov r0, r2 (DTB)\r
+  0x00, 0x00, 0xa0, 0xe1, # nop\r
+  0x00, 0x00, 0xa0, 0xe1, # nop\r
+  0x00, 0x00, 0xa0, 0xe1, # nop\r
+  0x00, 0x00, 0xa0, 0xe1, # nop\r
+  0x00, 0x00, 0xa0, 0xe1, # nop\r
+  0x00, 0x00, 0xa0, 0xe1, # nop\r
+\r
+  0xf6, 0x07, 0x00, 0xea, # b 0x2000\r
+  0x18, 0x28, 0x6f, 0x01, # magic\r
+  0x00, 0x00, 0x00, 0x00, # start\r
+  0x00, 0x00, 0x20, 0x00, # image size: 2 MB\r
+  0x01, 0x02, 0x03, 0x04  # endiannness flag\r
+!endif\r
 }\r
 \r
 0x00002000|0x001fe000\r