aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2005-09-12 21:14:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-12 23:04:15 -0400
commit9f5757476dc1c8eabc51e7d14722a2646bc2cb9d (patch)
tree913c06d2e6ad974e1553b19f810e5dc230947263 /arch/m68knommu
parent7cf27cb4162bd586c015e32383f30bc7fbb3ff8a (diff)
[PATCH] m68knommu: startup code for the Drangen Engine 68328 based board
Specialized startup code for the 68328 based DragenEngine board. It doesn't easily fit into the common 68x328 startup code framework. It doesn't want any of the common hardware setup to be done here. Signed-off-by: Greg Ungerer <gerg@uclinux.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/platform/68328/head-de2.S135
1 files changed, 135 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/68328/head-de2.S b/arch/m68knommu/platform/68328/head-de2.S
new file mode 100644
index 000000000000..94c5a1609a75
--- /dev/null
+++ b/arch/m68knommu/platform/68328/head-de2.S
@@ -0,0 +1,135 @@
1#include <linux/config.h>
2
3#if defined(CONFIG_RAM32MB)
4#define MEM_END 0x02000000 /* Memory size 32Mb */
5#elif defined(CONFIG_RAM16MB)
6#define MEM_END 0x01000000 /* Memory size 16Mb */
7#else
8#define MEM_END 0x00800000 /* Memory size 8Mb */
9#endif
10
11#undef CRT_DEBUG
12
13.macro PUTC CHAR
14#ifdef CRT_DEBUG
15 moveq #\CHAR, %d7
16 jsr putc
17#endif
18.endm
19
20 .global _start
21 .global _rambase
22 .global _ramvec
23 .global _ramstart
24 .global _ramend
25
26 .data
27
28/*
29 * Set up the usable of RAM stuff
30 */
31_rambase:
32 .long 0
33_ramvec:
34 .long 0
35_ramstart:
36 .long 0
37_ramend:
38 .long 0
39
40 .text
41
42_start:
43
44/*
45 * Setup initial stack
46 */
47 /* disable all interrupts */
48 movew #0x2700, %sr
49 movel #-1, 0xfffff304
50 movel #MEM_END-4, %sp
51
52 PUTC '\r'
53 PUTC '\n'
54 PUTC 'A'
55 PUTC 'B'
56
57/*
58 * Determine end of RAM
59 */
60
61 movel #MEM_END, %a0
62 movel %a0, _ramend
63
64 PUTC 'C'
65
66/*
67 * Move ROM filesystem above bss :-)
68 */
69
70 moveal #_sbss, %a0 /* romfs at the start of bss */
71 moveal #_ebss, %a1 /* Set up destination */
72 movel %a0, %a2 /* Copy of bss start */
73
74 movel 8(%a0), %d1 /* Get size of ROMFS */
75 addql #8, %d1 /* Allow for rounding */
76 andl #0xfffffffc, %d1 /* Whole words */
77
78 addl %d1, %a0 /* Copy from end */
79 addl %d1, %a1 /* Copy from end */
80 movel %a1, _ramstart /* Set start of ram */
81
821:
83 movel -(%a0), %d0 /* Copy dword */
84 movel %d0, -(%a1)
85 cmpl %a0, %a2 /* Check if at end */
86 bne 1b
87
88 PUTC 'D'
89
90/*
91 * Initialize BSS segment to 0
92 */
93
94 lea _sbss, %a0
95 lea _ebss, %a1
96
97 /* Copy 0 to %a0 until %a0 == %a1 */
982: cmpal %a0, %a1
99 beq 1f
100 clrl (%a0)+
101 bra 2b
1021:
103
104 PUTC 'E'
105
106/*
107 * Load the current task pointer and stack
108 */
109
110 lea init_thread_union, %a0
111 lea 0x2000(%a0), %sp
112
113 PUTC 'F'
114 PUTC '\r'
115 PUTC '\n'
116
117/*
118 * Go
119 */
120
121 jmp start_kernel
122
123/*
124 * Local functions
125 */
126
127#ifdef CRT_DEBUG
128putc:
129 moveb %d7, 0xfffff907
1301:
131 movew 0xfffff906, %d7
132 andw #0x2000, %d7
133 beq 1b
134 rts
135#endif