Tsunami.py revision 9338
112953Sgabeblack@google.com# Copyright (c) 2005-2007 The Regents of The University of Michigan
212953Sgabeblack@google.com# All rights reserved.
312953Sgabeblack@google.com#
412953Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
512953Sgabeblack@google.com# modification, are permitted provided that the following conditions are
612953Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
712953Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
812953Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
912953Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
1012953Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1112953Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1212953Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1312953Sgabeblack@google.com# this software without specific prior written permission.
1412953Sgabeblack@google.com#
1512953Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612953Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712953Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812953Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912953Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012953Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112953Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212953Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312953Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412953Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512953Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612953Sgabeblack@google.com#
2712953Sgabeblack@google.com# Authors: Nathan Binkert
2812953Sgabeblack@google.com
2912953Sgabeblack@google.comfrom m5.params import *
3012953Sgabeblack@google.comfrom m5.proxy import *
3112953Sgabeblack@google.comfrom BadDevice import BadDevice
3212953Sgabeblack@google.comfrom AlphaBackdoor import AlphaBackdoor
3312957Sgabeblack@google.comfrom Device import BasicPioDevice, IsaFake, BadAddr
3412957Sgabeblack@google.comfrom Pci import PciConfigAll
3512961Sgabeblack@google.comfrom Platform import Platform
3612954Sgabeblack@google.comfrom Uart import Uart8250
3712954Sgabeblack@google.com
3812953Sgabeblack@google.comclass TsunamiCChip(BasicPioDevice):
3912953Sgabeblack@google.com    type = 'TsunamiCChip'
4012953Sgabeblack@google.com    cxx_header = "dev/alpha/tsunami_cchip.hh"
4112961Sgabeblack@google.com    tsunami = Param.Tsunami(Parent.any, "Tsunami")
4212961Sgabeblack@google.com
4312953Sgabeblack@google.comclass TsunamiIO(BasicPioDevice):
4412953Sgabeblack@google.com    type = 'TsunamiIO'
4512953Sgabeblack@google.com    cxx_header = "dev/alpha/tsunami_io.hh"
4612953Sgabeblack@google.com    time = Param.Time('01/01/2009',
4712954Sgabeblack@google.com        "System time to use ('Now' for actual time)")
4812954Sgabeblack@google.com    year_is_bcd = Param.Bool(False,
4912954Sgabeblack@google.com        "The RTC should interpret the year as a BCD value")
5012954Sgabeblack@google.com    tsunami = Param.Tsunami(Parent.any, "Tsunami")
5112954Sgabeblack@google.com    frequency = Param.Frequency('1024Hz', "frequency of interrupts")
5212954Sgabeblack@google.com
5312954Sgabeblack@google.comclass TsunamiPChip(BasicPioDevice):
5412954Sgabeblack@google.com    type = 'TsunamiPChip'
5512954Sgabeblack@google.com    cxx_header = "dev/alpha/tsunami_pchip.hh"
5612954Sgabeblack@google.com    tsunami = Param.Tsunami(Parent.any, "Tsunami")
5712954Sgabeblack@google.com
5812954Sgabeblack@google.comclass Tsunami(Platform):
5912954Sgabeblack@google.com    type = 'Tsunami'
6012954Sgabeblack@google.com    cxx_header = "dev/alpha/tsunami.hh"
6112954Sgabeblack@google.com    system = Param.System(Parent.any, "system")
6212954Sgabeblack@google.com
6312954Sgabeblack@google.com    cchip = TsunamiCChip(pio_addr=0x801a0000000)
6412954Sgabeblack@google.com    pchip = TsunamiPChip(pio_addr=0x80180000000)
6512954Sgabeblack@google.com    pciconfig = PciConfigAll()
6612957Sgabeblack@google.com    fake_sm_chip = IsaFake(pio_addr=0x801fc000370)
6712954Sgabeblack@google.com
6812954Sgabeblack@google.com    fake_uart1 = IsaFake(pio_addr=0x801fc0002f8)
6912954Sgabeblack@google.com    fake_uart2 = IsaFake(pio_addr=0x801fc0003e8)
7012954Sgabeblack@google.com    fake_uart3 = IsaFake(pio_addr=0x801fc0002e8)
7112954Sgabeblack@google.com    fake_uart4 = IsaFake(pio_addr=0x801fc0003f0)
7212954Sgabeblack@google.com
7312954Sgabeblack@google.com    fake_ppc = IsaFake(pio_addr=0x801fc0003bb)
7412954Sgabeblack@google.com
7512954Sgabeblack@google.com    fake_OROM = IsaFake(pio_addr=0x800000a0000, pio_size=0x60000)
7612954Sgabeblack@google.com
7712954Sgabeblack@google.com    fake_pnp_addr = IsaFake(pio_addr=0x801fc000279)
7812954Sgabeblack@google.com    fake_pnp_write = IsaFake(pio_addr=0x801fc000a79)
7912954Sgabeblack@google.com    fake_pnp_read0 = IsaFake(pio_addr=0x801fc000203)
8012954Sgabeblack@google.com    fake_pnp_read1 = IsaFake(pio_addr=0x801fc000243)
8112954Sgabeblack@google.com    fake_pnp_read2 = IsaFake(pio_addr=0x801fc000283)
8212954Sgabeblack@google.com    fake_pnp_read3 = IsaFake(pio_addr=0x801fc0002c3)
8312954Sgabeblack@google.com    fake_pnp_read4 = IsaFake(pio_addr=0x801fc000303)
8412954Sgabeblack@google.com    fake_pnp_read5 = IsaFake(pio_addr=0x801fc000343)
8512954Sgabeblack@google.com    fake_pnp_read6 = IsaFake(pio_addr=0x801fc000383)
8612954Sgabeblack@google.com    fake_pnp_read7 = IsaFake(pio_addr=0x801fc0003c3)
8712954Sgabeblack@google.com
8812954Sgabeblack@google.com    fake_ata0 = IsaFake(pio_addr=0x801fc0001f0)
8912954Sgabeblack@google.com    fake_ata1 = IsaFake(pio_addr=0x801fc000170)
9012954Sgabeblack@google.com
9112954Sgabeblack@google.com    fb = BadDevice(pio_addr=0x801fc0003d0, devicename='FrameBuffer')
9212954Sgabeblack@google.com    io = TsunamiIO(pio_addr=0x801fc000000)
9312954Sgabeblack@google.com    uart = Uart8250(pio_addr=0x801fc0003f8)
9412954Sgabeblack@google.com    backdoor = AlphaBackdoor(pio_addr=0x80200000000, disk=Parent.simple_disk)
9512954Sgabeblack@google.com
9612954Sgabeblack@google.com    # Attach I/O devices to specified bus object.  Can't do this
9712954Sgabeblack@google.com    # earlier, since the bus object itself is typically defined at the
9812954Sgabeblack@google.com    # System level.
9912954Sgabeblack@google.com    def attachIO(self, bus):
10012954Sgabeblack@google.com        self.cchip.pio = bus.master
10112954Sgabeblack@google.com        self.pchip.pio = bus.master
10212954Sgabeblack@google.com        self.pciconfig.pio = bus.default
10312954Sgabeblack@google.com        bus.use_default_range = True
10412954Sgabeblack@google.com        self.fake_sm_chip.pio = bus.master
10512954Sgabeblack@google.com        self.fake_uart1.pio = bus.master
10612954Sgabeblack@google.com        self.fake_uart2.pio = bus.master
10712954Sgabeblack@google.com        self.fake_uart3.pio = bus.master
10812954Sgabeblack@google.com        self.fake_uart4.pio = bus.master
10912954Sgabeblack@google.com        self.fake_ppc.pio = bus.master
11012954Sgabeblack@google.com        self.fake_OROM.pio = bus.master
11112961Sgabeblack@google.com        self.fake_pnp_addr.pio = bus.master
11212961Sgabeblack@google.com        self.fake_pnp_write.pio = bus.master
11312961Sgabeblack@google.com        self.fake_pnp_read0.pio = bus.master
11412961Sgabeblack@google.com        self.fake_pnp_read1.pio = bus.master
11512961Sgabeblack@google.com        self.fake_pnp_read2.pio = bus.master
11612961Sgabeblack@google.com        self.fake_pnp_read3.pio = bus.master
11712961Sgabeblack@google.com        self.fake_pnp_read4.pio = bus.master
11812961Sgabeblack@google.com        self.fake_pnp_read5.pio = bus.master
11912961Sgabeblack@google.com        self.fake_pnp_read6.pio = bus.master
12012961Sgabeblack@google.com        self.fake_pnp_read7.pio = bus.master
12112961Sgabeblack@google.com        self.fake_ata0.pio = bus.master
12212961Sgabeblack@google.com        self.fake_ata1.pio = bus.master
12312961Sgabeblack@google.com        self.fb.pio = bus.master
12412961Sgabeblack@google.com        self.io.pio = bus.master
12512961Sgabeblack@google.com        self.uart.pio = bus.master
12612961Sgabeblack@google.com        self.backdoor.pio = bus.master
12712961Sgabeblack@google.com