10db37dc2SKumar Gala /*
28b47d7ecSKumar Gala  * Copyright 2008, 2011 Freescale Semiconductor, Inc.
30db37dc2SKumar Gala  *
40db37dc2SKumar Gala  * (C) Copyright 2000
50db37dc2SKumar Gala  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
60db37dc2SKumar Gala  *
71a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
80db37dc2SKumar Gala  */
90db37dc2SKumar Gala 
100db37dc2SKumar Gala #include <common.h>
110db37dc2SKumar Gala #include <asm/mmu.h>
120db37dc2SKumar Gala 
130db37dc2SKumar Gala struct fsl_e_tlb_entry tlb_table[] = {
140db37dc2SKumar Gala 	/* TLB 0 - for temp stack in cache */
156d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
160db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
170db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
186d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
190db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
200db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
216d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
220db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
230db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
246d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
250db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
260db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_4K, 0),
270db37dc2SKumar Gala 
28fff80975Schenhui zhao 	/* TLB 1 */
290db37dc2SKumar Gala 	/*
30fff80975Schenhui zhao 	 * Entry 0:
31fff80975Schenhui zhao 	 * FLASH(cover boot page)	16M	Non-cacheable, guarded
320db37dc2SKumar Gala 	 */
33fff80975Schenhui zhao 	SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
340db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
350db37dc2SKumar Gala 		      0, 0, BOOKE_PAGESZ_16M, 1),
360db37dc2SKumar Gala 
370db37dc2SKumar Gala 	/*
38fff80975Schenhui zhao 	 * Entry 1:
39fff80975Schenhui zhao 	 * CCSRBAR	1M	Non-cacheable, guarded
400db37dc2SKumar Gala 	 */
416d0f6bcfSJean-Christophe PLAGNIOL-VILLARD 	SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
420db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
43fff80975Schenhui zhao 		      0, 1, BOOKE_PAGESZ_1M, 1),
440db37dc2SKumar Gala 
450db37dc2SKumar Gala 	/*
46fff80975Schenhui zhao 	 * Entry 2:
47fff80975Schenhui zhao 	 * LBC SDRAM	64M	Cacheable, non-guarded
480db37dc2SKumar Gala 	 */
49fff80975Schenhui zhao 	SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE,
50fff80975Schenhui zhao 		      CONFIG_SYS_LBC_SDRAM_BASE_PHYS,
51*316f0d0fSYork Sun 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
52fff80975Schenhui zhao 		      0, 2, BOOKE_PAGESZ_64M, 1),
530db37dc2SKumar Gala 
540db37dc2SKumar Gala 	/*
55fff80975Schenhui zhao 	 * Entry 3:
56fff80975Schenhui zhao 	 * CADMUS registers	1M	Non-cacheable, guarded
570db37dc2SKumar Gala 	 */
58fff80975Schenhui zhao 	SET_TLB_ENTRY(1, CADMUS_BASE_ADDR, CADMUS_BASE_ADDR_PHYS,
590db37dc2SKumar Gala 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
60fff80975Schenhui zhao 		      0, 3, BOOKE_PAGESZ_1M, 1),
61fff80975Schenhui zhao 
62fff80975Schenhui zhao 	/*
63fff80975Schenhui zhao 	 * Entry 4:
64fff80975Schenhui zhao 	 * PCI and PCIe MEM	1G	Non-cacheable, guarded
65fff80975Schenhui zhao 	 */
66fff80975Schenhui zhao 	SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS,
67fff80975Schenhui zhao 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
68fff80975Schenhui zhao 		      0, 4, BOOKE_PAGESZ_1G, 1),
69fff80975Schenhui zhao 
70fff80975Schenhui zhao 	/*
71fff80975Schenhui zhao 	 * Entry 5:
72fff80975Schenhui zhao 	 * PCI1 IO	1M	Non-cacheable, guarded
73fff80975Schenhui zhao 	 */
74fff80975Schenhui zhao 	SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_IO_VIRT, CONFIG_SYS_PCI1_IO_PHYS,
75fff80975Schenhui zhao 		      MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
76fff80975Schenhui zhao 		      0, 5, BOOKE_PAGESZ_1M, 1),
77fff80975Schenhui zhao 
78fff80975Schenhui zhao 	/*
79fff80975Schenhui zhao 	 * Entry 6:
80fff80975Schenhui zhao 	 * PCIe IO	1M	Non-cacheable, guarded
81fff80975Schenhui zhao 	 */
82fff80975Schenhui zhao 	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
83fff80975Schenhui zhao 		      MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
84fff80975Schenhui zhao 		      0, 6, BOOKE_PAGESZ_1M, 1),
850db37dc2SKumar Gala };
860db37dc2SKumar Gala 
870db37dc2SKumar Gala int num_tlb_entries = ARRAY_SIZE(tlb_table);
88