aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2006-06-26 02:33:09 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:59:07 -0400
commit12ddae3348def8808fb755b23225b18fc4adfbe3 (patch)
tree616d10e9ae82b0507d69b34b33565c518d0648b6 /arch
parent73e2fba8dc1e0a686073a5183be1a99e9285d2ac (diff)
[PATCH] m68knommu: use configurable RAM setup in start up code
Change to using a configurable RAM setup in startup code. This cleans up the whole RAM base/sizing issue, and removes a lot of board specific code. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/m68knommu/platform/5307/head.S82
1 files changed, 10 insertions, 72 deletions
diff --git a/arch/m68knommu/platform/5307/head.S b/arch/m68knommu/platform/5307/head.S
index c30c462b99b1..1d9eb301d7ac 100644
--- a/arch/m68knommu/platform/5307/head.S
+++ b/arch/m68knommu/platform/5307/head.S
@@ -3,7 +3,7 @@
3/* 3/*
4 * head.S -- common startup code for ColdFire CPUs. 4 * head.S -- common startup code for ColdFire CPUs.
5 * 5 *
6 * (C) Copyright 1999-2004, Greg Ungerer (gerg@snapgear.com). 6 * (C) Copyright 1999-2006, Greg Ungerer <gerg@snapgear.com>.
7 */ 7 */
8 8
9/*****************************************************************************/ 9/*****************************************************************************/
@@ -19,47 +19,15 @@
19/*****************************************************************************/ 19/*****************************************************************************/
20 20
21/* 21/*
22 * Define fixed memory sizes. Configuration of a fixed memory size 22 * If we don't have a fixed memory size, then lets build in code
23 * overrides everything else. If the user defined a size we just
24 * blindly use it (they know what they are doing right :-)
25 */
26#if defined(CONFIG_RAM32MB)
27#define MEM_SIZE 0x02000000 /* memory size 32Mb */
28#elif defined(CONFIG_RAM16MB)
29#define MEM_SIZE 0x01000000 /* memory size 16Mb */
30#elif defined(CONFIG_RAM8MB)
31#define MEM_SIZE 0x00800000 /* memory size 8Mb */
32#elif defined(CONFIG_RAM4MB)
33#define MEM_SIZE 0x00400000 /* memory size 4Mb */
34#elif defined(CONFIG_RAM1MB)
35#define MEM_SIZE 0x00100000 /* memory size 1Mb */
36#endif
37
38/*
39 * Memory size exceptions for special cases. Some boards may be set
40 * for auto memory sizing, but we can't do it that way for some reason.
41 * For example the 5206eLITE board has static RAM, and auto-detecting
42 * the SDRAM will do you no good at all. Same goes for the MOD5272.
43 */
44#ifdef CONFIG_RAMAUTO
45#if defined(CONFIG_M5206eLITE)
46#define MEM_SIZE 0x00100000 /* 1MiB default memory */
47#endif
48#if defined(CONFIG_MOD5272)
49#define MEM_SIZE 0x00800000 /* 8MiB default memory */
50#endif
51#endif /* CONFIG_RAMAUTO */
52
53
54/*
55 * If we don't have a fixed memory size now, then lets build in code
56 * to auto detect the DRAM size. Obviously this is the prefered 23 * to auto detect the DRAM size. Obviously this is the prefered
57 * method, and should work for most boards (it won't work for those 24 * method, and should work for most boards. It won't work for those
58 * that do not have their RAM starting at address 0). 25 * that do not have their RAM starting at address 0, and it only
26 * works on SDRAM (not boards fitted with SRAM).
59 */ 27 */
60#if defined(MEM_SIZE) 28#if CONFIG_RAMSIZE != 0
61.macro GET_MEM_SIZE 29.macro GET_MEM_SIZE
62 movel #MEM_SIZE,%d0 /* hard coded memory size */ 30 movel #CONFIG_RAMSIZE,%d0 /* hard coded memory size */
63.endm 31.endm
64 32
65#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ 33#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \
@@ -98,37 +66,7 @@
98.endm 66.endm
99 67
100#else 68#else
101#error "ERROR: I don't know how to determine your boards memory size?" 69#error "ERROR: I don't know how to probe your boards memory size?"
102#endif
103
104
105/*
106 * Most ColdFire boards have their DRAM starting at address 0.
107 * Notable exception is the 5206eLITE board, another is the MOD5272.
108 */
109#if defined(CONFIG_M5206eLITE)
110#define MEM_BASE 0x30000000
111#endif
112#if defined(CONFIG_MOD5272)
113#define MEM_BASE 0x02000000
114#define VBR_BASE 0x20000000 /* vectors in SRAM */
115#endif
116#if defined(CONFIG_M5208EVB)
117#define MEM_BASE 0x40000000
118#endif
119
120#ifndef MEM_BASE
121#define MEM_BASE 0x00000000 /* memory base at address 0 */
122#endif
123
124/*
125 * The default location for the vectors is at the base of RAM.
126 * Some boards might like to use internal SRAM or something like
127 * that. If no board specific header defines an alternative then
128 * use the base of RAM.
129 */
130#ifndef VBR_BASE
131#define VBR_BASE MEM_BASE /* vector address */
132#endif 70#endif
133 71
134/*****************************************************************************/ 72/*****************************************************************************/
@@ -191,11 +129,11 @@ _start:
191 * Create basic memory configuration. Set VBR accordingly, 129 * Create basic memory configuration. Set VBR accordingly,
192 * and size memory. 130 * and size memory.
193 */ 131 */
194 movel #VBR_BASE,%a7 132 movel #CONFIG_VECTORBASE,%a7
195 movec %a7,%VBR /* set vectors addr */ 133 movec %a7,%VBR /* set vectors addr */
196 movel %a7,_ramvec 134 movel %a7,_ramvec
197 135
198 movel #MEM_BASE,%a7 /* mark the base of RAM */ 136 movel #CONFIG_RAMBASE,%a7 /* mark the base of RAM */
199 movel %a7,_rambase 137 movel %a7,_rambase
200 138
201 GET_MEM_SIZE /* macro code determines size */ 139 GET_MEM_SIZE /* macro code determines size */