1/*
2 * Copyright (c) 2010-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
--- 34 unchanged lines hidden (view full) ---
43#include "debug/Checkpoint.hh"
44#include "debug/Timer.hh"
45#include "dev/arm/amba_device.hh"
46#include "dev/arm/rtc_pl031.hh"
47#include "dev/mc146818.hh"
48#include "mem/packet.hh"
49#include "mem/packet_access.hh"
50
51using namespace AmbaDev;
52
53PL031::PL031(Params *p)
54 : AmbaIntDevice(p), timeVal(mkutctime(&p->time)), lastWrittenTick(0),
55 loadVal(0), matchVal(0), rawInt(false), maskInt(false),
56 pendingInt(false), matchEvent(this)
57{
58 pioSize = 0xfff;
59}
60
--- 27 unchanged lines hidden (view full) ---
88 break;
89 case RawISR:
90 data = rawInt;
91 break;
92 case MaskedISR:
93 data = pendingInt;
94 break;
95 default:
96 if (AmbaDev::readId(pkt, ambaId, pioAddr)) {
97 // Hack for variable sized access
98 data = pkt->get<uint32_t>();
99 break;
100 }
101 panic("Tried to read PL031 at offset %#x that doesn't exist\n", daddr);
102 break;
103 }
104
--- 46 unchanged lines hidden (view full) ---
151 break;
152 case IntClear:
153 if (pkt->get<uint32_t>()) {
154 rawInt = false;
155 pendingInt = false;
156 }
157 break;
158 default:
159 if (AmbaDev::readId(pkt, ambaId, pioAddr))
160 break;
161 panic("Tried to read PL031 at offset %#x that doesn't exist\n", daddr);
162 break;
163 }
164
165 pkt->makeAtomicResponse();
166 return pioDelay;
167}
--- 84 unchanged lines hidden ---
2 * Copyright (c) 2010-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
--- 34 unchanged lines hidden (view full) ---
43#include "debug/Checkpoint.hh"
44#include "debug/Timer.hh"
45#include "dev/arm/amba_device.hh"
46#include "dev/arm/rtc_pl031.hh"
47#include "dev/mc146818.hh"
48#include "mem/packet.hh"
49#include "mem/packet_access.hh"
50
51using namespace AmbaDev;
52
53PL031::PL031(Params *p)
54 : AmbaIntDevice(p), timeVal(mkutctime(&p->time)), lastWrittenTick(0),
55 loadVal(0), matchVal(0), rawInt(false), maskInt(false),
56 pendingInt(false), matchEvent(this)
57{
58 pioSize = 0xfff;
59}
60
--- 27 unchanged lines hidden (view full) ---
88 break;
89 case RawISR:
90 data = rawInt;
91 break;
92 case MaskedISR:
93 data = pendingInt;
94 break;
95 default:
96 if (AmbaDev::readId(pkt, ambaId, pioAddr)) {
97 // Hack for variable sized access
98 data = pkt->get<uint32_t>();
99 break;
100 }
101 panic("Tried to read PL031 at offset %#x that doesn't exist\n", daddr);
102 break;
103 }
104
--- 46 unchanged lines hidden (view full) ---
151 break;
152 case IntClear:
153 if (pkt->get<uint32_t>()) {
154 rawInt = false;
155 pendingInt = false;
156 }
157 break;
158 default:
159 if (AmbaDev::readId(pkt, ambaId, pioAddr))
160 break;
161 panic("Tried to read PL031 at offset %#x that doesn't exist\n", daddr);
162 break;
163 }
164
165 pkt->makeAtomicResponse();
166 return pioDelay;
167}
--- 84 unchanged lines hidden ---