RTEMS 7.0-rc1
Loading...
Searching...
No Matches
regs-mmu.h
Go to the documentation of this file.
1
7/*
8 * Copyright (C) 2008, 2011 embedded brains GmbH & Co. KG
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/*********************************************************************
33 *
34 * Copyright:
35 * Freescale Semiconductor, INC. All Rights Reserved.
36 * You are hereby granted a copyright license to use, modify, and
37 * distribute the SOFTWARE so long as this entire notice is
38 * retained without alteration in any modified and/or redistributed
39 * versions, and that such modified versions are clearly identified
40 * as such. No licenses are granted by implication, estoppel or
41 * otherwise under any patents or trademarks of Freescale
42 * Semiconductor, Inc. This software is provided on an "AS IS"
43 * basis and without warranty.
44 *
45 * To the maximum extent permitted by applicable law, Freescale
46 * Semiconductor DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
47 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
48 * PARTICULAR PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
49 * REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
50 * AND ANY ACCOMPANYING WRITTEN MATERIALS.
51 *
52 * To the maximum extent permitted by applicable law, IN NO EVENT
53 * SHALL Freescale Semiconductor BE LIABLE FOR ANY DAMAGES WHATSOEVER
54 * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
55 * BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER
56 * PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
57 *
58 * Freescale Semiconductor assumes no responsibility for the
59 * maintenance and support of this software
60 *
61 ********************************************************************/
62
63#ifndef LIBCPU_POWERPC_MPC55XX_REGS_MMU_H
64#define LIBCPU_POWERPC_MPC55XX_REGS_MMU_H
65
66#include <stdint.h>
67
68#include <bspopts.h>
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74/****************************************************************************/
75/* MMU */
76/****************************************************************************/
77 struct MMU_tag {
78 union {
79 uint32_t R;
80 struct {
81 uint32_t : 2;
82 uint32_t TLBSEL : 2;
83 uint32_t : 7;
84 uint32_t ESEL : 5;
85 uint32_t : 11;
86 uint32_t NV : 5;
87 } B;
88 } MAS0;
89
90 union {
91 uint32_t R;
92 struct {
93 uint32_t VALID : 1;
94 uint32_t IPROT : 1;
95 uint32_t : 6;
96 uint32_t TID : 8;
97 uint32_t : 3;
98 uint32_t TS : 1;
99 uint32_t TSIZE : 5;
100 uint32_t : 7;
101 } B;
102 } MAS1;
103
104 union {
105 uint32_t R;
106 struct {
107 uint32_t EPN : 22;
108 uint32_t : 4;
109 uint32_t VLE : 1;
110 uint32_t W : 1;
111 uint32_t I : 1;
112 uint32_t M : 1;
113 uint32_t G : 1;
114 uint32_t E : 1;
115 } B;
116 } MAS2;
117
118 union {
119 uint32_t R;
120 struct {
121 uint32_t RPN : 22;
122 uint32_t U0 : 1;
123 uint32_t U1 : 1;
124 uint32_t U2 : 1;
125 uint32_t U3 : 1;
126 uint32_t UX : 1;
127 uint32_t SX : 1;
128 uint32_t UW : 1;
129 uint32_t SW : 1;
130 uint32_t UR : 1;
131 uint32_t SR : 1;
132 } B;
133 } MAS3;
134 };
135
137 uint32_t R;
138 struct {
139 uint32_t : 2;
140 uint32_t TLBSELD : 2;
141 uint32_t : 10;
142 uint32_t TIDSELD : 2;
143 uint32_t : 4;
144 uint32_t TSIZED : 4;
145 uint32_t : 3;
146 uint32_t WD : 1;
147 uint32_t ID : 1;
148 uint32_t MD : 1;
149 uint32_t GD : 1;
150 uint32_t ED : 1;
151 } B;
152 };
153
155 uint32_t R;
156 struct {
157 uint32_t : 8;
158 uint32_t SPID : 8;
159 uint32_t : 15;
160 uint32_t SAS : 1;
161 } B;
162 };
163
164#define MPC55XX_MMU_TAG_TRANSLATE_INITIALIZER(idx, addreff, addrreal, size, x, w, r, io) \
165 { \
166 .MAS0 = { .B = { .TLBSEL = 1, .ESEL = (idx) } }, \
167 .MAS1 = { .B = { \
168 .VALID = 1, .IPROT = 1, .TID = 0, .TS = 0, .TSIZE = (size) } \
169 }, \
170 .MAS2 = { .B = { \
171 .EPN = (addreff) >> 10, .VLE = 0, \
172 .W = (io) == 2, .I = (io) == 1, .M = 0, .G = (io) == 1, .E = 0 } \
173 }, \
174 .MAS3 = { .B = { \
175 .RPN = (addrreal) >> 10, .U0 = 0, .U1 = 0, .U2 = 0, .U3 = 0, .UX = 0, \
176 .SX = (x), .UW = 0, .SW = (w), .UR = 0, .SR = (r) } \
177 } \
178 }
179
180#define MPC55XX_MMU_TAG_INITIALIZER(idx, addr, size, x, w, r, io) \
181 MPC55XX_MMU_TAG_TRANSLATE_INITIALIZER(idx, addr, addr, size, x, w, r, io)
182
183#define MPC55XX_MMU_1K 0
184#define MPC55XX_MMU_2K 1
185#define MPC55XX_MMU_4K 2
186#define MPC55XX_MMU_8K 3
187#define MPC55XX_MMU_16K 4
188#define MPC55XX_MMU_32K 5
189#define MPC55XX_MMU_64K 6
190#define MPC55XX_MMU_128K 7
191#define MPC55XX_MMU_256K 8
192#define MPC55XX_MMU_512K 9
193#define MPC55XX_MMU_1M 10
194#define MPC55XX_MMU_2M 11
195#define MPC55XX_MMU_4M 12
196#define MPC55XX_MMU_8M 13
197#define MPC55XX_MMU_16M 14
198#define MPC55XX_MMU_32M 15
199#define MPC55XX_MMU_64M 16
200#define MPC55XX_MMU_128M 17
201#define MPC55XX_MMU_256M 18
202#define MPC55XX_MMU_512M 19
203#define MPC55XX_MMU_1G 20
204#define MPC55XX_MMU_2G 21
205#define MPC55XX_MMU_4G 22
206
207#ifdef __cplusplus
208}
209#endif /* __cplusplus */
210
211#endif /* LIBCPU_POWERPC_MPC55XX_REGS_MMU_H */
Definition: regs-mmu.h:77
Definition: regs-mmu.h:136
Definition: regs-mmu.h:154