diff options
Diffstat (limited to 'meta/packages/uboot/u-boot-mkimage-openmoko-native/lowlevel_foo.patch')
-rw-r--r-- | meta/packages/uboot/u-boot-mkimage-openmoko-native/lowlevel_foo.patch | 229 |
1 files changed, 229 insertions, 0 deletions
diff --git a/meta/packages/uboot/u-boot-mkimage-openmoko-native/lowlevel_foo.patch b/meta/packages/uboot/u-boot-mkimage-openmoko-native/lowlevel_foo.patch new file mode 100644 index 0000000000..715c46ed81 --- /dev/null +++ b/meta/packages/uboot/u-boot-mkimage-openmoko-native/lowlevel_foo.patch | |||
@@ -0,0 +1,229 @@ | |||
1 | board/neo1973/lowlevel_foo.S: http://people.openmoko.org/laforge/tmp/bbt-20070206/lowlevel_foo.S | ||
2 | board/neo1973/lowlevel_foo.lds: http://people.openmoko.org/laforge/tmp/bbt-20070206/lowlevel_foo.lds | ||
3 | board/neo1973/Makefile: added building of lowlevel_foo.bin (based on | ||
4 | http://people.openmoko.org/laforge/tmp/bbt-20070206/lowlevel_foo.build.sh) | ||
5 | |||
6 | Index: u-boot/board/neo1973/common/lowlevel_foo.S | ||
7 | =================================================================== | ||
8 | --- /dev/null | ||
9 | +++ u-boot/board/neo1973/common/lowlevel_foo.S | ||
10 | @@ -0,0 +1,82 @@ | ||
11 | + | ||
12 | +_start: | ||
13 | + b reset | ||
14 | +undefvec: | ||
15 | + b undefvec | ||
16 | +swivec: | ||
17 | + b swivec | ||
18 | +pabtvec: | ||
19 | + b pabtvec | ||
20 | +dabtvec: | ||
21 | + b dabtvec | ||
22 | +rsvdvec: | ||
23 | + b rsvdvec | ||
24 | +irqvec: | ||
25 | + b irqvec | ||
26 | +fiqvec: | ||
27 | + b fiqvec | ||
28 | + | ||
29 | +reset: | ||
30 | + /* | ||
31 | + * set the cpu to SVC32 mode | ||
32 | + */ | ||
33 | + mrs r0,cpsr | ||
34 | + bic r0,r0,#0x1f | ||
35 | + orr r0,r0,#0xd3 | ||
36 | + msr cpsr,r0 | ||
37 | + | ||
38 | +/* turn off the watchdog */ | ||
39 | +#define pWTCON 0x53000000 | ||
40 | +#define INTMSK 0x4A000008 /* Interupt-Controller base addresses */ | ||
41 | +#define INTSUBMSK 0x4A00001C | ||
42 | +#define CLKDIVN 0x4C000014 /* clock divisor register */ | ||
43 | + | ||
44 | + ldr r0, =pWTCON | ||
45 | + mov r1, #0x0 | ||
46 | + str r1, [r0] | ||
47 | + | ||
48 | + mov r1, #0xffffffff | ||
49 | + ldr r0, =INTMSK | ||
50 | + str r1, [r0] | ||
51 | + ldr r1, =0x3ff | ||
52 | + ldr r0, =INTSUBMSK | ||
53 | + str r1, [r0] | ||
54 | + | ||
55 | + /* FCLK:HCLK:PCLK = 1:2:4 */ | ||
56 | + /* default FCLK is 120 MHz ! */ | ||
57 | + ldr r0, =CLKDIVN | ||
58 | + mov r1, #3 | ||
59 | + str r1, [r0] | ||
60 | + | ||
61 | + bl cpu_init_crit | ||
62 | + ldr r0,=TEXT_BASE | ||
63 | + mov pc, r0 | ||
64 | + | ||
65 | +cpu_init_crit: | ||
66 | + /* | ||
67 | + * flush v4 I/D caches | ||
68 | + */ | ||
69 | + mov r0, #0 | ||
70 | + mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ | ||
71 | + mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ | ||
72 | + | ||
73 | + /* | ||
74 | + * disable MMU stuff and caches | ||
75 | + */ | ||
76 | + mrc p15, 0, r0, c1, c0, 0 | ||
77 | + bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) | ||
78 | + bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) | ||
79 | + orr r0, r0, #0x00000002 @ set bit 2 (A) Align | ||
80 | + orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache | ||
81 | + mcr p15, 0, r0, c1, c0, 0 | ||
82 | + | ||
83 | + /* | ||
84 | + * before relocating, we have to setup RAM timing | ||
85 | + * because memory timing is board-dependend, you will | ||
86 | + * find a lowlevel_init.S in your board directory. | ||
87 | + */ | ||
88 | + mov ip, lr | ||
89 | + bl lowlevel_init | ||
90 | + mov lr, ip | ||
91 | + mov pc, lr | ||
92 | + | ||
93 | Index: u-boot/board/neo1973/common/lowlevel_foo.lds | ||
94 | =================================================================== | ||
95 | --- /dev/null | ||
96 | +++ u-boot/board/neo1973/common/lowlevel_foo.lds | ||
97 | @@ -0,0 +1,56 @@ | ||
98 | +/* | ||
99 | + * (C) Copyright 2002 | ||
100 | + * Gary Jennejohn, DENX Software Engineering, <gj@denx.de> | ||
101 | + * | ||
102 | + * See file CREDITS for list of people who contributed to this | ||
103 | + * project. | ||
104 | + * | ||
105 | + * This program is free software; you can redistribute it and/or | ||
106 | + * modify it under the terms of the GNU General Public License as | ||
107 | + * published by the Free Software Foundation; either version 2 of | ||
108 | + * the License, or (at your option) any later version. | ||
109 | + * | ||
110 | + * This program is distributed in the hope that it will be useful, | ||
111 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
112 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
113 | + * GNU General Public License for more details. | ||
114 | + * | ||
115 | + * You should have received a copy of the GNU General Public License | ||
116 | + * along with this program; if not, write to the Free Software | ||
117 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
118 | + * MA 02111-1307 USA | ||
119 | + */ | ||
120 | + | ||
121 | +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") | ||
122 | +OUTPUT_ARCH(arm) | ||
123 | +ENTRY(_start) | ||
124 | +SECTIONS | ||
125 | +{ | ||
126 | + . = 0x00000000; | ||
127 | + | ||
128 | + . = ALIGN(4); | ||
129 | + .text : | ||
130 | + { | ||
131 | + lowlevel_foo.o (.text) | ||
132 | + *(.text) | ||
133 | + } | ||
134 | + | ||
135 | + . = ALIGN(4); | ||
136 | + .rodata : { *(.rodata) } | ||
137 | + | ||
138 | + . = ALIGN(4); | ||
139 | + .data : { *(.data) } | ||
140 | + | ||
141 | + . = ALIGN(4); | ||
142 | + .got : { *(.got) } | ||
143 | + | ||
144 | + . = .; | ||
145 | + __u_boot_cmd_start = .; | ||
146 | + .u_boot_cmd : { *(.u_boot_cmd) } | ||
147 | + __u_boot_cmd_end = .; | ||
148 | + | ||
149 | + . = ALIGN(4); | ||
150 | + __bss_start = .; | ||
151 | + .bss : { *(.bss) } | ||
152 | + _end = .; | ||
153 | +} | ||
154 | Index: u-boot/board/neo1973/gta01/Makefile | ||
155 | =================================================================== | ||
156 | --- u-boot.orig/board/neo1973/gta01/Makefile | ||
157 | +++ u-boot/board/neo1973/gta01/Makefile | ||
158 | @@ -28,14 +28,31 @@ | ||
159 | OBJS := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o ../common/udc.o | ||
160 | SOBJS := ../common/lowlevel_init.o | ||
161 | |||
162 | +.PHONY: all | ||
163 | + | ||
164 | +all: $(LIB) lowevel_foo.bin | ||
165 | + | ||
166 | $(LIB): $(OBJS) $(SOBJS) | ||
167 | $(AR) crv $@ $(OBJS) $(SOBJS) | ||
168 | |||
169 | +lowlevel_foo.o: ../common/lowlevel_foo.S | ||
170 | + $(CC) -c -DTEXT_BASE=0x33F80000 -march=armv4 \ | ||
171 | + -o lowlevel_foo.o ../common/lowlevel_foo.S | ||
172 | + | ||
173 | +lowlevel_foo: lowlevel_foo.o ../common/lowlevel_init.o ../common/lowlevel_foo.lds | ||
174 | + $(LD) -T ../common/lowlevel_foo.lds -Ttext 0x33f80000 -Bstatic \ | ||
175 | + ../common/lowlevel_init.o lowlevel_foo.o -o lowlevel_foo | ||
176 | + | ||
177 | +lowevel_foo.bin: lowlevel_foo | ||
178 | + $(CROSS_COMPILE)objcopy --gap-fill=0xff -O binary \ | ||
179 | + lowlevel_foo lowlevel_foo.bin | ||
180 | + | ||
181 | + | ||
182 | clean: | ||
183 | - rm -f $(SOBJS) $(OBJS) | ||
184 | + rm -f $(SOBJS) $(OBJS) lowlevel_foo lowlevel_foo.o | ||
185 | |||
186 | distclean: clean | ||
187 | - rm -f $(LIB) core *.bak .depend | ||
188 | + rm -f $(LIB) core *.bak .depend lowlevel_foo.bin | ||
189 | |||
190 | ######################################################################### | ||
191 | |||
192 | Index: u-boot/board/qt2410/Makefile | ||
193 | =================================================================== | ||
194 | --- u-boot.orig/board/qt2410/Makefile | ||
195 | +++ u-boot/board/qt2410/Makefile | ||
196 | @@ -28,14 +28,31 @@ | ||
197 | OBJS := qt2410.o flash.o | ||
198 | SOBJS := lowlevel_init.o | ||
199 | |||
200 | +.PHONY: all | ||
201 | + | ||
202 | +all: $(LIB) lowevel_foo.bin | ||
203 | + | ||
204 | $(LIB): $(OBJS) $(SOBJS) | ||
205 | $(AR) crv $@ $(OBJS) $(SOBJS) | ||
206 | |||
207 | +lowlevel_foo.o: ../neo1973/common/lowlevel_foo.S | ||
208 | + $(CC) -c -DTEXT_BASE=0x33F80000 -march=armv4 \ | ||
209 | + -o lowlevel_foo.o ../neo1973/common/lowlevel_foo.S | ||
210 | + | ||
211 | +lowlevel_foo: lowlevel_foo.o lowlevel_init.o \ | ||
212 | + ../neo1973/common/lowlevel_foo.lds | ||
213 | + $(LD) -T ../neo1973/common/lowlevel_foo.lds -Ttext 0x33f80000 -Bstatic \ | ||
214 | + lowlevel_init.o lowlevel_foo.o -o lowlevel_foo | ||
215 | + | ||
216 | +lowevel_foo.bin: lowlevel_foo | ||
217 | + $(CROSS_COMPILE)objcopy --gap-fill=0xff -O binary \ | ||
218 | + lowlevel_foo lowlevel_foo.bin | ||
219 | + | ||
220 | clean: | ||
221 | - rm -f $(SOBJS) $(OBJS) | ||
222 | + rm -f $(SOBJS) $(OBJS) lowlevel_foo lowlevel_foo.o | ||
223 | |||
224 | distclean: clean | ||
225 | - rm -f $(LIB) core *.bak .depend | ||
226 | + rm -f $(LIB) core *.bak .depend lowlevel_foo.bin | ||
227 | |||
228 | ######################################################################### | ||
229 | |||