15222Sksewell@umich.edu# Copyright (c) 2007 The Regents of The University of Michigan
25222Sksewell@umich.edu# All rights reserved.
35222Sksewell@umich.edu#
45222Sksewell@umich.edu# Redistribution and use in source and binary forms, with or without
55222Sksewell@umich.edu# modification, are permitted provided that the following conditions are
65222Sksewell@umich.edu# met: redistributions of source code must retain the above copyright
75222Sksewell@umich.edu# notice, this list of conditions and the following disclaimer;
85222Sksewell@umich.edu# redistributions in binary form must reproduce the above copyright
95222Sksewell@umich.edu# notice, this list of conditions and the following disclaimer in the
105222Sksewell@umich.edu# documentation and/or other materials provided with the distribution;
115222Sksewell@umich.edu# neither the name of the copyright holders nor the names of its
125222Sksewell@umich.edu# contributors may be used to endorse or promote products derived from
135222Sksewell@umich.edu# this software without specific prior written permission.
145222Sksewell@umich.edu#
155222Sksewell@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
165222Sksewell@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
175222Sksewell@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
185222Sksewell@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
195222Sksewell@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
205222Sksewell@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
215222Sksewell@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
225222Sksewell@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
235222Sksewell@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245222Sksewell@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255222Sksewell@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
265222Sksewell@umich.edu#
275222Sksewell@umich.edu# Authors: Korey Sewell
285222Sksewell@umich.edu
295222Sksewell@umich.edufrom m5.params import *
305222Sksewell@umich.edufrom m5.proxy import *
315481Snate@binkert.org
3213665Sandreas.sandberg@arm.comfrom m5.objects.BadDevice import BadDevice
3313665Sandreas.sandberg@arm.comfrom m5.objects.Device import BasicPioDevice
3413665Sandreas.sandberg@arm.comfrom m5.objects.Platform import Platform
3513665Sandreas.sandberg@arm.comfrom m5.objects.Uart import Uart8250
365222Sksewell@umich.edu
375222Sksewell@umich.educlass MaltaCChip(BasicPioDevice):
385222Sksewell@umich.edu    type = 'MaltaCChip'
399338SAndreas.Sandberg@arm.com    cxx_header = "dev/mips/malta_cchip.hh"
405222Sksewell@umich.edu    malta = Param.Malta(Parent.any, "Malta")
415222Sksewell@umich.edu
425222Sksewell@umich.educlass MaltaIO(BasicPioDevice):
435222Sksewell@umich.edu    type = 'MaltaIO'
449338SAndreas.Sandberg@arm.com    cxx_header = "dev/mips/malta_io.hh"
456379Sgblack@eecs.umich.edu    time = Param.Time('01/01/2009',
465222Sksewell@umich.edu        "System time to use (0 for actual time, default is 1/1/06)")
476379Sgblack@eecs.umich.edu    year_is_bcd = Param.Bool(False,
486379Sgblack@eecs.umich.edu            "The RTC should interpret the year as a BCD value")
495222Sksewell@umich.edu    malta = Param.Malta(Parent.any, "Malta")
506379Sgblack@eecs.umich.edu    frequency = Param.Frequency('1024Hz', "frequency of interrupts")
515222Sksewell@umich.edu
525222Sksewell@umich.educlass Malta(Platform):
535222Sksewell@umich.edu    type = 'Malta'
549338SAndreas.Sandberg@arm.com    cxx_header = "dev/mips/malta.hh"
555222Sksewell@umich.edu    system = Param.System(Parent.any, "system")
565222Sksewell@umich.edu    cchip = MaltaCChip(pio_addr=0x801a0000000)
575222Sksewell@umich.edu    io = MaltaIO(pio_addr=0x801fc000000)
585222Sksewell@umich.edu    uart = Uart8250(pio_addr=0xBFD003F8)
595222Sksewell@umich.edu
605222Sksewell@umich.edu    # Attach I/O devices to specified bus object.  Can't do this
615222Sksewell@umich.edu    # earlier, since the bus object itself is typically defined at the
625222Sksewell@umich.edu    # System level.
635222Sksewell@umich.edu    def attachIO(self, bus):
648847Sandreas.hansson@arm.com        self.cchip.pio = bus.master
658847Sandreas.hansson@arm.com        self.io.pio = bus.master
668847Sandreas.hansson@arm.com        self.uart.pio = bus.master
67