1 /* head-uc-fr451.S: FR451 uc-linux specific bits of initialisation
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/init.h>
13 #include <linux/threads.h>
14 #include <linux/linkage.h>
15 #include <asm/ptrace.h>
17 #include <asm/spr-regs.h>
18 #include <asm/mb86943a.h>
22 #define __400_DBR0 0xfe000e00
23 #define __400_DBR1 0xfe000e08
24 #define __400_DBR2 0xfe000e10
25 #define __400_DBR3 0xfe000e18
26 #define __400_DAM0 0xfe000f00
27 #define __400_DAM1 0xfe000f08
28 #define __400_DAM2 0xfe000f10
29 #define __400_DAM3 0xfe000f18
30 #define __400_LGCR 0xfe000010
31 #define __400_LCR 0xfe000100
32 #define __400_LSBR 0xfe000c00
37 ###############################################################################
39 # set the protection map with the I/DAMPR registers
42 # GR25 SDRAM size [saved]
43 # GR26 &__head_reference [saved]
44 # GR30 LED address [saved]
46 ###############################################################################
47 .globl __head_fr451_set_protection
48 __head_fr451_set_protection:
58 # set the I/O region protection registers for FR401/3/5
59 sethi.p %hi(__region_IO),gr5
60 setlo %lo(__region_IO),gr5
61 sethi.p %hi(0x1fffffff),gr7
62 setlo %lo(0x1fffffff),gr7
63 ori gr5,#xAMPRx_SS_512Mb|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V,gr5
64 movgs gr5,dampr11 ; General I/O tile
67 # need to tile the remaining IAMPR/DAMPR registers to cover as much of the RAM as possible
68 # - start with the highest numbered registers
69 sethi.p %hi(__kernel_image_end),gr8
70 setlo %lo(__kernel_image_end),gr8
71 sethi.p %hi(32768),gr4 ; allow for a maximal allocator bitmap
74 sethi.p %hi(1024*2048-1),gr4 ; round up to nearest 2MiB
75 setlo %lo(1024*2048-1),gr4
80 sethi.p %hi(__page_offset),gr9
81 setlo %lo(__page_offset),gr9
84 sethi.p %hi(0xffffc000),gr11
85 setlo %lo(0xffffc000),gr11
87 # GR8 = base of uncovered RAM
88 # GR9 = top of uncovered RAM
91 call __head_split_region
98 call __head_split_region
105 call __head_split_region
112 call __head_split_region
119 call __head_split_region
126 call __head_split_region
133 call __head_split_region
139 # cover kernel core image with kernel-only segment
141 sethi.p %hi(__page_offset),gr8
142 setlo %lo(__page_offset),gr8
143 call __head_split_region
145 #ifdef CONFIG_PROTECT_KERNEL
146 ori.p gr4,#xAMPRx_S_KERNEL,gr4
147 ori gr5,#xAMPRx_S_KERNEL,gr5
155 # start in TLB context 0 with no page tables
159 # the FR451 also has an extra trap base register
163 # turn on the timers as appropriate
168 sethi.p %hi(HSR0_ETMI),gr5
169 setlo %lo(HSR0_ETMI),gr5