self.system_port = self.membus.slave
self.intrctrl = IntrControl()
if not cmdline:
- cmdline = 'irqpoll lpj=1000000000'
+ cmdline = 'earlyprintk=ttyS0 console=ttyS0 irqpoll lpj=1000000000'
self.boot_osflags = fillInCmdline(mdesc, cmdline)
- self.kernel = binary('vmlinux')
+ #self.kernel = binary('vmlinux')
+ self.skiboot = binary('skiboot.elf');
+ self.kernel = binary('vmlinux');
+ self.initramfs = binary('initramfs.cpio');
self.dtb_filename = binary('gem5-power9-fs.dtb')
self.multi_thread = True;
self._num_cpus = 2;
cxx_header = 'arch/power/system.hh'
dtb_filename = Param.String("",
"File that contains the Device Tree Blob. Don't use DTB if empty.")
+ skiboot = Param.String("",
+ "File that contains the OPAL firmware.");
+ initramfs = Param.String("",
+ "File that contains the initramfs image");
early_kernel_symbols = Param.Bool(False,
"enable early kernel symbol tables before MMU")
DataStoragePCSet = 0x300,
InstrStoragePCSet = 0x400,
PriDoorbellPCSet = 0xA00,
- HypDoorbellPCSet = 0xe80
+ HypDoorbellPCSet = 0xe80,
+ DirectExternalPCSet = 0x500
};
extern long stdout_buf_addr;
}
};
+class DirectExternalInterrupt : public PowerInterrupt
+{
+ public:
+ DirectExternalInterrupt()
+ {
+ }
+ virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst =
+ StaticInst::nullStaticInstPtr)
+ {
+ printf("Direct External Interrupt invoked\n");
+ // Refer Power ISA Manual v3.0B Book-III, section 6.5.7.1
+ Lpcr lpcr = tc->readIntReg(INTREG_LPCR);
+
+ if (lpcr.lpes){
+ tc->setIntReg(INTREG_SRR0 , tc->instAddr());
+ PowerInterrupt::updateSRR1(tc);
+ PowerInterrupt::updateMsr(tc);
+ Msr msr = tc->readIntReg(INTREG_MSR);
+ msr.ri = 0;
+ tc->setIntReg(INTREG_MSR, msr);
+ }
+ else{
+ tc->setIntReg(INTREG_HSRR0 , tc->instAddr());
+ PowerInterrupt::updateHSRR1(tc);
+ PowerInterrupt::updateMsr(tc);
+ Msr msr = tc->readIntReg(INTREG_MSR);
+ msr.hv = 1;
+ tc->setIntReg(INTREG_MSR, msr);
+ }
+ tc->pcState(DirectExternalPCSet);
+ }
+};
+
class PriDoorbellInterrupt : public PowerInterrupt
{
public:
interrupts[Decrementer] = 1;
if (msr.ee)
{
+ if (interrupts[2] == 1)
+ return true;
for (int i = 0; i < NumInterruptLevels; i++) {
if (interrupts[i] == 1)
return true;
clear(DirHypDoorbell,0);
return std::make_shared<HypDoorbellInterrupt>();
}
+ else if (interrupts[DirectExt]){
+ clear(DirectExt,0);
+ return std::make_shared<DirectExternalInterrupt>();
+ }
+
else return NoFault;
}
0x378: mtmmcr0({{MMCR0 = Rs;}});
0x380: mtcfar({{ CFAR = Rs; }});
0x390: mttbl({{ TBL = Rs; }});
+ 0x33c: mtspr({{ }});
0x3a0: mtamr({{AMR = Rs;}}, [ IsPrivileged ]);
0x3a1: mtiamr({{IAMR = Rs;}});
0x3a4: mtuamor({{UAMOR = Rs;}}, [ IsPrivileged ]);
(int)threadContexts.size());
ThreadContext *tc = threadContexts[0];
- tc->pcState(tc->getSystemPtr()->kernelEntry);
+ //tc->pcState(tc->getSystemPtr()->kernelEntry);
+ tc->pcState(0x10); // For skiboot
//Sixty Four, little endian,Hypervisor bits are enabled.
// IR and DR bits are disabled.
Msr msr = 0x9000000000000001;
// This PVR is specific to power9
// Setting TB register to 0
tc->setIntReg(INTREG_TB , 0x0);
- tc->setIntReg(INTREG_PVR , 0x004e1100);
+ //tc->setIntReg(INTREG_PVR , 0x004e1100);
+ tc->setIntReg(INTREG_PVR , 0x004e0200);
tc->setIntReg(INTREG_MSR , msr);
//ArgumentReg0 is initialized with 0xc00000 because in linux/system.cc
//dtb is loaded at 0xc00000