Merge zizzer:/bk/linux into zower.eecs.umich.edu:/z/hsul/work/bk/linux
--HG-- extra : convert_revision : b4e2fc55ec9cd0caa7cdf02de8a61c66e8b35c67
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user