tsunami_io.hh (3943:68e673d2db04) tsunami_io.hh (4762:c94e103c83ad)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32
33/** @file
34 * Tsunami I/O Space mapping including RTC/timer interrupts
35 */
36
37#ifndef __DEV_TSUNAMI_IO_HH__
38#define __DEV_TSUNAMI_IO_HH__
39
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32
33/** @file
34 * Tsunami I/O Space mapping including RTC/timer interrupts
35 */
36
37#ifndef __DEV_TSUNAMI_IO_HH__
38#define __DEV_TSUNAMI_IO_HH__
39
40#include "dev/io_device.hh"
41#include "base/range.hh"
42#include "dev/alpha/tsunami.hh"
40#include "base/range.hh"
41#include "dev/alpha/tsunami.hh"
42#include "dev/io_device.hh"
43#include "params/TsunamiIO.hh"
43#include "sim/eventq.hh"
44
45/**
46 * Tsunami I/O device is a catch all for all the south bridge stuff we care
47 * to implement.
48 */
49class TsunamiIO : public BasicPioDevice
50{

--- 29 unchanged lines hidden (view full) ---

80 const std::string &name() const { return _name; }
81
82 /** RTC periodic interrupt event */
83 RTCEvent event;
84
85 /** Current RTC register address/index */
86 int addr;
87
44#include "sim/eventq.hh"
45
46/**
47 * Tsunami I/O device is a catch all for all the south bridge stuff we care
48 * to implement.
49 */
50class TsunamiIO : public BasicPioDevice
51{

--- 29 unchanged lines hidden (view full) ---

81 const std::string &name() const { return _name; }
82
83 /** RTC periodic interrupt event */
84 RTCEvent event;
85
86 /** Current RTC register address/index */
87 int addr;
88
88 /** should the year be interpreted as BCD? */
89 bool year_is_bcd;
90
91 /** Data for real-time clock function */
92 union {
93 uint8_t clock_data[10];
94
95 struct {
96 uint8_t sec;
97 uint8_t sec_alrm;
98 uint8_t min;

--- 10 unchanged lines hidden (view full) ---

109 /** RTC status register A */
110 uint8_t stat_regA;
111
112 /** RTC status register B */
113 uint8_t stat_regB;
114
115 public:
116 RTC(const std::string &name, Tsunami* tsunami,
89 /** Data for real-time clock function */
90 union {
91 uint8_t clock_data[10];
92
93 struct {
94 uint8_t sec;
95 uint8_t sec_alrm;
96 uint8_t min;

--- 10 unchanged lines hidden (view full) ---

107 /** RTC status register A */
108 uint8_t stat_regA;
109
110 /** RTC status register B */
111 uint8_t stat_regB;
112
113 public:
114 RTC(const std::string &name, Tsunami* tsunami,
117 const std::vector<int> &t, bool bcd, Tick i);
115 const TsunamiIOParams *params);
118
119 /** RTC address port: write address of RTC RAM data to access */
120 void writeAddr(const uint8_t data);
121
122 /** RTC write data */
123 void writeData(const uint8_t data);
124
125 /** RTC read data */

--- 182 unchanged lines hidden (view full) ---

308
309 public:
310 /**
311 * Return the freqency of the RTC
312 * @return interrupt rate of the RTC
313 */
314 Tick frequency() const;
315
116
117 /** RTC address port: write address of RTC RAM data to access */
118 void writeAddr(const uint8_t data);
119
120 /** RTC write data */
121 void writeData(const uint8_t data);
122
123 /** RTC read data */

--- 182 unchanged lines hidden (view full) ---

306
307 public:
308 /**
309 * Return the freqency of the RTC
310 * @return interrupt rate of the RTC
311 */
312 Tick frequency() const;
313
316 struct Params : public BasicPioDevice::Params
317 {
318 Tick frequency;
319 Tsunami *tsunami;
320 std::vector<int> init_time;
321 bool year_is_bcd;
322 };
323
324 protected:
325 const Params *params() const { return (const Params*)_params; }
326
327 public:
314 public:
315 typedef TsunamiIOParams Params;
328 /**
329 * Initialize all the data for devices supported by Tsunami I/O.
330 * @param p pointer to Params struct
331 */
316 /**
317 * Initialize all the data for devices supported by Tsunami I/O.
318 * @param p pointer to Params struct
319 */
332 TsunamiIO(Params *p);
320 TsunamiIO(const Params *p);
333
321
322 const Params *
323 params() const
324 {
325 return dynamic_cast<const Params *>(_params);
326 }
327
334 virtual Tick read(PacketPtr pkt);
335 virtual Tick write(PacketPtr pkt);
336
337 /**
338 * Post an PIC interrupt to the CPU via the CChip
339 * @param bitvector interrupt to post.
340 */
341 void postPIC(uint8_t bitvector);

--- 23 unchanged lines hidden ---
328 virtual Tick read(PacketPtr pkt);
329 virtual Tick write(PacketPtr pkt);
330
331 /**
332 * Post an PIC interrupt to the CPU via the CChip
333 * @param bitvector interrupt to post.
334 */
335 void postPIC(uint8_t bitvector);

--- 23 unchanged lines hidden ---