summaryrefslogtreecommitdiff
path: root/src/dev/arm/amba_device.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@arm.com>2010-08-23 11:18:40 -0500
committerAli Saidi <Ali.Saidi@arm.com>2010-08-23 11:18:40 -0500
commitc0ca01ec368cc02bbc9e2d14e93183fe263ee09b (patch)
treefba0726eb20ac03f40e090e1f8f25f3845ac053f /src/dev/arm/amba_device.hh
parent330fada1aa8fa3134c97ef44aba5a84d8620b8ae (diff)
downloadgem5-c0ca01ec368cc02bbc9e2d14e93183fe263ee09b.tar.xz
ARM: Change how the AMBA device ID checking is done to make it more generic
Diffstat (limited to 'src/dev/arm/amba_device.hh')
-rw-r--r--src/dev/arm/amba_device.hh46
1 files changed, 29 insertions, 17 deletions
diff --git a/src/dev/arm/amba_device.hh b/src/dev/arm/amba_device.hh
index b2d7af043..679202c84 100644
--- a/src/dev/arm/amba_device.hh
+++ b/src/dev/arm/amba_device.hh
@@ -50,33 +50,45 @@
#define __DEV_ARM_AMBA_DEVICE_H__
#include "base/range.hh"
+#include "mem/packet.hh"
+#include "mem/packet_access.hh"
#include "dev/io_device.hh"
#include "params/AmbaDevice.hh"
+#include "params/AmbaDmaDevice.hh"
+
+namespace AmbaDev {
+
+const int AMBA_PER_ID0 = 0xFE0;
+const int AMBA_PER_ID1 = 0xFE4;
+const int AMBA_PER_ID2 = 0xFE8;
+const int AMBA_PER_ID3 = 0xFEC;
+const int AMBA_CEL_ID0 = 0xFF0;
+const int AMBA_CEL_ID1 = 0xFF4;
+const int AMBA_CEL_ID2 = 0xFF8;
+const int AMBA_CEL_ID3 = 0xFFC;
+
+bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr);
+}
class AmbaDevice : public BasicPioDevice
{
protected:
- static const int AMBA_PER_ID0 = 0xFE0;
- static const int AMBA_PER_ID1 = 0xFE4;
- static const int AMBA_PER_ID2 = 0xFE8;
- static const int AMBA_PER_ID3 = 0xFEC;
- static const int AMBA_CEL_ID0 = 0xFF0;
- static const int AMBA_CEL_ID1 = 0xFF4;
- static const int AMBA_CEL_ID2 = 0xFF8;
- static const int AMBA_CEL_ID3 = 0xFFC;
-
uint64_t ambaId;
public:
- typedef AmbaDeviceParams Params;
- const Params *
- params() const
- {
- return dynamic_cast<const Params *>(_params);
- }
+ typedef AmbaDeviceParams Params;
AmbaDevice(const Params *p);
+};
- bool readId(PacketPtr pkt);
+class AmbaDmaDevice : public DmaDevice
+{
+ protected:
+ uint64_t ambaId;
+
+ public:
+ typedef AmbaDmaDeviceParams Params;
+ AmbaDmaDevice(const Params *p);
};
-#endif //__DEV_ARM_AMBA_FAKE_H__
+
+#endif //__DEV_ARM_AMBA_DEVICE_H__