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/threads.h>
13 #include <linux/linkage.h>
14 #include <asm/ptrace.h>
16 #include <asm/spr-regs.h>
17 #include <asm/mb86943a.h>
21 #define __400_DBR0 0xfe000e00
22 #define __400_DBR1 0xfe000e08
23 #define __400_DBR2 0xfe000e10
24 #define __400_DBR3 0xfe000e18
25 #define __400_DAM0 0xfe000f00
26 #define __400_DAM1 0xfe000f08
27 #define __400_DAM2 0xfe000f10
28 #define __400_DAM3 0xfe000f18
29 #define __400_LGCR 0xfe000010
30 #define __400_LCR 0xfe000100
31 #define __400_LSBR 0xfe000c00
33 .section .text.init,"ax"
36 ###############################################################################
38 # set the protection map with the I/DAMPR registers
41 # GR25 SDRAM size [saved]
42 # GR26 &__head_reference [saved]
43 # GR30 LED address [saved]
45 ###############################################################################
46 .globl __head_fr451_set_protection
47 __head_fr451_set_protection:
57 # set the I/O region protection registers for FR401/3/5
58 sethi.p %hi(__region_IO),gr5
59 setlo %lo(__region_IO),gr5
60 sethi.p %hi(0x1fffffff),gr7
61 setlo %lo(0x1fffffff),gr7
62 ori gr5,#xAMPRx_SS_512Mb|xAMPRx_S_KERNEL|xAMPRx_C|xAMPRx_V,gr5
63 movgs gr5,dampr11 ; General I/O tile
66 # need to tile the remaining IAMPR/DAMPR registers to cover as much of the RAM as possible
67 # - start with the highest numbered registers
68 sethi.p %hi(__kernel_image_end),gr8
69 setlo %lo(__kernel_image_end),gr8
70 sethi.p %hi(32768),gr4 ; allow for a maximal allocator bitmap
73 sethi.p %hi(1024*2048-1),gr4 ; round up to nearest 2MiB
74 setlo %lo(1024*2048-1),gr4
79 sethi.p %hi(__page_offset),gr9
80 setlo %lo(__page_offset),gr9
83 sethi.p %hi(0xffffc000),gr11
84 setlo %lo(0xffffc000),gr11
86 # GR8 = base of uncovered RAM
87 # GR9 = top of uncovered RAM
90 call __head_split_region
97 call __head_split_region
104 call __head_split_region
111 call __head_split_region
118 call __head_split_region
125 call __head_split_region
132 call __head_split_region
138 # cover kernel core image with kernel-only segment
140 sethi.p %hi(__page_offset),gr8
141 setlo %lo(__page_offset),gr8
142 call __head_split_region
144 #ifdef CONFIG_PROTECT_KERNEL
145 ori.p gr4,#xAMPRx_S_KERNEL,gr4
146 ori gr5,#xAMPRx_S_KERNEL,gr5
154 # start in TLB context 0 with no page tables
158 # the FR451 also has an extra trap base register
162 # turn on the timers as appropriate
167 sethi.p %hi(HSR0_ETMI),gr5
168 setlo %lo(HSR0_ETMI),gr5