blob: 73f5729ef56be45c8fbd419c809836a3a604e165 [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 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Poonam Aggrwal728ece32009-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 Aggrwale0082f72011-02-09 20:05:29 +000012 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,
13 CONFIG_SYS_INIT_RAM_ADDR_PHYS,
Poonam Aggrwal728ece32009-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 Aggrwale0082f72011-02-09 20:05:29 +000017 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024,
Poonam Aggrwal728ece32009-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 Aggrwale0082f72011-02-09 20:05:29 +000021 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024,
Poonam Aggrwal728ece32009-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 Aggrwale0082f72011-02-09 20:05:29 +000025 CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024,
Poonam Aggrwal728ece32009-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 Galaabc76eb2009-11-17 20:21:20 -060032 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Poonam Aggrwal728ece32009-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
Prabhakar Kushwahabc2d40c2014-05-15 16:43:12 +053040#ifndef CONFIG_SPL_BUILD
Poonam Aggrwal728ece32009-08-05 13:29:24 +053041 /* W**G* - Flash/promjet, localbus */
42 /* This will be changed to *I*G* after relocation to RAM. */
43 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
44 MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
45 0, 2, BOOKE_PAGESZ_16M, 1),
46
Prabhakar Kushwahab7070902011-01-19 10:52:04 +053047#if defined(CONFIG_PCI)
Poonam Aggrwal728ece32009-08-05 13:29:24 +053048 /* *I*G* - PCI */
Prabhakar Kushwahab0c5ceb2011-03-23 04:21:13 -050049 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053050 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
51 0, 3, BOOKE_PAGESZ_1G, 1),
52
53 /* *I*G* - PCI I/O */
Prabhakar Kushwahab0c5ceb2011-03-23 04:21:13 -050054 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
Poonam Aggrwal728ece32009-08-05 13:29:24 +053055 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
56 0, 4, BOOKE_PAGESZ_256K, 1),
57
Prabhakar Kushwahab7070902011-01-19 10:52:04 +053058#endif /* #if defined(CONFIG_PCI) */
Prabhakar Kushwahabc2d40c2014-05-15 16:43:12 +053059#endif
Poonam Aggrwal728ece32009-08-05 13:29:24 +053060 /* *I*G - NAND */
61 SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
62 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
63 0, 5, BOOKE_PAGESZ_1M, 1),
64
65 /* *I*G - VSC7385 Switch */
66 SET_TLB_ENTRY(1, CONFIG_SYS_VSC7385_BASE, CONFIG_SYS_VSC7385_BASE_PHYS,
67 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
68 0, 6, BOOKE_PAGESZ_1M, 1),
69
Prabhakar Kushwahabc2d40c2014-05-15 16:43:12 +053070#ifdef CONFIG_SYS_INIT_L2_ADDR
71 /* *I*G - L2SRAM */
72 SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR, CONFIG_SYS_INIT_L2_ADDR_PHYS,
73 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_G,
74 0, 11, BOOKE_PAGESZ_256K, 1),
75#if CONFIG_SYS_L2_SIZE >= (256 << 10)
76 SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
77 CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
78 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
79 0, 12, BOOKE_PAGESZ_256K, 1),
80#endif
81#endif
82
83#if defined(CONFIG_SYS_RAMBOOT) || \
84 (defined(CONFIG_SPL) && !defined(CONFIG_SPL_COMMON_INIT_DDR))
Priyanka Jain0c871e952011-02-08 13:13:15 +053085 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);