diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2014-10-29 23:18:26 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2014-10-29 23:18:26 -0500 |
commit | baf88e908d285191c13b5e96c16065957e5af7a6 (patch) | |
tree | 7361d43b795f80a80a89995eb6865d51a972f36a /src/base/loader | |
parent | 3a5c975fd7a0e6c8f25067c1794581056c01c22c (diff) | |
download | gem5-baf88e908d285191c13b5e96c16065957e5af7a6.tar.xz |
arm: Fix multi-system AArch64 boot w/caches.
Automatically extract cpu release address from DTB file.
Check SCTLR_EL1 to verify all caches are enabled.
Diffstat (limited to 'src/base/loader')
-rw-r--r-- | src/base/loader/dtb_object.cc | 21 | ||||
-rw-r--r-- | src/base/loader/dtb_object.hh | 7 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/base/loader/dtb_object.cc b/src/base/loader/dtb_object.cc index f22cee1ed..adf7d2c3a 100644 --- a/src/base/loader/dtb_object.cc +++ b/src/base/loader/dtb_object.cc @@ -35,6 +35,7 @@ #include <cassert> #include "base/loader/dtb_object.hh" +#include "sim/byteswap.hh" #include "fdt.h" #include "libfdt.h" @@ -154,6 +155,26 @@ DtbObject::addBootCmdLine(const char* _args, size_t len) return true; } +Addr +DtbObject::findReleaseAddr() +{ + void *fd = (void*)fileData; + + int offset = fdt_path_offset(fd, "/cpus/cpu@0"); + int len; + + const void* temp = fdt_getprop(fd, offset, "cpu-release-addr", &len); + Addr rel_addr = 0; + + if (len > 3) + rel_addr = betoh(*static_cast<const uint32_t*>(temp)); + if (len == 8) + rel_addr = (rel_addr << 32) | betoh(*(static_cast<const uint32_t*>(temp)+1)); + + return rel_addr; +} + + bool DtbObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask) { diff --git a/src/base/loader/dtb_object.hh b/src/base/loader/dtb_object.hh index ec5294553..74bb52d44 100644 --- a/src/base/loader/dtb_object.hh +++ b/src/base/loader/dtb_object.hh @@ -60,6 +60,13 @@ class DtbObject : public ObjectFile * @return returns true on success, false otherwise */ bool addBootCmdLine(const char* _args, size_t len); + + /** Parse the DTB file enough to find the provided release + * address and return it. + * @return release address for SMP boot + */ + Addr findReleaseAddr(); + bool loadGlobalSymbols(SymbolTable *symtab, Addr addrMask = std::numeric_limits<Addr>::max()); bool loadLocalSymbols(SymbolTable *symtab, |