arch-arm: Add support for automatic reset addr selection
authorAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 9 Feb 2018 18:26:44 +0000 (18:26 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 16 Feb 2018 09:28:24 +0000 (09:28 +0000)
Add an option to automatically set the aarch64 reset vector to the
entry point of the kernel. This is useful when running bare metal
workloads that don't use a normal boot loader.

Change-Id: Id472f865d461f0d8d8ea8efe5db582c170de0b90
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/8143
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
src/arch/arm/ArmSystem.py
src/arch/arm/system.cc

index f76140bc9f7dcc0e6760ba3578dedab63899d80c..56874772502cfc797c39e3355ba2ea70067cf999 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2012-2013, 2015-2017 ARM Limited
+# Copyright (c) 2009, 2012-2013, 2015-2018 ARM Limited
 # All rights reserved.
 #
 # The license below extends only to copyright in the software and shall
@@ -72,6 +72,8 @@ class ArmSystem(System):
     reset_addr_64 = Param.Addr(0x0,
         "Reset address if the highest implemented exception level is 64 bits "
         "(ARMv8)")
+    auto_reset_addr_64 = Param.Bool(False,
+        "Determine reset address from kernel entry point if no boot loader")
     phys_addr_range_64 = Param.UInt8(40,
         "Supported physical address range in bits when using AArch64 (ARMv8)")
     have_large_asid_64 = Param.Bool(False,
index 097a87b2b19141c722ef71e9b8a1d096be5ec7a2..50ac4aeeb43bb97c830549626fa65c3a95a1727b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012-2013, 2015,2017 ARM Limited
+ * Copyright (c) 2010, 2012-2013, 2015,2017-2018 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -62,7 +62,9 @@ ArmSystem::ArmSystem(Params *p)
       _haveVirtualization(p->have_virtualization),
       _genericTimer(nullptr),
       _highestELIs64(p->highest_el_is_64),
-      _resetAddr64(p->reset_addr_64),
+      _resetAddr64(p->auto_reset_addr_64 ?
+                   (kernelEntry & loadAddrMask) + loadAddrOffset :
+                   p->reset_addr_64),
       _physAddrRange64(p->phys_addr_range_64),
       _haveLargeAsid64(p->have_large_asid_64),
       _m5opRange(p->m5ops_base ?