south_bridge.hh revision 5446
12292SN/A/*
22329SN/A * Copyright (c) 2008 The Regents of The University of Michigan
32292SN/A * All rights reserved.
42292SN/A *
52292SN/A * Redistribution and use in source and binary forms, with or without
62292SN/A * modification, are permitted provided that the following conditions are
72292SN/A * met: redistributions of source code must retain the above copyright
82292SN/A * notice, this list of conditions and the following disclaimer;
92292SN/A * redistributions in binary form must reproduce the above copyright
102292SN/A * notice, this list of conditions and the following disclaimer in the
112292SN/A * documentation and/or other materials provided with the distribution;
122292SN/A * neither the name of the copyright holders nor the names of its
132292SN/A * contributors may be used to endorse or promote products derived from
142292SN/A * this software without specific prior written permission.
152292SN/A *
162292SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172292SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182292SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192292SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202292SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212292SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222292SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232292SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242292SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252292SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262292SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272689Sktlim@umich.edu *
282689Sktlim@umich.edu * Authors: Gabe Black
292292SN/A */
302292SN/A
312292SN/A#ifndef __DEV_X86_SOUTH_BRIDGE_SOUTH_BRIDGE_HH__
322292SN/A#define __DEV_X86_SOUTH_BRIDGE_SOUTH_BRIDGE_HH__
332292SN/A
342292SN/A#include "base/range_map.hh"
352292SN/A#include "dev/io_device.hh"
362292SN/A#include "dev/x86/south_bridge/cmos.hh"
372292SN/A#include "dev/x86/south_bridge/i8254.hh"
382292SN/A#include "dev/x86/south_bridge/i8259.hh"
392292SN/A#include "dev/x86/south_bridge/speaker.hh"
402669Sktlim@umich.edu#include "dev/x86/south_bridge/sub_device.hh"
412292SN/A#include "params/SouthBridge.hh"
422292SN/A
435529Snate@binkert.orgclass SouthBridge : public PioDevice
445529Snate@binkert.org{
452292SN/A  protected:
462292SN/A    AddrRangeList rangeList;
472292SN/A
482733Sktlim@umich.edu    typedef range_map<Addr, X86ISA::SubDevice *> RangeMap;
492292SN/A    typedef RangeMap::iterator RangeMapIt;
502292SN/A    RangeMap rangeMap;
512292SN/A
522292SN/A
532348SN/A    void addDevice(X86ISA::SubDevice &);
542292SN/A
552292SN/A  public:
562292SN/A    // PICs
572292SN/A    X86ISA::I8259 pic1;
582292SN/A    X86ISA::I8259 pic2;
592292SN/A
602292SN/A    // I8254 Programmable Interval Timer
615529Snate@binkert.org    X86ISA::I8254 pit;
622292SN/A
632292SN/A    // CMOS apperature
642292SN/A    X86ISA::Cmos cmos;
652292SN/A
662727Sktlim@umich.edu    // PC speaker
672727Sktlim@umich.edu    X86ISA::Speaker speaker;
682727Sktlim@umich.edu
692871Sktlim@umich.edu  public:
702871Sktlim@umich.edu
712871Sktlim@umich.edu    void addressRanges(AddrRangeList &range_list);
722871Sktlim@umich.edu
732871Sktlim@umich.edu    Tick read(PacketPtr pkt);
742907Sktlim@umich.edu    Tick write(PacketPtr pkt);
752871Sktlim@umich.edu
762292SN/A    typedef SouthBridgeParams Params;
776221Snate@binkert.org    SouthBridge(const Params *p);
782348SN/A
792307SN/A    const Params *
802348SN/A    params() const
812307SN/A    {
822307SN/A        return dynamic_cast<const Params *>(_params);
832292SN/A    }
846221Snate@binkert.org};
856221Snate@binkert.org
862292SN/A#endif //__DEV_X86_SOUTH_BRIDGE_SOUTH_BRIDGE_HH__
872292SN/A