# 0xc00 Primary part number ("c" or higher implies ARM v7)
# 0x0 Revision
midr_regval = Param.UInt32(0x350fc000, "MIDR value")
+ multi_proc = Param.Bool(True, "Multiprocessor system?")
boot_loader = Param.String("", "File that contains the boot loader code if any")
gic_cpu_addr = Param.Addr(0, "Addres of the GIC CPU interface")
flags_addr = Param.Addr(0, "Address of the flags register for MP booting")
*/
#include "arch/arm/isa.hh"
+#include "arch/arm/system.hh"
#include "cpu/checker/cpu.hh"
#include "debug/Arm.hh"
#include "debug/MiscRegs.hh"
miscRegs[MISCREG_SCTLR] = sctlr;
miscRegs[MISCREG_SCTLR_RST] = sctlr_rst;
- // Preserve MIDR accross reset
+ // Preserve MIDR across reset
miscRegs[MISCREG_MIDR] = midr;
/* Start with an event in the mailbox */
mvfr1.vfpHalfPrecision = 1;
miscRegs[MISCREG_MVFR1] = mvfr1;
- miscRegs[MISCREG_MPIDR] = 0;
-
// Reset values of PRRR and NMRR are implementation dependent
miscRegs[MISCREG_PRRR] =
MiscReg
ISA::readMiscReg(int misc_reg, ThreadContext *tc)
{
+ ArmSystem *arm_sys;
+
if (misc_reg == MISCREG_CPSR) {
CPSR cpsr = miscRegs[misc_reg];
PCState pc = tc->pcState();
switch (misc_reg) {
case MISCREG_MPIDR:
+ arm_sys = dynamic_cast<ArmSystem*>(tc->getSystemPtr());
+ assert(arm_sys);
- return 0x80000000 | // multiprocessor extensions available
- tc->cpuId();
+ if (arm_sys->multiProc) {
+ return 0x80000000 | // multiprocessor extensions available
+ tc->cpuId();
+ } else {
+ return 0x80000000 | // multiprocessor extensions available
+ 0x40000000 | // in up system
+ tc->cpuId();
+ }
break;
case MISCREG_ID_MMFR0:
return 0x03; // VMSAv7 support
using namespace Linux;
ArmSystem::ArmSystem(Params *p)
- : System(p), bootldr(NULL)
+ : System(p), bootldr(NULL), multiProc(p->multi_proc)
{
if (p->boot_loader != "") {
bootldr = createObjectFile(p->boot_loader);
}
for (int i = 0; i < threadContexts.size(); i++) {
- if (p->midr_regval) {
- threadContexts[i]->setMiscReg(ArmISA::MISCREG_MIDR,
- p->midr_regval);
- }
+ threadContexts[i]->setMiscReg(ArmISA::MISCREG_MIDR,
+ p->midr_regval);
}
}