blob: 8d1e5fee9365c073b08f66112106ab98d40ed6b9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kumar Gala1242b882008-01-17 01:01:09 -06002/*
Kumar Galaad4e9d42011-01-04 17:57:59 -06003 * Copyright 2008, 2011 Freescale Semiconductor, Inc.
Kumar Gala1242b882008-01-17 01:01:09 -06004 *
5 * (C) Copyright 2000
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Kumar Gala1242b882008-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-VILLARD03836942008-10-16 15:01:15 +020014 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
Kumar Gala1242b882008-01-17 01:01:09 -060015 MAS3_SX|MAS3_SW|MAS3_SR, 0,
16 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD03836942008-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 Gala1242b882008-01-17 01:01:09 -060018 MAS3_SX|MAS3_SW|MAS3_SR, 0,
19 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD03836942008-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 Gala1242b882008-01-17 01:01:09 -060021 MAS3_SX|MAS3_SW|MAS3_SR, 0,
22 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD03836942008-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 Gala1242b882008-01-17 01:01:09 -060024 MAS3_SX|MAS3_SW|MAS3_SR, 0,
25 0, 0, BOOKE_PAGESZ_4K, 0),
26
chenhui zhaoe97171e2011-10-13 13:40:59 +080027 /* TLB 1 */
Kumar Gala1242b882008-01-17 01:01:09 -060028 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080029 * Entry 0:
30 * FLASH(cover boot page) 16M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060031 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080032 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
Kumar Gala1242b882008-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 zhaoe97171e2011-10-13 13:40:59 +080037 * Entry 1:
38 * CCSRBAR 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060039 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080040 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060041 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaoe97171e2011-10-13 13:40:59 +080042 0, 1, BOOKE_PAGESZ_1M, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060043
Kumar Gala1242b882008-01-17 01:01:09 -060044 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080045 * Entry 2:
46 * LBC SDRAM 64M Cacheable, non-guarded
Kumar Gala1242b882008-01-17 01:01:09 -060047 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080048 SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE,
49 CONFIG_SYS_LBC_SDRAM_BASE_PHYS,
York Sun05204d02017-12-05 10:57:54 -080050 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
chenhui zhaoe97171e2011-10-13 13:40:59 +080051 0, 2, BOOKE_PAGESZ_64M, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060052
53 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080054 * Entry 3:
55 * CADMUS registers 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060056 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080057 SET_TLB_ENTRY(1, CADMUS_BASE_ADDR, CADMUS_BASE_ADDR_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060058 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaoe97171e2011-10-13 13:40:59 +080059 0, 3, BOOKE_PAGESZ_1M, 1),
Kumar Galaad4e9d42011-01-04 17:57:59 -060060
Kumar Gala1242b882008-01-17 01:01:09 -060061 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080062 * Entry 4:
63 * PCI and PCIe MEM 1G Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060064 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080065 SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060066 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaoe97171e2011-10-13 13:40:59 +080067 0, 4, BOOKE_PAGESZ_1G, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060068
69 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080070 * Entry 5:
71 * PCI1 IO 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060072 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080073 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),
Kumar Gala1242b882008-01-17 01:01:09 -060076
77 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080078 * Entry 6:
79 * PCIe IO 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060080 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080081 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 Gala1242b882008-01-17 01:01:09 -060084};
85
86int num_tlb_entries = ARRAY_SIZE(tlb_table);