blob: 8d1e5fee9365c073b08f66112106ab98d40ed6b9 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kumar Gala0db37dc2008-01-17 01:01:09 -06002/*
Kumar Gala8b47d7e2011-01-04 17:57:59 -06003 * Copyright 2008, 2011 Freescale Semiconductor, Inc.
Kumar Gala0db37dc2008-01-17 01:01:09 -06004 *
5 * (C) Copyright 2000
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Kumar Gala0db37dc2008-01-17 01:01:09 -06007 */
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 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020014 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
Kumar Gala0db37dc2008-01-17 01:01:09 -060015 MAS3_SX|MAS3_SW|MAS3_SR, 0,
16 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020017 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
Kumar Gala0db37dc2008-01-17 01:01:09 -060018 MAS3_SX|MAS3_SW|MAS3_SR, 0,
19 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020020 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
Kumar Gala0db37dc2008-01-17 01:01:09 -060021 MAS3_SX|MAS3_SW|MAS3_SR, 0,
22 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020023 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
Kumar Gala0db37dc2008-01-17 01:01:09 -060024 MAS3_SX|MAS3_SW|MAS3_SR, 0,
25 0, 0, BOOKE_PAGESZ_4K, 0),
26
chenhui zhaofff80972011-10-13 13:40:59 +080027 /* TLB 1 */
Kumar Gala0db37dc2008-01-17 01:01:09 -060028 /*
chenhui zhaofff80972011-10-13 13:40:59 +080029 * Entry 0:
30 * FLASH(cover boot page) 16M Non-cacheable, guarded
Kumar Gala0db37dc2008-01-17 01:01:09 -060031 */
chenhui zhaofff80972011-10-13 13:40:59 +080032 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
Kumar Gala0db37dc2008-01-17 01:01:09 -060033 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
34 0, 0, BOOKE_PAGESZ_16M, 1),
35
36 /*
chenhui zhaofff80972011-10-13 13:40:59 +080037 * Entry 1:
38 * CCSRBAR 1M Non-cacheable, guarded
Kumar Gala0db37dc2008-01-17 01:01:09 -060039 */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020040 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Kumar Gala0db37dc2008-01-17 01:01:09 -060041 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaofff80972011-10-13 13:40:59 +080042 0, 1, BOOKE_PAGESZ_1M, 1),
Kumar Gala0db37dc2008-01-17 01:01:09 -060043
44 /*
chenhui zhaofff80972011-10-13 13:40:59 +080045 * Entry 2:
46 * LBC SDRAM 64M Cacheable, non-guarded
Kumar Gala0db37dc2008-01-17 01:01:09 -060047 */
chenhui zhaofff80972011-10-13 13:40:59 +080048 SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE,
49 CONFIG_SYS_LBC_SDRAM_BASE_PHYS,
York Sun316f0d02017-12-05 10:57:54 -080050 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
chenhui zhaofff80972011-10-13 13:40:59 +080051 0, 2, BOOKE_PAGESZ_64M, 1),
Kumar Gala0db37dc2008-01-17 01:01:09 -060052
53 /*
chenhui zhaofff80972011-10-13 13:40:59 +080054 * Entry 3:
55 * CADMUS registers 1M Non-cacheable, guarded
Kumar Gala0db37dc2008-01-17 01:01:09 -060056 */
chenhui zhaofff80972011-10-13 13:40:59 +080057 SET_TLB_ENTRY(1, CADMUS_BASE_ADDR, CADMUS_BASE_ADDR_PHYS,
Kumar Gala0db37dc2008-01-17 01:01:09 -060058 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaofff80972011-10-13 13:40:59 +080059 0, 3, BOOKE_PAGESZ_1M, 1),
60
61 /*
62 * Entry 4:
63 * PCI and PCIe MEM 1G Non-cacheable, guarded
64 */
65 SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS,
66 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
67 0, 4, BOOKE_PAGESZ_1G, 1),
68
69 /*
70 * Entry 5:
71 * PCI1 IO 1M Non-cacheable, guarded
72 */
73 SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_IO_VIRT, CONFIG_SYS_PCI1_IO_PHYS,
74 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
75 0, 5, BOOKE_PAGESZ_1M, 1),
76
77 /*
78 * Entry 6:
79 * PCIe IO 1M Non-cacheable, guarded
80 */
81 SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
82 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
83 0, 6, BOOKE_PAGESZ_1M, 1),
Kumar Gala0db37dc2008-01-17 01:01:09 -060084};
85
86int num_tlb_entries = ARRAY_SIZE(tlb_table);