blob: 1847935a73761b646437c9299e321b818086ef6a [file] [log] [blame]
Poonam Aggrwal728ece32009-08-05 13:29:24 +05301/*
Prabhakar Kushwahab7070902011-01-19 10:52:04 +05302 * Copyright 2011 Freescale Semiconductor, Inc.
Poonam Aggrwal728ece32009-08-05 13:29:24 +05303 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23#include <common.h>
24#include <asm/mmu.h>
25
26struct fsl_e_tlb_entry tlb_table[] = {
27 /* TLB 0 - for temp stack in cache */
Poonam Aggrwale0082f72011-02-09 20:05:29 +000028 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,
29 CONFIG_SYS_INIT_RAM_ADDR_PHYS,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053030 MAS3_SX|MAS3_SW|MAS3_SR, 0,
31 0, 0, BOOKE_PAGESZ_4K, 0),
32 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 ,
Poonam Aggrwale0082f72011-02-09 20:05:29 +000033 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053034 MAS3_SX|MAS3_SW|MAS3_SR, 0,
35 0, 0, BOOKE_PAGESZ_4K, 0),
36 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 ,
Poonam Aggrwale0082f72011-02-09 20:05:29 +000037 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053038 MAS3_SX|MAS3_SW|MAS3_SR, 0,
39 0, 0, BOOKE_PAGESZ_4K, 0),
40 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 ,
Poonam Aggrwale0082f72011-02-09 20:05:29 +000041 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053042 MAS3_SX|MAS3_SW|MAS3_SR, 0,
43 0, 0, BOOKE_PAGESZ_4K, 0),
44
45 /* TLB 1 */
46 /* *I*** - Covers boot page */
47 SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
Kumar Galaabc76eb2009-11-17 20:21:20 -060048 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053049 0, 0, BOOKE_PAGESZ_4K, 1),
50
51 /* *I*G* - CCSRBAR */
52 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
53 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
54 0, 1, BOOKE_PAGESZ_1M, 1),
55
56 /* W**G* - Flash/promjet, localbus */
57 /* This will be changed to *I*G* after relocation to RAM. */
58 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
59 MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
60 0, 2, BOOKE_PAGESZ_16M, 1),
61
Prabhakar Kushwahab7070902011-01-19 10:52:04 +053062#if defined(CONFIG_PCI)
Poonam Aggrwal728ece32009-08-05 13:29:24 +053063 /* *I*G* - PCI */
Prabhakar Kushwahab0c5ceb2011-03-23 04:21:13 -050064 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053065 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
66 0, 3, BOOKE_PAGESZ_1G, 1),
67
68 /* *I*G* - PCI I/O */
Prabhakar Kushwahab0c5ceb2011-03-23 04:21:13 -050069 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053070 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
71 0, 4, BOOKE_PAGESZ_256K, 1),
72
Prabhakar Kushwahab7070902011-01-19 10:52:04 +053073#endif /* #if defined(CONFIG_PCI) */
Poonam Aggrwal728ece32009-08-05 13:29:24 +053074 /* *I*G - NAND */
75 SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
76 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
77 0, 5, BOOKE_PAGESZ_1M, 1),
78
79 /* *I*G - VSC7385 Switch */
80 SET_TLB_ENTRY(1, CONFIG_SYS_VSC7385_BASE, CONFIG_SYS_VSC7385_BASE_PHYS,
81 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
82 0, 6, BOOKE_PAGESZ_1M, 1),
83
Priyanka Jain0c871e952011-02-08 13:13:15 +053084#if defined(CONFIG_SYS_RAMBOOT)
85 SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
86 MAS3_SX|MAS3_SW|MAS3_SR, 0,
87 0, 7, BOOKE_PAGESZ_1G, 1)
Dipen Dudhatf7780ec2009-10-08 13:33:18 +053088#endif
Poonam Aggrwal728ece32009-08-05 13:29:24 +053089};
90
91int num_tlb_entries = ARRAY_SIZE(tlb_table);