blob: de80c3c0e5734625cbcd22726ab9d0017b42bb06 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +02002/*
3 * (C) Copyright 2008
4 * Sergei Poselenov, Emcraft Systems, sposelenov@emcraft.com.
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc.
7 *
8 * (C) Copyright 2000
9 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020010 */
11
12#include <common.h>
13#include <asm/mmu.h>
14
15struct fsl_e_tlb_entry tlb_table[] = {
16 /* TLB 0 - for temp stack in cache */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020017 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020018 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 + 4 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020021 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 + 8 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020024 MAS3_SX|MAS3_SW|MAS3_SR, 0,
25 0, 0, BOOKE_PAGESZ_4K, 0),
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020026 SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020027 MAS3_SX|MAS3_SW|MAS3_SR, 0,
28 0, 0, BOOKE_PAGESZ_4K, 0),
29
30
31 /*
Anatolij Gustschine6f5c912008-08-15 15:42:13 +020032 * TLB 1: 64M Non-cacheable, guarded
Sergei Poselenov96dd16b2008-06-06 15:42:41 +020033 * 0xfc000000 64M FLASH
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020034 * Out of reset this entry is only 4K.
35 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020036 SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020037 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
38 0, 1, BOOKE_PAGESZ_64M, 1),
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020039
40 /*
41 * TLB 2: 256M Non-cacheable, guarded
42 * 0x80000000 256M PCI1 MEM First half
43 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020044 SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_PHYS, CONFIG_SYS_PCI1_MEM_PHYS,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020045 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
46 0, 2, BOOKE_PAGESZ_256M, 1),
47
48 /*
49 * TLB 3: 256M Non-cacheable, guarded
50 * 0x90000000 256M PCI1 MEM Second half
51 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020052 SET_TLB_ENTRY(1, CONFIG_SYS_PCI1_MEM_PHYS + 0x10000000, CONFIG_SYS_PCI1_MEM_PHYS + 0x10000000,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020053 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
54 0, 3, BOOKE_PAGESZ_256M, 1),
55
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020056#if defined(CONFIG_SYS_FPGA_BASE)
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020057 /*
Sergei Poselenov96dd16b2008-06-06 15:42:41 +020058 * TLB 4: 1M Non-cacheable, guarded
59 * 0xc0000000 1M FPGA and NAND
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020060 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020061 SET_TLB_ENTRY(1, CONFIG_SYS_FPGA_BASE, CONFIG_SYS_FPGA_BASE,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020062 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
Sergei Poselenov96dd16b2008-06-06 15:42:41 +020063 0, 4, BOOKE_PAGESZ_1M, 1),
64#endif
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020065
66 /*
Anatolij Gustschine6f5c912008-08-15 15:42:13 +020067 * TLB 5: 64M Non-cacheable, guarded
68 * 0xc8000000 16M LIME GDC framebuffer
69 * 0xc9fc0000 256K LIME GDC MMIO
70 * (0xcbfc0000 256K LIME GDC MMIO)
71 * MMIO is relocatable and could be at 0xcbfc0000
72 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020073 SET_TLB_ENTRY(1, CONFIG_SYS_LIME_BASE, CONFIG_SYS_LIME_BASE,
Anatolij Gustschine6f5c912008-08-15 15:42:13 +020074 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
75 0, 5, BOOKE_PAGESZ_64M, 1),
76
77 /*
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020078 * TLB 6: 64M Non-cacheable, guarded
79 * 0xe000_0000 1M CCSRBAR
80 * 0xe200_0000 16M PCI1 IO
81 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020082 SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020083 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
84 0, 6, BOOKE_PAGESZ_64M, 1),
85
Anatolij Gustschina49dccd2008-11-13 18:08:57 +010086#if !defined(CONFIG_SPD_EEPROM)
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020087 /*
88 * TLB 7+8: 512M DDR, cache disabled (needed for memory test)
89 * 0x00000000 512M DDR System memory
90 * Without SPD EEPROM configured DDR, this must be setup manually.
91 * Make sure the TLB count at the top of this table is correct.
92 * Likely it needs to be increased by two for these entries.
93 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020094 SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE, CONFIG_SYS_DDR_SDRAM_BASE,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020095 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
96 0, 7, BOOKE_PAGESZ_256M, 1),
97
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020098 SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000, CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000,
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +020099 MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
100 0, 8, BOOKE_PAGESZ_256M, 1),
Anatolij Gustschina49dccd2008-11-13 18:08:57 +0100101#endif
Sergei Poselenovf2bf96c2008-04-30 11:42:50 +0200102};
103
104int num_tlb_entries = ARRAY_SIZE(tlb_table);