realview.cc revision 11244:a2af58a06c4e
16145Snate@binkert.org/*
26145Snate@binkert.org * Copyright (c) 2009, 2014 ARM Limited
36145Snate@binkert.org * All rights reserved
46145Snate@binkert.org *
56145Snate@binkert.org * The license below extends only to copyright in the software and shall
66145Snate@binkert.org * not be construed as granting a license to any other intellectual
76145Snate@binkert.org * property including but not limited to intellectual property relating
86145Snate@binkert.org * to a hardware implementation of the functionality of the software
96145Snate@binkert.org * licensed hereunder.  You may use the software subject to the license
106145Snate@binkert.org * terms below provided that you ensure that this notice is replicated
116145Snate@binkert.org * unmodified and in its entirety in all distributions of the software,
126145Snate@binkert.org * modified or unmodified, in source code or in binary form.
136145Snate@binkert.org *
146145Snate@binkert.org * Copyright (c) 2004-2005 The Regents of The University of Michigan
156145Snate@binkert.org * All rights reserved.
166145Snate@binkert.org *
176145Snate@binkert.org * Redistribution and use in source and binary forms, with or without
186145Snate@binkert.org * modification, are permitted provided that the following conditions are
196145Snate@binkert.org * met: redistributions of source code must retain the above copyright
206145Snate@binkert.org * notice, this list of conditions and the following disclaimer;
216145Snate@binkert.org * redistributions in binary form must reproduce the above copyright
226145Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
236145Snate@binkert.org * documentation and/or other materials provided with the distribution;
246145Snate@binkert.org * neither the name of the copyright holders nor the names of its
256145Snate@binkert.org * contributors may be used to endorse or promote products derived from
266145Snate@binkert.org * this software without specific prior written permission.
276145Snate@binkert.org *
286145Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
297454Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
307454Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
318645Snilay@cs.wisc.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
327454Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3310301Snilay@cs.wisc.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
347054Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
358259SBrad.Beckmann@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366154Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376154Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386145Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
397055Snate@binkert.org *
407454Snate@binkert.org * Authors: Ali Saidi
417454Snate@binkert.org */
427055Snate@binkert.org
439274Snilay@cs.wisc.edu/** @file
446145Snate@binkert.org * Implementation of RealView platform.
459858Snilay@cs.wisc.edu */
466145Snate@binkert.org
476145Snate@binkert.org#include <deque>
486145Snate@binkert.org#include <string>
496145Snate@binkert.org#include <vector>
509858Snilay@cs.wisc.edu
516145Snate@binkert.org#include "config/the_isa.hh"
527054Snate@binkert.org#include "cpu/intr_control.hh"
537454Snate@binkert.org#include "dev/arm/base_gic.hh"
546145Snate@binkert.org#include "dev/arm/realview.hh"
557054Snate@binkert.org#include "dev/terminal.hh"
567454Snate@binkert.org#include "sim/system.hh"
576145Snate@binkert.org
586145Snate@binkert.orgusing namespace std;
597054Snate@binkert.orgusing namespace TheISA;
609274Snilay@cs.wisc.edu
619274Snilay@cs.wisc.edu
629274Snilay@cs.wisc.eduRealView::RealView(const Params *p)
639858Snilay@cs.wisc.edu    : Platform(p), system(p->system), gic(nullptr)
649274Snilay@cs.wisc.edu{}
659274Snilay@cs.wisc.edu
669274Snilay@cs.wisc.eduvoid
6710370Snilay@cs.wisc.eduRealView::postConsoleInt()
686145Snate@binkert.org{
699858Snilay@cs.wisc.edu    warn_once("Don't know what interrupt to post for console.\n");
709508Snilay@cs.wisc.edu    //panic("Need implementation\n");
7110311Snilay@cs.wisc.edu}
7210370Snilay@cs.wisc.edu
7310370Snilay@cs.wisc.eduvoid
7410370Snilay@cs.wisc.eduRealView::clearConsoleInt()
759508Snilay@cs.wisc.edu{
766145Snate@binkert.org    warn_once("Don't know what interrupt to clear for console.\n");
776145Snate@binkert.org    //panic("Need implementation\n");
787054Snate@binkert.org}
7910370Snilay@cs.wisc.edu
8010311Snilay@cs.wisc.eduvoid
8110311Snilay@cs.wisc.eduRealView::postPciInt(int line)
826145Snate@binkert.org{
837054Snate@binkert.org    gic->sendInt(line);
8410918Sbrandon.potter@amd.com}
8510918Sbrandon.potter@amd.com
8610311Snilay@cs.wisc.eduvoid
8710311Snilay@cs.wisc.eduRealView::clearPciInt(int line)
8810311Snilay@cs.wisc.edu{
8910311Snilay@cs.wisc.edu    gic->clearInt(line);
907454Snate@binkert.org}
916145Snate@binkert.org
927054Snate@binkert.orgRealView *
9310370Snilay@cs.wisc.eduRealViewParams::create()
9410311Snilay@cs.wisc.edu{
9510370Snilay@cs.wisc.edu    return new RealView(this);
9610370Snilay@cs.wisc.edu}
9710370Snilay@cs.wisc.edu