blob: f9f8cc9a01e828de413ee66d4d6aa9ae1b7dd54d [file] [log] [blame]
Kumar Gala3b558e22008-01-17 02:02:10 -06001/*
2 * Copyright 2008 Freescale Semiconductor, Inc.
3 *
4 * (C) Copyright 2000
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25
26#include <common.h>
27#include <asm/mmu.h>
28
29struct fsl_e_tlb_entry tlb_table[] = {
30 /* TLB 0 - for temp stack in cache */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020031 SET_TLB_ENTRY (0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020032 MAS3_SX | MAS3_SW | MAS3_SR, 0,
33 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020034 SET_TLB_ENTRY (0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
35 CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020036 MAS3_SX | MAS3_SW | MAS3_SR, 0,
37 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020038 SET_TLB_ENTRY (0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
39 CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020040 MAS3_SX | MAS3_SW | MAS3_SR, 0,
41 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020042 SET_TLB_ENTRY (0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
43 CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020044 MAS3_SX | MAS3_SW | MAS3_SR, 0,
45 0, 0, BOOKE_PAGESZ_4K, 0),
Kumar Gala3b558e22008-01-17 02:02:10 -060046
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +020047#ifndef CONFIG_TQM_BIGFLASH
Kumar Gala3b558e22008-01-17 02:02:10 -060048 /*
49 * TLB 0, 1: 128M Non-cacheable, guarded
50 * 0xf8000000 128M FLASH
51 * Out of reset this entry is only 4K.
52 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020053 SET_TLB_ENTRY (1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020054 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
55 0, 1, BOOKE_PAGESZ_64M, 1),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020056 SET_TLB_ENTRY (1, CONFIG_SYS_FLASH_BASE + 0x4000000,
57 CONFIG_SYS_FLASH_BASE + 0x4000000,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020058 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
59 0, 0, BOOKE_PAGESZ_64M, 1),
Kumar Gala3b558e22008-01-17 02:02:10 -060060
61 /*
62 * TLB 2: 256M Non-cacheable, guarded
63 * 0x80000000 256M PCI1 MEM First half
64 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020065 SET_TLB_ENTRY (1, CONFIG_SYS_PCI1_MEM_PHYS, CONFIG_SYS_PCI1_MEM_PHYS,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020066 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
67 0, 2, BOOKE_PAGESZ_256M, 1),
Kumar Gala3b558e22008-01-17 02:02:10 -060068
69 /*
70 * TLB 3: 256M Non-cacheable, guarded
71 * 0x90000000 256M PCI1 MEM Second half
72 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020073 SET_TLB_ENTRY (1, CONFIG_SYS_PCI1_MEM_PHYS + 0x10000000,
74 CONFIG_SYS_PCI1_MEM_PHYS + 0x10000000,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +020075 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
76 0, 3, BOOKE_PAGESZ_256M, 1),
Kumar Gala3b558e22008-01-17 02:02:10 -060077
Wolfgang Grandeggerb9e80782008-06-05 13:12:08 +020078#ifdef CONFIG_PCIE1
79 /*
80 * TLB 4: 256M Non-cacheable, guarded
81 * 0xc0000000 256M PCI express MEM First half
82 */
Peter Tyser06412752010-09-29 13:37:28 -050083 SET_TLB_ENTRY (1, CONFIG_SYS_PCIE1_MEM_BUS, CONFIG_SYS_PCIE1_MEM_BUS,
Wolfgang Grandeggerb9e80782008-06-05 13:12:08 +020084 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
85 0, 4, BOOKE_PAGESZ_256M, 1),
86
87 /*
88 * TLB 5: 256M Non-cacheable, guarded
89 * 0xd0000000 256M PCI express MEM Second half
90 */
Peter Tyser06412752010-09-29 13:37:28 -050091 SET_TLB_ENTRY (1, CONFIG_SYS_PCIE1_MEM_BUS + 0x10000000,
92 CONFIG_SYS_PCIE1_MEM_BUS + 0x10000000,
Wolfgang Grandeggerb9e80782008-06-05 13:12:08 +020093 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
94 0, 5, BOOKE_PAGESZ_256M, 1),
95#else /* !CONFIG_PCIE */
Kumar Gala3b558e22008-01-17 02:02:10 -060096 /*
97 * TLB 4: 256M Non-cacheable, guarded
98 * 0xc0000000 256M Rapid IO MEM First half
99 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200100 SET_TLB_ENTRY (1, CONFIG_SYS_RIO_MEM_BASE, CONFIG_SYS_RIO_MEM_BASE,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +0200101 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
102 0, 4, BOOKE_PAGESZ_256M, 1),
Kumar Gala3b558e22008-01-17 02:02:10 -0600103
104 /*
105 * TLB 5: 256M Non-cacheable, guarded
106 * 0xd0000000 256M Rapid IO MEM Second half
107 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200108 SET_TLB_ENTRY (1, CONFIG_SYS_RIO_MEM_BASE + 0x10000000,
109 CONFIG_SYS_RIO_MEM_BASE + 0x10000000,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +0200110 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
111 0, 5, BOOKE_PAGESZ_256M, 1),
Wolfgang Grandeggerb9e80782008-06-05 13:12:08 +0200112#endif /* CONFIG_PCIE */
Kumar Gala3b558e22008-01-17 02:02:10 -0600113
114 /*
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +0200115 * TLB 6: 64M Non-cacheable, guarded
116 * 0xe0000000 1M CCSRBAR
117 * 0xe2000000 16M PCI1 IO
Wolfgang Grandegger1c2deff2008-06-05 13:12:09 +0200118 * 0xe3000000 16M CAN and NAND Flash
Kumar Gala3b558e22008-01-17 02:02:10 -0600119 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200120 SET_TLB_ENTRY (1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +0200121 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
122 0, 6, BOOKE_PAGESZ_64M, 1),
Wolfgang Grandeggerb9e80782008-06-05 13:12:08 +0200123#ifdef CONFIG_PCIE1
124 /*
125 * TLB 9: 16M Non-cacheable, guarded
126 * 0xef000000 16M PCI express IO
127 */
Peter Tyser06412752010-09-29 13:37:28 -0500128 SET_TLB_ENTRY (1, CONFIG_SYS_PCIE1_IO_BUS, CONFIG_SYS_PCIE1_IO_BUS,
Wolfgang Grandeggerb9e80782008-06-05 13:12:08 +0200129 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
130 0, 9, BOOKE_PAGESZ_16M, 1),
131#endif /* CONFIG_PCIE */
132
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200133#else /* CONFIG_TQM_BIGFLASH */
134
135 /*
136 * TLB 0,1,2,3: 1G Non-cacheable, guarded
137 * 0xc0000000 1G FLASH
138 * Out of reset this entry is only 4K.
139 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200140 SET_TLB_ENTRY (1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200141 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
142 0, 3, BOOKE_PAGESZ_256M, 1),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200143 SET_TLB_ENTRY (1, CONFIG_SYS_FLASH_BASE + 0x10000000,
144 CONFIG_SYS_FLASH_BASE + 0x10000000,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200145 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
146 0, 2, BOOKE_PAGESZ_256M, 1),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200147 SET_TLB_ENTRY (1, CONFIG_SYS_FLASH_BASE + 0x20000000,
148 CONFIG_SYS_FLASH_BASE + 0x20000000,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200149 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
150 0, 1, BOOKE_PAGESZ_256M, 1),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200151 SET_TLB_ENTRY (1, CONFIG_SYS_FLASH_BASE + 0x30000000,
152 CONFIG_SYS_FLASH_BASE + 0x30000000,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200153 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
154 0, 0, BOOKE_PAGESZ_256M, 1),
155
156 /*
157 * TLB 4: 256M Non-cacheable, guarded
158 * 0x80000000 256M PCI1 MEM First half
159 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200160 SET_TLB_ENTRY (1, CONFIG_SYS_PCI1_MEM_PHYS, CONFIG_SYS_PCI1_MEM_PHYS,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200161 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
162 0, 4, BOOKE_PAGESZ_256M, 1),
163
164 /*
165 * TLB 5: 256M Non-cacheable, guarded
166 * 0x90000000 256M PCI1 MEM Second half
167 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200168 SET_TLB_ENTRY (1, CONFIG_SYS_PCI1_MEM_PHYS + 0x10000000,
169 CONFIG_SYS_PCI1_MEM_PHYS + 0x10000000,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200170 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
171 0, 5, BOOKE_PAGESZ_256M, 1),
172
173#ifdef CONFIG_PCIE1
174 /*
175 * TLB 6: 256M Non-cacheable, guarded
176 * 0xc0000000 256M PCI express MEM First half
177 */
Peter Tyser06412752010-09-29 13:37:28 -0500178 SET_TLB_ENTRY (1, CONFIG_SYS_PCIE1_MEM_BUS, CONFIG_SYS_PCIE1_MEM_BUS,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200179 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
180 0, 6, BOOKE_PAGESZ_256M, 1),
181#else /* !CONFIG_PCIE */
182 /*
183 * TLB 6: 256M Non-cacheable, guarded
184 * 0xb0000000 256M Rapid IO MEM First half
185 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200186 SET_TLB_ENTRY (1, CONFIG_SYS_RIO_MEM_BASE, CONFIG_SYS_RIO_MEM_BASE,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200187 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
188 0, 6, BOOKE_PAGESZ_256M, 1),
189
190#endif /* CONFIG_PCIE */
191
192 /*
193 * TLB 7: 64M Non-cacheable, guarded
194 * 0xa0000000 1M CCSRBAR
195 * 0xa2000000 16M PCI1 IO
196 * 0xa3000000 16M CAN and NAND Flash
197 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200198 SET_TLB_ENTRY (1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200199 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
200 0, 7, BOOKE_PAGESZ_64M, 1),
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200201#ifdef CONFIG_PCIE1
202 /*
203 * TLB 10: 16M Non-cacheable, guarded
204 * 0xaf000000 16M PCI express IO
205 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200206 SET_TLB_ENTRY (1, CONFIG_SYS_PCIE1_IO_BASE, CONFIG_SYS_PCIE1_IO_BASE,
Wolfgang Grandeggere8cc3f02008-06-05 13:12:10 +0200207 MAS3_SX | MAS3_SW | MAS3_SR, MAS2_I | MAS2_G,
208 0, 10, BOOKE_PAGESZ_16M, 1),
209#endif /* CONFIG_PCIE */
210
211#endif /* CONFIG_TQM_BIGFLASH */
Kumar Gala3b558e22008-01-17 02:02:10 -0600212};
213
Wolfgang Grandeggerb99ba162008-06-05 13:12:00 +0200214int num_tlb_entries = ARRAY_SIZE (tlb_table);