Revision: 19333
          http://sourceforge.net/p/edk2/code/19333
Author:   abiesheuvel
Date:     2015-12-17 17:11:33 +0000 (Thu, 17 Dec 2015)
Log Message:
-----------
ArmVirtPkg/ArmVirtXen: add ARM support

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 <[email protected]>
Acked-by: Laszlo Ersek <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/2

Modified Paths:
--------------
    trunk/edk2/ArmVirtPkg/ArmVirtXen.dsc
    trunk/edk2/ArmVirtPkg/ArmVirtXen.fdf

Modified: trunk/edk2/ArmVirtPkg/ArmVirtXen.dsc
===================================================================
--- trunk/edk2/ArmVirtPkg/ArmVirtXen.dsc        2015-12-17 17:11:25 UTC (rev 
19332)
+++ trunk/edk2/ArmVirtPkg/ArmVirtXen.dsc        2015-12-17 17:11:33 UTC (rev 
19333)
@@ -24,7 +24,7 @@
   PLATFORM_VERSION               = 0.1
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/ArmVirtXen-$(ARCH)
-  SUPPORTED_ARCHITECTURES        = AARCH64
+  SUPPORTED_ARCHITECTURES        = AARCH64|ARM
   BUILD_TARGETS                  = DEBUG|RELEASE
   SKUID_IDENTIFIER               = DEFAULT
   FLASH_DEFINITION               = ArmVirtPkg/ArmVirtXen.fdf
@@ -65,10 +65,10 @@
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
 
 [LibraryClasses.AARCH64.SEC]
-  ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibSec.inf
+  ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibPrePi.inf
 
 [LibraryClasses.ARM.SEC]
-  ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
+  ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
 
 [BuildOptions]
   RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 
-I$(WORKSPACE)/ArmVirtPkg/Include
@@ -167,7 +167,6 @@
       PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
       HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
       
PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
-      ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibPrePi.inf
       
MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
       
SerialPortLib|OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.inf
   }

Modified: trunk/edk2/ArmVirtPkg/ArmVirtXen.fdf
===================================================================
--- trunk/edk2/ArmVirtPkg/ArmVirtXen.fdf        2015-12-17 17:11:25 UTC (rev 
19332)
+++ trunk/edk2/ArmVirtPkg/ArmVirtXen.fdf        2015-12-17 17:11:33 UTC (rev 
19333)
@@ -53,11 +53,12 @@
 
 #
 # Implement the Linux kernel header layout so that the Xen loader will identify
-# it as something bootable, and execute it with a FDT pointer in x0. This area
-# will be reused to store a copy of the FDT so round it up to 8 KB.
+# it as something bootable, and execute it with a FDT pointer in x0 or r2.
+# This area will be reused to store a copy of the FDT so round it up to 8 KB.
 #
 0x00000000|0x00002000
 DATA = {
+!if $(ARCH) == AARCH64
   0x01, 0x00, 0x00, 0x10,                         # code0: adr x1, .
   0xff, 0x07, 0x00, 0x14,                         # code1: b 0x2000
   0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
@@ -68,6 +69,22 @@
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res4
   0x41, 0x52, 0x4d, 0x64,                         # magic: "ARM\x64"
   0x00, 0x00, 0x00, 0x00                          # res5
+!else
+  0x08, 0x10, 0x4f, 0xe2, # adr r1, .
+  0x02, 0x00, 0xa0, 0xe1, # mov r0, r2 (DTB)
+  0x00, 0x00, 0xa0, 0xe1, # nop
+  0x00, 0x00, 0xa0, 0xe1, # nop
+  0x00, 0x00, 0xa0, 0xe1, # nop
+  0x00, 0x00, 0xa0, 0xe1, # nop
+  0x00, 0x00, 0xa0, 0xe1, # nop
+  0x00, 0x00, 0xa0, 0xe1, # nop
+
+  0xf6, 0x07, 0x00, 0xea, # b 0x2000
+  0x18, 0x28, 0x6f, 0x01, # magic
+  0x00, 0x00, 0x00, 0x00, # start
+  0x00, 0x00, 0x20, 0x00, # image size: 2 MB
+  0x01, 0x02, 0x03, 0x04  # endiannness flag
+!endif
 }
 
 0x00002000|0x001fe000


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to