init.S 2.6 KB
Newer Older
1
/*
2 3
 * (C) Copyright 2008
 * Stefan Roese, DENX Software Engineering, sr@denx.de.
4
 *
5
 * SPDX-License-Identifier:	GPL-2.0+
6 7
 */

8
#include <asm-offsets.h>
9
#include <ppc_asm.tmpl>
10
#include <asm/mmu.h>
11 12
#include <config.h>

13
/*
14 15 16 17 18 19 20
 * TLB TABLE
 *
 * This table is used by the cpu boot code to setup the initial tlb
 * entries. Rather than make broad assumptions in the cpu source tree,
 * this table lets each board set things up however they like.
 *
 *  Pointer to the table is returned in r1
21
 */
22 23 24 25 26 27
    .section .bootpg,"ax"
    .globl tlbtab

tlbtab:
	tlbtab_start

28
	/* vxWorks needs this as first entry for the Machine Check interrupt */
S
Stefan Roese 已提交
29
	tlbentry( 0x40000000, SZ_256M, 0, 0, AC_RWX | SA_IG )
30

31 32 33 34 35 36
	/*
	 * The RAM-boot version skips the SDRAM TLB (identified by EPN=0). This
	 * entry is already configured for SDRAM via the JTAG debugger and mustn't
	 * be re-initialized by this RAM-booting U-Boot version.
	 */
#ifndef CONFIG_SYS_RAMBOOT
37
	/* TLB-entry for DDR SDRAM (Up to 2GB) */
38
#ifdef CONFIG_4xx_DCACHE
S
Stefan Roese 已提交
39
	tlbentry( CONFIG_SYS_SDRAM_BASE, SZ_256M, CONFIG_SYS_SDRAM_BASE, 0, AC_RWX | SA_G)
40
#else
S
Stefan Roese 已提交
41
	tlbentry( CONFIG_SYS_SDRAM_BASE, SZ_256M, CONFIG_SYS_SDRAM_BASE, 0, AC_RWX | SA_IG )
42
#endif
43
#endif /* CONFIG_SYS_RAMBOOT */
44

45
	/* TLB-entry for EBC */
S
Stefan Roese 已提交
46
	tlbentry( CONFIG_SYS_BCSR_BASE, SZ_256M, CONFIG_SYS_BCSR_BASE, 1, AC_RWX | SA_IG )
47 48 49 50

	/* BOOT_CS (FLASH) must be forth. Before relocation SA_I can be off to use the
	 * speed up boot process. It is patched after relocation to enable SA_I
	 */
S
Stefan Roese 已提交
51
	tlbentry( CONFIG_SYS_BOOT_BASE_ADDR, SZ_256M, CONFIG_SYS_BOOT_BASE_ADDR, 1, AC_RWX | SA_G )
52

53
#ifdef CONFIG_SYS_INIT_RAM_DCACHE
54
	/* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
S
Stefan Roese 已提交
55
	tlbentry( CONFIG_SYS_INIT_RAM_ADDR, SZ_64K, CONFIG_SYS_INIT_RAM_ADDR, 0, AC_RWX | SA_G )
56 57 58
#endif

	/* TLB-entry for PCI Memory */
S
Stefan Roese 已提交
59 60 61 62
	tlbentry( CONFIG_SYS_PCI_MEMBASE, SZ_256M, CONFIG_SYS_PCI_MEMBASE, 1, AC_RW | SA_IG )
	tlbentry( CONFIG_SYS_PCI_MEMBASE1, SZ_256M, CONFIG_SYS_PCI_MEMBASE1, 1, AC_RW | SA_IG )
	tlbentry( CONFIG_SYS_PCI_MEMBASE2, SZ_256M, CONFIG_SYS_PCI_MEMBASE2, 1, AC_RW | SA_IG )
	tlbentry( CONFIG_SYS_PCI_MEMBASE3, SZ_256M, CONFIG_SYS_PCI_MEMBASE3, 1, AC_RW | SA_IG )
63 64

	/* TLB-entry for NAND */
S
Stefan Roese 已提交
65
	tlbentry( CONFIG_SYS_NAND_ADDR, SZ_1K, CONFIG_SYS_NAND_ADDR, 1, AC_RWX | SA_IG )
66 67

	/* TLB-entry for Internal Registers & OCM */
S
Stefan Roese 已提交
68
	tlbentry( 0xe0000000, SZ_16M, 0xe0000000, 0,  AC_RWX | SA_I )
69 70

	/*TLB-entry PCI registers*/
S
Stefan Roese 已提交
71
	tlbentry( 0xEEC00000, SZ_1K, 0xEEC00000, 1,  AC_RWX | SA_IG )
72 73

	/* TLB-entry for peripherals */
S
Stefan Roese 已提交
74
	tlbentry( 0xEF000000, SZ_16M, 0xEF000000, 1, AC_RWX | SA_IG)
75

76
	/* TLB-entry PCI IO Space - from sr@denx.de */
S
Stefan Roese 已提交
77
	tlbentry(0xE8000000, SZ_64K, 0xE8000000, 1, AC_RWX | SA_IG)
78

79
	tlbtab_end