Malta.py revision 9338
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 325481Snate@binkert.orgfrom BadDevice import BadDevice 335222Sksewell@umich.edufrom Device import BasicPioDevice 345481Snate@binkert.orgfrom Pci import PciConfigAll 355222Sksewell@umich.edufrom Platform import Platform 365222Sksewell@umich.edufrom Uart import Uart8250 375222Sksewell@umich.edu 385222Sksewell@umich.educlass MaltaCChip(BasicPioDevice): 395222Sksewell@umich.edu type = 'MaltaCChip' 409338SAndreas.Sandberg@arm.com cxx_header = "dev/mips/malta_cchip.hh" 415222Sksewell@umich.edu malta = Param.Malta(Parent.any, "Malta") 425222Sksewell@umich.edu 435222Sksewell@umich.educlass MaltaIO(BasicPioDevice): 445222Sksewell@umich.edu type = 'MaltaIO' 459338SAndreas.Sandberg@arm.com cxx_header = "dev/mips/malta_io.hh" 466379Sgblack@eecs.umich.edu time = Param.Time('01/01/2009', 475222Sksewell@umich.edu "System time to use (0 for actual time, default is 1/1/06)") 486379Sgblack@eecs.umich.edu year_is_bcd = Param.Bool(False, 496379Sgblack@eecs.umich.edu "The RTC should interpret the year as a BCD value") 505222Sksewell@umich.edu malta = Param.Malta(Parent.any, "Malta") 516379Sgblack@eecs.umich.edu frequency = Param.Frequency('1024Hz', "frequency of interrupts") 525222Sksewell@umich.edu 535222Sksewell@umich.educlass MaltaPChip(BasicPioDevice): 545222Sksewell@umich.edu type = 'MaltaPChip' 559338SAndreas.Sandberg@arm.com cxx_header = "dev/mips/malta_pchip.hh" 565222Sksewell@umich.edu malta = Param.Malta(Parent.any, "Malta") 575222Sksewell@umich.edu 585222Sksewell@umich.educlass Malta(Platform): 595222Sksewell@umich.edu type = 'Malta' 609338SAndreas.Sandberg@arm.com cxx_header = "dev/mips/malta.hh" 615222Sksewell@umich.edu system = Param.System(Parent.any, "system") 625222Sksewell@umich.edu cchip = MaltaCChip(pio_addr=0x801a0000000) 635222Sksewell@umich.edu io = MaltaIO(pio_addr=0x801fc000000) 645222Sksewell@umich.edu uart = Uart8250(pio_addr=0xBFD003F8) 655222Sksewell@umich.edu 665222Sksewell@umich.edu # Attach I/O devices to specified bus object. Can't do this 675222Sksewell@umich.edu # earlier, since the bus object itself is typically defined at the 685222Sksewell@umich.edu # System level. 695222Sksewell@umich.edu def attachIO(self, bus): 708847Sandreas.hansson@arm.com self.cchip.pio = bus.master 718847Sandreas.hansson@arm.com self.io.pio = bus.master 728847Sandreas.hansson@arm.com self.uart.pio = bus.master 73