diff options
-rw-r--r-- | dev/alpha_console.cc | 17 | ||||
-rw-r--r-- | dev/alpha_console.hh | 3 | ||||
-rw-r--r-- | dev/pcidev.cc | 12 | ||||
-rw-r--r-- | dev/pcidev.hh | 10 | ||||
-rw-r--r-- | kern/linux/linux_system.cc | 14 | ||||
-rw-r--r-- | kern/tru64/tru64_system.cc | 14 | ||||
-rw-r--r-- | sim/sim_object.cc | 3 |
7 files changed, 56 insertions, 17 deletions
diff --git a/dev/alpha_console.cc b/dev/alpha_console.cc index 2e9e09e93..111b23c81 100644 --- a/dev/alpha_console.cc +++ b/dev/alpha_console.cc @@ -50,11 +50,12 @@ #include "sim/builder.hh" #include "sim/system.hh" #include "dev/tsunami_io.hh" +#include "sim/sim_object.hh" using namespace std; AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d, - System *system, BaseCPU *cpu, TsunamiIO *clock, + System *system, BaseCPU *cpu, SimObject *clock, int num_cpus, MemoryController *mmu, Addr a, HierParams *hier, Bus *bus) : PioDevice(name), disk(d), console(cons), addr(a) @@ -79,8 +80,14 @@ AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d, alphaAccess->numCPUs = num_cpus; alphaAccess->mem_size = system->physmem->size(); alphaAccess->cpuClock = cpu->getFreq() / 1000000; - alphaAccess->intrClockFrequency = clock->frequency(); - + TsunamiIO *clock_linux = dynamic_cast<TsunamiIO *>(clock); + TlaserClock *clock_tru64 = dynamic_cast<TlaserClock *>(clock); + if (clock_linux) + alphaAccess->intrClockFrequency = clock_linux->frequency(); + else if (clock_tru64) + alphaAccess->intrClockFrequency = clock_tru64->frequency(); + else + panic("clock must be of type TlaserClock or TsunamiIO\n"); alphaAccess->diskUnit = 1; } @@ -267,7 +274,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaConsole) Param<Addr> addr; SimObjectParam<System *> system; SimObjectParam<BaseCPU *> cpu; - SimObjectParam<TsunamiIO *> clock; + SimObjectParam<SimObject *> clock; SimObjectParam<Bus*> io_bus; SimObjectParam<HierParams *> hier; @@ -282,7 +289,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaConsole) INIT_PARAM(addr, "Device Address"), INIT_PARAM(system, "system object"), INIT_PARAM(cpu, "Processor"), - INIT_PARAM(clock, "Turbolaser Clock"), + INIT_PARAM(clock, "Clock"), INIT_PARAM_DFLT(io_bus, "The IO Bus to attach to", NULL), INIT_PARAM_DFLT(hier, "Hierarchy global variables", &defaultHierParams) diff --git a/dev/alpha_console.hh b/dev/alpha_console.hh index be8538e50..4986d0e5f 100644 --- a/dev/alpha_console.hh +++ b/dev/alpha_console.hh @@ -38,6 +38,7 @@ #include "dev/io_device.hh" #include "sim/host.hh" #include "dev/tsunami_io.hh" +#include "sim/sim_object.hh" class BaseCPU; class SimConsole; @@ -90,7 +91,7 @@ class AlphaConsole : public PioDevice public: /** Standard Constructor */ AlphaConsole(const std::string &name, SimConsole *cons, SimpleDisk *d, - System *system, BaseCPU *cpu, TsunamiIO *clock, + System *system, BaseCPU *cpu, SimObject *clock, int num_cpus, MemoryController *mmu, Addr addr, HierParams *hier, Bus *bus); diff --git a/dev/pcidev.cc b/dev/pcidev.cc index 0e0b7f840..2b2f54fce 100644 --- a/dev/pcidev.cc +++ b/dev/pcidev.cc @@ -53,8 +53,8 @@ using namespace std; PciDev::PciDev(const string &name, MemoryController *mmu, PciConfigAll *cf, PciConfigData *cd, uint32_t bus, uint32_t dev, uint32_t func) - : FunctionalMemory(name), MMU(mmu), ConfigSpace(cf), ConfigData(cd), - Bus(bus), Device(dev), Function(func) + : FunctionalMemory(name), MMU(mmu), configSpace(cf), configData(cd), + bus(bus), device(dev), function(func) { // copy the config data from the PciConfigData object if (cd) { @@ -79,21 +79,21 @@ PciDev::ReadConfig(int offset, int size, uint8_t *data) memcpy((uint32_t*)data, config.data + offset, sizeof(uint32_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - Device, Function, offset, *(uint32_t*)(config.data + offset)); + device, function, offset, *(uint32_t*)(config.data + offset)); break; case sizeof(uint16_t): memcpy((uint16_t*)data, config.data + offset, sizeof(uint16_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - Device, Function, offset, *(uint16_t*)(config.data + offset)); + device, function, offset, *(uint16_t*)(config.data + offset)); break; case sizeof(uint8_t): memcpy((uint8_t*)data, config.data + offset, sizeof(uint8_t)); DPRINTF(PCIDEV, "read device: %#x function: %#x register: %#x data: %#x\n", - Device, Function, offset, (uint16_t)(*(uint8_t*)(config.data + offset))); + device, function, offset, (uint16_t)(*(uint8_t*)(config.data + offset))); break; default: @@ -115,7 +115,7 @@ PciDev::WriteConfig(int offset, int size, uint32_t data) DPRINTF(PCIDEV, "write device: %#x function: %#x reg: %#x size: %#x data: %#x\n", - Device, Function, offset, size, word_value); + device, function, offset, size, word_value); barnum = (offset - PCI0_BASE_ADDR0) >> 2; diff --git a/dev/pcidev.hh b/dev/pcidev.hh index 6496791b2..1a45f5c7b 100644 --- a/dev/pcidev.hh +++ b/dev/pcidev.hh @@ -67,11 +67,11 @@ class PciDev : public FunctionalMemory { protected: MemoryController *MMU; - PciConfigAll *ConfigSpace; - PciConfigData *ConfigData; - uint32_t Bus; - uint32_t Device; - uint32_t Function; + PciConfigAll *configSpace; + PciConfigData *configData; + uint32_t bus; + uint32_t device; + uint32_t function; PCIConfig config; uint32_t BARSize[6]; diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index d863ffd0a..12c1f5c32 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -300,6 +300,20 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, strcpy(osflags, boot_osflags.c_str()); } + if (consoleSymtab->findAddress("xxm_rpb", addr)) { + Addr paddr = vtophys(physmem, addr); + char *hwprb = (char *)physmem->dma_addr(paddr, sizeof(uint64_t)); + + if (hwprb) { + *(uint64_t*)(hwprb+0x50) = 34; // Tsunami + *(uint64_t*)(hwprb+0x58) = (1<<10); + } + else + panic("could not translate hwprb addr to set system type/variation\n"); + + } else + panic("could not find hwprb to set system type/variation\n"); + if (kernelSymtab->findAddress("panic", addr)) kernelPanicEvent->schedule(addr); else diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index b03d7bf26..f8dda6f84 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -124,6 +124,20 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, strcpy(osflags, boot_osflags.c_str()); } + if (consoleSymtab->findAddress("xxm_rpb", addr)) { + Addr paddr = vtophys(physmem, addr); + char *hwprb = (char *)physmem->dma_addr(paddr, sizeof(uint64_t)); + + if (hwprb) { + *(uint64_t*)(hwprb+0x50) = 12; // Tlaser + *(uint64_t*)(hwprb+0x58) = (2<<1); + } + else + panic("could not translate hwprb addr to set system type/variation\n"); + } else + panic("could not find hwprb to set system type/variation\n"); + + #ifdef DEBUG if (kernelSymtab->findAddress("panic", addr)) kernelPanicEvent->schedule(addr); diff --git a/sim/sim_object.cc b/sim/sim_object.cc index c55021e41..2ec588afa 100644 --- a/sim/sim_object.cc +++ b/sim/sim_object.cc @@ -36,6 +36,7 @@ #include "sim/host.hh" #include "sim/sim_object.hh" #include "sim/sim_stats.hh" +#include "sim/param.hh" using namespace std; @@ -191,3 +192,5 @@ SimObject::serializeAll(ostream &os) obj->serialize(os); } } + +DEFINE_SIM_OBJECT_CLASS_NAME("SimObject", SimObject) |