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