15222Sksewell@umich.edu/*
25222Sksewell@umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan
35222Sksewell@umich.edu * All rights reserved.
45222Sksewell@umich.edu *
55222Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without
65222Sksewell@umich.edu * modification, are permitted provided that the following conditions are
75222Sksewell@umich.edu * met: redistributions of source code must retain the above copyright
85222Sksewell@umich.edu * notice, this list of conditions and the following disclaimer;
95222Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright
105222Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the
115222Sksewell@umich.edu * documentation and/or other materials provided with the distribution;
125222Sksewell@umich.edu * neither the name of the copyright holders nor the names of its
135222Sksewell@umich.edu * contributors may be used to endorse or promote products derived from
145222Sksewell@umich.edu * this software without specific prior written permission.
155222Sksewell@umich.edu *
165222Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
175222Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
185222Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
195222Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
205222Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
215222Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
225222Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
235222Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
245222Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
255222Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
265222Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
275222Sksewell@umich.edu *
285222Sksewell@umich.edu * Authors: Nathan Binkert
295222Sksewell@umich.edu */
305222Sksewell@umich.edu
315222Sksewell@umich.edu#ifndef __MIPS_ACCESS_H__
325222Sksewell@umich.edu#define __MIPS_ACCESS_H__
335222Sksewell@umich.edu
345222Sksewell@umich.edu/** @file
355222Sksewell@umich.edu * System Console Memory Mapped Register Definition
365222Sksewell@umich.edu */
375222Sksewell@umich.edu
385222Sksewell@umich.edu#define MIPS_ACCESS_VERSION (1305)
395222Sksewell@umich.edu#define CONSOLE_START_ADDRESS 0xBFD00F00
405222Sksewell@umich.edu#define REG_OFFSET 1
415222Sksewell@umich.edu#define UART8250_BASE 0xBFD003F8
425222Sksewell@umich.edu#define UART8250_END 7*REG_OFFSET
435222Sksewell@umich.edu#ifdef CONSOLE
445222Sksewell@umich.edutypedef unsigned uint32_t;
455222Sksewell@umich.edutypedef unsigned long uint64_t;
465222Sksewell@umich.edu#endif
475222Sksewell@umich.edu
485222Sksewell@umich.edu// This structure hacked up from simos
495222Sksewell@umich.edustruct MipsAccess
505222Sksewell@umich.edu{
515543Ssaidi@eecs.umich.edu    uint32_t    inputChar;              // 00: Placeholder for input
525543Ssaidi@eecs.umich.edu    uint32_t    last_offset;            // 04: must be first field
535543Ssaidi@eecs.umich.edu    uint32_t    version;                // 08:
545543Ssaidi@eecs.umich.edu    uint32_t    numCPUs;                // 0C:
555543Ssaidi@eecs.umich.edu    uint32_t    intrClockFrequency;     // 10: Hz
565222Sksewell@umich.edu
575222Sksewell@umich.edu    // Loaded kernel
585543Ssaidi@eecs.umich.edu    uint32_t    kernStart;              // 14:
595543Ssaidi@eecs.umich.edu    uint32_t    kernEnd;                // 18:
605543Ssaidi@eecs.umich.edu    uint32_t    entryPoint;             // 1c:
615222Sksewell@umich.edu
625222Sksewell@umich.edu                // console simple output stuff
635543Ssaidi@eecs.umich.edu                uint32_t        outputChar;             // 20: Placeholder for output
645222Sksewell@umich.edu
655222Sksewell@umich.edu    // console disk stuff
665543Ssaidi@eecs.umich.edu    uint32_t    diskUnit;               // 24:
675543Ssaidi@eecs.umich.edu    uint32_t    diskCount;              // 28:
685543Ssaidi@eecs.umich.edu    uint32_t    diskPAddr;              // 2c:
695543Ssaidi@eecs.umich.edu    uint32_t    diskBlock;              // 30:
705543Ssaidi@eecs.umich.edu    uint32_t    diskOperation;          // 34:
715222Sksewell@umich.edu
725222Sksewell@umich.edu                // MP boot
735543Ssaidi@eecs.umich.edu    uint32_t    cpuStack[64];           // 70:
745222Sksewell@umich.edu
755222Sksewell@umich.edu    /* XXX There appears to be a problem in accessing
765222Sksewell@umich.edu     * unit64_t in the console.c file. They are treated
775222Sksewell@umich.edu     * like uint32_int and result in the wrong address for
785222Sksewell@umich.edu     * everything below. This problem should be investigated.
795222Sksewell@umich.edu     */
805543Ssaidi@eecs.umich.edu    uint64_t    cpuClock;               // 38: MHz
815543Ssaidi@eecs.umich.edu    uint64_t    mem_size;               // 40:
825222Sksewell@umich.edu};
835222Sksewell@umich.edu
845222Sksewell@umich.edu#endif // __MIPS_ACCESS_H__
85