blob: fea1606a1d3f162d5e69c184e5c26b270a12a99e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Kumar Gala9b1b7692008-01-17 01:12:22 -06002/*
3 * Copyright 2008 Freescale Semiconductor, Inc.
4 *
5 * (C) Copyright 2000
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Kumar Gala9b1b7692008-01-17 01:12:22 -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 Gala9b1b7692008-01-17 01:12:22 -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 Gala9b1b7692008-01-17 01:12:22 -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 Gala9b1b7692008-01-17 01:12:22 -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 Gala9b1b7692008-01-17 01:12:22 -060024 MAS3_SX|MAS3_SW|MAS3_SR, 0,
25 0, 0, BOOKE_PAGESZ_4K, 0),
26
27 /* TLB 1 Initializations */
28 /*
29 * TLBe 0: 16M Non-cacheable, guarded
30 * 0xff000000 16M FLASH (upper half)
31 * Out of reset this entry is only 4K.
32 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020033 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE + 0x1000000, CONFIG_SYS_FLASH_BASE + 0x1000000,
Kumar Gala9b1b7692008-01-17 01:12:22 -060034 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
35 0, 0, BOOKE_PAGESZ_16M, 1),
36
37 /*
38 * TLBe 1: 16M Non-cacheable, guarded
39 * 0xfe000000 16M FLASH (lower half)
40 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020041 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE,
Kumar Gala9b1b7692008-01-17 01:12:22 -060042 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
43 0, 1, BOOKE_PAGESZ_16M, 1),
44
45 /*
46 * TLBe 2: 1G Non-cacheable, guarded
47 * 0x80000000 512M PCI1 MEM
Wolfgang Denka1be4762008-05-20 16:00:29 +020048 * 0xa0000000 512M PCIe MEM
Kumar Gala9b1b7692008-01-17 01:12:22 -060049 */
Kumar Galaef43b6e2008-12-02 16:08:39 -060050 SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_VIRT, CONFIG_SYS_PCI1_MEM_PHYS,
Kumar Gala9b1b7692008-01-17 01:12:22 -060051 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
52 0, 2, BOOKE_PAGESZ_1G, 1),
53
54 /*
55 * TLBe 3: 64M Non-cacheable, guarded
56 * 0xe000_0000 1M CCSRBAR
57 * 0xe200_0000 8M PCI1 IO
58 * 0xe280_0000 8M PCIe IO
59 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020060 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Kumar Gala9b1b7692008-01-17 01:12:22 -060061 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
62 0, 3, BOOKE_PAGESZ_64M, 1),
63
64 /*
65 * TLBe 4: 64M Cacheable, non-guarded
66 * 0xf000_0000 64M LBC SDRAM
67 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020068 SET_TLB_ENTRY(1, CONFIG_SYS_LBC_SDRAM_BASE, CONFIG_SYS_LBC_SDRAM_BASE,
York Sun05204d02017-12-05 10:57:54 -080069 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
Kumar Gala9b1b7692008-01-17 01:12:22 -060070 0, 4, BOOKE_PAGESZ_64M, 1),
71
72 /*
73 * TLBe 5: 256K Non-cacheable, guarded
74 * 0xf8000000 32K BCSR
75 * 0xf8008000 32K PIB (CS4)
76 * 0xf8010000 32K PIB (CS5)
77 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020078 SET_TLB_ENTRY(1, CONFIG_SYS_BCSR_BASE, CONFIG_SYS_BCSR_BASE,
Kumar Gala9b1b7692008-01-17 01:12:22 -060079 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
80 0, 5, BOOKE_PAGESZ_256K, 1),
81};
82
83int num_tlb_entries = ARRAY_SIZE(tlb_table);