return self
def x86IOAddress(port):
- IO_address_space_base = 0x1000000000000000
+ IO_address_space_base = 0x8000000000000000
return IO_address_space_base + port;
def makeLinuxX86System(mem_mode, mdesc = None):
# Platform
self.opteron = Opteron()
+ self.opteron.attachIO(self.iobus)
self.intrctrl = IntrControl()
//XXX Add "Model-Specific Registers"
+ MISCREG_PCI_CONFIG_ADDRESS,
+
NUM_MISCREGS
};
* ISA-specific helper functions for memory mapped IPR accesses.
*/
+#include "arch/x86/miscregs.hh"
#include "config/full_system.hh"
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#if !FULL_SYSTEM
panic("Shouldn't have a memory mapped register in SE\n");
#else
- xc->setMiscReg(pkt->getAddr() / sizeof(MiscReg),
- gtoh(pkt->get<uint64_t>()));
+ MiscRegIndex index = (MiscRegIndex)(pkt->getAddr() / sizeof(MiscReg));
+ if (index == MISCREG_PCI_CONFIG_ADDRESS) {
+ xc->setMiscReg(index, gtoh(pkt->get<uint32_t>()));
+ } else {
+ xc->setMiscReg(pkt->getAddr() / sizeof(MiscReg),
+ gtoh(pkt->get<uint64_t>()));
+ }
#endif
return xc->getCpuPtr()->ticks(1);
}
namespace X86ISA {
-TLB::TLB(const Params *p) : SimObject(p), size(p->size)
+TLB::TLB(const Params *p) : SimObject(p), configAddress(0), size(p->size)
{
tlb = new TlbEntry[size];
std::memset(tlb, 0, sizeof(TlbEntry) * size);
}
}
+void
+TLB::setConfigAddress(uint32_t addr)
+{
+ configAddress = addr;
+}
+
void
TLB::invalidateNonGlobal()
{
// Make sure the address fits in the expected 16 bit IO address
// space.
assert(!(IOPort & ~0xFFFF));
- req->setPaddr(PhysAddrPrefixIO | IOPort);
+ if (IOPort == 0xCF8 && req->getSize() == 4) {
+ req->setMmapedIpr(true);
+ req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(MiscReg));
+ } else if ((IOPort & ~mask(2)) == 0xCFC) {
+ Addr configAddress =
+ tc->readMiscRegNoEffect(MISCREG_PCI_CONFIG_ADDRESS);
+ if (bits(configAddress, 31, 31)) {
+ req->setPaddr(PhysAddrPrefixPciConfig |
+ bits(configAddress, 30, 0));
+ }
+ } else {
+ req->setPaddr(PhysAddrPrefixIO | IOPort);
+ }
return NoFault;
} else {
panic("Access to unrecognized internal address space %#x.\n",
friend class FakeDTLBFault;
bool _allowNX;
+ uint32_t configAddress;
public:
bool allowNX() const
TlbEntry *lookup(Addr va, bool update_lru = true);
+ void setConfigAddress(uint32_t addr);
+
#if FULL_SYSTEM
protected:
const Addr IntAddrPrefixMSR = ULL(0x200000000);
const Addr IntAddrPrefixIO = ULL(0x300000000);
- const Addr PhysAddrPrefixIO = ULL(0x1000000000000000);
+ const Addr PhysAddrPrefixIO = ULL(0x8000000000000000);
+ const Addr PhysAddrPrefixPciConfig = ULL(0xC000000000000000);
}
#endif //__ARCH_X86_X86TRAITS_HH__
from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr
from Uart import Uart8250
from Platform import Platform
+from Pci import PciConfigAll
from SimConsole import SimConsole
class Opteron(Platform):
type = 'Opteron'
system = Param.System(Parent.any, "system")
+
+ pciconfig = PciConfigAll()
+
+ def attachIO(self, bus):
+ self.pciconfig.pio = bus.default
+ bus.responder_set = True
+ bus.responder = self.pciconfig
#include <string>
#include <vector>
+#include "arch/x86/x86_traits.hh"
#include "cpu/intr_control.hh"
#include "dev/simconsole.hh"
#include "dev/x86/opteron.hh"
Addr
Opteron::calcConfigAddr(int bus, int dev, int func)
{
- panic("Need implementation\n");
- M5_DUMMY_RETURN
+ assert(func < 8);
+ assert(dev < 32);
+ assert(bus == 0);
+ return (PhysAddrPrefixPciConfig | (func << 8) | (dev << 11));
}
Opteron *