RTEMS 6.1-rc6
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 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15/*********************************************************************
16 *
17 * Copyright:
18 * Freescale Semiconductor, INC. All Rights Reserved.
19 * You are hereby granted a copyright license to use, modify, and
20 * distribute the SOFTWARE so long as this entire notice is
21 * retained without alteration in any modified and/or redistributed
22 * versions, and that such modified versions are clearly identified
23 * as such. No licenses are granted by implication, estoppel or
24 * otherwise under any patents or trademarks of Freescale
25 * Semiconductor, Inc. This software is provided on an "AS IS"
26 * basis and without warranty.
27 *
28 * To the maximum extent permitted by applicable law, Freescale
29 * Semiconductor DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
30 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
31 * PARTICULAR PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
32 * REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
33 * AND ANY ACCOMPANYING WRITTEN MATERIALS.
34 *
35 * To the maximum extent permitted by applicable law, IN NO EVENT
36 * SHALL Freescale Semiconductor BE LIABLE FOR ANY DAMAGES WHATSOEVER
37 * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
38 * BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER
39 * PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
40 *
41 * Freescale Semiconductor assumes no responsibility for the
42 * maintenance and support of this software
43 *
44 ********************************************************************/
45
46#ifndef LIBCPU_POWERPC_MPC55XX_REGS_MMU_H
47#define LIBCPU_POWERPC_MPC55XX_REGS_MMU_H
48
49#include <stdint.h>
50
51#include <bspopts.h>
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57/****************************************************************************/
58/* MMU */
59/****************************************************************************/
60 struct MMU_tag {
61 union {
62 uint32_t R;
63 struct {
64 uint32_t : 2;
65 uint32_t TLBSEL : 2;
66 uint32_t : 7;
67 uint32_t ESEL : 5;
68 uint32_t : 11;
69 uint32_t NV : 5;
70 } B;
71 } MAS0;
72
73 union {
74 uint32_t R;
75 struct {
76 uint32_t VALID : 1;
77 uint32_t IPROT : 1;
78 uint32_t : 6;
79 uint32_t TID : 8;
80 uint32_t : 3;
81 uint32_t TS : 1;
82 uint32_t TSIZE : 5;
83 uint32_t : 7;
84 } B;
85 } MAS1;
86
87 union {
88 uint32_t R;
89 struct {
90 uint32_t EPN : 22;
91 uint32_t : 4;
92 uint32_t VLE : 1;
93 uint32_t W : 1;
94 uint32_t I : 1;
95 uint32_t M : 1;
96 uint32_t G : 1;
97 uint32_t E : 1;
98 } B;
99 } MAS2;
100
101 union {
102 uint32_t R;
103 struct {
104 uint32_t RPN : 22;
105 uint32_t U0 : 1;
106 uint32_t U1 : 1;
107 uint32_t U2 : 1;
108 uint32_t U3 : 1;
109 uint32_t UX : 1;
110 uint32_t SX : 1;
111 uint32_t UW : 1;
112 uint32_t SW : 1;
113 uint32_t UR : 1;
114 uint32_t SR : 1;
115 } B;
116 } MAS3;
117 };
118
120 uint32_t R;
121 struct {
122 uint32_t : 2;
123 uint32_t TLBSELD : 2;
124 uint32_t : 10;
125 uint32_t TIDSELD : 2;
126 uint32_t : 4;
127 uint32_t TSIZED : 4;
128 uint32_t : 3;
129 uint32_t WD : 1;
130 uint32_t ID : 1;
131 uint32_t MD : 1;
132 uint32_t GD : 1;
133 uint32_t ED : 1;
134 } B;
135 };
136
138 uint32_t R;
139 struct {
140 uint32_t : 8;
141 uint32_t SPID : 8;
142 uint32_t : 15;
143 uint32_t SAS : 1;
144 } B;
145 };
146
147#define MPC55XX_MMU_TAG_TRANSLATE_INITIALIZER(idx, addreff, addrreal, size, x, w, r, io) \
148 { \
149 .MAS0 = { .B = { .TLBSEL = 1, .ESEL = (idx) } }, \
150 .MAS1 = { .B = { \
151 .VALID = 1, .IPROT = 1, .TID = 0, .TS = 0, .TSIZE = (size) } \
152 }, \
153 .MAS2 = { .B = { \
154 .EPN = (addreff) >> 10, .VLE = 0, \
155 .W = (io) == 2, .I = (io) == 1, .M = 0, .G = (io) == 1, .E = 0 } \
156 }, \
157 .MAS3 = { .B = { \
158 .RPN = (addrreal) >> 10, .U0 = 0, .U1 = 0, .U2 = 0, .U3 = 0, .UX = 0, \
159 .SX = (x), .UW = 0, .SW = (w), .UR = 0, .SR = (r) } \
160 } \
161 }
162
163#define MPC55XX_MMU_TAG_INITIALIZER(idx, addr, size, x, w, r, io) \
164 MPC55XX_MMU_TAG_TRANSLATE_INITIALIZER(idx, addr, addr, size, x, w, r, io)
165
166#define MPC55XX_MMU_1K 0
167#define MPC55XX_MMU_2K 1
168#define MPC55XX_MMU_4K 2
169#define MPC55XX_MMU_8K 3
170#define MPC55XX_MMU_16K 4
171#define MPC55XX_MMU_32K 5
172#define MPC55XX_MMU_64K 6
173#define MPC55XX_MMU_128K 7
174#define MPC55XX_MMU_256K 8
175#define MPC55XX_MMU_512K 9
176#define MPC55XX_MMU_1M 10
177#define MPC55XX_MMU_2M 11
178#define MPC55XX_MMU_4M 12
179#define MPC55XX_MMU_8M 13
180#define MPC55XX_MMU_16M 14
181#define MPC55XX_MMU_32M 15
182#define MPC55XX_MMU_64M 16
183#define MPC55XX_MMU_128M 17
184#define MPC55XX_MMU_256M 18
185#define MPC55XX_MMU_512M 19
186#define MPC55XX_MMU_1G 20
187#define MPC55XX_MMU_2G 21
188#define MPC55XX_MMU_4G 22
189
190#ifdef __cplusplus
191}
192#endif /* __cplusplus */
193
194#endif /* LIBCPU_POWERPC_MPC55XX_REGS_MMU_H */
Definition: regs-mmu.h:60
Definition: regs-mmu.h:119
Definition: regs-mmu.h:137