blob: 1328a589cbcb9905754e2a67f46f0e80127ab5d2 [file] [log] [blame]
Haiying Wang765547d2009-03-27 17:02:45 -04001/*
Haiying Wang3aed5502010-09-29 13:31:35 -04002 * Copyright 2009-2010 Freescale Semiconductor, Inc.
Haiying Wang765547d2009-03-27 17:02:45 -04003 *
4 * (C) Copyright 2000
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Haiying Wang765547d2009-03-27 17:02:45 -04008 */
9
10#include <common.h>
11#include <asm/mmu.h>
12
13struct fsl_e_tlb_entry tlb_table[] = {
14 /* TLB 0 - for temp stack in cache */
15 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
16 MAS3_SX|MAS3_SW|MAS3_SR, 0,
17 0, 0, BOOKE_PAGESZ_4K, 0),
18 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
19 CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
20 MAS3_SX|MAS3_SW|MAS3_SR, 0,
21 0, 0, BOOKE_PAGESZ_4K, 0),
22 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
23 CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
24 MAS3_SX|MAS3_SW|MAS3_SR, 0,
25 0, 0, BOOKE_PAGESZ_4K, 0),
26 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
27 CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
28 MAS3_SX|MAS3_SW|MAS3_SR, 0,
29 0, 0, BOOKE_PAGESZ_4K, 0),
30
31 /* TLB 1 Initializations */
32 /*
Haiying Wang3aed5502010-09-29 13:31:35 -040033 * TLBe 0: 64M write-through, guarded
Haiying Wang765547d2009-03-27 17:02:45 -040034 * Out of reset this entry is only 4K.
Haiying Wang3aed5502010-09-29 13:31:35 -040035 * 0xfc000000 32MB NAND FLASH (CS3)
36 * 0xfe000000 32MB NOR FLASH (CS0)
Haiying Wang765547d2009-03-27 17:02:45 -040037 */
Haiying Wang3aed5502010-09-29 13:31:35 -040038#ifdef CONFIG_NAND_SPL
Anton Vorontsova29155e2009-10-15 17:47:08 +040039 SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE,
Haiying Wang765547d2009-03-27 17:02:45 -040040 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Haiying Wang3aed5502010-09-29 13:31:35 -040041 0, 0, BOOKE_PAGESZ_1M, 1),
42#else
43 SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE,
44 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_W|MAS2_G,
Anton Vorontsova29155e2009-10-15 17:47:08 +040045 0, 0, BOOKE_PAGESZ_64M, 1),
Haiying Wang3aed5502010-09-29 13:31:35 -040046#endif
Haiying Wang765547d2009-03-27 17:02:45 -040047 /*
Anton Vorontsova29155e2009-10-15 17:47:08 +040048 * TLBe 1: 256KB Non-cacheable, guarded
49 * 0xf8000000 32K BCSR
50 * 0xf8008000 32K PIB (CS4)
51 * 0xf8010000 32K PIB (CS5)
Haiying Wang765547d2009-03-27 17:02:45 -040052 */
Anton Vorontsova29155e2009-10-15 17:47:08 +040053 SET_TLB_ENTRY(1, CONFIG_SYS_BCSR_BASE, CONFIG_SYS_BCSR_BASE_PHYS,
Haiying Wang765547d2009-03-27 17:02:45 -040054 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Anton Vorontsova29155e2009-10-15 17:47:08 +040055 0, 1, BOOKE_PAGESZ_256K, 1),
Haiying Wang765547d2009-03-27 17:02:45 -040056
57 /*
58 * TLBe 2: 256M Non-cacheable, guarded
59 * 0xa00000000 256M PCIe MEM (lower half)
60 */
61 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS,
62 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
63 0, 2, BOOKE_PAGESZ_256M, 1),
64
65 /*
66 * TLBe 3: 256M Non-cacheable, guarded
67 * 0xb00000000 256M PCIe MEM (higher half)
68 */
69 SET_TLB_ENTRY(1, (CONFIG_SYS_PCIE1_MEM_VIRT + 0x10000000),
70 (CONFIG_SYS_PCIE1_MEM_PHYS + 0x10000000),
71 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
72 0, 3, BOOKE_PAGESZ_256M, 1),
73
74 /*
75 * TLBe 4: 64M Non-cacheable, guarded
76 * 0xe000_0000 1M CCSRBAR
77 * 0xe280_0000 8M PCIe IO
78 */
79 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
80 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
81 0, 4, BOOKE_PAGESZ_64M, 1),
Liu Yu674ef7b2010-01-18 19:03:28 +080082
83#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
84 /* *I*G - L2SRAM */
85 SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
86 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
87 0, 5, BOOKE_PAGESZ_256K, 1),
88 SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
89 CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
90 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
91 0, 6, BOOKE_PAGESZ_256K, 1),
92#endif
Haiying Wang765547d2009-03-27 17:02:45 -040093};
94
95int num_tlb_entries = ARRAY_SIZE(tlb_table);