blob: 7513f1d3c3243a93f9767135e87c420f9b0ed91e [file] [log] [blame]
Dirk Eibachab4c62c2009-07-27 08:49:48 +02001/*
2 * (C) Copyright 2009
3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
4 *
5 * Based on board/amcc/canyonlands/init.S
6 * (C) Copyright 2008
7 * Stefan Roese, DENX Software Engineering, sr@denx.de.
8 *
9 * See file CREDITS for list of people who contributed to this
10 * project.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * MA 02111-1307 USA
26 */
27
Wolfgang Denk25ddd1f2010-10-26 14:34:52 +020028#include <asm-offsets.h>
Dirk Eibachab4c62c2009-07-27 08:49:48 +020029#include <ppc_asm.tmpl>
30#include <config.h>
Peter Tyser61f2b382010-04-12 22:28:07 -050031#include <asm/mmu.h>
Dirk Eibachab4c62c2009-07-27 08:49:48 +020032
33/**************************************************************************
34 * TLB TABLE
35 *
36 * This table is used by the cpu boot code to setup the initial tlb
37 * entries. Rather than make broad assumptions in the cpu source tree,
38 * this table lets each board set things up however they like.
39 *
40 * Pointer to the table is returned in r1
41 *
42 *************************************************************************/
43 .section .bootpg,"ax"
44 .globl tlbtab
45
46tlbtab:
47 tlbtab_start
48
49 /*
50 * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to
51 * use the speed up boot process. It is patched after relocation to
52 * enable SA_I
53 */
54 tlbentry(CONFIG_SYS_BOOT_BASE_ADDR, SZ_16M, CONFIG_SYS_BOOT_BASE_ADDR,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020055 4, AC_RWX | SA_G) /* TLB 0 */
Dirk Eibachab4c62c2009-07-27 08:49:48 +020056
57 /*
58 * TLB entries for SDRAM are not needed on this platform.
59 * They are dynamically generated in the SPD DDR(2) detection
60 * routine.
61 */
62
63#ifdef CONFIG_SYS_INIT_RAM_DCACHE
64 /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
65 tlbentry(CONFIG_SYS_INIT_RAM_ADDR, SZ_4K, CONFIG_SYS_INIT_RAM_ADDR,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020066 0, AC_RWX | SA_G)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020067#endif
68
69 tlbentry(CONFIG_SYS_PCI_BASE, SZ_256M, 0x00000000, 0xC,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020070 AC_RW | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020071 tlbentry(CONFIG_SYS_PCI_MEMBASE, SZ_256M, 0x20000000, 0xC,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020072 AC_RW | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020073
74 /* TLB-entry for NVRAM */
75 tlbentry(CONFIG_SYS_NVRAM_BASE, SZ_1M, CONFIG_SYS_NVRAM_BASE, 4,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020076 AC_RW | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020077
78 /* TLB-entry for UART */
79 tlbentry(CONFIG_SYS_UART_BASE, SZ_16K, CONFIG_SYS_UART_BASE, 4,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020080 AC_RW | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020081
82 /* TLB-entry for IO */
83 tlbentry(CONFIG_SYS_IO_BASE, SZ_16K, CONFIG_SYS_IO_BASE, 4,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020084 AC_RW | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020085
86 /* TLB-entry for OCM */
87 tlbentry(CONFIG_SYS_OCM_BASE, SZ_1M, 0x00000000, 4,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020088 AC_RWX | SA_I)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020089
90 /* TLB-entry for Local Configuration registers => peripherals */
91 tlbentry(CONFIG_SYS_LOCAL_CONF_REGS, SZ_16M, CONFIG_SYS_LOCAL_CONF_REGS,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020092 4, AC_RWX | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020093
94 /* AHB: Internal USB Peripherals (USB, SATA) */
95 tlbentry(CONFIG_SYS_AHB_BASE, SZ_1M, 0xbff00000, 4,
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020096 AC_RWX | SA_IG)
Dirk Eibachab4c62c2009-07-27 08:49:48 +020097
98 tlbtab_end