access.h revision 12429:beefb9f5f551
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 */
30
31#ifndef __MIPS_ACCESS_H__
32#define __MIPS_ACCESS_H__
33
34/** @file
35 * System Console Memory Mapped Register Definition
36 */
37
38#define MIPS_ACCESS_VERSION (1305)
39#define CONSOLE_START_ADDRESS 0xBFD00F00
40#define REG_OFFSET 1
41#define UART8250_BASE 0xBFD003F8
42#define UART8250_END 7*REG_OFFSET
43#ifdef CONSOLE
44typedef unsigned uint32_t;
45typedef unsigned long uint64_t;
46#endif
47
48// This structure hacked up from simos
49struct MipsAccess
50{
51    uint32_t    inputChar;              // 00: Placeholder for input
52    uint32_t    last_offset;            // 04: must be first field
53    uint32_t    version;                // 08:
54    uint32_t    numCPUs;                // 0C:
55    uint32_t    intrClockFrequency;     // 10: Hz
56
57    // Loaded kernel
58    uint32_t    kernStart;              // 14:
59    uint32_t    kernEnd;                // 18:
60    uint32_t    entryPoint;             // 1c:
61
62                // console simple output stuff
63                uint32_t        outputChar;             // 20: Placeholder for output
64
65    // console disk stuff
66    uint32_t    diskUnit;               // 24:
67    uint32_t    diskCount;              // 28:
68    uint32_t    diskPAddr;              // 2c:
69    uint32_t    diskBlock;              // 30:
70    uint32_t    diskOperation;          // 34:
71
72                // MP boot
73    uint32_t    cpuStack[64];           // 70:
74
75    /* XXX There appears to be a problem in accessing
76     * unit64_t in the console.c file. They are treated
77     * like uint32_int and result in the wrong address for
78     * everything below. This problem should be investigated.
79     */
80    uint64_t    cpuClock;               // 38: MHz
81    uint64_t    mem_size;               // 40:
82};
83
84#endif // __MIPS_ACCESS_H__
85