1 From f6afbf15365eec4c2f7702d79920dcf2f47fe48c Mon Sep 17 00:00:00 2001
2 From: Terry Lv <r65388@freescale.com>
3 Date: Fri, 11 Dec 2009 19:12:06 +0800
4 Subject: [PATCH] ENGR00119254: Add mmu header for mx51 build error
6 Add mmu header for mx51 build error.
8 Signed-off-by: Terry Lv <r65388@freescale.com>
10 include/asm-arm/arch-mx51/mmu.h | 135 +++++++++++++++++++++++++++++++++++++++
11 1 files changed, 135 insertions(+), 0 deletions(-)
13 diff --git a/include/asm-arm/arch-mx51/mmu.h b/include/asm-arm/arch-mx51/mmu.h
15 index 0000000..a701c72
17 +++ b/include/asm-arm/arch-mx51/mmu.h
20 + * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
24 + * The code contained herein is licensed under the GNU General Public
25 + * License. You may obtain a copy of the GNU General Public License
26 + * Version 2 or later at the following locations:
28 + * http://www.opensource.org/licenses/gpl-license.html
29 + * http://www.gnu.org/copyleft/gpl.html
32 +#ifndef __ARM_ARCH_MMU_H
33 +#define __ARM_ARCH_MMU_H
36 + * Translation Table Base Bit Masks
38 +#define ARM_TRANSLATION_TABLE_MASK 0xFFFFC000
41 + * Domain Access Control Bit Masks
43 +#define ARM_ACCESS_TYPE_NO_ACCESS(domain_num) (0x0 << (domain_num)*2)
44 +#define ARM_ACCESS_TYPE_CLIENT(domain_num) (0x1 << (domain_num)*2)
45 +#define ARM_ACCESS_TYPE_MANAGER(domain_num) (0x3 << (domain_num)*2)
47 +struct ARM_MMU_FIRST_LEVEL_FAULT {
49 + unsigned int sbz:30;
52 +#define ARM_MMU_FIRST_LEVEL_FAULT_ID 0x0
54 +struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE {
57 + unsigned int domain:4;
59 + unsigned int base_address:23;
62 +#define ARM_MMU_FIRST_LEVEL_PAGE_TABLE_ID 0x1
64 +struct ARM_MMU_FIRST_LEVEL_SECTION {
69 + unsigned int domain:4;
70 + unsigned int sbz0:1;
72 + unsigned int sbz1:8;
73 + unsigned int base_address:12;
76 +#define ARM_MMU_FIRST_LEVEL_SECTION_ID 0x2
78 +struct ARM_MMU_FIRST_LEVEL_RESERVED {
80 + unsigned int sbz:30;
83 +#define ARM_MMU_FIRST_LEVEL_RESERVED_ID 0x3
85 +#define ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, table_index) \
86 + (unsigned long *)((unsigned long)(ttb_base) + ((table_index) << 2))
88 +#define ARM_FIRST_LEVEL_PAGE_TABLE_SIZE 0x4000
90 +#define ARM_MMU_SECTION(ttb_base, actual_base, virtual_base, \
91 + cacheable, bufferable, perm) \
93 + register union ARM_MMU_FIRST_LEVEL_DESCRIPTOR desc; \
95 + desc.section.id = ARM_MMU_FIRST_LEVEL_SECTION_ID; \
96 + desc.section.domain = 0; \
97 + desc.section.c = (cacheable); \
98 + desc.section.b = (bufferable); \
99 + desc.section.ap = (perm); \
100 + desc.section.base_address = (actual_base); \
101 + *ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, (virtual_base)) \
105 +#define X_ARM_MMU_SECTION(abase, vbase, size, cache, buff, access) \
107 + int i; int j = abase; int k = vbase; \
108 + for (i = size; i > 0 ; i--, j++, k++) \
109 + ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access); \
112 +union ARM_MMU_FIRST_LEVEL_DESCRIPTOR {
113 + unsigned long word;
114 + struct ARM_MMU_FIRST_LEVEL_FAULT fault;
115 + struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE page_table;
116 + struct ARM_MMU_FIRST_LEVEL_SECTION section;
117 + struct ARM_MMU_FIRST_LEVEL_RESERVED reserved;
120 +#define ARM_UNCACHEABLE 0
121 +#define ARM_CACHEABLE 1
122 +#define ARM_UNBUFFERABLE 0
123 +#define ARM_BUFFERABLE 1
125 +#define ARM_ACCESS_PERM_NONE_NONE 0
126 +#define ARM_ACCESS_PERM_RO_NONE 0
127 +#define ARM_ACCESS_PERM_RO_RO 0
128 +#define ARM_ACCESS_PERM_RW_NONE 1
129 +#define ARM_ACCESS_PERM_RW_RO 2
130 +#define ARM_ACCESS_PERM_RW_RW 3
133 + * Initialization for the Domain Access Control Register
135 +#define ARM_ACCESS_DACR_DEFAULT ( \
136 + ARM_ACCESS_TYPE_MANAGER(0) | \
137 + ARM_ACCESS_TYPE_NO_ACCESS(1) | \
138 + ARM_ACCESS_TYPE_NO_ACCESS(2) | \
139 + ARM_ACCESS_TYPE_NO_ACCESS(3) | \
140 + ARM_ACCESS_TYPE_NO_ACCESS(4) | \
141 + ARM_ACCESS_TYPE_NO_ACCESS(5) | \
142 + ARM_ACCESS_TYPE_NO_ACCESS(6) | \
143 + ARM_ACCESS_TYPE_NO_ACCESS(7) | \
144 + ARM_ACCESS_TYPE_NO_ACCESS(8) | \
145 + ARM_ACCESS_TYPE_NO_ACCESS(9) | \
146 + ARM_ACCESS_TYPE_NO_ACCESS(10) | \
147 + ARM_ACCESS_TYPE_NO_ACCESS(11) | \
148 + ARM_ACCESS_TYPE_NO_ACCESS(12) | \
149 + ARM_ACCESS_TYPE_NO_ACCESS(13) | \
150 + ARM_ACCESS_TYPE_NO_ACCESS(14) | \
151 + ARM_ACCESS_TYPE_NO_ACCESS(15))