blob: bc98972e33264557a0f06cc1755998bfc7a0fe5f [file] [log] [blame]
Poonam Aggrwal987862c2009-08-05 13:29:24 +05301/*
Prabhakar Kushwaha750007b2011-01-19 10:52:04 +05302 * Copyright 2011 Freescale Semiconductor, Inc.
Poonam Aggrwal987862c2009-08-05 13:29:24 +05303 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Poonam Aggrwal987862c2009-08-05 13:29:24 +05305 */
6
7#include <common.h>
8#include <asm/mmu.h>
9
10struct fsl_e_tlb_entry tlb_table[] = {
11 /* TLB 0 - for temp stack in cache */
Poonam Aggrwalc4b852a2011-02-09 20:05:29 +000012 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,
13 CONFIG_SYS_INIT_RAM_ADDR_PHYS,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053014 MAS3_SX|MAS3_SW|MAS3_SR, 0,
15 0, 0, BOOKE_PAGESZ_4K, 0),
16 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 ,
Poonam Aggrwalc4b852a2011-02-09 20:05:29 +000017 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053018 MAS3_SX|MAS3_SW|MAS3_SR, 0,
19 0, 0, BOOKE_PAGESZ_4K, 0),
20 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 ,
Poonam Aggrwalc4b852a2011-02-09 20:05:29 +000021 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053022 MAS3_SX|MAS3_SW|MAS3_SR, 0,
23 0, 0, BOOKE_PAGESZ_4K, 0),
24 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 ,
Poonam Aggrwalc4b852a2011-02-09 20:05:29 +000025 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053026 MAS3_SX|MAS3_SW|MAS3_SR, 0,
27 0, 0, BOOKE_PAGESZ_4K, 0),
28
29 /* TLB 1 */
30 /* *I*** - Covers boot page */
31 SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
Kumar Gala4756ffa2009-11-17 20:21:20 -060032 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053033 0, 0, BOOKE_PAGESZ_4K, 1),
34
35 /* *I*G* - CCSRBAR */
36 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
37 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
38 0, 1, BOOKE_PAGESZ_1M, 1),
39
40 /* W**G* - Flash/promjet, localbus */
41 /* This will be changed to *I*G* after relocation to RAM. */
42 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
43 MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
44 0, 2, BOOKE_PAGESZ_16M, 1),
45
Prabhakar Kushwaha750007b2011-01-19 10:52:04 +053046#if defined(CONFIG_PCI)
Poonam Aggrwal987862c2009-08-05 13:29:24 +053047 /* *I*G* - PCI */
Prabhakar Kushwahaa14909d2011-03-23 04:21:13 -050048 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053049 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
50 0, 3, BOOKE_PAGESZ_1G, 1),
51
52 /* *I*G* - PCI I/O */
Prabhakar Kushwahaa14909d2011-03-23 04:21:13 -050053 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
Poonam Aggrwal987862c2009-08-05 13:29:24 +053054 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
55 0, 4, BOOKE_PAGESZ_256K, 1),
56
Prabhakar Kushwaha750007b2011-01-19 10:52:04 +053057#endif /* #if defined(CONFIG_PCI) */
Poonam Aggrwal987862c2009-08-05 13:29:24 +053058 /* *I*G - NAND */
59 SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
60 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
61 0, 5, BOOKE_PAGESZ_1M, 1),
62
63 /* *I*G - VSC7385 Switch */
64 SET_TLB_ENTRY(1, CONFIG_SYS_VSC7385_BASE, CONFIG_SYS_VSC7385_BASE_PHYS,
65 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
66 0, 6, BOOKE_PAGESZ_1M, 1),
67
Priyanka Jain56a98992011-02-08 13:13:15 +053068#if defined(CONFIG_SYS_RAMBOOT)
69 SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
70 MAS3_SX|MAS3_SW|MAS3_SR, 0,
71 0, 7, BOOKE_PAGESZ_1G, 1)
Dipen Dudhate98a3fc2009-10-08 13:33:18 +053072#endif
Poonam Aggrwal987862c2009-08-05 13:29:24 +053073};
74
75int num_tlb_entries = ARRAY_SIZE(tlb_table);