/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
+ * Copyright (c) 2008 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <vector>
#include "arch/x86/x86_traits.hh"
+#include "dev/intel_8254_timer.hh"
#include "cpu/intr_control.hh"
#include "dev/simconsole.hh"
#include "dev/x86/pc.hh"
PC::PC(const Params *p)
: Platform(p), system(p->system)
{
+ southBridge = NULL;
// set the back pointer from the system to myself
system->platform = this;
}
+void
+PC::init()
+{
+ assert(southBridge);
+ Intel8254Timer & timer = southBridge->pit.pit;
+ //Timer 0, mode 2, no bcd, 16 bit count
+ timer.writeControl(0x34);
+ //Timer 0, latch command
+ timer.writeControl(0x00);
+ //Write a 16 bit count of 0
+ timer.counter0.write(0);
+ timer.counter0.write(0);
+}
+
Tick
PC::intrFrequency()
{
/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
+ * Copyright (c) 2008 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define __DEV_PC_HH__
#include "dev/platform.hh"
+#include "dev/x86/south_bridge/south_bridge.hh"
#include "params/PC.hh"
class IdeController;
public:
/** Pointer to the system */
System *system;
+ SouthBridge * southBridge;
public:
typedef PCParams Params;
+ /**
+ * Do platform initialization stuff
+ */
+ void init();
+
PC(const Params *p);
/**
#include "arch/x86/x86_traits.hh"
#include "base/range.hh"
+#include "dev/x86/pc.hh"
#include "dev/x86/south_bridge/south_bridge.hh"
using namespace X86ISA;
addDevice(pit);
addDevice(cmos);
addDevice(speaker);
+
+ // Let the platform know where we are
+ PC * pc = dynamic_cast<PC *>(platform);
+ assert(pc);
+ pc->southBridge = this;
}
SouthBridge *
/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
+ * Copyright (c) 2008 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
class SouthBridge : public PioDevice
{
protected:
+ AddrRangeList rangeList;
+
+ typedef range_map<Addr, X86ISA::SubDevice *> RangeMap;
+ typedef RangeMap::iterator RangeMapIt;
+ RangeMap rangeMap;
+
+
+ void addDevice(X86ISA::SubDevice &);
+
+ public:
// PICs
X86ISA::I8259 pic1;
X86ISA::I8259 pic2;
// PC speaker
X86ISA::Speaker speaker;
- AddrRangeList rangeList;
-
- typedef range_map<Addr, X86ISA::SubDevice *> RangeMap;
- typedef RangeMap::iterator RangeMapIt;
- RangeMap rangeMap;
-
-
- void addDevice(X86ISA::SubDevice &);
-
public:
+
void addressRanges(AddrRangeList &range_list);
Tick read(PacketPtr pkt);