blob: 7ff7a59170e1b5828b38af57336c809ba5e3c877 [file] [log] [blame]
Stefan Roese899620c2006-08-15 14:22:35 +02001/*
Stefan Roese5bc528f2006-10-07 11:35:25 +02002 * (C) Copyright 2006
3 * Stefan Roese, DENX Software Engineering, sr@denx.de.
4 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Stefan Roese5bc528f2006-10-07 11:35:25 +02006 */
Stefan Roese899620c2006-08-15 14:22:35 +02007
Wolfgang Denk25ddd1f2010-10-26 14:34:52 +02008#include <asm-offsets.h>
Stefan Roese899620c2006-08-15 14:22:35 +02009#include <ppc_asm.tmpl>
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020010#include <asm/mmu.h>
Stefan Roese899620c2006-08-15 14:22:35 +020011#include <config.h>
Stefan Roese550650d2010-09-20 16:05:31 +020012#include <asm/ppc4xx.h>
Stefan Roese899620c2006-08-15 14:22:35 +020013
Stefan Roese899620c2006-08-15 14:22:35 +020014/**************************************************************************
15 * TLB TABLE
16 *
17 * This table is used by the cpu boot code to setup the initial tlb
18 * entries. Rather than make broad assumptions in the cpu source tree,
19 * this table lets each board set things up however they like.
20 *
21 * Pointer to the table is returned in r1
22 *
23 *************************************************************************/
24
Stefan Roese5bc528f2006-10-07 11:35:25 +020025 .section .bootpg,"ax"
26 .globl tlbtab
Stefan Roese899620c2006-08-15 14:22:35 +020027
28tlbtab:
Stefan Roese5bc528f2006-10-07 11:35:25 +020029 tlbtab_start
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020030 tlbentry(0xff000000, SZ_16M, 0xff000000, 1, AC_RWX | SA_IG )
31 tlbentry(CONFIG_SYS_PERIPHERAL_BASE, SZ_256M, 0x40000000, 1, AC_RW | SA_IG)
32 tlbentry(CONFIG_SYS_ISRAM_BASE, SZ_4K, 0x80000000, 0, AC_RWX)
33 tlbentry(CONFIG_SYS_ISRAM_BASE + 0x1000, SZ_4K, 0x80001000, 0, AC_RWX)
Pieter Voorthuijsen511e4f92008-03-17 09:27:56 +010034#ifdef CONFIG_4xx_DCACHE
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020035 tlbentry(CONFIG_SYS_SDRAM_BASE, SZ_256M, 0x00000000, 0, AC_RWX | SA_G)
Pieter Voorthuijsen511e4f92008-03-17 09:27:56 +010036#else
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020037 tlbentry(CONFIG_SYS_SDRAM_BASE, SZ_256M, 0x00000000, 0, AC_RWX | SA_IG)
Pieter Voorthuijsen511e4f92008-03-17 09:27:56 +010038#endif
39
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020040#ifdef CONFIG_SYS_INIT_RAM_DCACHE
Pieter Voorthuijsen511e4f92008-03-17 09:27:56 +010041 /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020042 tlbentry(CONFIG_SYS_INIT_RAM_ADDR, SZ_64K, CONFIG_SYS_INIT_RAM_ADDR, 0, AC_RWX | SA_G)
Pieter Voorthuijsen511e4f92008-03-17 09:27:56 +010043#endif
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020044 tlbentry(CONFIG_SYS_PCI_BASE, SZ_256M, 0x00000000, 2, AC_RW | SA_IG)
Stefan Roese899620c2006-08-15 14:22:35 +020045
Stefan Roese5bc528f2006-10-07 11:35:25 +020046 /* PCI */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020047 tlbentry(CONFIG_SYS_PCI_MEMBASE, SZ_256M, CONFIG_SYS_PCI_MEMBASE, 3, AC_RW | SA_IG)
48 tlbentry(CONFIG_SYS_PCI_MEMBASE1, SZ_256M, CONFIG_SYS_PCI_MEMBASE1, 3, AC_RW | SA_IG)
49 tlbentry(CONFIG_SYS_PCI_MEMBASE2, SZ_256M, CONFIG_SYS_PCI_MEMBASE2, 3, AC_RW | SA_IG)
Stefan Roese5bc528f2006-10-07 11:35:25 +020050
51 /* NAND */
Stefan Roesecf6eb6d2010-04-14 13:57:18 +020052 tlbentry(CONFIG_SYS_NAND_BASE, SZ_4K, CONFIG_SYS_NAND_BASE, 1, AC_RWX | SA_IG)
Stefan Roese5bc528f2006-10-07 11:35:25 +020053 tlbtab_end