diff options
author | Anthony Gutierrez <atgutier@umich.edu> | 2013-02-15 18:48:59 -0500 |
---|---|---|
committer | Anthony Gutierrez <atgutier@umich.edu> | 2013-02-15 18:48:59 -0500 |
commit | f7107fb7954b45547ab792493e86760cf6fe33ed (patch) | |
tree | 3beddab45393dc5dd5799c6f5346e73fa8a5b52e /src/arch/arm/linux | |
parent | ba983f9387a703f3be8149382d4f0dcfb2009b6c (diff) | |
download | gem5-f7107fb7954b45547ab792493e86760cf6fe33ed.tar.xz |
loader: add a flattened device tree blob (dtb) object
this adds a dtb_object so the loader can load in the dtb
file for linux/android ARM kernels.
Diffstat (limited to 'src/arch/arm/linux')
-rw-r--r-- | src/arch/arm/linux/system.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/arm/linux/system.cc b/src/arch/arm/linux/system.cc index 74950cbaf..4478aadf4 100644 --- a/src/arch/arm/linux/system.cc +++ b/src/arch/arm/linux/system.cc @@ -45,6 +45,7 @@ #include "arch/arm/isa_traits.hh" #include "arch/arm/utility.hh" #include "arch/generic/linux/threadinfo.hh" +#include "base/loader/dtb_object.hh" #include "base/loader/object_file.hh" #include "base/loader/symtab.hh" #include "cpu/base.hh" @@ -143,6 +144,20 @@ LinuxArmSystem::initState() if (!dtb_file) { fatal("couldn't load DTB file: %s\n", params()->dtb_filename); } + + DtbObject *_dtb_file = dynamic_cast<DtbObject*>(dtb_file); + + if (_dtb_file) { + if (!_dtb_file->addBootCmdLine(params()->boot_osflags.c_str(), + params()->boot_osflags.size())) { + warn("couldn't append bootargs to DTB file: %s\n", + params()->dtb_filename); + } + } else { + warn("dtb_file cast failed; couldn't append bootargs " + "to DTB file: %s\n", params()->dtb_filename); + } + dtb_file->setTextBase(params()->atags_addr); dtb_file->loadSections(physProxy); delete dtb_file; |