blob: 577878cf7672a90f4c246025db0e871462552a33 [file] [log] [blame]
Kumar Gala129ba612008-08-12 11:13:08 -05001/*
Kumar Galacb14e932010-11-12 08:22:01 -06002 * Copyright 2008-2010 Freescale Semiconductor, Inc.
Kumar Gala129ba612008-08-12 11:13:08 -05003 *
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+
Kumar Gala129ba612008-08-12 11:13:08 -05008 */
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 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020015 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
Kumar Gala129ba612008-08-12 11:13:08 -050016 MAS3_SX|MAS3_SW|MAS3_SR, 0,
17 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020018 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
Kumar Gala129ba612008-08-12 11:13:08 -050019 MAS3_SX|MAS3_SW|MAS3_SR, 0,
20 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020021 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
Kumar Gala129ba612008-08-12 11:13:08 -050022 MAS3_SX|MAS3_SW|MAS3_SR, 0,
23 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020024 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
Kumar Gala129ba612008-08-12 11:13:08 -050025 MAS3_SX|MAS3_SW|MAS3_SR, 0,
26 0, 0, BOOKE_PAGESZ_4K, 0),
27
Kumar Gala129ba612008-08-12 11:13:08 -050028 /* TLB 1 */
29 /* *I*** - Covers boot page */
30 SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
Kumar Galaabc76eb2009-11-17 20:21:20 -060031 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Kumar Gala129ba612008-08-12 11:13:08 -050032 0, 0, BOOKE_PAGESZ_4K, 1),
33
34 /* *I*G* - CCSRBAR */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020035 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Kumar Gala129ba612008-08-12 11:13:08 -050036 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
37 0, 1, BOOKE_PAGESZ_1M, 1),
38
39 /* W**G* - Flash/promjet, localbus */
40 /* This will be changed to *I*G* after relocation to RAM. */
Kumar Galac953ddf2008-12-02 14:19:34 -060041 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
Kumar Gala7c0d4a72008-09-22 14:11:11 -050042 MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
Kumar Gala129ba612008-08-12 11:13:08 -050043 0, 2, BOOKE_PAGESZ_256M, 1),
44
Kumar Galae4382ac2011-11-08 11:03:54 -060045#ifndef CONFIG_NAND_SPL
Kumar Gala129ba612008-08-12 11:13:08 -050046 /* *I*G* - PCI */
Kumar Gala5af0fdd2008-12-02 16:08:39 -060047 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT, CONFIG_SYS_PCIE3_MEM_PHYS,
Kumar Gala129ba612008-08-12 11:13:08 -050048 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
49 0, 3, BOOKE_PAGESZ_1G, 1),
50
51 /* *I*G* - PCI */
Kumar Gala5af0fdd2008-12-02 16:08:39 -060052 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x40000000, CONFIG_SYS_PCIE3_MEM_PHYS + 0x40000000,
Kumar Gala129ba612008-08-12 11:13:08 -050053 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
54 0, 4, BOOKE_PAGESZ_256M, 1),
55
Kumar Gala5af0fdd2008-12-02 16:08:39 -060056 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x50000000, CONFIG_SYS_PCIE3_MEM_PHYS + 0x50000000,
Kumar Gala129ba612008-08-12 11:13:08 -050057 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
58 0, 5, BOOKE_PAGESZ_256M, 1),
59
60 /* *I*G* - PCI I/O */
Kumar Galaaca5f012008-12-02 16:08:40 -060061 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_IO_VIRT, CONFIG_SYS_PCIE3_IO_PHYS,
Kumar Gala129ba612008-08-12 11:13:08 -050062 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
63 0, 6, BOOKE_PAGESZ_256K, 1),
Kumar Galae4382ac2011-11-08 11:03:54 -060064#endif
Haiying Wangc013b742008-10-29 13:32:59 -040065
66 /* *I*G - NAND */
67 SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE_PHYS,
68 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
69 0, 7, BOOKE_PAGESZ_1M, 1),
70
Kumar Gala52b565f2008-12-02 14:19:33 -060071 SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
Haiying Wangb5f65df2009-01-13 16:29:28 -050072 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
73 0, 8, BOOKE_PAGESZ_4K, 1),
Kumar Galacb14e932010-11-12 08:22:01 -060074
75#if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
76 /* *I*G - L2SRAM */
77 SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR,
78 CONFIG_SYS_INIT_L2_ADDR_PHYS,
79 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
80 0, 9, BOOKE_PAGESZ_256K, 1),
81 SET_TLB_ENTRY(1, CONFIG_SYS_INIT_L2_ADDR + 0x40000,
82 CONFIG_SYS_INIT_L2_ADDR_PHYS + 0x40000,
83 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
84 0, 10, BOOKE_PAGESZ_256K, 1),
85#endif
Kumar Gala129ba612008-08-12 11:13:08 -050086};
87
88int num_tlb_entries = ARRAY_SIZE(tlb_table);