blob: 0b2afa8054d81105e79387f68fca1a51764d1758 [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
Tom Rinidec7ea02024-05-20 13:35:03 -06009#include <config.h>
Kumar Gala1242b882008-01-17 01:01:09 -060010#include <asm/mmu.h>
Tom Rinidec7ea02024-05-20 13:35:03 -060011#include <asm/ppc.h>
Kumar Gala1242b882008-01-17 01:01:09 -060012
13struct fsl_e_tlb_entry tlb_table[] = {
14 /* TLB 0 - for temp stack in cache */
Tom Rini6a5dccc2022-11-16 13:10:41 -050015 SET_TLB_ENTRY(0, CFG_SYS_INIT_RAM_ADDR, CFG_SYS_INIT_RAM_ADDR,
Kumar Gala1242b882008-01-17 01:01:09 -060016 MAS3_SX|MAS3_SW|MAS3_SR, 0,
17 0, 0, BOOKE_PAGESZ_4K, 0),
Tom Rini6a5dccc2022-11-16 13:10:41 -050018 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 -060019 MAS3_SX|MAS3_SW|MAS3_SR, 0,
20 0, 0, BOOKE_PAGESZ_4K, 0),
Tom Rini6a5dccc2022-11-16 13:10:41 -050021 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 -060022 MAS3_SX|MAS3_SW|MAS3_SR, 0,
23 0, 0, BOOKE_PAGESZ_4K, 0),
Tom Rini6a5dccc2022-11-16 13:10:41 -050024 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 -060025 MAS3_SX|MAS3_SW|MAS3_SR, 0,
26 0, 0, BOOKE_PAGESZ_4K, 0),
27
chenhui zhaoe97171e2011-10-13 13:40:59 +080028 /* TLB 1 */
Kumar Gala1242b882008-01-17 01:01:09 -060029 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080030 * Entry 0:
31 * FLASH(cover boot page) 16M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060032 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050033 SET_TLB_ENTRY(1, CFG_SYS_FLASH_BASE, CFG_SYS_FLASH_BASE_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060034 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
35 0, 0, BOOKE_PAGESZ_16M, 1),
36
37 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080038 * Entry 1:
39 * CCSRBAR 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060040 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050041 SET_TLB_ENTRY(1, CFG_SYS_CCSRBAR, CFG_SYS_CCSRBAR_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060042 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaoe97171e2011-10-13 13:40:59 +080043 0, 1, BOOKE_PAGESZ_1M, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060044
Kumar Gala1242b882008-01-17 01:01:09 -060045 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080046 * Entry 2:
47 * LBC SDRAM 64M Cacheable, non-guarded
Kumar Gala1242b882008-01-17 01:01:09 -060048 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050049 SET_TLB_ENTRY(1, CFG_SYS_LBC_SDRAM_BASE,
50 CFG_SYS_LBC_SDRAM_BASE_PHYS,
York Sun05204d02017-12-05 10:57:54 -080051 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
chenhui zhaoe97171e2011-10-13 13:40:59 +080052 0, 2, BOOKE_PAGESZ_64M, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060053
54 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080055 * Entry 3:
56 * CADMUS registers 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060057 */
chenhui zhaoe97171e2011-10-13 13:40:59 +080058 SET_TLB_ENTRY(1, CADMUS_BASE_ADDR, CADMUS_BASE_ADDR_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060059 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaoe97171e2011-10-13 13:40:59 +080060 0, 3, BOOKE_PAGESZ_1M, 1),
Kumar Galaad4e9d42011-01-04 17:57:59 -060061
Kumar Gala1242b882008-01-17 01:01:09 -060062 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080063 * Entry 4:
64 * PCI and PCIe MEM 1G Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060065 */
Tom Rini56af6592022-11-16 13:10:33 -050066 SET_TLB_ENTRY(1, CFG_SYS_PCI1_MEM_VIRT, CFG_SYS_PCI1_MEM_PHYS,
Kumar Gala1242b882008-01-17 01:01:09 -060067 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
chenhui zhaoe97171e2011-10-13 13:40:59 +080068 0, 4, BOOKE_PAGESZ_1G, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060069
70 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080071 * Entry 5:
72 * PCI1 IO 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060073 */
Tom Rini56af6592022-11-16 13:10:33 -050074 SET_TLB_ENTRY(1, CFG_SYS_PCI1_IO_VIRT, CFG_SYS_PCI1_IO_PHYS,
chenhui zhaoe97171e2011-10-13 13:40:59 +080075 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
76 0, 5, BOOKE_PAGESZ_1M, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060077
78 /*
chenhui zhaoe97171e2011-10-13 13:40:59 +080079 * Entry 6:
80 * PCIe IO 1M Non-cacheable, guarded
Kumar Gala1242b882008-01-17 01:01:09 -060081 */
Tom Rini56af6592022-11-16 13:10:33 -050082 SET_TLB_ENTRY(1, CFG_SYS_PCIE1_IO_VIRT, CFG_SYS_PCIE1_IO_PHYS,
chenhui zhaoe97171e2011-10-13 13:40:59 +080083 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
84 0, 6, BOOKE_PAGESZ_1M, 1),
Kumar Gala1242b882008-01-17 01:01:09 -060085};
86
87int num_tlb_entries = ARRAY_SIZE(tlb_table);