blob: 44acebaa2bbd99a9d837ed0ad209420e9cb7de07 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Poonam Aggrwala2ec1352011-02-09 19:17:53 +00002/*
3 * Copyright 2010-2011 Freescale Semiconductor, Inc.
Poonam Aggrwala2ec1352011-02-09 19:17:53 +00004 */
5
Tom Rinidec7ea02024-05-20 13:35:03 -06006#include <config.h>
Poonam Aggrwala2ec1352011-02-09 19:17:53 +00007#include <asm/mmu.h>
Tom Rinidec7ea02024-05-20 13:35:03 -06008#include <asm/ppc.h>
Poonam Aggrwala2ec1352011-02-09 19:17:53 +00009
10struct fsl_e_tlb_entry tlb_table[] = {
11 /* TLB 0 - for temp stack in cache */
Tom Rini6a5dccc2022-11-16 13:10:41 -050012 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR, CFG_SYS_INIT_RAM_ADDR,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000013 MAS3_SX|MAS3_SW|MAS3_SR, 0,
14 0, 0, BOOKE_PAGESZ_4K, 0),
Tom Rini6a5dccc2022-11-16 13:10:41 -050015 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR + 4 * 1024 ,
16 CFG_SYS_INIT_RAM_ADDR + 4 * 1024,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000017 MAS3_SX|MAS3_SW|MAS3_SR, 0,
18 0, 0, BOOKE_PAGESZ_4K, 0),
Tom Rini6a5dccc2022-11-16 13:10:41 -050019 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR + 8 * 1024 ,
20 CFG_SYS_INIT_RAM_ADDR + 8 * 1024,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000021 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 ,
24 CFG_SYS_INIT_RAM_ADDR + 12 * 1024,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000025 MAS3_SX|MAS3_SW|MAS3_SR, 0,
26 0, 0, BOOKE_PAGESZ_4K, 0),
27
28 /* TLB 1 */
29 /* *I*** - Covers boot page */
Prabhakar Kushwahad6a7aba2013-05-07 11:19:55 +053030 SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
31 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
32 0, 0, BOOKE_PAGESZ_4K, 1),
Prabhakar Kushwahaafffcb02013-12-11 12:42:11 +053033#ifdef CONFIG_SPL_NAND_BOOT
Prabhakar Kushwaha66d6aa82013-04-16 13:28:12 +053034 SET_TLB_ENTRY(1, 0xffffe000, 0xffffe000,
35 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Prabhakar Kushwahad6a7aba2013-05-07 11:19:55 +053036 0, 10, BOOKE_PAGESZ_4K, 1),
37#endif
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000038
39 /* *I*G* - CCSRBAR */
Tom Rini6a5dccc2022-11-16 13:10:41 -050040 SET_TLB_ENTRY(1, CFG_SYS_CCSRBAR, CFG_SYS_CCSRBAR_PHYS,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000041 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
42 0, 1, BOOKE_PAGESZ_1M, 1),
43
Prabhakar Kushwaha66d6aa82013-04-16 13:28:12 +053044#ifndef CONFIG_SPL_BUILD
Tom Rini6a5dccc2022-11-16 13:10:41 -050045 SET_TLB_ENTRY(1, CFG_SYS_FLASH_BASE, CFG_SYS_FLASH_BASE_PHYS,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000046 MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
47 0, 2, BOOKE_PAGESZ_16M, 1),
48
Tom Rini6a5dccc2022-11-16 13:10:41 -050049 SET_TLB_ENTRY(1, CFG_SYS_FLASH_BASE + 0x1000000,
50 CFG_SYS_FLASH_BASE_PHYS + 0x1000000,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000051 MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
52 0, 3, BOOKE_PAGESZ_16M, 1),
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000053
Prabhakar Kushwaha5b029e92013-05-17 14:22:34 +053054#ifdef CONFIG_PCI
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000055 /* *I*G* - PCI */
Tom Rini56af6592022-11-16 13:10:33 -050056 SET_TLB_ENTRY(1, CFG_SYS_PCIE1_MEM_VIRT, CFG_SYS_PCIE1_MEM_PHYS,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000057 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
58 0, 4, BOOKE_PAGESZ_1G, 1),
59
60 /* *I*G* - PCI I/O */
Tom Rini56af6592022-11-16 13:10:33 -050061 SET_TLB_ENTRY(1, CFG_SYS_PCIE1_IO_VIRT, CFG_SYS_PCIE1_IO_PHYS,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000062 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
63 0, 5, BOOKE_PAGESZ_256K, 1),
64#endif
65#endif
66
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000067 /* *I*G - Board CPLD */
Tom Rini6a5dccc2022-11-16 13:10:41 -050068 SET_TLB_ENTRY(1, CFG_SYS_CPLD_BASE, CFG_SYS_CPLD_BASE_PHYS,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000069 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
70 0, 6, BOOKE_PAGESZ_256K, 1),
71
Tom Rinib4213492022-11-12 17:36:51 -050072 SET_TLB_ENTRY(1, CFG_SYS_NAND_BASE, CFG_SYS_NAND_BASE_PHYS,
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000073 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
74 0, 7, BOOKE_PAGESZ_1M, 1),
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000075
Tom Rinif8f6b322022-05-21 14:44:28 -040076#if defined(CONFIG_SYS_RAMBOOT) || !CONFIG_IS_ENABLED(COMMON_INIT_DDR)
Tom Rini6a5dccc2022-11-16 13:10:41 -050077 SET_TLB_ENTRY(1, CFG_SYS_DDR_SDRAM_BASE, CFG_SYS_DDR_SDRAM_BASE,
York Sun05204d02017-12-05 10:57:54 -080078 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
Ying Zhang1233cbc2014-01-24 15:50:09 +080079 0, 8, BOOKE_PAGESZ_1G, 1),
80#endif
81
Tom Rini6a5dccc2022-11-16 13:10:41 -050082#ifdef CFG_SYS_INIT_L2_ADDR
Ying Zhang1233cbc2014-01-24 15:50:09 +080083 /* *I*G - L2SRAM */
Tom Rini6a5dccc2022-11-16 13:10:41 -050084 SET_TLB_ENTRY(1, CFG_SYS_INIT_L2_ADDR, CFG_SYS_INIT_L2_ADDR_PHYS,
Ying Zhang1233cbc2014-01-24 15:50:09 +080085 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_G,
86 0, 11, BOOKE_PAGESZ_256K, 1)
Poonam Aggrwala2ec1352011-02-09 19:17:53 +000087#endif
88};
89
90int num_tlb_entries = ARRAY_SIZE(tlb_table);