Annotation of sys/arch/sh/include/mmu_sh3.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: mmu_sh3.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
2: /* $NetBSD: mmu_sh3.h,v 1.6 2006/03/04 01:55:03 uwe Exp $ */
3:
4: /*-
5: * Copyright (c) 2002 The NetBSD Foundation, Inc.
6: * All rights reserved.
7: *
8: * This code is derived from software contributed to The NetBSD Foundation
9: * by UCHIYAMA Yasushi.
10: *
11: * Redistribution and use in source and binary forms, with or without
12: * modification, are permitted provided that the following conditions
13: * are met:
14: * 1. Redistributions of source code must retain the above copyright
15: * notice, this list of conditions and the following disclaimer.
16: * 2. Redistributions in binary form must reproduce the above copyright
17: * notice, this list of conditions and the following disclaimer in the
18: * documentation and/or other materials provided with the distribution.
19: * 3. All advertising materials mentioning features or use of this software
20: * must display the following acknowledgement:
21: * This product includes software developed by the NetBSD
22: * Foundation, Inc. and its contributors.
23: * 4. Neither the name of The NetBSD Foundation nor the names of its
24: * contributors may be used to endorse or promote products derived
25: * from this software without specific prior written permission.
26: *
27: * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37: * POSSIBILITY OF SUCH DAMAGE.
38: */
39:
40: #ifndef _SH_MMU_SH3_H_
41: #define _SH_MMU_SH3_H_
42: #include <sh/devreg.h>
43:
44: /* 128-entry 4-way set-associative */
45: #define SH3_MMU_WAY 4
46: #define SH3_MMU_ENTRY 32
47:
48: #define SH3_PTEH 0xfffffff0
49: #define SH3_PTEH_ASID_MASK 0x000000ff
50: #define SH3_PTEH_VPN_MASK 0xfffffc00
51: #define SH3_PTEL 0xfffffff4
52: #define SH3_PTEL_HWBITS 0x1ffff17e /* [28:12][8][6:1] */
53: #define SH3_TTB 0xfffffff8
54: #define SH3_TEA 0xfffffffc
55: #define SH3_MMUCR 0xffffffe0
56: #define SH3_MMUCR_AT 0x00000001
57: #define SH3_MMUCR_IX 0x00000002
58: #define SH3_MMUCR_TF 0x00000004
59: #define SH3_MMUCR_RC 0x00000030
60: #define SH3_MMUCR_SV 0x00000100
61:
62: /*
63: * memory-mapped TLB
64: */
65: /* Address array */
66: #define SH3_MMUAA 0xf2000000
67: /* address specification */
68: #define SH3_MMU_VPN_SHIFT 12
69: #define SH3_MMU_VPN_MASK 0x0001f000 /* [16:12] */
70: #define SH3_MMU_WAY_SHIFT 8
71: #define SH3_MMU_WAY_MASK 0x00000300 /* [9:8] */
72: /* data specification */
73: #define SH3_MMU_D_VALID 0x00000100
74: #define SH3_MMUAA_D_VPN_MASK_1K 0xfffe0c00 /* [31:17][11:10] */
75: #define SH3_MMUAA_D_VPN_MASK_4K 0xfffe0000 /* [31:17] */
76: #define SH3_MMUAA_D_ASID_MASK 0x000000ff
77:
78: /* Data array */
79: #define SH3_MMUDA 0xf3000000
80: #define SH3_MMUDA_D_PPN_MASK 0xfffffc00
81: #define SH3_MMUDA_D_V 0x00000100
82: #define SH3_MMUDA_D_PR_SHIFT 5
83: #define SH3_MMUDA_D_PR_MASK 0x00000060 /* [6:5] */
84: #define SH3_MMUDA_D_SZ 0x00000010
85: #define SH3_MMUDA_D_C 0x00000008
86: #define SH3_MMUDA_D_D 0x00000004
87: #define SH3_MMUDA_D_SH 0x00000002
88:
89: #define SH3_TLB_DISABLE *(volatile uint32_t *)SH3_MMUCR = SH3_MMUCR_TF
90: #endif /* !_SH_MMU_SH3_H_ */
CVSweb