1/* 2 * Copyright (c) 2010, 2012-2013, 2015,2017-2018 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 34 unchanged lines hidden (view full) --- 43#include "arch/arm/system.hh" 44 45#include <iostream> 46 47#include "arch/arm/semihosting.hh" 48#include "base/loader/object_file.hh" 49#include "base/loader/symtab.hh" 50#include "cpu/thread_context.hh" |
51#include "dev/arm/gic_v3.hh" |
52#include "mem/fs_translating_port_proxy.hh" 53#include "mem/physical.hh" 54#include "sim/full_system.hh" 55 56using namespace std; 57using namespace Linux; 58 59ArmSystem::ArmSystem(Params *p) 60 : System(p), 61 bootLoaders(), bootldr(nullptr), 62 _haveSecurity(p->have_security), 63 _haveLPAE(p->have_lpae), 64 _haveVirtualization(p->have_virtualization), 65 _haveCrypto(p->have_crypto), 66 _genericTimer(nullptr), |
67 _gic(nullptr), |
68 _resetAddr(p->auto_reset_addr ? 69 (kernelEntry & loadAddrMask) + loadAddrOffset : 70 p->reset_addr), 71 _highestELIs64(p->highest_el_is_64), 72 _physAddrRange64(p->phys_addr_range_64), 73 _haveLargeAsid64(p->have_large_asid_64), 74 _m5opRange(p->m5ops_base ? 75 RangeSize(p->m5ops_base, 0x10000) : --- 57 unchanged lines hidden (view full) --- 133 // address map being resolved in the interconnect 134 135 // Call the initialisation of the super class 136 System::initState(); 137 138 const Params* p = params(); 139 140 if (bootldr) { |
141 bool isGICv3System = dynamic_cast<Gicv3 *>(getGIC()) != nullptr; |
142 bootldr->loadSections(physProxy); 143 144 inform("Using bootloader at address %#x\n", bootldr->entryPoint()); 145 146 // Put the address of the boot loader into r7 so we know 147 // where to branch to after the reset fault 148 // All other values needed by the boot loader to know what to do |
149 if (!p->flags_addr) 150 fatal("flags_addr must be set with bootloader\n"); |
151 |
152 if (!p->gic_cpu_addr && !isGICv3System) 153 fatal("gic_cpu_addr must be set with bootloader\n"); 154 |
155 for (int i = 0; i < threadContexts.size(); i++) { 156 if (!_highestELIs64) 157 threadContexts[i]->setIntReg(3, (kernelEntry & loadAddrMask) + 158 loadAddrOffset); |
159 if (!isGICv3System) 160 threadContexts[i]->setIntReg(4, params()->gic_cpu_addr); |
161 threadContexts[i]->setIntReg(5, params()->flags_addr); 162 } 163 inform("Using kernel entry physical address at %#x\n", 164 (kernelEntry & loadAddrMask) + loadAddrOffset); 165 } else { 166 // Set the initial PC to be at start of the kernel code 167 if (!_highestELIs64) 168 threadContexts[0]->pcState((kernelEntry & loadAddrMask) + --- 145 unchanged lines hidden --- |