blob: 20c5bddf6be2738f9e8bec272df4bd9ceb675898 [file] [log] [blame]
Larry Johnsonc591dff2007-12-27 11:28:51 -05001/*
2 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02003 * SPDX-License-Identifier: GPL-2.0+
Larry Johnsonc591dff2007-12-27 11:28:51 -05004 */
5
Wolfgang Denk25ddd1f2010-10-26 14:34:52 +02006#include <asm-offsets.h>
Larry Johnsonc591dff2007-12-27 11:28:51 -05007#include <ppc_asm.tmpl>
Peter Tyser61f2b382010-04-12 22:28:07 -05008#include <asm/mmu.h>
Larry Johnsonc591dff2007-12-27 11:28:51 -05009#include <config.h>
10
11/**************************************************************************
12 * TLB TABLE
13 *
14 * This table is used by the cpu boot code to setup the initial tlb
15 * entries. Rather than make broad assumptions in the cpu source tree,
16 * this table lets each board set things up however they like.
17 *
18 * Pointer to the table is returned in r1
19 *
20 *************************************************************************/
21 .section .bootpg,"ax"
22 .globl tlbtab
23
24tlbtab:
25 tlbtab_start
26
27 /*
28 * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
29 * speed up boot process. It is patched after relocation to enable SA_I
30 */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020031 tlbentry( 0xF0000000, SZ_256M, 0xF0000000, 1, AC_RWX | SA_G )
Larry Johnsonc591dff2007-12-27 11:28:51 -050032
33 /*
34 * TLB entries for SDRAM are not needed on this platform. They are
35 * generated dynamically in the SPD DDR2 detection routine.
36 */
37
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020038#ifdef CONFIG_SYS_INIT_RAM_DCACHE
Larry Johnsonc591dff2007-12-27 11:28:51 -050039 /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020040 tlbentry( CONFIG_SYS_INIT_RAM_ADDR, SZ_64K, CONFIG_SYS_INIT_RAM_ADDR, 0,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020041 AC_RWX | SA_G )
Larry Johnsonc591dff2007-12-27 11:28:51 -050042#endif
43
44 /* TLB-entry for PCI Memory */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020045 tlbentry( CONFIG_SYS_PCI_MEMBASE + 0x00000000, SZ_256M,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020046 CONFIG_SYS_PCI_MEMBASE + 0x00000000, 1, AC_RW | SA_IG )
Larry Johnson6433fa22008-03-17 11:10:35 -050047
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020048 tlbentry( CONFIG_SYS_PCI_MEMBASE + 0x10000000, SZ_256M,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020049 CONFIG_SYS_PCI_MEMBASE + 0x10000000, 1, AC_RW | SA_IG )
Larry Johnson6433fa22008-03-17 11:10:35 -050050
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020051 tlbentry( CONFIG_SYS_PCI_MEMBASE + 0x20000000, SZ_256M,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020052 CONFIG_SYS_PCI_MEMBASE + 0x20000000, 1, AC_RW | SA_IG )
Larry Johnson6433fa22008-03-17 11:10:35 -050053
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020054 tlbentry( CONFIG_SYS_PCI_MEMBASE + 0x30000000, SZ_256M,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020055 CONFIG_SYS_PCI_MEMBASE + 0x30000000, 1, AC_RW | SA_IG )
Larry Johnsonc591dff2007-12-27 11:28:51 -050056
57 /* TLB-entry for EBC */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020058 tlbentry( CONFIG_SYS_CPLD_BASE, SZ_1K, CONFIG_SYS_CPLD_BASE, 1, AC_RW | SA_IG )
Larry Johnsonc591dff2007-12-27 11:28:51 -050059
60 /* TLB-entry for Internal Registers & OCM */
61 /* I wonder why this must be executable -- lrj@acm.org 2007-10-08 */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020062 tlbentry( 0xE0000000, SZ_16M, 0xE0000000, 0, AC_RWX | SA_I )
Larry Johnsonc591dff2007-12-27 11:28:51 -050063
64 /*TLB-entry PCI registers*/
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020065 tlbentry( 0xEEC00000, SZ_1K, 0xEEC00000, 1, AC_RW | SA_IG )
Larry Johnsonc591dff2007-12-27 11:28:51 -050066
67 /* TLB-entry for peripherals */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020068 tlbentry( 0xEF000000, SZ_16M, 0xEF000000, 1, AC_RW | SA_IG)
Larry Johnsonc591dff2007-12-27 11:28:51 -050069
70 /* TLB-entry PCI IO Space - from sr@denx.de */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020071 tlbentry(0xE8000000, SZ_64K, 0xE8000000, 1, AC_RW | SA_IG)
Larry Johnsonc591dff2007-12-27 11:28:51 -050072
73 tlbtab_end
Larry Johnson6433fa22008-03-17 11:10:35 -050074
75#if defined(CONFIG_KORAT_PERMANENT)
76 .globl korat_branch_absolute
77korat_branch_absolute:
78 mtlr r3
79 blr
80#endif