blob: 994a32dd92ad04267c9dca1c3c8b813b2f13a989 [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 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050014 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR, CFG_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),
Tom Rini6a5dccc2022-11-16 13:10:41 -050017 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR + 4 * 1024 , CFG_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),
Tom Rini6a5dccc2022-11-16 13:10:41 -050020 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR + 8 * 1024 , CFG_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),
Tom Rini6a5dccc2022-11-16 13:10:41 -050023 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR + 12 * 1024 , CFG_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 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050032 SET_TLB_ENTRY(1, CFG_SYS_FLASH_BASE, CFG_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 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050040 SET_TLB_ENTRY(1, CFG_SYS_CCSRBAR, CFG_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 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050048 SET_TLB_ENTRY(1, CFG_SYS_LBC_SDRAM_BASE,
49 CFG_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 */
Tom Rini56af6592022-11-16 13:10:33 -050065 SET_TLB_ENTRY(1, CFG_SYS_PCI1_MEM_VIRT, CFG_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 */
Tom Rini56af6592022-11-16 13:10:33 -050073 SET_TLB_ENTRY(1, CFG_SYS_PCI1_IO_VIRT, CFG_SYS_PCI1_IO_PHYS,
chenhui zhaoe97171e2011-10-13 13:40:59 +080074 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 */
Tom Rini56af6592022-11-16 13:10:33 -050081 SET_TLB_ENTRY(1, CFG_SYS_PCIE1_IO_VIRT, CFG_SYS_PCIE1_IO_PHYS,
chenhui zhaoe97171e2011-10-13 13:40:59 +080082 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);