10db37dc2SKumar Gala /*
20db37dc2SKumar Gala  * Copyright 2008 Freescale Semiconductor, Inc.
30db37dc2SKumar Gala  *
40db37dc2SKumar Gala  * (C) Copyright 2000
50db37dc2SKumar Gala  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
60db37dc2SKumar Gala  *
70db37dc2SKumar Gala  * See file CREDITS for list of people who contributed to this
80db37dc2SKumar Gala  * project.
90db37dc2SKumar Gala  *
100db37dc2SKumar Gala  * This program is free software; you can redistribute it and/or
110db37dc2SKumar Gala  * modify it under the terms of the GNU General Public License as
120db37dc2SKumar Gala  * published by the Free Software Foundation; either version 2 of
130db37dc2SKumar Gala  * the License, or (at your option) any later version.
140db37dc2SKumar Gala  *
150db37dc2SKumar Gala  * This program is distributed in the hope that it will be useful,
160db37dc2SKumar Gala  * but WITHOUT ANY WARRANTY; without even the implied warranty of
170db37dc2SKumar Gala  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
180db37dc2SKumar Gala  * GNU General Public License for more details.
190db37dc2SKumar Gala  *
200db37dc2SKumar Gala  * You should have received a copy of the GNU General Public License
210db37dc2SKumar Gala  * along with this program; if not, write to the Free Software
220db37dc2SKumar Gala  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
230db37dc2SKumar Gala  * MA 02111-1307 USA
240db37dc2SKumar Gala  */
250db37dc2SKumar Gala 
260db37dc2SKumar Gala #include <common.h>
270db37dc2SKumar Gala #include <asm/mmu.h>
280db37dc2SKumar Gala 
290db37dc2SKumar Gala struct fsl_e_tlb_entry tlb_table[] = {
300db37dc2SKumar Gala 	/* TLB 0 - for temp stack in cache */
31*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
320db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
330db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
34*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
350db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
360db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
37*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
380db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
390db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
40*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
410db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
420db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
430db37dc2SKumar Gala 
440db37dc2SKumar Gala 	/*
450db37dc2SKumar Gala 	 * TLB 0:	16M	Non-cacheable, guarded
460db37dc2SKumar Gala 	 * 0xff000000	16M	FLASH
470db37dc2SKumar Gala 	 * Out of reset this entry is only 4K.
480db37dc2SKumar Gala 	 */
49*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_BOOT_BLOCK, CONFIG_SYS_BOOT_BLOCK,
500db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
510db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_16M, 1),
520db37dc2SKumar Gala 
530db37dc2SKumar Gala 	/*
540db37dc2SKumar Gala 	 * TLB 1:	1G	Non-cacheable, guarded
550db37dc2SKumar Gala 	 * 0x80000000	1G	PCI1/PCIE  8,9,a,b
560db37dc2SKumar Gala 	 */
57*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_PCI_PHYS, CONFIG_SYS_PCI_PHYS,
580db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
590db37dc2SKumar Gala 		      0, 1, BOOKE_PAGESZ_1G, 1),
600db37dc2SKumar Gala 
61*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_RIO_MEM_PHYS
620db37dc2SKumar Gala 	/*
630db37dc2SKumar Gala 	 * TLB 2:	256M	Non-cacheable, guarded
640db37dc2SKumar Gala 	 */
65*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_RIO_MEM_BASE, CONFIG_SYS_RIO_MEM_BASE,
660db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
670db37dc2SKumar Gala 		      0, 2, BOOKE_PAGESZ_256M, 1),
680db37dc2SKumar Gala 
690db37dc2SKumar Gala 	/*
700db37dc2SKumar Gala 	 * TLB 3:	256M	Non-cacheable, guarded
710db37dc2SKumar Gala 	 */
72*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_RIO_MEM_BASE + 0x10000000, CONFIG_SYS_RIO_MEM_BASE + 0x10000000,
730db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
740db37dc2SKumar Gala 		      0, 3, BOOKE_PAGESZ_256M, 1),
750db37dc2SKumar Gala #endif
760db37dc2SKumar Gala 	/*
770db37dc2SKumar Gala 	 * TLB 5:	64M	Non-cacheable, guarded
780db37dc2SKumar Gala 	 * 0xe000_0000	1M	CCSRBAR
790db37dc2SKumar Gala 	 * 0xe200_0000	1M	PCI1 IO
800db37dc2SKumar Gala 	 * 0xe210_0000	1M	PCI2 IO
810db37dc2SKumar Gala 	 * 0xe300_0000	1M	PCIe IO
820db37dc2SKumar Gala 	 */
83*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
840db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
850db37dc2SKumar Gala 		      0, 5, BOOKE_PAGESZ_64M, 1),
860db37dc2SKumar Gala 
870db37dc2SKumar Gala 	/*
880db37dc2SKumar Gala 	 * TLB 6:	64M	Cacheable, non-guarded
890db37dc2SKumar Gala 	 * 0xf000_0000	64M	LBC SDRAM
900db37dc2SKumar Gala 	 */
91*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_LBC_CACHE_BASE, CONFIG_SYS_LBC_CACHE_BASE,
920db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
930db37dc2SKumar Gala 		      0, 6, BOOKE_PAGESZ_64M, 1),
940db37dc2SKumar Gala 
950db37dc2SKumar Gala 	/*
960db37dc2SKumar Gala 	 * TLB 7:	64M	Non-cacheable, guarded
970db37dc2SKumar Gala 	 * 0xf8000000	64M	CADMUS registers, relocated L2SRAM
980db37dc2SKumar Gala 	 */
99*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_LBC_NONCACHE_BASE, CONFIG_SYS_LBC_NONCACHE_BASE,
1000db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
1010db37dc2SKumar Gala 		      0, 7, BOOKE_PAGESZ_64M, 1),
1020db37dc2SKumar Gala };
1030db37dc2SKumar Gala 
1040db37dc2SKumar Gala int num_tlb_entries = ARRAY_SIZE(tlb_table);
105