1 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/Makefile u-boot-2009.03/Makefile
|
2 |
18 |
qaztronic |
--- u-boot-2009.03_orig/Makefile 2009-03-21 14:04:41.000000000 -0700
|
3 |
|
|
+++ u-boot-2009.03/Makefile 2009-03-25 15:43:49.455339700 -0700
|
4 |
17 |
qaztronic |
@@ -182,7 +182,10 @@
|
5 |
|
|
endif
|
6 |
|
|
ifeq ($(ARCH),sparc)
|
7 |
|
|
CROSS_COMPILE = sparc-elf-
|
8 |
|
|
-endif # sparc
|
9 |
|
|
+endif
|
10 |
|
|
+ifeq ($(ARCH),or1200)
|
11 |
|
|
+CROSS_COMPILE = or32-uclinux-
|
12 |
|
|
+endif # or1200
|
13 |
|
|
endif # HOSTARCH,ARCH
|
14 |
|
|
endif # CROSS_COMPILE
|
15 |
|
|
|
16 |
|
|
@@ -279,7 +282,7 @@
|
17 |
|
|
# The "tools" are needed early, so put this first
|
18 |
|
|
# Don't include stuff already done in $(LIBS)
|
19 |
|
|
SUBDIRS = tools \
|
20 |
|
|
- examples \
|
21 |
|
|
+# examples \
|
22 |
|
|
api_examples
|
23 |
|
|
|
24 |
|
|
.PHONY : $(SUBDIRS)
|
25 |
19 |
qaztronic |
@@ -3457,6 +3460,21 @@
|
26 |
17 |
qaztronic |
grsim_leon2_config : unconfig
|
27 |
|
|
@$(MKCONFIG) $(@:_config=) sparc leon2 grsim_leon2 gaisler
|
28 |
19 |
qaztronic |
|
29 |
17 |
qaztronic |
+
|
30 |
|
|
+#========================================================================
|
31 |
|
|
+# qaz
|
32 |
|
|
+#========================================================================
|
33 |
|
|
+de1_or1k_config: unconfig
|
34 |
|
|
+ @mkdir -p $(obj)include
|
35 |
|
|
+ @echo "#define CONFIG_DE1_OR1K" > $(obj)include/config.h
|
36 |
|
|
+ @$(MKCONFIG) -a $(@:_config=) or1200 or1200 de1_or1k qaz
|
37 |
|
|
+
|
38 |
|
|
+Dev_Kit_060804_config: unconfig
|
39 |
|
|
+ @mkdir -p $(obj)include
|
40 |
|
|
+ @echo "#define CONFIG_DEV_KIT_060804" > $(obj)include/config.h
|
41 |
|
|
+ @$(MKCONFIG) -a $(@:_config=) or1200 or1200 Dev_Kit_060804 qaz
|
42 |
|
|
+
|
43 |
19 |
qaztronic |
+
|
44 |
17 |
qaztronic |
#########################################################################
|
45 |
|
|
#########################################################################
|
46 |
19 |
qaztronic |
#########################################################################
|
47 |
|
|
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/board/qaz/Dev_Kit_060804/Dev_Kit_060804.c u-boot-2009.03/board/qaz/Dev_Kit_060804/Dev_Kit_060804.c
|
48 |
18 |
qaztronic |
--- u-boot-2009.03_orig/board/qaz/Dev_Kit_060804/Dev_Kit_060804.c 1969-12-31 16:00:00.000000000 -0800
|
49 |
|
|
+++ u-boot-2009.03/board/qaz/Dev_Kit_060804/Dev_Kit_060804.c 2009-03-24 13:34:53.471013000 -0700
|
50 |
17 |
qaztronic |
@@ -0,0 +1,100 @@
|
51 |
18 |
qaztronic |
+/*
|
52 |
|
|
+ * (C) Copyright ????
|
53 |
|
|
+ * XXX, XXX@XXX.org
|
54 |
|
|
+ *
|
55 |
|
|
+ *
|
56 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
57 |
|
|
+ * project.
|
58 |
|
|
+ *
|
59 |
|
|
+ * This program is free software; you can redistribute it and/or
|
60 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
61 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
62 |
|
|
+ * the License, or (at your option) any later version.
|
63 |
|
|
+ *
|
64 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
65 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
66 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
67 |
|
|
+ * GNU General Public License for more details.
|
68 |
|
|
+ *
|
69 |
|
|
+ * You should have received a copy of the GNU General Public License
|
70 |
|
|
+ * along with this program; if not, write to the Free Software
|
71 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
72 |
|
|
+ * MA 02111-1307 USA
|
73 |
|
|
+ */
|
74 |
|
|
+
|
75 |
|
|
+#include
|
76 |
|
|
+#include
|
77 |
|
|
+#include
|
78 |
|
|
+
|
79 |
|
|
+
|
80 |
|
|
+DECLARE_GLOBAL_DATA_PTR;
|
81 |
|
|
+
|
82 |
|
|
+// extern unsigned int _data_start, _data_lma_start, _data_end;
|
83 |
|
|
+// extern unsigned int _bss_start, _bss_end;
|
84 |
|
|
+
|
85 |
|
|
+int board_early_init_f (void)
|
86 |
|
|
+{
|
87 |
|
|
+// memcpy( (void *)_data_start, (void *)_data_lma_start, (_data_end - _data_start) );
|
88 |
|
|
+
|
89 |
|
|
+// memset ( (void *)_bss_start, 0, ( _bss_end - _bss_start ) );
|
90 |
|
|
+
|
91 |
|
|
+ return 0;
|
92 |
|
|
+}
|
93 |
|
|
+
|
94 |
|
|
+
|
95 |
|
|
+/*
|
96 |
|
|
+ * Check Board Identity:
|
97 |
|
|
+ */
|
98 |
|
|
+int checkboard (void)
|
99 |
|
|
+{
|
100 |
|
|
+ char str[64];
|
101 |
|
|
+ int i = getenv_r ("serial#", str, sizeof(str));
|
102 |
|
|
+
|
103 |
|
|
+ puts ("Board: ");
|
104 |
|
|
+
|
105 |
|
|
+ if (i == -1) {
|
106 |
|
|
+ puts ("### No HW ID - assuming ???");
|
107 |
|
|
+ } else {
|
108 |
|
|
+ puts(str);
|
109 |
|
|
+ }
|
110 |
|
|
+
|
111 |
|
|
+ putc ('\n');
|
112 |
|
|
+
|
113 |
|
|
+ return 0;
|
114 |
|
|
+}
|
115 |
|
|
+
|
116 |
|
|
+
|
117 |
|
|
+
|
118 |
|
|
+/*
|
119 |
|
|
+ * post code for de1 board
|
120 |
|
|
+ */
|
121 |
|
|
+void set_de1_post( unsigned int post_code )
|
122 |
|
|
+{
|
123 |
|
|
+ gd->bd->post_code = post_code;
|
124 |
|
|
+
|
125 |
|
|
+ *((volatile unsigned int *)(0x5ffffffc)) = gd->bd->post_code;
|
126 |
|
|
+ *((volatile unsigned int *)(0x5ffffffc)) = 0xcea5e0ff;
|
127 |
|
|
+}
|
128 |
|
|
+
|
129 |
|
|
+
|
130 |
|
|
+void init_de1_post( void )
|
131 |
|
|
+{
|
132 |
|
|
+ gd->bd->post_code = 0;
|
133 |
|
|
+
|
134 |
|
|
+ *((volatile unsigned int *)(0x5ffffffc)) = gd->bd->post_code;
|
135 |
|
|
+ *((volatile unsigned int *)(0x5ffffffc)) = 0xcea5e0ff;
|
136 |
|
|
+}
|
137 |
|
|
+
|
138 |
|
|
+
|
139 |
|
|
+int de1_post_incr( void )
|
140 |
|
|
+{
|
141 |
|
|
+ gd->bd->post_code++;
|
142 |
|
|
+
|
143 |
|
|
+ *((volatile unsigned int *)(0x5ffffffc)) = gd->bd->post_code;
|
144 |
|
|
+ *((volatile unsigned int *)(0x5ffffffc)) = 0xcea5e0ff;
|
145 |
|
|
+
|
146 |
|
|
+ return(0);
|
147 |
|
|
+}
|
148 |
|
|
+
|
149 |
|
|
+
|
150 |
|
|
+
|
151 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/board/qaz/Dev_Kit_060804/Makefile u-boot-2009.03/board/qaz/Dev_Kit_060804/Makefile
|
152 |
18 |
qaztronic |
--- u-boot-2009.03_orig/board/qaz/Dev_Kit_060804/Makefile 1969-12-31 16:00:00.000000000 -0800
|
153 |
|
|
+++ u-boot-2009.03/board/qaz/Dev_Kit_060804/Makefile 2009-03-24 13:34:53.471013000 -0700
|
154 |
17 |
qaztronic |
@@ -0,0 +1,50 @@
|
155 |
18 |
qaztronic |
+#
|
156 |
|
|
+# (C) Copyright 2000-2006
|
157 |
|
|
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
158 |
|
|
+#
|
159 |
|
|
+# See file CREDITS for list of people who contributed to this
|
160 |
|
|
+# project.
|
161 |
|
|
+#
|
162 |
|
|
+# This program is free software; you can redistribute it and/or
|
163 |
|
|
+# modify it under the terms of the GNU General Public License as
|
164 |
|
|
+# published by the Free Software Foundation; either version 2 of
|
165 |
|
|
+# the License, or (at your option) any later version.
|
166 |
|
|
+#
|
167 |
|
|
+# This program is distributed in the hope that it will be useful,
|
168 |
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
169 |
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
170 |
|
|
+# GNU General Public License for more details.
|
171 |
|
|
+#
|
172 |
|
|
+# You should have received a copy of the GNU General Public License
|
173 |
|
|
+# along with this program; if not, write to the Free Software
|
174 |
|
|
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
175 |
|
|
+# MA 02111-1307 USA
|
176 |
|
|
+#
|
177 |
|
|
+
|
178 |
|
|
+include $(TOPDIR)/config.mk
|
179 |
|
|
+
|
180 |
|
|
+LIB = $(obj)lib$(BOARD).a
|
181 |
|
|
+
|
182 |
|
|
+COBJS := Dev_Kit_060804.o
|
183 |
|
|
+
|
184 |
|
|
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
185 |
|
|
+OBJS := $(addprefix $(obj),$(COBJS))
|
186 |
|
|
+SOBJS := $(addprefix $(obj),$(SOBJS))
|
187 |
|
|
+
|
188 |
|
|
+$(LIB): $(obj).depend $(OBJS)
|
189 |
|
|
+ $(AR) $(ARFLAGS) $@ $(OBJS)
|
190 |
|
|
+
|
191 |
|
|
+clean:
|
192 |
|
|
+ rm -f $(SOBJS) $(OBJS)
|
193 |
|
|
+
|
194 |
|
|
+distclean: clean
|
195 |
|
|
+ rm -f $(LIB) core *.bak $(obj).depend
|
196 |
|
|
+
|
197 |
|
|
+#########################################################################
|
198 |
|
|
+
|
199 |
|
|
+# defines $(obj).depend target
|
200 |
|
|
+include $(SRCTREE)/rules.mk
|
201 |
|
|
+
|
202 |
|
|
+sinclude $(obj).depend
|
203 |
|
|
+
|
204 |
|
|
+#########################################################################
|
205 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/board/qaz/Dev_Kit_060804/u-boot.lds u-boot-2009.03/board/qaz/Dev_Kit_060804/u-boot.lds
|
206 |
18 |
qaztronic |
--- u-boot-2009.03_orig/board/qaz/Dev_Kit_060804/u-boot.lds 1969-12-31 16:00:00.000000000 -0800
|
207 |
|
|
+++ u-boot-2009.03/board/qaz/Dev_Kit_060804/u-boot.lds 2009-03-24 13:34:53.455424000 -0700
|
208 |
17 |
qaztronic |
@@ -0,0 +1,67 @@
|
209 |
18 |
qaztronic |
+/* ------------------------------ */
|
210 |
|
|
+/* link script */
|
211 |
|
|
+/* ------------------------------ */
|
212 |
|
|
+
|
213 |
|
|
+MEMORY
|
214 |
|
|
+ {
|
215 |
|
|
+ boot_rom_1 : ORIGIN = 0x00000000, LENGTH = 0x00020000
|
216 |
|
|
+ mem_bank_3 : ORIGIN = 0x30000000, LENGTH = 0x00010000
|
217 |
|
|
+ }
|
218 |
|
|
+
|
219 |
|
|
+ENTRY(_start)
|
220 |
|
|
+
|
221 |
|
|
+SECTIONS
|
222 |
|
|
+{
|
223 |
|
|
+ .text ALIGN(0x4):
|
224 |
|
|
+ {
|
225 |
|
|
+ . = 0x100;
|
226 |
|
|
+ *(.vectors)
|
227 |
|
|
+ __text_start = .;
|
228 |
|
|
+ . = 0x2000;
|
229 |
|
|
+ *(.text)
|
230 |
|
|
+ __text_end = .;
|
231 |
|
|
+ } > boot_rom_1
|
232 |
|
|
+
|
233 |
|
|
+ .rodata ALIGN(0x4):
|
234 |
|
|
+ {
|
235 |
|
|
+ __rodata_start = .;
|
236 |
|
|
+ *(.rodata)
|
237 |
|
|
+ *(.rodata.*)
|
238 |
|
|
+ __rodata_end = .;
|
239 |
|
|
+ } > boot_rom_1
|
240 |
|
|
+
|
241 |
|
|
+ .u_boot_cmd ALIGN(0x4):
|
242 |
|
|
+ {
|
243 |
|
|
+ . = .;
|
244 |
|
|
+ ___u_boot_cmd_start = .;
|
245 |
|
|
+ *(.u_boot_cmd)
|
246 |
|
|
+ ___u_boot_cmd_end = .;
|
247 |
|
|
+ } > boot_rom_1
|
248 |
|
|
+
|
249 |
|
|
+ . = ALIGN(4);
|
250 |
|
|
+ __data_lma_start = .;
|
251 |
|
|
+ .data :
|
252 |
|
|
+ {
|
253 |
|
|
+ __data_start = .;
|
254 |
|
|
+ *(.data)
|
255 |
|
|
+ __data_end = .;
|
256 |
|
|
+ } > boot_rom_1
|
257 |
|
|
+
|
258 |
|
|
+ . = ALIGN(4);
|
259 |
|
|
+ .bss (NOLOAD):
|
260 |
|
|
+ {
|
261 |
|
|
+ __bss_start = .;
|
262 |
|
|
+ *(.bss)
|
263 |
|
|
+ __bss_end = .;
|
264 |
|
|
+ } > mem_bank_3
|
265 |
|
|
+
|
266 |
|
|
+ . = ALIGN(4);
|
267 |
|
|
+ .stack (NOLOAD) :
|
268 |
|
|
+ {
|
269 |
|
|
+ __stack_start = .;
|
270 |
|
|
+ *(.stack)
|
271 |
|
|
+ __stack_end = .;
|
272 |
|
|
+ } > mem_bank_3
|
273 |
|
|
+
|
274 |
|
|
+ __end = . ;
|
275 |
|
|
+}
|
276 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/board/qaz/de1_or1k/Makefile u-boot-2009.03/board/qaz/de1_or1k/Makefile
|
277 |
18 |
qaztronic |
--- u-boot-2009.03_orig/board/qaz/de1_or1k/Makefile 1969-12-31 16:00:00.000000000 -0800
|
278 |
|
|
+++ u-boot-2009.03/board/qaz/de1_or1k/Makefile 2009-03-24 13:34:53.096877000 -0700
|
279 |
17 |
qaztronic |
@@ -0,0 +1,50 @@
|
280 |
18 |
qaztronic |
+#
|
281 |
|
|
+# (C) Copyright 2000-2006
|
282 |
|
|
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
283 |
|
|
+#
|
284 |
|
|
+# See file CREDITS for list of people who contributed to this
|
285 |
|
|
+# project.
|
286 |
|
|
+#
|
287 |
|
|
+# This program is free software; you can redistribute it and/or
|
288 |
|
|
+# modify it under the terms of the GNU General Public License as
|
289 |
|
|
+# published by the Free Software Foundation; either version 2 of
|
290 |
|
|
+# the License, or (at your option) any later version.
|
291 |
|
|
+#
|
292 |
|
|
+# This program is distributed in the hope that it will be useful,
|
293 |
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
294 |
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
295 |
|
|
+# GNU General Public License for more details.
|
296 |
|
|
+#
|
297 |
|
|
+# You should have received a copy of the GNU General Public License
|
298 |
|
|
+# along with this program; if not, write to the Free Software
|
299 |
|
|
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
300 |
|
|
+# MA 02111-1307 USA
|
301 |
|
|
+#
|
302 |
|
|
+
|
303 |
|
|
+include $(TOPDIR)/config.mk
|
304 |
|
|
+
|
305 |
|
|
+LIB = $(obj)lib$(BOARD).a
|
306 |
|
|
+
|
307 |
|
|
+COBJS := de1_or1k.o
|
308 |
|
|
+
|
309 |
|
|
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
310 |
|
|
+OBJS := $(addprefix $(obj),$(COBJS))
|
311 |
|
|
+SOBJS := $(addprefix $(obj),$(SOBJS))
|
312 |
|
|
+
|
313 |
|
|
+$(LIB): $(obj).depend $(OBJS)
|
314 |
|
|
+ $(AR) $(ARFLAGS) $@ $(OBJS)
|
315 |
|
|
+
|
316 |
|
|
+clean:
|
317 |
|
|
+ rm -f $(SOBJS) $(OBJS)
|
318 |
|
|
+
|
319 |
|
|
+distclean: clean
|
320 |
|
|
+ rm -f $(LIB) core *.bak $(obj).depend
|
321 |
|
|
+
|
322 |
|
|
+#########################################################################
|
323 |
|
|
+
|
324 |
|
|
+# defines $(obj).depend target
|
325 |
|
|
+include $(SRCTREE)/rules.mk
|
326 |
|
|
+
|
327 |
|
|
+sinclude $(obj).depend
|
328 |
|
|
+
|
329 |
|
|
+#########################################################################
|
330 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/board/qaz/de1_or1k/de1_or1k.c u-boot-2009.03/board/qaz/de1_or1k/de1_or1k.c
|
331 |
18 |
qaztronic |
--- u-boot-2009.03_orig/board/qaz/de1_or1k/de1_or1k.c 1969-12-31 16:00:00.000000000 -0800
|
332 |
|
|
+++ u-boot-2009.03/board/qaz/de1_or1k/de1_or1k.c 2009-03-24 13:34:53.081288000 -0700
|
333 |
17 |
qaztronic |
@@ -0,0 +1,100 @@
|
334 |
18 |
qaztronic |
+/*
|
335 |
|
|
+ * (C) Copyright ????
|
336 |
|
|
+ * XXX, XXX@XXX.org
|
337 |
|
|
+ *
|
338 |
|
|
+ *
|
339 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
340 |
|
|
+ * project.
|
341 |
|
|
+ *
|
342 |
|
|
+ * This program is free software; you can redistribute it and/or
|
343 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
344 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
345 |
|
|
+ * the License, or (at your option) any later version.
|
346 |
|
|
+ *
|
347 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
348 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
349 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
350 |
|
|
+ * GNU General Public License for more details.
|
351 |
|
|
+ *
|
352 |
|
|
+ * You should have received a copy of the GNU General Public License
|
353 |
|
|
+ * along with this program; if not, write to the Free Software
|
354 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
355 |
|
|
+ * MA 02111-1307 USA
|
356 |
|
|
+ */
|
357 |
|
|
+
|
358 |
|
|
+#include
|
359 |
|
|
+#include
|
360 |
|
|
+#include
|
361 |
|
|
+
|
362 |
|
|
+
|
363 |
|
|
+DECLARE_GLOBAL_DATA_PTR;
|
364 |
|
|
+
|
365 |
|
|
+// extern unsigned int _data_start, _data_lma_start, _data_end;
|
366 |
|
|
+// extern unsigned int _bss_start, _bss_end;
|
367 |
|
|
+
|
368 |
|
|
+int board_early_init_f (void)
|
369 |
|
|
+{
|
370 |
|
|
+// memcpy( (void *)_data_start, (void *)_data_lma_start, (_data_end - _data_start) );
|
371 |
|
|
+
|
372 |
|
|
+// memset ( (void *)_bss_start, 0, ( _bss_end - _bss_start ) );
|
373 |
|
|
+
|
374 |
|
|
+ return 0;
|
375 |
|
|
+}
|
376 |
|
|
+
|
377 |
|
|
+
|
378 |
|
|
+/*
|
379 |
|
|
+ * Check Board Identity:
|
380 |
|
|
+ */
|
381 |
|
|
+int checkboard (void)
|
382 |
|
|
+{
|
383 |
|
|
+ char str[64];
|
384 |
|
|
+ int i = getenv_r ("serial#", str, sizeof(str));
|
385 |
|
|
+
|
386 |
|
|
+ puts ("Board: ");
|
387 |
|
|
+
|
388 |
|
|
+ if (i == -1) {
|
389 |
|
|
+ puts ("### No HW ID - assuming DE1_OR1k");
|
390 |
|
|
+ } else {
|
391 |
|
|
+ puts(str);
|
392 |
|
|
+ }
|
393 |
|
|
+
|
394 |
|
|
+ putc ('\n');
|
395 |
|
|
+
|
396 |
|
|
+ return 0;
|
397 |
|
|
+}
|
398 |
|
|
+
|
399 |
|
|
+
|
400 |
|
|
+
|
401 |
|
|
+/*
|
402 |
|
|
+ * post code for de1 board
|
403 |
|
|
+ */
|
404 |
|
|
+void set_de1_post( unsigned int post_code )
|
405 |
|
|
+{
|
406 |
|
|
+ gd->bd->post_code = post_code;
|
407 |
|
|
+
|
408 |
|
|
+ *((volatile unsigned int *)(0x2ffffffc)) = gd->bd->post_code;
|
409 |
|
|
+ *((volatile unsigned int *)(0x2ffffffc)) = 0xcea5e0ff;
|
410 |
|
|
+}
|
411 |
|
|
+
|
412 |
|
|
+
|
413 |
|
|
+void init_de1_post( void )
|
414 |
|
|
+{
|
415 |
|
|
+ gd->bd->post_code = 0;
|
416 |
|
|
+
|
417 |
|
|
+ *((volatile unsigned int *)(0x2ffffffc)) = gd->bd->post_code;
|
418 |
|
|
+ *((volatile unsigned int *)(0x2ffffffc)) = 0xcea5e0ff;
|
419 |
|
|
+}
|
420 |
|
|
+
|
421 |
|
|
+
|
422 |
|
|
+int de1_post_incr( void )
|
423 |
|
|
+{
|
424 |
|
|
+ gd->bd->post_code++;
|
425 |
|
|
+
|
426 |
|
|
+ *((volatile unsigned int *)(0x2ffffffc)) = gd->bd->post_code;
|
427 |
|
|
+ *((volatile unsigned int *)(0x2ffffffc)) = 0xcea5e0ff;
|
428 |
|
|
+
|
429 |
|
|
+ return(0);
|
430 |
|
|
+}
|
431 |
|
|
+
|
432 |
|
|
+
|
433 |
|
|
+
|
434 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/board/qaz/de1_or1k/u-boot.lds u-boot-2009.03/board/qaz/de1_or1k/u-boot.lds
|
435 |
18 |
qaztronic |
--- u-boot-2009.03_orig/board/qaz/de1_or1k/u-boot.lds 1969-12-31 16:00:00.000000000 -0800
|
436 |
|
|
+++ u-boot-2009.03/board/qaz/de1_or1k/u-boot.lds 2009-03-24 13:34:53.455424000 -0700
|
437 |
17 |
qaztronic |
@@ -0,0 +1,67 @@
|
438 |
18 |
qaztronic |
+/* ------------------------------ */
|
439 |
|
|
+/* link script */
|
440 |
|
|
+/* ------------------------------ */
|
441 |
|
|
+
|
442 |
|
|
+MEMORY
|
443 |
|
|
+ {
|
444 |
|
|
+ boot_rom_1 : ORIGIN = 0x00000000, LENGTH = 0x00020000
|
445 |
|
|
+ mem_bank_3 : ORIGIN = 0x30000000, LENGTH = 0x00010000
|
446 |
|
|
+ }
|
447 |
|
|
+
|
448 |
|
|
+ENTRY(_start)
|
449 |
|
|
+
|
450 |
|
|
+SECTIONS
|
451 |
|
|
+{
|
452 |
|
|
+ .text ALIGN(0x4):
|
453 |
|
|
+ {
|
454 |
|
|
+ . = 0x100;
|
455 |
|
|
+ *(.vectors)
|
456 |
|
|
+ __text_start = .;
|
457 |
|
|
+ . = 0x2000;
|
458 |
|
|
+ *(.text)
|
459 |
|
|
+ __text_end = .;
|
460 |
|
|
+ } > boot_rom_1
|
461 |
|
|
+
|
462 |
|
|
+ .rodata ALIGN(0x4):
|
463 |
|
|
+ {
|
464 |
|
|
+ __rodata_start = .;
|
465 |
|
|
+ *(.rodata)
|
466 |
|
|
+ *(.rodata.*)
|
467 |
|
|
+ __rodata_end = .;
|
468 |
|
|
+ } > boot_rom_1
|
469 |
|
|
+
|
470 |
|
|
+ .u_boot_cmd ALIGN(0x4):
|
471 |
|
|
+ {
|
472 |
|
|
+ . = .;
|
473 |
|
|
+ ___u_boot_cmd_start = .;
|
474 |
|
|
+ *(.u_boot_cmd)
|
475 |
|
|
+ ___u_boot_cmd_end = .;
|
476 |
|
|
+ } > boot_rom_1
|
477 |
|
|
+
|
478 |
|
|
+ . = ALIGN(4);
|
479 |
|
|
+ __data_lma_start = .;
|
480 |
|
|
+ .data :
|
481 |
|
|
+ {
|
482 |
|
|
+ __data_start = .;
|
483 |
|
|
+ *(.data)
|
484 |
|
|
+ __data_end = .;
|
485 |
|
|
+ } > boot_rom_1
|
486 |
|
|
+
|
487 |
|
|
+ . = ALIGN(4);
|
488 |
|
|
+ .bss (NOLOAD):
|
489 |
|
|
+ {
|
490 |
|
|
+ __bss_start = .;
|
491 |
|
|
+ *(.bss)
|
492 |
|
|
+ __bss_end = .;
|
493 |
|
|
+ } > mem_bank_3
|
494 |
|
|
+
|
495 |
|
|
+ . = ALIGN(4);
|
496 |
|
|
+ .stack (NOLOAD) :
|
497 |
|
|
+ {
|
498 |
|
|
+ __stack_start = .;
|
499 |
|
|
+ *(.stack)
|
500 |
|
|
+ __stack_end = .;
|
501 |
|
|
+ } > mem_bank_3
|
502 |
|
|
+
|
503 |
|
|
+ __end = . ;
|
504 |
|
|
+}
|
505 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/common/cmd_bootm.c u-boot-2009.03/common/cmd_bootm.c
|
506 |
18 |
qaztronic |
--- u-boot-2009.03_orig/common/cmd_bootm.c 2009-03-21 14:04:41.000000000 -0700
|
507 |
|
|
+++ u-boot-2009.03/common/cmd_bootm.c 2009-03-25 16:25:04.705123000 -0700
|
508 |
17 |
qaztronic |
@@ -191,6 +191,8 @@
|
509 |
|
|
#define IH_INITRD_ARCH IH_ARCH_SH
|
510 |
|
|
#elif defined(__sparc__)
|
511 |
|
|
#define IH_INITRD_ARCH IH_ARCH_SPARC
|
512 |
|
|
+#elif defined(__or1200__)
|
513 |
|
|
+ #define IH_INITRD_ARCH IH_ARCH_INVALID
|
514 |
|
|
#else
|
515 |
|
|
# error Unknown CPU type
|
516 |
|
|
#endif
|
517 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/cpu/or1200/Makefile u-boot-2009.03/cpu/or1200/Makefile
|
518 |
18 |
qaztronic |
--- u-boot-2009.03_orig/cpu/or1200/Makefile 1969-12-31 16:00:00.000000000 -0800
|
519 |
|
|
+++ u-boot-2009.03/cpu/or1200/Makefile 2009-03-24 13:32:29.713725000 -0700
|
520 |
17 |
qaztronic |
@@ -0,0 +1,57 @@
|
521 |
18 |
qaztronic |
+#
|
522 |
|
|
+# (C) Copyright 2000-2006
|
523 |
|
|
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
524 |
|
|
+#
|
525 |
|
|
+# (C) Copyright 2007
|
526 |
|
|
+# Nobuhiro Iwamatsu
|
527 |
|
|
+#
|
528 |
|
|
+# (C) Copyright 2007
|
529 |
|
|
+# Yoshihiro Shimoda
|
530 |
|
|
+#
|
531 |
|
|
+# See file CREDITS for list of people who contributed to this
|
532 |
|
|
+# project.
|
533 |
|
|
+#
|
534 |
|
|
+# This program is free software; you can redistribute it and/or
|
535 |
|
|
+# modify it under the terms of the GNU General Public License as
|
536 |
|
|
+# published by the Free Software Foundation; either version 2 of
|
537 |
|
|
+# the License, or (at your option) any later version.
|
538 |
|
|
+#
|
539 |
|
|
+# This program is distributed in the hope that it will be useful,
|
540 |
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
541 |
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
542 |
|
|
+# GNU General Public License for more details.
|
543 |
|
|
+#
|
544 |
|
|
+# You should have received a copy of the GNU General Public License
|
545 |
|
|
+# along with this program; if not, write to the Free Software
|
546 |
|
|
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
547 |
|
|
+# MA 02111-1307 USA
|
548 |
|
|
+#
|
549 |
|
|
+
|
550 |
|
|
+include $(TOPDIR)/config.mk
|
551 |
|
|
+
|
552 |
|
|
+LIB = $(obj)lib$(CPU).a
|
553 |
|
|
+
|
554 |
|
|
+SOBJS = start.o
|
555 |
|
|
+COBJS = interrupts.o watchdog.o time.o cpu.o
|
556 |
|
|
+
|
557 |
|
|
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
558 |
|
|
+OBJS := $(addprefix $(obj),$(COBJS))
|
559 |
|
|
+SOBJS := $(addprefix $(obj),$(SOBJS))
|
560 |
|
|
+
|
561 |
|
|
+$(LIB): $(OBJS) $(SOBJS)
|
562 |
|
|
+ $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
|
563 |
|
|
+
|
564 |
|
|
+clean:
|
565 |
|
|
+ rm -f $(SOBJS) $(OBJS)
|
566 |
|
|
+
|
567 |
|
|
+distclean: clean
|
568 |
|
|
+ rm -f $(LIB) core *.bak $(obj).depend
|
569 |
|
|
+
|
570 |
|
|
+#########################################################################
|
571 |
|
|
+
|
572 |
|
|
+# defines $(obj).depend target
|
573 |
|
|
+include $(SRCTREE)/rules.mk
|
574 |
|
|
+
|
575 |
|
|
+sinclude $(obj).depend
|
576 |
|
|
+
|
577 |
|
|
+#########################################################################
|
578 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/cpu/or1200/cpu.c u-boot-2009.03/cpu/or1200/cpu.c
|
579 |
18 |
qaztronic |
--- u-boot-2009.03_orig/cpu/or1200/cpu.c 1969-12-31 16:00:00.000000000 -0800
|
580 |
|
|
+++ u-boot-2009.03/cpu/or1200/cpu.c 2009-03-24 13:32:29.713725000 -0700
|
581 |
17 |
qaztronic |
@@ -0,0 +1,35 @@
|
582 |
18 |
qaztronic |
+/*
|
583 |
|
|
+ * (C) Copyright 2004, Psyent Corporation
|
584 |
|
|
+ * Scott McNutt
|
585 |
|
|
+ *
|
586 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
587 |
|
|
+ * project.
|
588 |
|
|
+ *
|
589 |
|
|
+ * This program is free software; you can redistribute it and/or
|
590 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
591 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
592 |
|
|
+ * the License, or (at your option) any later version.
|
593 |
|
|
+ *
|
594 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
595 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
596 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
597 |
|
|
+ * GNU General Public License for more details.
|
598 |
|
|
+ *
|
599 |
|
|
+ * You should have received a copy of the GNU General Public License
|
600 |
|
|
+ * along with this program; if not, write to the Free Software
|
601 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
602 |
|
|
+ * MA 02111-1307 USA
|
603 |
|
|
+ */
|
604 |
|
|
+
|
605 |
|
|
+#include
|
606 |
|
|
+
|
607 |
|
|
+
|
608 |
|
|
+
|
609 |
|
|
+int do_reset (void)
|
610 |
|
|
+{
|
611 |
|
|
+ void (*rst)(void) = (void(*)(void))0x00000000;
|
612 |
|
|
+// void (*rst)(void) = (void(*)(void))CFG_RESET_ADDR;
|
613 |
|
|
+ disable_interrupts ();
|
614 |
|
|
+ rst();
|
615 |
|
|
+ return(0);
|
616 |
|
|
+}
|
617 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/cpu/or1200/interrupts.c u-boot-2009.03/cpu/or1200/interrupts.c
|
618 |
18 |
qaztronic |
--- u-boot-2009.03_orig/cpu/or1200/interrupts.c 1969-12-31 16:00:00.000000000 -0800
|
619 |
|
|
+++ u-boot-2009.03/cpu/or1200/interrupts.c 2009-03-24 13:32:29.698200000 -0700
|
620 |
17 |
qaztronic |
@@ -0,0 +1,42 @@
|
621 |
18 |
qaztronic |
+/*
|
622 |
|
|
+ * (C) Copyright 2007
|
623 |
|
|
+ * Yoshihiro Shimoda
|
624 |
|
|
+ *
|
625 |
|
|
+ * (C) Copyright 2007
|
626 |
|
|
+ * Nobuhiro Iwamatsu
|
627 |
|
|
+ *
|
628 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
629 |
|
|
+ * project.
|
630 |
|
|
+ *
|
631 |
|
|
+ * This program is free software; you can redistribute it and/or
|
632 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
633 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
634 |
|
|
+ * the License, or (at your option) any later version.
|
635 |
|
|
+ *
|
636 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
637 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
638 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
639 |
|
|
+ * GNU General Public License for more details.
|
640 |
|
|
+ *
|
641 |
|
|
+ * You should have received a copy of the GNU General Public License
|
642 |
|
|
+ * along with this program; if not, write to the Free Software
|
643 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
644 |
|
|
+ * MA 02111-1307 USA
|
645 |
|
|
+ */
|
646 |
|
|
+
|
647 |
|
|
+#include
|
648 |
|
|
+
|
649 |
|
|
+int interrupt_init(void)
|
650 |
|
|
+{
|
651 |
|
|
+ return 0;
|
652 |
|
|
+}
|
653 |
|
|
+
|
654 |
|
|
+void enable_interrupts(void)
|
655 |
|
|
+{
|
656 |
|
|
+
|
657 |
|
|
+}
|
658 |
|
|
+
|
659 |
|
|
+int disable_interrupts(void)
|
660 |
|
|
+{
|
661 |
|
|
+ return 0;
|
662 |
|
|
+}
|
663 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/cpu/or1200/start.S u-boot-2009.03/cpu/or1200/start.S
|
664 |
18 |
qaztronic |
--- u-boot-2009.03_orig/cpu/or1200/start.S 1969-12-31 16:00:00.000000000 -0800
|
665 |
|
|
+++ u-boot-2009.03/cpu/or1200/start.S 2009-03-24 13:32:29.713725000 -0700
|
666 |
17 |
qaztronic |
@@ -0,0 +1,27 @@
|
667 |
18 |
qaztronic |
+/* */
|
668 |
|
|
+/* */
|
669 |
|
|
+
|
670 |
|
|
+#include
|
671 |
|
|
+
|
672 |
|
|
+.section .stack, "aw", @nobits
|
673 |
|
|
+.space 0x8000
|
674 |
|
|
+_stack:
|
675 |
|
|
+
|
676 |
|
|
+.section .vectors, "ax"
|
677 |
|
|
+
|
678 |
|
|
+ .global _start
|
679 |
|
|
+_start:
|
680 |
|
|
+
|
681 |
|
|
+ /* Set stack pointer */
|
682 |
|
|
+ l.movhi r1,hi(_stack)
|
683 |
|
|
+ l.ori r1,r1,lo(_stack)
|
684 |
|
|
+
|
685 |
|
|
+ /* Jump to main */
|
686 |
|
|
+ l.movhi r2,hi(_board_init)
|
687 |
|
|
+ l.ori r2,r2,lo(_board_init)
|
688 |
|
|
+ l.jr r2
|
689 |
|
|
+ l.nop
|
690 |
|
|
+
|
691 |
|
|
+
|
692 |
|
|
+
|
693 |
17 |
qaztronic |
+
|
694 |
|
|
\ No newline at end of file
|
695 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/cpu/or1200/time.c u-boot-2009.03/cpu/or1200/time.c
|
696 |
18 |
qaztronic |
--- u-boot-2009.03_orig/cpu/or1200/time.c 1969-12-31 16:00:00.000000000 -0800
|
697 |
|
|
+++ u-boot-2009.03/cpu/or1200/time.c 2009-03-25 17:31:06.263350000 -0700
|
698 |
17 |
qaztronic |
@@ -0,0 +1,39 @@
|
699 |
|
|
+/*
|
700 |
|
|
+ * (C) Copyright 2007 Michal Simek
|
701 |
|
|
+ * (C) Copyright 2004 Atmark Techno, Inc.
|
702 |
|
|
+ *
|
703 |
|
|
+ * Michal SIMEK
|
704 |
|
|
+ * Yasushi SHOJI
|
705 |
|
|
+ *
|
706 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
707 |
|
|
+ * project.
|
708 |
|
|
+ *
|
709 |
|
|
+ * This program is free software; you can redistribute it and/or
|
710 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
711 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
712 |
|
|
+ * the License, or (at your option) any later version.
|
713 |
|
|
+ *
|
714 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
715 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
716 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
717 |
|
|
+ * GNU General Public License for more details.
|
718 |
|
|
+ *
|
719 |
|
|
+ * You should have received a copy of the GNU General Public License
|
720 |
|
|
+ * along with this program; if not, write to the Free Software
|
721 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
722 |
|
|
+ * MA 02111-1307 USA
|
723 |
|
|
+ */
|
724 |
|
|
+
|
725 |
|
|
+#include
|
726 |
|
|
+
|
727 |
|
|
+void udelay (unsigned long usec)
|
728 |
|
|
+{
|
729 |
|
|
+ unsigned int i;
|
730 |
|
|
+ for (i = 0; i < (usec * CONFIG_HZ / 10000000); i++);
|
731 |
|
|
+}
|
732 |
|
|
+
|
733 |
|
|
+
|
734 |
|
|
+ulong get_timer (ulong base_ticks)
|
735 |
|
|
+{
|
736 |
|
|
+ return 0;
|
737 |
|
|
+}
|
738 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/cpu/or1200/watchdog.c u-boot-2009.03/cpu/or1200/watchdog.c
|
739 |
18 |
qaztronic |
--- u-boot-2009.03_orig/cpu/or1200/watchdog.c 1969-12-31 16:00:00.000000000 -0800
|
740 |
|
|
+++ u-boot-2009.03/cpu/or1200/watchdog.c 2009-03-24 13:32:29.698200000 -0700
|
741 |
17 |
qaztronic |
@@ -0,0 +1,33 @@
|
742 |
18 |
qaztronic |
+/*
|
743 |
|
|
+ * (C) Copyright 2007
|
744 |
|
|
+ * Yoshihiro Shimoda
|
745 |
|
|
+ *
|
746 |
|
|
+ * This program is free software; you can redistribute it and/or
|
747 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
748 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
749 |
|
|
+ * the License, or (at your option) any later version.
|
750 |
|
|
+ *
|
751 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
752 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
753 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
754 |
|
|
+ * GNU General Public License for more details.
|
755 |
|
|
+ *
|
756 |
|
|
+ * You should have received a copy of the GNU General Public License
|
757 |
|
|
+ * along with this program; if not, write to the Free Software
|
758 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
759 |
|
|
+ * MA 02111-1307 USA
|
760 |
|
|
+ */
|
761 |
|
|
+
|
762 |
|
|
+#include
|
763 |
|
|
+#include
|
764 |
|
|
+
|
765 |
|
|
+int watchdog_init(void)
|
766 |
|
|
+{
|
767 |
|
|
+ return 0;
|
768 |
|
|
+}
|
769 |
|
|
+
|
770 |
|
|
+void reset_cpu(unsigned long ignored)
|
771 |
|
|
+{
|
772 |
|
|
+ while (1)
|
773 |
|
|
+ ;
|
774 |
|
|
+}
|
775 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/fs/yaffs2/Makefile u-boot-2009.03/fs/yaffs2/Makefile
|
776 |
18 |
qaztronic |
--- u-boot-2009.03_orig/fs/yaffs2/Makefile 2009-03-21 14:04:41.000000000 -0700
|
777 |
|
|
+++ u-boot-2009.03/fs/yaffs2/Makefile 2009-03-31 14:56:33.220296000 -0700
|
778 |
19 |
qaztronic |
@@ -14,7 +14,7 @@
|
779 |
|
|
#
|
780 |
|
|
# NB Warning this Makefile does not include header dependencies.
|
781 |
|
|
#
|
782 |
18 |
qaztronic |
-# $Id: Makefile,v 1.15 2007/07/18 19:40:38 charles Exp $
|
783 |
|
|
+# $Id: Makefile,v 1.1.1.1 2009/03/25 22:22:12 kenagy Exp $
|
784 |
19 |
qaztronic |
|
785 |
|
|
#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
|
786 |
|
|
include $(TOPDIR)/config.mk
|
787 |
|
|
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/bitops.h u-boot-2009.03/include/asm-or1200/bitops.h
|
788 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/bitops.h 1969-12-31 16:00:00.000000000 -0800
|
789 |
|
|
+++ u-boot-2009.03/include/asm-or1200/bitops.h 2008-08-26 18:13:42.783673400 -0700
|
790 |
17 |
qaztronic |
@@ -0,0 +1,554 @@
|
791 |
|
|
+/* asm/bitops.h for Linux/or32
|
792 |
|
|
+ *
|
793 |
|
|
+ * __PHX__ TODO: asm versions
|
794 |
|
|
+ *
|
795 |
|
|
+ */
|
796 |
|
|
+
|
797 |
|
|
+#ifdef __KERNEL__
|
798 |
|
|
+#ifndef _OR32_BITOPS_H
|
799 |
|
|
+#define _OR32_BITOPS_H
|
800 |
|
|
+
|
801 |
|
|
+#include
|
802 |
|
|
+#include
|
803 |
|
|
+// #include
|
804 |
|
|
+
|
805 |
|
|
+
|
806 |
|
|
+static __inline__ int set_bit(int nr, volatile void * a)
|
807 |
|
|
+{
|
808 |
|
|
+ int * addr = (void *)a;
|
809 |
|
|
+ int mask, retval;
|
810 |
|
|
+ unsigned long flags;
|
811 |
|
|
+
|
812 |
|
|
+ addr += nr >> 5;
|
813 |
|
|
+ mask = 1 << (nr & 0x1f);
|
814 |
|
|
+ local_irq_save(flags);
|
815 |
|
|
+ retval = (mask & *addr) != 0;
|
816 |
|
|
+ *addr |= mask;
|
817 |
|
|
+ local_irq_restore(flags);
|
818 |
|
|
+ return retval;
|
819 |
|
|
+}
|
820 |
|
|
+
|
821 |
|
|
+/*
|
822 |
|
|
+ * non-atomic version
|
823 |
|
|
+ */
|
824 |
|
|
+static __inline__ void __set_bit(int nr, volatile unsigned long *addr)
|
825 |
|
|
+{
|
826 |
|
|
+ unsigned long mask = 1 << (nr & 0x1f);
|
827 |
|
|
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
|
828 |
|
|
+
|
829 |
|
|
+ *p |= mask;
|
830 |
|
|
+}
|
831 |
|
|
+
|
832 |
|
|
+static __inline__ int clear_bit(int nr, volatile void * a)
|
833 |
|
|
+{
|
834 |
|
|
+ int * addr = (void *)a;
|
835 |
|
|
+ int mask, retval;
|
836 |
|
|
+ unsigned long flags;
|
837 |
|
|
+
|
838 |
|
|
+ addr += nr >> 5;
|
839 |
|
|
+ mask = 1 << (nr & 0x1f);
|
840 |
|
|
+ local_irq_save(flags);
|
841 |
|
|
+ retval = (mask & *addr) != 0;
|
842 |
|
|
+ *addr &= ~mask;
|
843 |
|
|
+ local_irq_restore(flags);
|
844 |
|
|
+ return retval;
|
845 |
|
|
+}
|
846 |
|
|
+
|
847 |
|
|
+/*
|
848 |
|
|
+ * non-atomic version
|
849 |
|
|
+ */
|
850 |
|
|
+static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
|
851 |
|
|
+{
|
852 |
|
|
+ unsigned long mask = 1 << (nr & 0x1f);
|
853 |
|
|
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
|
854 |
|
|
+
|
855 |
|
|
+ *p &= ~mask;
|
856 |
|
|
+}
|
857 |
|
|
+
|
858 |
|
|
+static __inline__ unsigned long change_bit(unsigned long nr, void *addr)
|
859 |
|
|
+{
|
860 |
|
|
+ int mask;
|
861 |
|
|
+ unsigned long flags;
|
862 |
|
|
+ unsigned long *ADDR = (unsigned long *) addr;
|
863 |
|
|
+ unsigned long oldbit;
|
864 |
|
|
+
|
865 |
|
|
+ ADDR += nr >> 5;
|
866 |
|
|
+ mask = 1 << (nr & 31);
|
867 |
|
|
+ local_irq_save(flags);
|
868 |
|
|
+ oldbit = (mask & *ADDR);
|
869 |
|
|
+ *ADDR ^= mask;
|
870 |
|
|
+ local_irq_restore(flags);
|
871 |
|
|
+ return oldbit != 0;
|
872 |
|
|
+}
|
873 |
|
|
+
|
874 |
|
|
+/*
|
875 |
|
|
+ * non-atomic version
|
876 |
|
|
+ */
|
877 |
|
|
+static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
|
878 |
|
|
+{
|
879 |
|
|
+ unsigned long mask = 1 << (nr & 0x1f);
|
880 |
|
|
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
|
881 |
|
|
+
|
882 |
|
|
+ *p ^= mask;
|
883 |
|
|
+}
|
884 |
|
|
+
|
885 |
|
|
+static __inline__ int test_bit(int nr, const void *a)
|
886 |
|
|
+{
|
887 |
|
|
+ unsigned int mask;
|
888 |
|
|
+ unsigned int *adr = (unsigned int *)a;
|
889 |
|
|
+
|
890 |
|
|
+ adr += nr >> 5;
|
891 |
|
|
+ mask = 1 << (nr & 0x1f);
|
892 |
|
|
+ return ((mask & *adr) != 0);
|
893 |
|
|
+}
|
894 |
|
|
+
|
895 |
|
|
+static __inline__ int test_and_set_bit(int nr, void *addr)
|
896 |
|
|
+{
|
897 |
|
|
+ unsigned int mask, retval;
|
898 |
|
|
+ unsigned long flags;
|
899 |
|
|
+ unsigned int *adr = (unsigned int *)addr;
|
900 |
|
|
+
|
901 |
|
|
+ adr += nr >> 5;
|
902 |
|
|
+ mask = 1 << (nr & 0x1f);
|
903 |
|
|
+ local_irq_save(flags);
|
904 |
|
|
+ retval = (mask & *adr) != 0;
|
905 |
|
|
+ *adr |= mask;
|
906 |
|
|
+ local_irq_restore(flags);
|
907 |
|
|
+ return retval;
|
908 |
|
|
+}
|
909 |
|
|
+
|
910 |
|
|
+/*
|
911 |
|
|
+ * non-atomic version
|
912 |
|
|
+ */
|
913 |
|
|
+static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr)
|
914 |
|
|
+{
|
915 |
|
|
+ unsigned long mask = 1 << (nr & 0x1f);
|
916 |
|
|
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
|
917 |
|
|
+ unsigned long old = *p;
|
918 |
|
|
+
|
919 |
|
|
+ *p = old | mask;
|
920 |
|
|
+ return (old & mask) != 0;
|
921 |
|
|
+}
|
922 |
|
|
+
|
923 |
|
|
+
|
924 |
|
|
+static __inline__ int test_and_clear_bit(int nr, void *addr)
|
925 |
|
|
+{
|
926 |
|
|
+ unsigned int mask, retval;
|
927 |
|
|
+ unsigned long flags;
|
928 |
|
|
+ unsigned int *adr = (unsigned int *)addr;
|
929 |
|
|
+
|
930 |
|
|
+ adr += nr >> 5;
|
931 |
|
|
+ mask = 1 << (nr & 0x1f);
|
932 |
|
|
+ local_irq_save(flags);
|
933 |
|
|
+ retval = (mask & *adr) != 0;
|
934 |
|
|
+ *adr &= ~mask;
|
935 |
|
|
+ local_irq_restore(flags);
|
936 |
|
|
+ return retval;
|
937 |
|
|
+}
|
938 |
|
|
+
|
939 |
|
|
+/*
|
940 |
|
|
+ * non-atomic version
|
941 |
|
|
+ */
|
942 |
|
|
+static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
|
943 |
|
|
+{
|
944 |
|
|
+ unsigned long mask = 1 << (nr & 0x1f);
|
945 |
|
|
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
|
946 |
|
|
+ unsigned long old = *p;
|
947 |
|
|
+
|
948 |
|
|
+ *p = old & ~mask;
|
949 |
|
|
+ return (old & mask) != 0;
|
950 |
|
|
+}
|
951 |
|
|
+
|
952 |
|
|
+static __inline__ int test_and_change_bit(int nr, void *addr)
|
953 |
|
|
+{
|
954 |
|
|
+ unsigned int mask, retval;
|
955 |
|
|
+ unsigned long flags;
|
956 |
|
|
+ unsigned int *adr = (unsigned int *)addr;
|
957 |
|
|
+ adr += nr >> 5;
|
958 |
|
|
+ mask = 1 << (nr & 0x1f);
|
959 |
|
|
+ local_irq_save(flags);
|
960 |
|
|
+ retval = (mask & *adr) != 0;
|
961 |
|
|
+ *adr ^= mask;
|
962 |
|
|
+ local_irq_restore(flags);
|
963 |
|
|
+ return retval;
|
964 |
|
|
+}
|
965 |
|
|
+
|
966 |
|
|
+/*
|
967 |
|
|
+ * non-atomic version
|
968 |
|
|
+ */
|
969 |
|
|
+static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr)
|
970 |
|
|
+{
|
971 |
|
|
+ unsigned long mask = 1 << (nr & 0x1f);
|
972 |
|
|
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
|
973 |
|
|
+ unsigned long old = *p;
|
974 |
|
|
+
|
975 |
|
|
+ *p = old ^ mask;
|
976 |
|
|
+ return (old & mask) != 0;
|
977 |
|
|
+}
|
978 |
|
|
+
|
979 |
|
|
+#define __change_bit(nr, addr) (void)__test_and_change_bit(nr, addr)
|
980 |
|
|
+
|
981 |
|
|
+/*
|
982 |
|
|
+ * Find-bit routines..
|
983 |
|
|
+ */
|
984 |
|
|
+
|
985 |
|
|
+/*
|
986 |
|
|
+ * fls: find last bit set.
|
987 |
|
|
+ */
|
988 |
|
|
+
|
989 |
|
|
+#define fls(x) generic_fls(x)
|
990 |
|
|
+
|
991 |
|
|
+/* The easy/cheese version for now. */
|
992 |
|
|
+static __inline__ unsigned long ffz(unsigned long word)
|
993 |
|
|
+{
|
994 |
|
|
+ unsigned long result = 0;
|
995 |
|
|
+
|
996 |
|
|
+ while(word & 1) {
|
997 |
|
|
+ result++;
|
998 |
|
|
+ word >>= 1;
|
999 |
|
|
+ }
|
1000 |
|
|
+ return result;
|
1001 |
|
|
+}
|
1002 |
|
|
+
|
1003 |
|
|
+/*
|
1004 |
|
|
+ * ffs: find first bit set. This is defined the same way as
|
1005 |
|
|
+ * the libc and compiler builtin ffs routines, therefore
|
1006 |
|
|
+ * differs in spirit from the above ffz (man ffs).
|
1007 |
|
|
+ */
|
1008 |
|
|
+
|
1009 |
|
|
+#define ffs(x) generic_ffs(x)
|
1010 |
|
|
+
|
1011 |
|
|
+/*
|
1012 |
|
|
+ * hweightN - returns the hamming weight of a N-bit word
|
1013 |
|
|
+ * @x: the word to weigh
|
1014 |
|
|
+ *
|
1015 |
|
|
+ * The Hamming Weight of a number is the total number of bits set in it.
|
1016 |
|
|
+ */
|
1017 |
|
|
+#if 0 /*RGD*/
|
1018 |
|
|
+#define hweight32(x) generic_hweight32(x)
|
1019 |
|
|
+#define hweight16(x) generic_hweight16(x)
|
1020 |
|
|
+#define hweight8(x) generic_hweight8(x)
|
1021 |
|
|
+#endif
|
1022 |
|
|
+/**
|
1023 |
|
|
+ * __ffs - find first bit in word.
|
1024 |
|
|
+ * @word: The word to search
|
1025 |
|
|
+ *
|
1026 |
|
|
+ * Undefined if no bit exists, so code should check against 0 first.
|
1027 |
|
|
+ */
|
1028 |
|
|
+static __inline__ int __ffs(unsigned long word)
|
1029 |
|
|
+{
|
1030 |
|
|
+ int num = 0;
|
1031 |
|
|
+
|
1032 |
|
|
+ if ((word & 0xffff) == 0) {
|
1033 |
|
|
+ num += 16;
|
1034 |
|
|
+ word >>= 16;
|
1035 |
|
|
+ }
|
1036 |
|
|
+ if ((word & 0xff) == 0) {
|
1037 |
|
|
+ num += 8;
|
1038 |
|
|
+ word >>= 8;
|
1039 |
|
|
+ }
|
1040 |
|
|
+ if ((word & 0xf) == 0) {
|
1041 |
|
|
+ num += 4;
|
1042 |
|
|
+ word >>= 4;
|
1043 |
|
|
+ }
|
1044 |
|
|
+ if ((word & 0x3) == 0) {
|
1045 |
|
|
+ num += 2;
|
1046 |
|
|
+ word >>= 2;
|
1047 |
|
|
+ }
|
1048 |
|
|
+ if ((word & 0x1) == 0)
|
1049 |
|
|
+ num += 1;
|
1050 |
|
|
+ return num;
|
1051 |
|
|
+}
|
1052 |
|
|
+
|
1053 |
|
|
+// /*
|
1054 |
|
|
+// * Every architecture must define this function. It's the fastest
|
1055 |
|
|
+// * way of searching a 140-bit bitmap where the first 100 bits are
|
1056 |
|
|
+// * unlikely to be set. It's guaranteed that at least one of the 140
|
1057 |
|
|
+// * bits is cleared.
|
1058 |
|
|
+// */
|
1059 |
|
|
+// static __inline__ int sched_find_first_bit(unsigned long *b)
|
1060 |
|
|
+// {
|
1061 |
|
|
+
|
1062 |
|
|
+// if (unlikely(b[0]))
|
1063 |
|
|
+// return __ffs(b[0]);
|
1064 |
|
|
+// if (unlikely(b[1]))
|
1065 |
|
|
+// return __ffs(b[1]) + 32;
|
1066 |
|
|
+// if (unlikely(b[2]))
|
1067 |
|
|
+// return __ffs(b[2]) + 64;
|
1068 |
|
|
+// if (b[3])
|
1069 |
|
|
+// return __ffs(b[3]) + 96;
|
1070 |
|
|
+// return __ffs(b[4]) + 128;
|
1071 |
|
|
+// }
|
1072 |
|
|
+
|
1073 |
|
|
+/**
|
1074 |
|
|
+ * * find_next_bit - find the next set bit in a memory region
|
1075 |
|
|
+ * * @addr: The address to base the search on
|
1076 |
|
|
+ * * @offset: The bitnumber to start searching at
|
1077 |
|
|
+ * * @size: The maximum size to search
|
1078 |
|
|
+ * */
|
1079 |
|
|
+static __inline__ unsigned long find_next_bit(const unsigned long *addr,
|
1080 |
|
|
+ unsigned long size, unsigned long offset)
|
1081 |
|
|
+{
|
1082 |
|
|
+ unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
|
1083 |
|
|
+ unsigned int result = offset & ~31UL;
|
1084 |
|
|
+ unsigned int tmp;
|
1085 |
|
|
+
|
1086 |
|
|
+ if (offset >= size)
|
1087 |
|
|
+ return size;
|
1088 |
|
|
+ size -= result;
|
1089 |
|
|
+ offset &= 31UL;
|
1090 |
|
|
+ if (offset) {
|
1091 |
|
|
+ tmp = *p++;
|
1092 |
|
|
+ tmp &= ~0UL << offset;
|
1093 |
|
|
+ if (size < 32)
|
1094 |
|
|
+ goto found_first;
|
1095 |
|
|
+ if (tmp)
|
1096 |
|
|
+ goto found_middle;
|
1097 |
|
|
+ size -= 32;
|
1098 |
|
|
+ result += 32;
|
1099 |
|
|
+ }
|
1100 |
|
|
+ while (size >= 32) {
|
1101 |
|
|
+ if ((tmp = *p++) != 0)
|
1102 |
|
|
+ goto found_middle;
|
1103 |
|
|
+ result += 32;
|
1104 |
|
|
+ size -= 32;
|
1105 |
|
|
+ }
|
1106 |
|
|
+ if (!size)
|
1107 |
|
|
+ return result;
|
1108 |
|
|
+ tmp = *p;
|
1109 |
|
|
+
|
1110 |
|
|
+ found_first:
|
1111 |
|
|
+ tmp &= ~0UL >> (32 - size);
|
1112 |
|
|
+ if (tmp == 0UL) /* Are any bits set? */
|
1113 |
|
|
+ return result + size; /* Nope. */
|
1114 |
|
|
+ found_middle:
|
1115 |
|
|
+ return result + __ffs(tmp);
|
1116 |
|
|
+}
|
1117 |
|
|
+
|
1118 |
|
|
+
|
1119 |
|
|
+/* find_next_zero_bit() finds the first zero bit in a bit string of length
|
1120 |
|
|
+ * 'size' bits, starting the search at bit 'offset'. This is largely based
|
1121 |
|
|
+ * on Linus's ALPHA routines, which are pretty portable BTW.
|
1122 |
|
|
+ */
|
1123 |
|
|
+
|
1124 |
|
|
+static __inline__ unsigned long find_next_zero_bit(const unsigned long *addr,
|
1125 |
|
|
+ unsigned long size,
|
1126 |
|
|
+ unsigned long offset)
|
1127 |
|
|
+{
|
1128 |
|
|
+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
|
1129 |
|
|
+ unsigned long result = offset & ~31UL;
|
1130 |
|
|
+ unsigned long tmp;
|
1131 |
|
|
+
|
1132 |
|
|
+ if (offset >= size)
|
1133 |
|
|
+ return size;
|
1134 |
|
|
+ size -= result;
|
1135 |
|
|
+ offset &= 31UL;
|
1136 |
|
|
+ if (offset) {
|
1137 |
|
|
+ tmp = *(p++);
|
1138 |
|
|
+ tmp |= ~0UL >> (32-offset);
|
1139 |
|
|
+ if (size < 32)
|
1140 |
|
|
+ goto found_first;
|
1141 |
|
|
+ if (~tmp)
|
1142 |
|
|
+ goto found_middle;
|
1143 |
|
|
+ size -= 32;
|
1144 |
|
|
+ result += 32;
|
1145 |
|
|
+ }
|
1146 |
|
|
+ while (size & ~31UL) {
|
1147 |
|
|
+ if (~(tmp = *(p++)))
|
1148 |
|
|
+ goto found_middle;
|
1149 |
|
|
+ result += 32;
|
1150 |
|
|
+ size -= 32;
|
1151 |
|
|
+ }
|
1152 |
|
|
+ if (!size)
|
1153 |
|
|
+ return result;
|
1154 |
|
|
+ tmp = *p;
|
1155 |
|
|
+
|
1156 |
|
|
+found_first:
|
1157 |
|
|
+ tmp |= ~0UL >> size;
|
1158 |
|
|
+found_middle:
|
1159 |
|
|
+ return result + ffz(tmp);
|
1160 |
|
|
+}
|
1161 |
|
|
+
|
1162 |
|
|
+/**
|
1163 |
|
|
+ * find_first_bit - find the first set bit in a memory region
|
1164 |
|
|
+ * @addr: The address to start the search at
|
1165 |
|
|
+ * @size: The maximum size to search
|
1166 |
|
|
+ *
|
1167 |
|
|
+ * Returns the bit-number of the first set bit, not the number of the byte
|
1168 |
|
|
+ * containing a bit.
|
1169 |
|
|
+ */
|
1170 |
|
|
+#define find_first_bit(addr, size) \
|
1171 |
|
|
+ find_next_bit((addr), (size), 0)
|
1172 |
|
|
+
|
1173 |
|
|
+
|
1174 |
|
|
+/* Linus sez that gcc can optimize the following correctly, we'll see if this
|
1175 |
|
|
+ * holds on the Sparc as it does for the ALPHA.
|
1176 |
|
|
+ */
|
1177 |
|
|
+
|
1178 |
|
|
+#define find_first_zero_bit(addr, size) \
|
1179 |
|
|
+ find_next_zero_bit((addr), (size), 0)
|
1180 |
|
|
+
|
1181 |
|
|
+/* Now for the ext2 filesystem bit operations and helper routines. */
|
1182 |
|
|
+
|
1183 |
|
|
+static __inline__ int ext2_set_bit(int nr,void * addr)
|
1184 |
|
|
+{
|
1185 |
|
|
+ int mask, retval;
|
1186 |
|
|
+ unsigned long flags;
|
1187 |
|
|
+ unsigned char *ADDR = (unsigned char *) addr;
|
1188 |
|
|
+
|
1189 |
|
|
+ ADDR += nr >> 3;
|
1190 |
|
|
+ mask = 1 << (nr & 0x07);
|
1191 |
|
|
+ local_irq_save(flags);
|
1192 |
|
|
+ retval = (mask & *ADDR) != 0;
|
1193 |
|
|
+ *ADDR |= mask;
|
1194 |
|
|
+ local_irq_restore(flags);
|
1195 |
|
|
+ return retval;
|
1196 |
|
|
+}
|
1197 |
|
|
+
|
1198 |
|
|
+static __inline__ int ext2_clear_bit(int nr, void * addr)
|
1199 |
|
|
+{
|
1200 |
|
|
+ int mask, retval;
|
1201 |
|
|
+ unsigned long flags;
|
1202 |
|
|
+ unsigned char *ADDR = (unsigned char *) addr;
|
1203 |
|
|
+
|
1204 |
|
|
+ ADDR += nr >> 3;
|
1205 |
|
|
+ mask = 1 << (nr & 0x07);
|
1206 |
|
|
+ local_irq_save(flags);
|
1207 |
|
|
+ retval = (mask & *ADDR) != 0;
|
1208 |
|
|
+ *ADDR &= ~mask;
|
1209 |
|
|
+ local_irq_restore(flags);
|
1210 |
|
|
+ return retval;
|
1211 |
|
|
+}
|
1212 |
|
|
+
|
1213 |
|
|
+static __inline__ int ext2_test_bit(int nr, const void * addr)
|
1214 |
|
|
+{
|
1215 |
|
|
+ int mask;
|
1216 |
|
|
+ const unsigned char *ADDR = (const unsigned char *) addr;
|
1217 |
|
|
+
|
1218 |
|
|
+ ADDR += nr >> 3;
|
1219 |
|
|
+ mask = 1 << (nr & 0x07);
|
1220 |
|
|
+ return ((mask & *ADDR) != 0);
|
1221 |
|
|
+}
|
1222 |
|
|
+
|
1223 |
|
|
+#define ext2_find_first_zero_bit(addr, size) \
|
1224 |
|
|
+ ext2_find_next_zero_bit((addr), (size), 0)
|
1225 |
|
|
+
|
1226 |
|
|
+static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
|
1227 |
|
|
+{
|
1228 |
|
|
+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
|
1229 |
|
|
+ unsigned long result = offset & ~31UL;
|
1230 |
|
|
+ unsigned long tmp;
|
1231 |
|
|
+
|
1232 |
|
|
+ if (offset >= size)
|
1233 |
|
|
+ return size;
|
1234 |
|
|
+ size -= result;
|
1235 |
|
|
+ offset &= 31UL;
|
1236 |
|
|
+ if(offset) {
|
1237 |
|
|
+ tmp = *(p++);
|
1238 |
|
|
+ tmp |= ~0UL << (32-offset);
|
1239 |
|
|
+ if(size < 32)
|
1240 |
|
|
+ goto found_first;
|
1241 |
|
|
+ if(~tmp)
|
1242 |
|
|
+ goto found_middle;
|
1243 |
|
|
+ size -= 32;
|
1244 |
|
|
+ result += 32;
|
1245 |
|
|
+ }
|
1246 |
|
|
+ while(size & ~31UL) {
|
1247 |
|
|
+ if(~(tmp = *(p++)))
|
1248 |
|
|
+ goto found_middle;
|
1249 |
|
|
+ result += 32;
|
1250 |
|
|
+ size -= 32;
|
1251 |
|
|
+ }
|
1252 |
|
|
+ if(!size)
|
1253 |
|
|
+ return result;
|
1254 |
|
|
+ tmp = *p;
|
1255 |
|
|
+
|
1256 |
|
|
+found_first:
|
1257 |
|
|
+ tmp |= ~0UL << size;
|
1258 |
|
|
+found_middle:
|
1259 |
|
|
+ tmp = ((tmp>>24) | ((tmp>>8)&0xff00) | ((tmp<<8)&0xff0000) | (tmp<<24));
|
1260 |
|
|
+ return result + ffz(tmp);
|
1261 |
|
|
+}
|
1262 |
|
|
+
|
1263 |
|
|
+#define __ext2_set_bit ext2_set_bit
|
1264 |
|
|
+#define __ext2_clear_bit ext2_clear_bit
|
1265 |
|
|
+
|
1266 |
|
|
+static __inline__ int __ext2_test_bit(int nr, __const__ void * addr)
|
1267 |
|
|
+{
|
1268 |
|
|
+ int mask;
|
1269 |
|
|
+ __const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
|
1270 |
|
|
+
|
1271 |
|
|
+ ADDR += nr >> 3;
|
1272 |
|
|
+ mask = 1 << (nr & 0x07);
|
1273 |
|
|
+ return ((mask & *ADDR) != 0);
|
1274 |
|
|
+}
|
1275 |
|
|
+
|
1276 |
|
|
+#define __ext2_find_first_zero_bit(addr, size) \
|
1277 |
|
|
+ __ext2_find_next_zero_bit((addr), (size), 0)
|
1278 |
|
|
+
|
1279 |
|
|
+static __inline__ unsigned long __ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
|
1280 |
|
|
+{
|
1281 |
|
|
+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
|
1282 |
|
|
+ unsigned long result = offset & ~31UL;
|
1283 |
|
|
+ unsigned long tmp;
|
1284 |
|
|
+
|
1285 |
|
|
+ if (offset >= size)
|
1286 |
|
|
+ return size;
|
1287 |
|
|
+ size -= result;
|
1288 |
|
|
+ offset &= 31UL;
|
1289 |
|
|
+ if(offset) {
|
1290 |
|
|
+ tmp = *(p++);
|
1291 |
|
|
+ tmp |= __swab32(~0UL >> (32-offset));
|
1292 |
|
|
+ if(size < 32)
|
1293 |
|
|
+ goto found_first;
|
1294 |
|
|
+ if(~tmp)
|
1295 |
|
|
+ goto found_middle;
|
1296 |
|
|
+ size -= 32;
|
1297 |
|
|
+ result += 32;
|
1298 |
|
|
+ }
|
1299 |
|
|
+ while(size & ~31UL) {
|
1300 |
|
|
+ if(~(tmp = *(p++)))
|
1301 |
|
|
+ goto found_middle;
|
1302 |
|
|
+ result += 32;
|
1303 |
|
|
+ size -= 32;
|
1304 |
|
|
+ }
|
1305 |
|
|
+ if(!size)
|
1306 |
|
|
+ return result;
|
1307 |
|
|
+ tmp = *p;
|
1308 |
|
|
+
|
1309 |
|
|
+found_first:
|
1310 |
|
|
+ return result + ffz(__swab32(tmp) | (~0UL << size));
|
1311 |
|
|
+found_middle:
|
1312 |
|
|
+ return result + ffz(__swab32(tmp));
|
1313 |
|
|
+}
|
1314 |
|
|
+
|
1315 |
|
|
+#define ext2_set_bit_atomic(lock, nr, addr) \
|
1316 |
|
|
+ ({ \
|
1317 |
|
|
+ int ret; \
|
1318 |
|
|
+ spin_lock(lock); \
|
1319 |
|
|
+ ret = ext2_set_bit((nr), (unsigned long *)(addr)); \
|
1320 |
|
|
+ spin_unlock(lock); \
|
1321 |
|
|
+ ret; \
|
1322 |
|
|
+ })
|
1323 |
|
|
+
|
1324 |
|
|
+#define ext2_clear_bit_atomic(lock, nr, addr) \
|
1325 |
|
|
+ ({ \
|
1326 |
|
|
+ int ret; \
|
1327 |
|
|
+ spin_lock(lock); \
|
1328 |
|
|
+ ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \
|
1329 |
|
|
+ spin_unlock(lock); \
|
1330 |
|
|
+ ret; \
|
1331 |
|
|
+ })
|
1332 |
|
|
+
|
1333 |
|
|
+/*
|
1334 |
|
|
+ * clear_bit() doesn't provide any barrier for the compiler.
|
1335 |
|
|
+ */
|
1336 |
|
|
+
|
1337 |
|
|
+#define smp_mb__before_clear_bit() barrier()
|
1338 |
|
|
+#define smp_mb__after_clear_bit() barrier()
|
1339 |
|
|
+// #include
|
1340 |
|
|
+// #include
|
1341 |
|
|
+// #include
|
1342 |
|
|
+// #include
|
1343 |
|
|
+#endif /* _OR32_BITOPS_H */
|
1344 |
|
|
+#endif /* __KERNEL__ */
|
1345 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/byteorder.h u-boot-2009.03/include/asm-or1200/byteorder.h
|
1346 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/byteorder.h 1969-12-31 16:00:00.000000000 -0800
|
1347 |
|
|
+++ u-boot-2009.03/include/asm-or1200/byteorder.h 2008-07-02 09:36:01.937500000 -0700
|
1348 |
17 |
qaztronic |
@@ -0,0 +1,13 @@
|
1349 |
|
|
+#ifndef _OR32_BYTEORDER_H
|
1350 |
|
|
+#define _OR32_BYTEORDER_H
|
1351 |
|
|
+
|
1352 |
|
|
+#include
|
1353 |
|
|
+
|
1354 |
|
|
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
|
1355 |
|
|
+# define __BYTEORDER_HAS_U64__
|
1356 |
|
|
+# define __SWAB_64_THRU_32__
|
1357 |
|
|
+#endif
|
1358 |
|
|
+
|
1359 |
|
|
+#include
|
1360 |
|
|
+
|
1361 |
|
|
+#endif /* _OR32_BYTEORDER_H */
|
1362 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/config.h u-boot-2009.03/include/asm-or1200/config.h
|
1363 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/config.h 1969-12-31 16:00:00.000000000 -0800
|
1364 |
|
|
+++ u-boot-2009.03/include/asm-or1200/config.h 2009-03-25 15:52:40.248817600 -0700
|
1365 |
17 |
qaztronic |
@@ -0,0 +1,5 @@
|
1366 |
|
|
+/*
|
1367 |
|
|
+
|
1368 |
|
|
+*/
|
1369 |
|
|
+
|
1370 |
|
|
+
|
1371 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/global_data.h u-boot-2009.03/include/asm-or1200/global_data.h
|
1372 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/global_data.h 1969-12-31 16:00:00.000000000 -0800
|
1373 |
|
|
+++ u-boot-2009.03/include/asm-or1200/global_data.h 2008-09-05 09:56:50.625000000 -0700
|
1374 |
17 |
qaztronic |
@@ -0,0 +1,58 @@
|
1375 |
|
|
+/*
|
1376 |
|
|
+ * (C) Copyright 2004 Atmark Techno, Inc.
|
1377 |
|
|
+ *
|
1378 |
|
|
+ * Yasushi SHOJI
|
1379 |
|
|
+ *
|
1380 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
1381 |
|
|
+ * project.
|
1382 |
|
|
+ *
|
1383 |
|
|
+ * This program is free software; you can redistribute it and/or
|
1384 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
1385 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
1386 |
|
|
+ * the License, or (at your option) any later version.
|
1387 |
|
|
+ *
|
1388 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
1389 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
1390 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
1391 |
|
|
+ * GNU General Public License for more details.
|
1392 |
|
|
+ *
|
1393 |
|
|
+ * You should have received a copy of the GNU General Public License
|
1394 |
|
|
+ * along with this program; if not, write to the Free Software
|
1395 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
1396 |
|
|
+ * MA 02111-1307 USA
|
1397 |
|
|
+ */
|
1398 |
|
|
+
|
1399 |
|
|
+#ifndef __ASM_GBL_DATA_H
|
1400 |
|
|
+#define __ASM_GBL_DATA_H
|
1401 |
|
|
+/*
|
1402 |
|
|
+ * The following data structure is placed in some memory wich is
|
1403 |
|
|
+ * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
|
1404 |
|
|
+ * some locked parts of the data cache) to allow for a minimum set of
|
1405 |
|
|
+ * global variables during system initialization (until we have set
|
1406 |
|
|
+ * up the memory controller so that we can use RAM).
|
1407 |
|
|
+ *
|
1408 |
|
|
+ * Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t)
|
1409 |
|
|
+ */
|
1410 |
|
|
+
|
1411 |
|
|
+typedef struct global_data {
|
1412 |
|
|
+ bd_t *bd;
|
1413 |
|
|
+ unsigned long flags;
|
1414 |
|
|
+ unsigned long baudrate;
|
1415 |
|
|
+ unsigned long have_console; /* serial_init() was called */
|
1416 |
|
|
+ unsigned long reloc_off; /* Relocation Offset */
|
1417 |
|
|
+ unsigned long env_addr; /* Address of Environment struct */
|
1418 |
|
|
+ unsigned long env_valid; /* Checksum of Environment valid? */
|
1419 |
|
|
+ unsigned long fb_base; /* base address of frame buffer */
|
1420 |
|
|
+ void **jt; /* jump table */
|
1421 |
|
|
+} gd_t;
|
1422 |
|
|
+
|
1423 |
|
|
+/*
|
1424 |
|
|
+ * Global Data Flags
|
1425 |
|
|
+ */
|
1426 |
|
|
+#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
|
1427 |
|
|
+#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
|
1428 |
|
|
+#define GD_FLG_SILENT 0x00004 /* Silent mode */
|
1429 |
|
|
+
|
1430 |
|
|
+#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r30")
|
1431 |
|
|
+
|
1432 |
|
|
+#endif /* __ASM_GBL_DATA_H */
|
1433 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/io.h u-boot-2009.03/include/asm-or1200/io.h
|
1434 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/io.h 1969-12-31 16:00:00.000000000 -0800
|
1435 |
|
|
+++ u-boot-2009.03/include/asm-or1200/io.h 2008-07-02 09:36:02.031250000 -0700
|
1436 |
17 |
qaztronic |
@@ -0,0 +1,90 @@
|
1437 |
|
|
+#ifndef _OR32_IO_H
|
1438 |
|
|
+#define _OR32_IO_H
|
1439 |
|
|
+
|
1440 |
|
|
+#include /* for __va, __pa */
|
1441 |
|
|
+
|
1442 |
|
|
+
|
1443 |
|
|
+/*
|
1444 |
|
|
+ * Change virtual addresses to physical addresses and vv.
|
1445 |
|
|
+ */
|
1446 |
|
|
+
|
1447 |
|
|
+static inline unsigned long virt_to_phys(volatile void * address)
|
1448 |
|
|
+{
|
1449 |
|
|
+ return __pa(address);
|
1450 |
|
|
+}
|
1451 |
|
|
+
|
1452 |
|
|
+static inline void * phys_to_virt(unsigned long address)
|
1453 |
|
|
+{
|
1454 |
|
|
+ return __va(address);
|
1455 |
|
|
+}
|
1456 |
|
|
+
|
1457 |
|
|
+extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
|
1458 |
|
|
+
|
1459 |
|
|
+extern inline void * ioremap(unsigned long offset, unsigned long size)
|
1460 |
|
|
+{
|
1461 |
|
|
+ return __ioremap(offset, size, 0);
|
1462 |
|
|
+}
|
1463 |
|
|
+
|
1464 |
|
|
+/* #define _PAGE_CI 0x002 */
|
1465 |
|
|
+extern inline void * ioremap_nocache(unsigned long offset, unsigned long size)
|
1466 |
|
|
+{
|
1467 |
|
|
+ return __ioremap(offset, size, 0x002);
|
1468 |
|
|
+}
|
1469 |
|
|
+
|
1470 |
|
|
+extern void iounmap(void *addr);
|
1471 |
|
|
+
|
1472 |
|
|
+#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
|
1473 |
|
|
+
|
1474 |
|
|
+/*
|
1475 |
|
|
+ * IO bus memory addresses are also 1:1 with the physical address
|
1476 |
|
|
+ */
|
1477 |
|
|
+#define virt_to_bus virt_to_phys
|
1478 |
|
|
+#define bus_to_virt phys_to_virt
|
1479 |
|
|
+
|
1480 |
|
|
+/*
|
1481 |
|
|
+ * readX/writeX() are used to access memory mapped devices. On some
|
1482 |
|
|
+ * architectures the memory mapped IO stuff needs to be accessed
|
1483 |
|
|
+ * differently. On the or32 architecture, we just read/write the
|
1484 |
|
|
+ * memory location directly.
|
1485 |
|
|
+ */
|
1486 |
|
|
+#define readb(addr) (*(volatile unsigned char *) (addr))
|
1487 |
|
|
+#define readw(addr) (*(volatile unsigned short *) (addr))
|
1488 |
|
|
+#define readl(addr) (*(volatile unsigned int *) (addr))
|
1489 |
|
|
+
|
1490 |
|
|
+#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
|
1491 |
|
|
+#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
|
1492 |
|
|
+#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
|
1493 |
|
|
+#define __raw_writel writel /*RGD*/
|
1494 |
|
|
+
|
1495 |
|
|
+#define memset_io(a,b,c) memset((void *)(a),(b),(c))
|
1496 |
|
|
+#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
|
1497 |
|
|
+#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
|
1498 |
|
|
+
|
1499 |
|
|
+/*
|
1500 |
|
|
+ * Again, or32 does not require mem IO specific function.
|
1501 |
|
|
+ */
|
1502 |
|
|
+
|
1503 |
|
|
+#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d))
|
1504 |
|
|
+
|
1505 |
|
|
+#define IO_BASE 0x0
|
1506 |
|
|
+#define IO_SPACE_LIMIT 0xffffffff
|
1507 |
|
|
+
|
1508 |
|
|
+#define inb(port) (*(volatile unsigned char *) (port+IO_BASE))
|
1509 |
|
|
+#define outb(value,port) ((*(volatile unsigned char *) (port+IO_BASE)) = (value))
|
1510 |
|
|
+
|
1511 |
|
|
+#define inb_p(port) inb((port))
|
1512 |
|
|
+#define outb_p(val, port) outb((val), (port))
|
1513 |
|
|
+
|
1514 |
|
|
+/*
|
1515 |
|
|
+ * Convert a physical pointer to a virtual kernel pointer for /dev/mem
|
1516 |
|
|
+ * access
|
1517 |
|
|
+ */
|
1518 |
|
|
+#define xlate_dev_mem_ptr(p) __va(p)
|
1519 |
|
|
+
|
1520 |
|
|
+/*
|
1521 |
|
|
+ * Convert a virtual cached pointer to an uncached pointer
|
1522 |
|
|
+ */
|
1523 |
|
|
+#define xlate_dev_kmem_ptr(p) p
|
1524 |
|
|
+
|
1525 |
|
|
+
|
1526 |
|
|
+#endif
|
1527 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/page.h u-boot-2009.03/include/asm-or1200/page.h
|
1528 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/page.h 1969-12-31 16:00:00.000000000 -0800
|
1529 |
|
|
+++ u-boot-2009.03/include/asm-or1200/page.h 2008-07-02 09:36:02.140625000 -0700
|
1530 |
17 |
qaztronic |
@@ -0,0 +1,107 @@
|
1531 |
|
|
+#ifndef _OR32_PAGE_H
|
1532 |
|
|
+#define _OR32_PAGE_H
|
1533 |
|
|
+
|
1534 |
|
|
+
|
1535 |
|
|
+/* PAGE_SHIFT determines the page size */
|
1536 |
|
|
+#define PAGE_SHIFT 13
|
1537 |
|
|
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
|
1538 |
|
|
+#define PAGE_MASK (~(PAGE_SIZE-1))
|
1539 |
|
|
+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
|
1540 |
|
|
+
|
1541 |
|
|
+#define PAGE_OFFSET 0xc0000000
|
1542 |
|
|
+#define KERNELBASE PAGE_OFFSET
|
1543 |
|
|
+
|
1544 |
|
|
+#ifdef __KERNEL__
|
1545 |
|
|
+
|
1546 |
|
|
+#ifndef __ASSEMBLY__
|
1547 |
|
|
+#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
|
1548 |
|
|
+#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
|
1549 |
|
|
+
|
1550 |
|
|
+#define clear_user_page(page, vaddr, pg) clear_page(page)
|
1551 |
|
|
+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
|
1552 |
|
|
+
|
1553 |
|
|
+#define STRICT_MM_TYPECHECKS
|
1554 |
|
|
+#ifdef STRICT_MM_TYPECHECKS
|
1555 |
|
|
+/*
|
1556 |
|
|
+ * These are used to make use of C type-checking..
|
1557 |
|
|
+ */
|
1558 |
|
|
+typedef struct { unsigned long pte; } pte_t;
|
1559 |
|
|
+typedef struct { unsigned long pmd; } pmd_t;
|
1560 |
|
|
+typedef struct { unsigned long pgd; } pgd_t;
|
1561 |
|
|
+typedef struct { unsigned long pgprot; } pgprot_t;
|
1562 |
|
|
+
|
1563 |
|
|
+#define pte_val(x) ((x).pte)
|
1564 |
|
|
+#define pmd_val(x) ((x).pmd)
|
1565 |
|
|
+#define pgd_val(x) ((x).pgd)
|
1566 |
|
|
+#define pgprot_val(x) ((x).pgprot)
|
1567 |
|
|
+
|
1568 |
|
|
+#define __pte(x) ((pte_t) { (x) } )
|
1569 |
|
|
+#define __pmd(x) ((pmd_t) { (x) } )
|
1570 |
|
|
+#define __pgd(x) ((pgd_t) { (x) } )
|
1571 |
|
|
+#define __pgprot(x) ((pgprot_t) { (x) } )
|
1572 |
|
|
+
|
1573 |
|
|
+#else /* STRICT_MM_TYPECHECKS */
|
1574 |
|
|
+/*
|
1575 |
|
|
+ * .. while these make it easier on the compiler
|
1576 |
|
|
+ */
|
1577 |
|
|
+typedef unsigned long pte_t;
|
1578 |
|
|
+typedef unsigned long pmd_t;
|
1579 |
|
|
+typedef unsigned long pgd_t;
|
1580 |
|
|
+typedef unsigned long pgprot_t;
|
1581 |
|
|
+
|
1582 |
|
|
+#define pte_val(x) (x)
|
1583 |
|
|
+#define pmd_val(x) (x)
|
1584 |
|
|
+#define pgd_val(x) (x)
|
1585 |
|
|
+#define pgprot_val(x) (x)
|
1586 |
|
|
+
|
1587 |
|
|
+#define __pte(x) (x)
|
1588 |
|
|
+#define __pmd(x) (x)
|
1589 |
|
|
+#define __pgd(x) (x)
|
1590 |
|
|
+#define __pgprot(x) (x)
|
1591 |
|
|
+
|
1592 |
|
|
+#endif /* STRICT_MM_TYPECHECKS */
|
1593 |
|
|
+
|
1594 |
|
|
+
|
1595 |
|
|
+/* Pure 2^n version of get_order */
|
1596 |
|
|
+static __inline__ int get_order(unsigned long size)
|
1597 |
|
|
+{
|
1598 |
|
|
+ int order;
|
1599 |
|
|
+
|
1600 |
|
|
+ size = (size-1) >> (PAGE_SHIFT-1);
|
1601 |
|
|
+ order = -1;
|
1602 |
|
|
+ do {
|
1603 |
|
|
+ size >>= 1;
|
1604 |
|
|
+ order++;
|
1605 |
|
|
+ } while (size);
|
1606 |
|
|
+ return order;
|
1607 |
|
|
+}
|
1608 |
|
|
+
|
1609 |
|
|
+
|
1610 |
|
|
+/* macros to convert between really physical and virtual addresses
|
1611 |
|
|
+ */
|
1612 |
|
|
+
|
1613 |
|
|
+#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
|
1614 |
|
|
+#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
|
1615 |
|
|
+
|
1616 |
|
|
+#define pfn_to_page(pfn) (mem_map + (pfn))
|
1617 |
|
|
+#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
|
1618 |
|
|
+
|
1619 |
|
|
+#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
|
1620 |
|
|
+#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
|
1621 |
|
|
+
|
1622 |
|
|
+#define pfn_valid(pfn) ((pfn) < max_mapnr)
|
1623 |
|
|
+#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
|
1624 |
|
|
+
|
1625 |
|
|
+/* from linker script */
|
1626 |
|
|
+
|
1627 |
|
|
+extern unsigned long dram_start, dram_end;
|
1628 |
|
|
+
|
1629 |
|
|
+#endif /* __ASSEMBLY__ */
|
1630 |
|
|
+
|
1631 |
|
|
+#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
|
1632 |
|
|
+ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
|
1633 |
|
|
+
|
1634 |
|
|
+#endif /* __KERNEL__ */
|
1635 |
|
|
+
|
1636 |
|
|
+#endif /* _OR32_PAGE_H */
|
1637 |
|
|
+
|
1638 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/posix_types.h u-boot-2009.03/include/asm-or1200/posix_types.h
|
1639 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/posix_types.h 1969-12-31 16:00:00.000000000 -0800
|
1640 |
|
|
+++ u-boot-2009.03/include/asm-or1200/posix_types.h 2008-08-26 18:22:31.441162400 -0700
|
1641 |
17 |
qaztronic |
@@ -0,0 +1,142 @@
|
1642 |
|
|
+#ifndef _OR32_POSIX_TYPES_H
|
1643 |
|
|
+#define _OR32_POSIX_TYPES_H
|
1644 |
|
|
+
|
1645 |
|
|
+/*
|
1646 |
|
|
+ * This file is generally used by user-level software, so you need to
|
1647 |
|
|
+ * be a little careful about namespace pollution etc. Also, we cannot
|
1648 |
|
|
+ * assume GCC is being used.
|
1649 |
|
|
+ */
|
1650 |
|
|
+
|
1651 |
|
|
+typedef unsigned int __kernel_dev_t;
|
1652 |
|
|
+
|
1653 |
|
|
+typedef unsigned int __kernel_ino_t;
|
1654 |
|
|
+typedef unsigned int __kernel_mode_t;
|
1655 |
|
|
+typedef unsigned short __kernel_nlink_t;
|
1656 |
|
|
+typedef long __kernel_off_t;
|
1657 |
|
|
+typedef int __kernel_pid_t;
|
1658 |
|
|
+typedef unsigned int __kernel_uid_t;
|
1659 |
|
|
+typedef unsigned int __kernel_gid_t;
|
1660 |
|
|
+typedef unsigned int __kernel_size_t;
|
1661 |
|
|
+typedef int __kernel_ssize_t;
|
1662 |
|
|
+typedef long __kernel_ptrdiff_t;
|
1663 |
|
|
+typedef long __kernel_time_t;
|
1664 |
|
|
+typedef long __kernel_suseconds_t;
|
1665 |
|
|
+typedef long __kernel_clock_t;
|
1666 |
|
|
+typedef int __kernel_timer_t;
|
1667 |
|
|
+typedef int __kernel_clockid_t;
|
1668 |
|
|
+typedef int __kernel_daddr_t;
|
1669 |
|
|
+typedef char * __kernel_caddr_t;
|
1670 |
|
|
+typedef short __kernel_ipc_pid_t;
|
1671 |
|
|
+typedef unsigned short __kernel_uid16_t;
|
1672 |
|
|
+typedef unsigned short __kernel_gid16_t;
|
1673 |
|
|
+typedef unsigned int __kernel_uid32_t;
|
1674 |
|
|
+typedef unsigned int __kernel_gid32_t;
|
1675 |
|
|
+
|
1676 |
|
|
+typedef unsigned int __kernel_old_uid_t;
|
1677 |
|
|
+typedef unsigned int __kernel_old_gid_t;
|
1678 |
|
|
+typedef unsigned short __kernel_old_dev_t;
|
1679 |
|
|
+
|
1680 |
|
|
+/* i386, cris version
|
1681 |
|
|
+typedef unsigned long __kernel_ino_t;
|
1682 |
|
|
+typedef unsigned short __kernel_mode_t;
|
1683 |
|
|
+typedef unsigned short __kernel_nlink_t;
|
1684 |
|
|
+typedef long __kernel_off_t;
|
1685 |
|
|
+typedef int __kernel_pid_t;
|
1686 |
|
|
+typedef unsigned short __kernel_ipc_pid_t;
|
1687 |
|
|
+typedef unsigned short __kernel_uid_t;
|
1688 |
|
|
+typedef unsigned short __kernel_gid_t;
|
1689 |
|
|
+typedef unsigned int __kernel_size_t;
|
1690 |
|
|
+typedef long __kernel_ssize_t;
|
1691 |
|
|
+typedef int __kernel_ptrdiff_t;
|
1692 |
|
|
+typedef long __kernel_time_t;
|
1693 |
|
|
+typedef long __kernel_suseconds_t;
|
1694 |
|
|
+typedef long __kernel_clock_t;
|
1695 |
|
|
+typedef int __kernel_timer_t;
|
1696 |
|
|
+typedef int __kernel_clockid_t;
|
1697 |
|
|
+typedef int __kernel_daddr_t;
|
1698 |
|
|
+typedef char * __kernel_caddr_t;
|
1699 |
|
|
+typedef unsigned short __kernel_uid16_t;
|
1700 |
|
|
+typedef unsigned short __kernel_gid16_t;
|
1701 |
|
|
+typedef unsigned int __kernel_uid32_t;
|
1702 |
|
|
+typedef unsigned int __kernel_gid32_t;
|
1703 |
|
|
+
|
1704 |
|
|
+typedef unsigned short __kernel_old_uid_t;
|
1705 |
|
|
+typedef unsigned short __kernel_old_gid_t;
|
1706 |
|
|
+typedef unsigned short __kernel_old_dev_t;
|
1707 |
|
|
+*/
|
1708 |
|
|
+
|
1709 |
|
|
+#ifdef __GNUC__
|
1710 |
|
|
+typedef long long __kernel_loff_t;
|
1711 |
|
|
+#endif
|
1712 |
|
|
+
|
1713 |
|
|
+typedef struct {
|
1714 |
|
|
+ int val[2];
|
1715 |
|
|
+} __kernel_fsid_t;
|
1716 |
|
|
+
|
1717 |
|
|
+#ifndef __GNUC__
|
1718 |
|
|
+
|
1719 |
|
|
+#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
|
1720 |
|
|
+#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
|
1721 |
|
|
+#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
|
1722 |
|
|
+#define __FD_ZERO(set) \
|
1723 |
|
|
+ ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set)))
|
1724 |
|
|
+
|
1725 |
|
|
+#else /* __GNUC__ */
|
1726 |
|
|
+
|
1727 |
|
|
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
|
1728 |
|
|
+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
|
1729 |
|
|
+/* With GNU C, use inline functions instead so args are evaluated only once: */
|
1730 |
|
|
+
|
1731 |
|
|
+#undef __FD_SET
|
1732 |
|
|
+static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
|
1733 |
|
|
+{
|
1734 |
|
|
+ unsigned long _tmp = fd / __NFDBITS;
|
1735 |
|
|
+ unsigned long _rem = fd % __NFDBITS;
|
1736 |
|
|
+ fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
|
1737 |
|
|
+}
|
1738 |
|
|
+
|
1739 |
|
|
+#undef __FD_CLR
|
1740 |
|
|
+static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
|
1741 |
|
|
+{
|
1742 |
|
|
+ unsigned long _tmp = fd / __NFDBITS;
|
1743 |
|
|
+ unsigned long _rem = fd % __NFDBITS;
|
1744 |
|
|
+ fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
|
1745 |
|
|
+}
|
1746 |
|
|
+
|
1747 |
|
|
+#undef __FD_ISSET
|
1748 |
|
|
+static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p)
|
1749 |
|
|
+{
|
1750 |
|
|
+ unsigned long _tmp = fd / __NFDBITS;
|
1751 |
|
|
+ unsigned long _rem = fd % __NFDBITS;
|
1752 |
|
|
+ return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
|
1753 |
|
|
+}
|
1754 |
|
|
+
|
1755 |
|
|
+/*
|
1756 |
|
|
+ * This will unroll the loop for the normal constant case (8 ints,
|
1757 |
|
|
+ * for a 256-bit fd_set)
|
1758 |
|
|
+ */
|
1759 |
|
|
+#undef __FD_ZERO
|
1760 |
|
|
+static __inline__ void __FD_ZERO(__kernel_fd_set *p)
|
1761 |
|
|
+{
|
1762 |
|
|
+ unsigned int *tmp = (unsigned int *)p->fds_bits;
|
1763 |
|
|
+ int i;
|
1764 |
|
|
+
|
1765 |
|
|
+ if (__builtin_constant_p(__FDSET_LONGS)) {
|
1766 |
|
|
+ switch (__FDSET_LONGS) {
|
1767 |
|
|
+ case 8:
|
1768 |
|
|
+ tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
|
1769 |
|
|
+ tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
|
1770 |
|
|
+ return;
|
1771 |
|
|
+ }
|
1772 |
|
|
+ }
|
1773 |
|
|
+ i = __FDSET_LONGS;
|
1774 |
|
|
+ while (i) {
|
1775 |
|
|
+ i--;
|
1776 |
|
|
+ *tmp = 0;
|
1777 |
|
|
+ tmp++;
|
1778 |
|
|
+ }
|
1779 |
|
|
+}
|
1780 |
|
|
+
|
1781 |
|
|
+#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
|
1782 |
|
|
+#endif /* __GNUC__ */
|
1783 |
|
|
+#endif /* _OR32_POSIX_TYPES_H */
|
1784 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/processor.h u-boot-2009.03/include/asm-or1200/processor.h
|
1785 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/processor.h 1969-12-31 16:00:00.000000000 -0800
|
1786 |
|
|
+++ u-boot-2009.03/include/asm-or1200/processor.h 2008-07-02 09:36:02.187500000 -0700
|
1787 |
17 |
qaztronic |
@@ -0,0 +1,119 @@
|
1788 |
|
|
+/*
|
1789 |
|
|
+ * include/asm-or32/processor.h
|
1790 |
|
|
+ *
|
1791 |
|
|
+ * Based on:
|
1792 |
|
|
+ * include/asm-cris/processor.h
|
1793 |
|
|
+ * Copyright (C) 2000, 2001, 2002 Axis Communications AB
|
1794 |
|
|
+ *
|
1795 |
|
|
+ */
|
1796 |
|
|
+
|
1797 |
|
|
+#ifndef _OR32_PROCESSOR_H
|
1798 |
|
|
+#define _OR32_PROCESSOR_H
|
1799 |
|
|
+
|
1800 |
|
|
+#include
|
1801 |
|
|
+#include
|
1802 |
|
|
+#include
|
1803 |
|
|
+
|
1804 |
|
|
+/* Kernel and user SR register setting */
|
1805 |
|
|
+#define KERNEL_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE | SPR_SR_DCE | SPR_SR_SM)
|
1806 |
|
|
+#define USER_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE | SPR_SR_DCE | SPR_SR_IEE | SPR_SR_TEE)
|
1807 |
|
|
+/*
|
1808 |
|
|
+ * Default implementation of macro that returns current
|
1809 |
|
|
+ * instruction pointer ("program counter").
|
1810 |
|
|
+ */
|
1811 |
|
|
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
|
1812 |
|
|
+
|
1813 |
|
|
+/* or32has no problems with write protection */
|
1814 |
|
|
+
|
1815 |
|
|
+#define wp_works_ok 1
|
1816 |
|
|
+
|
1817 |
|
|
+/*
|
1818 |
|
|
+ * User space process size. This is hardcoded into a few places,
|
1819 |
|
|
+ * so don't change it unless you know what you are doing.
|
1820 |
|
|
+ */
|
1821 |
|
|
+
|
1822 |
|
|
+#define TASK_SIZE (0x80000000UL)
|
1823 |
|
|
+
|
1824 |
|
|
+/* This decides where the kernel will search for a free chunk of vm
|
1825 |
|
|
+ * space during mmap's.
|
1826 |
|
|
+ */
|
1827 |
|
|
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)
|
1828 |
|
|
+
|
1829 |
|
|
+/* THREAD_SIZE is the size of the task_struct/kernel_stack combo.
|
1830 |
|
|
+ * normally, the stack is found by doing something like p + THREAD_SIZE
|
1831 |
|
|
+ * in or32, a page is 8192 bytes, which seems like a sane size
|
1832 |
|
|
+ */
|
1833 |
|
|
+
|
1834 |
|
|
+#define THREAD_SIZE PAGE_SIZE
|
1835 |
|
|
+
|
1836 |
|
|
+#ifndef __ASSEMBLY__
|
1837 |
|
|
+
|
1838 |
|
|
+struct task_struct;
|
1839 |
|
|
+
|
1840 |
|
|
+typedef struct {
|
1841 |
|
|
+ unsigned long seg;
|
1842 |
|
|
+} mm_segment_t;
|
1843 |
|
|
+
|
1844 |
|
|
+struct thread_struct {
|
1845 |
|
|
+ unsigned long usp; /* user space pointer */
|
1846 |
|
|
+ unsigned long ksp; /* kernel stack pointer */
|
1847 |
|
|
+ struct pt_regs *regs; /* pointer to saved register state */
|
1848 |
|
|
+ mm_segment_t fs; /* for get_fs() validation */
|
1849 |
|
|
+ signed long last_syscall;
|
1850 |
|
|
+};
|
1851 |
|
|
+
|
1852 |
|
|
+/*
|
1853 |
|
|
+ * At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack.
|
1854 |
|
|
+ * This macro allows us to find those regs for a task.
|
1855 |
|
|
+ * Notice that subsequent pt_regs stackings, like recursive interrupts occuring while
|
1856 |
|
|
+ * we're in the kernel, won't affect this - only the first user->kernel transition
|
1857 |
|
|
+ * registers are reached by this.
|
1858 |
|
|
+ */
|
1859 |
|
|
+#define user_regs(thread_info) (((struct pt_regs *)((unsigned long)(thread_info) + THREAD_SIZE)) - 1)
|
1860 |
|
|
+
|
1861 |
|
|
+/*
|
1862 |
|
|
+ * Dito but for the currently running task
|
1863 |
|
|
+ */
|
1864 |
|
|
+
|
1865 |
|
|
+#define current_regs() user_regs(current->thread_info)
|
1866 |
|
|
+
|
1867 |
|
|
+extern inline void prepare_to_copy(struct task_struct *tsk)
|
1868 |
|
|
+{
|
1869 |
|
|
+}
|
1870 |
|
|
+
|
1871 |
|
|
+#define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack)
|
1872 |
|
|
+
|
1873 |
|
|
+#define INIT_THREAD { \
|
1874 |
|
|
+ 0, INIT_SP, NULL, KERNEL_DS, 0 }
|
1875 |
|
|
+
|
1876 |
|
|
+
|
1877 |
|
|
+#define KSTK_EIP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->pc: 0)
|
1878 |
|
|
+#define KSTK_ESP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->sp: 0)
|
1879 |
|
|
+
|
1880 |
|
|
+
|
1881 |
|
|
+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
|
1882 |
|
|
+
|
1883 |
|
|
+void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
|
1884 |
|
|
+void release_thread(struct task_struct *);
|
1885 |
|
|
+unsigned long get_wchan(struct task_struct *p);
|
1886 |
|
|
+
|
1887 |
|
|
+/*
|
1888 |
|
|
+ * Free current thread data structures etc..
|
1889 |
|
|
+ */
|
1890 |
|
|
+
|
1891 |
|
|
+extern inline void exit_thread(void)
|
1892 |
|
|
+{
|
1893 |
|
|
+ /* Nothing needs to be done. */
|
1894 |
|
|
+}
|
1895 |
|
|
+
|
1896 |
|
|
+/*
|
1897 |
|
|
+ * Return saved PC of a blocked thread. For now, this is the "user" PC
|
1898 |
|
|
+ */
|
1899 |
|
|
+extern unsigned long thread_saved_pc(struct task_struct *t);
|
1900 |
|
|
+
|
1901 |
|
|
+#define init_stack (init_thread_union.stack)
|
1902 |
|
|
+
|
1903 |
|
|
+#define cpu_relax() do { } while (0)
|
1904 |
|
|
+
|
1905 |
|
|
+#endif /* __ASSEMBLY__ */
|
1906 |
|
|
+#endif /* _OR32_PROCESSOR_H */
|
1907 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/ptrace.h u-boot-2009.03/include/asm-or1200/ptrace.h
|
1908 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/ptrace.h 1969-12-31 16:00:00.000000000 -0800
|
1909 |
|
|
+++ u-boot-2009.03/include/asm-or1200/ptrace.h 2008-07-02 09:36:02.187500000 -0700
|
1910 |
17 |
qaztronic |
@@ -0,0 +1,86 @@
|
1911 |
|
|
+#ifndef _OR32_PTRACE_H
|
1912 |
|
|
+#define _OR32_PTRACE_H
|
1913 |
|
|
+
|
1914 |
|
|
+#include
|
1915 |
|
|
+/*
|
1916 |
|
|
+ * This struct defines the way the registers are stored on the
|
1917 |
|
|
+ * kernel stack during a system call or other kernel entry.
|
1918 |
|
|
+ *
|
1919 |
|
|
+ * this should only contain volatile regs
|
1920 |
|
|
+ * since we can keep non-volatile in the thread_struct
|
1921 |
|
|
+ * should set this up when only volatiles are saved
|
1922 |
|
|
+ * by intr code.
|
1923 |
|
|
+ *
|
1924 |
|
|
+ * Since this is going on the stack, *CARE MUST BE TAKEN* to insure
|
1925 |
|
|
+ * that the overall structure is a multiple of 16 bytes in length.
|
1926 |
|
|
+ *
|
1927 |
|
|
+ * Note that the offsets of the fields in this struct correspond with
|
1928 |
|
|
+ * the values below.
|
1929 |
|
|
+ */
|
1930 |
|
|
+
|
1931 |
|
|
+#ifndef __ASSEMBLY__
|
1932 |
|
|
+
|
1933 |
|
|
+struct pt_regs {
|
1934 |
|
|
+ long pc;
|
1935 |
|
|
+ long sr;
|
1936 |
|
|
+ long sp;
|
1937 |
|
|
+ long gprs[30];
|
1938 |
|
|
+ long orig_gpr3; /* Used for restarting system calls */
|
1939 |
|
|
+ long result; /* Result of a system call */
|
1940 |
|
|
+ long syscallno; /* Syscall no. (used by strace) */
|
1941 |
|
|
+};
|
1942 |
|
|
+#endif /* __ASSEMBLY__ */
|
1943 |
|
|
+
|
1944 |
|
|
+#ifdef __KERNEL__
|
1945 |
|
|
+#define STACK_FRAME_OVERHEAD 0 /* size of minimum stack frame */
|
1946 |
|
|
+
|
1947 |
|
|
+/* Size of stack frame allocated when calling signal handler. */
|
1948 |
|
|
+#define __SIGNAL_FRAMESIZE 64
|
1949 |
|
|
+
|
1950 |
|
|
+#define instruction_pointer(regs) ((regs)->pc)
|
1951 |
|
|
+#define user_mode(regs) (((regs)->sr & SPR_SR_SM) == 0)
|
1952 |
|
|
+#define profile_pc(regs) instruction_pointer(regs)
|
1953 |
|
|
+
|
1954 |
|
|
+#endif /* __KERNEL__ */
|
1955 |
|
|
+
|
1956 |
|
|
+/*
|
1957 |
|
|
+ * Offsets used by 'ptrace' system call interface.
|
1958 |
|
|
+ */
|
1959 |
|
|
+#define PC 0
|
1960 |
|
|
+#define SR 4
|
1961 |
|
|
+#define SP 8
|
1962 |
|
|
+#define GPR2 12
|
1963 |
|
|
+#define GPR3 16
|
1964 |
|
|
+#define GPR4 20
|
1965 |
|
|
+#define GPR5 24
|
1966 |
|
|
+#define GPR6 28
|
1967 |
|
|
+#define GPR7 32
|
1968 |
|
|
+#define GPR8 36
|
1969 |
|
|
+#define GPR9 40
|
1970 |
|
|
+#define GPR10 44
|
1971 |
|
|
+#define GPR11 48
|
1972 |
|
|
+#define GPR12 52
|
1973 |
|
|
+#define GPR13 56
|
1974 |
|
|
+#define GPR14 60
|
1975 |
|
|
+#define GPR15 64
|
1976 |
|
|
+#define GPR16 68
|
1977 |
|
|
+#define GPR17 72
|
1978 |
|
|
+#define GPR18 76
|
1979 |
|
|
+#define GPR19 80
|
1980 |
|
|
+#define GPR20 84
|
1981 |
|
|
+#define GPR21 88
|
1982 |
|
|
+#define GPR22 92
|
1983 |
|
|
+#define GPR23 96
|
1984 |
|
|
+#define GPR24 100
|
1985 |
|
|
+#define GPR25 104
|
1986 |
|
|
+#define GPR26 108
|
1987 |
|
|
+#define GPR27 112
|
1988 |
|
|
+#define GPR28 116
|
1989 |
|
|
+#define GPR29 120
|
1990 |
|
|
+#define GPR30 124
|
1991 |
|
|
+#define GPR31 128
|
1992 |
|
|
+#define ORIG_GPR3 132
|
1993 |
|
|
+#define RESULT 136
|
1994 |
|
|
+#define SYSCALLNO 140
|
1995 |
|
|
+
|
1996 |
|
|
+#endif /* _OR32_PTRACE_H */
|
1997 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/spr_defs.h u-boot-2009.03/include/asm-or1200/spr_defs.h
|
1998 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/spr_defs.h 1969-12-31 16:00:00.000000000 -0800
|
1999 |
|
|
+++ u-boot-2009.03/include/asm-or1200/spr_defs.h 2008-07-02 09:36:02.296875000 -0700
|
2000 |
17 |
qaztronic |
@@ -0,0 +1,438 @@
|
2001 |
|
|
+/* spr_defs.h -- Defines OR1K architecture specific special-purpose registers
|
2002 |
|
|
+ Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
|
2003 |
|
|
+
|
2004 |
|
|
+ For more information about OpenRISC processors, licensing and
|
2005 |
|
|
+ design services you may contact Beyond Semiconductor at
|
2006 |
|
|
+ sales@bsemi.com or visit website http://www.bsemi.com.
|
2007 |
|
|
+
|
2008 |
|
|
+This file is part of OpenRISC 1000 Architectural Simulator.
|
2009 |
|
|
+
|
2010 |
|
|
+This program is free software; you can redistribute it and/or modify
|
2011 |
|
|
+it under the terms of the GNU General Public License as published by
|
2012 |
|
|
+the Free Software Foundation; either version 2 of the License, or
|
2013 |
|
|
+(at your option) any later version.
|
2014 |
|
|
+
|
2015 |
|
|
+This program is distributed in the hope that it will be useful,
|
2016 |
|
|
+but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2017 |
|
|
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2018 |
|
|
+GNU General Public License for more details.
|
2019 |
|
|
+
|
2020 |
|
|
+You should have received a copy of the GNU General Public License
|
2021 |
|
|
+along with this program; if not, write to the Free Software
|
2022 |
|
|
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
2023 |
|
|
+
|
2024 |
|
|
+/* This file is also used by microkernel test bench. Among
|
2025 |
|
|
+others it is also used in assembly file(s). */
|
2026 |
|
|
+
|
2027 |
|
|
+/* Definition of special-purpose registers (SPRs) */
|
2028 |
|
|
+
|
2029 |
|
|
+#ifndef _SPR_DEFS_H
|
2030 |
|
|
+#define _SPR_DEFS_H
|
2031 |
|
|
+
|
2032 |
|
|
+#define MAX_GRPS (32)
|
2033 |
|
|
+#define MAX_SPRS_PER_GRP_BITS (11)
|
2034 |
|
|
+#define MAX_SPRS_PER_GRP (1 << MAX_SPRS_PER_GRP_BITS)
|
2035 |
|
|
+#define MAX_SPRS (0x10000)
|
2036 |
|
|
+
|
2037 |
|
|
+/* Base addresses for the groups */
|
2038 |
|
|
+#define SPRGROUP_SYS (0<< MAX_SPRS_PER_GRP_BITS)
|
2039 |
|
|
+#define SPRGROUP_DMMU (1<< MAX_SPRS_PER_GRP_BITS)
|
2040 |
|
|
+#define SPRGROUP_IMMU (2<< MAX_SPRS_PER_GRP_BITS)
|
2041 |
|
|
+#define SPRGROUP_DC (3<< MAX_SPRS_PER_GRP_BITS)
|
2042 |
|
|
+#define SPRGROUP_IC (4<< MAX_SPRS_PER_GRP_BITS)
|
2043 |
|
|
+#define SPRGROUP_MAC (5<< MAX_SPRS_PER_GRP_BITS)
|
2044 |
|
|
+#define SPRGROUP_D (6<< MAX_SPRS_PER_GRP_BITS)
|
2045 |
|
|
+#define SPRGROUP_PC (7<< MAX_SPRS_PER_GRP_BITS)
|
2046 |
|
|
+#define SPRGROUP_PM (8<< MAX_SPRS_PER_GRP_BITS)
|
2047 |
|
|
+#define SPRGROUP_PIC (9<< MAX_SPRS_PER_GRP_BITS)
|
2048 |
|
|
+#define SPRGROUP_TT (10<< MAX_SPRS_PER_GRP_BITS)
|
2049 |
|
|
+
|
2050 |
|
|
+/* System control and status group */
|
2051 |
|
|
+#define SPR_VR (SPRGROUP_SYS + 0)
|
2052 |
|
|
+#define SPR_UPR (SPRGROUP_SYS + 1)
|
2053 |
|
|
+#define SPR_PC (SPRGROUP_SYS + 16) /* CZ 21/06/01 */
|
2054 |
|
|
+#define SPR_SR (SPRGROUP_SYS + 17) /* CZ 21/06/01 */
|
2055 |
|
|
+#define SPR_EPCR_BASE (SPRGROUP_SYS + 32) /* CZ 21/06/01 */
|
2056 |
|
|
+#define SPR_EPCR_LAST (SPRGROUP_SYS + 47) /* CZ 21/06/01 */
|
2057 |
|
|
+#define SPR_EEAR_BASE (SPRGROUP_SYS + 48)
|
2058 |
|
|
+#define SPR_EEAR_LAST (SPRGROUP_SYS + 63)
|
2059 |
|
|
+#define SPR_ESR_BASE (SPRGROUP_SYS + 64)
|
2060 |
|
|
+#define SPR_ESR_LAST (SPRGROUP_SYS + 79)
|
2061 |
|
|
+
|
2062 |
|
|
+#if 0
|
2063 |
|
|
+/* Data MMU group */
|
2064 |
|
|
+#define SPR_DMMUCR (SPRGROUP_DMMU + 0)
|
2065 |
|
|
+#define SPR_DTLBMR_BASE(WAY) (SPRGROUP_DMMU + 0x200 + (WAY) * 0x200)
|
2066 |
|
|
+#define SPR_DTLBMR_LAST(WAY) (SPRGROUP_DMMU + 0x2ff + (WAY) * 0x200)
|
2067 |
|
|
+#define SPR_DTLBTR_BASE(WAY) (SPRGROUP_DMMU + 0x300 + (WAY) * 0x200)
|
2068 |
|
|
+#define SPR_DTLBTR_LAST(WAY) (SPRGROUP_DMMU + 0x3ff + (WAY) * 0x200)
|
2069 |
|
|
+
|
2070 |
|
|
+/* Instruction MMU group */
|
2071 |
|
|
+#define SPR_IMMUCR (SPRGROUP_IMMU + 0)
|
2072 |
|
|
+#define SPR_ITLBMR_BASE(WAY) (SPRGROUP_IMMU + 0x200 + (WAY) * 0x200)
|
2073 |
|
|
+#define SPR_ITLBMR_LAST(WAY) (SPRGROUP_IMMU + 0x2ff + (WAY) * 0x200)
|
2074 |
|
|
+#define SPR_ITLBTR_BASE(WAY) (SPRGROUP_IMMU + 0x300 + (WAY) * 0x200)
|
2075 |
|
|
+#define SPR_ITLBTR_LAST(WAY) (SPRGROUP_IMMU + 0x3ff + (WAY) * 0x200)
|
2076 |
|
|
+#else
|
2077 |
|
|
+/* Data MMU group */
|
2078 |
|
|
+#define SPR_DMMUCR (SPRGROUP_DMMU + 0)
|
2079 |
|
|
+#define SPR_DTLBMR_BASE(WAY) (SPRGROUP_DMMU + 0x200 + (WAY) * 0x100)
|
2080 |
|
|
+#define SPR_DTLBMR_LAST(WAY) (SPRGROUP_DMMU + 0x27f + (WAY) * 0x100)
|
2081 |
|
|
+#define SPR_DTLBTR_BASE(WAY) (SPRGROUP_DMMU + 0x280 + (WAY) * 0x100)
|
2082 |
|
|
+#define SPR_DTLBTR_LAST(WAY) (SPRGROUP_DMMU + 0x2ff + (WAY) * 0x100)
|
2083 |
|
|
+
|
2084 |
|
|
+/* Instruction MMU group */
|
2085 |
|
|
+#define SPR_IMMUCR (SPRGROUP_IMMU + 0)
|
2086 |
|
|
+#define SPR_ITLBMR_BASE(WAY) (SPRGROUP_IMMU + 0x200 + (WAY) * 0x100)
|
2087 |
|
|
+#define SPR_ITLBMR_LAST(WAY) (SPRGROUP_IMMU + 0x27f + (WAY) * 0x100)
|
2088 |
|
|
+#define SPR_ITLBTR_BASE(WAY) (SPRGROUP_IMMU + 0x280 + (WAY) * 0x100)
|
2089 |
|
|
+#define SPR_ITLBTR_LAST(WAY) (SPRGROUP_IMMU + 0x2ff + (WAY) * 0x100)
|
2090 |
|
|
+#endif
|
2091 |
|
|
+
|
2092 |
|
|
+/* Data cache group */
|
2093 |
|
|
+#define SPR_DCCR (SPRGROUP_DC + 0)
|
2094 |
|
|
+#define SPR_DCBPR (SPRGROUP_DC + 1)
|
2095 |
|
|
+#define SPR_DCBFR (SPRGROUP_DC + 2)
|
2096 |
|
|
+#define SPR_DCBIR (SPRGROUP_DC + 3)
|
2097 |
|
|
+#define SPR_DCBWR (SPRGROUP_DC + 4)
|
2098 |
|
|
+#define SPR_DCBLR (SPRGROUP_DC + 5)
|
2099 |
|
|
+#define SPR_DCR_BASE(WAY) (SPRGROUP_DC + 0x200 + (WAY) * 0x200)
|
2100 |
|
|
+#define SPR_DCR_LAST(WAY) (SPRGROUP_DC + 0x3ff + (WAY) * 0x200)
|
2101 |
|
|
+
|
2102 |
|
|
+/* Instruction cache group */
|
2103 |
|
|
+#define SPR_ICCR (SPRGROUP_IC + 0)
|
2104 |
|
|
+#define SPR_ICBPR (SPRGROUP_IC + 1)
|
2105 |
|
|
+#define SPR_ICBIR (SPRGROUP_IC + 2)
|
2106 |
|
|
+#define SPR_ICBLR (SPRGROUP_IC + 3)
|
2107 |
|
|
+#define SPR_ICR_BASE(WAY) (SPRGROUP_IC + 0x200 + (WAY) * 0x200)
|
2108 |
|
|
+#define SPR_ICR_LAST(WAY) (SPRGROUP_IC + 0x3ff + (WAY) * 0x200)
|
2109 |
|
|
+
|
2110 |
|
|
+/* MAC group */
|
2111 |
|
|
+#define SPR_MACLO (SPRGROUP_MAC + 1)
|
2112 |
|
|
+#define SPR_MACHI (SPRGROUP_MAC + 2)
|
2113 |
|
|
+
|
2114 |
|
|
+/* Debug group */
|
2115 |
|
|
+#define SPR_DVR(N) (SPRGROUP_D + (N))
|
2116 |
|
|
+#define SPR_DCR(N) (SPRGROUP_D + 8 + (N))
|
2117 |
|
|
+#define SPR_DMR1 (SPRGROUP_D + 16)
|
2118 |
|
|
+#define SPR_DMR2 (SPRGROUP_D + 17)
|
2119 |
|
|
+#define SPR_DWCR0 (SPRGROUP_D + 18)
|
2120 |
|
|
+#define SPR_DWCR1 (SPRGROUP_D + 19)
|
2121 |
|
|
+#define SPR_DSR (SPRGROUP_D + 20)
|
2122 |
|
|
+#define SPR_DRR (SPRGROUP_D + 21)
|
2123 |
|
|
+#define SPR_DIR (SPRGROUP_D + 22)
|
2124 |
|
|
+
|
2125 |
|
|
+/* Performance counters group */
|
2126 |
|
|
+#define SPR_PCCR(N) (SPRGROUP_PC + (N))
|
2127 |
|
|
+#define SPR_PCMR(N) (SPRGROUP_PC + 8 + (N))
|
2128 |
|
|
+
|
2129 |
|
|
+/* Power management group */
|
2130 |
|
|
+#define SPR_PMR (SPRGROUP_PM + 0)
|
2131 |
|
|
+
|
2132 |
|
|
+/* PIC group */
|
2133 |
|
|
+#define SPR_PICMR (SPRGROUP_PIC + 0)
|
2134 |
|
|
+#define SPR_PICPR (SPRGROUP_PIC + 1)
|
2135 |
|
|
+#define SPR_PICSR (SPRGROUP_PIC + 2)
|
2136 |
|
|
+
|
2137 |
|
|
+/* Tick Timer group */
|
2138 |
|
|
+#define SPR_TTMR (SPRGROUP_TT + 0)
|
2139 |
|
|
+#define SPR_TTCR (SPRGROUP_TT + 1)
|
2140 |
|
|
+
|
2141 |
|
|
+/*
|
2142 |
|
|
+ * Bit definitions for the Version Register
|
2143 |
|
|
+ *
|
2144 |
|
|
+ */
|
2145 |
|
|
+#define SPR_VR_VER 0xffff0000 /* Processor version */
|
2146 |
|
|
+#define SPR_VR_REV 0x0000003f /* Processor revision */
|
2147 |
|
|
+
|
2148 |
|
|
+/*
|
2149 |
|
|
+ * Bit definitions for the Unit Present Register
|
2150 |
|
|
+ *
|
2151 |
|
|
+ */
|
2152 |
|
|
+#define SPR_UPR_UP 0x00000001 /* UPR present */
|
2153 |
|
|
+#define SPR_UPR_DCP 0x00000002 /* Data cache present */
|
2154 |
|
|
+#define SPR_UPR_ICP 0x00000004 /* Instruction cache present */
|
2155 |
|
|
+#define SPR_UPR_DMP 0x00000008 /* Data MMU present */
|
2156 |
|
|
+#define SPR_UPR_IMP 0x00000010 /* Instruction MMU present */
|
2157 |
|
|
+#define SPR_UPR_OB32P 0x00000020 /* ORBIS32 present */
|
2158 |
|
|
+#define SPR_UPR_OB64P 0x00000040 /* ORBIS64 present */
|
2159 |
|
|
+#define SPR_UPR_OF32P 0x00000080 /* ORFPX32 present */
|
2160 |
|
|
+#define SPR_UPR_OF64P 0x00000100 /* ORFPX64 present */
|
2161 |
|
|
+#define SPR_UPR_OV32P 0x00000200 /* ORVDX32 present */
|
2162 |
|
|
+#define SPR_UPR_OV64P 0x00000400 /* ORVDX64 present */
|
2163 |
|
|
+#define SPR_UPR_DUP 0x00000800 /* Debug unit present */
|
2164 |
|
|
+#define SPR_UPR_PCUP 0x00001000 /* Performance counters unit present */
|
2165 |
|
|
+#define SPR_UPR_PMP 0x00002000 /* Power management present */
|
2166 |
|
|
+#define SPR_UPR_PICP 0x00004000 /* PIC present */
|
2167 |
|
|
+#define SPR_UPR_TTP 0x00008000 /* Tick timer present */
|
2168 |
|
|
+#define SPR_UPR_SRP 0x00010000 /* Shadow registers present */
|
2169 |
|
|
+#define SPR_UPR_RES 0x00fe0000 /* ORVDX32 present */
|
2170 |
|
|
+#define SPR_UPR_CUST 0xff000000 /* Custom units */
|
2171 |
|
|
+
|
2172 |
|
|
+/*
|
2173 |
|
|
+ * Bit definitions for the Supervision Register
|
2174 |
|
|
+ *
|
2175 |
|
|
+ */
|
2176 |
|
|
+#define SPR_SR_CID 0xf0000000 /* Context ID */
|
2177 |
|
|
+#define SPR_SR_FO 0x00008000 /* Fixed one */
|
2178 |
|
|
+#define SPR_SR_EPH 0x00004000 /* Exception Prefixi High */
|
2179 |
|
|
+#define SPR_SR_DSX 0x00002000 /* Delay Slot Exception */
|
2180 |
|
|
+#define SPR_SR_OVE 0x00001000 /* Overflow flag Exception */
|
2181 |
|
|
+#define SPR_SR_OV 0x00000800 /* Overflow flag */
|
2182 |
|
|
+#define SPR_SR_CY 0x00000400 /* Carry flag */
|
2183 |
|
|
+#define SPR_SR_F 0x00000200 /* Condition Flag */
|
2184 |
|
|
+#define SPR_SR_CE 0x00000100 /* CID Enable */
|
2185 |
|
|
+#define SPR_SR_LEE 0x00000080 /* Little Endian Enable */
|
2186 |
|
|
+#define SPR_SR_IME 0x00000040 /* Instruction MMU Enable */
|
2187 |
|
|
+#define SPR_SR_DME 0x00000020 /* Data MMU Enable */
|
2188 |
|
|
+#define SPR_SR_ICE 0x00000010 /* Instruction Cache Enable */
|
2189 |
|
|
+#define SPR_SR_DCE 0x00000008 /* Data Cache Enable */
|
2190 |
|
|
+#define SPR_SR_IEE 0x00000004 /* Interrupt Exception Enable */
|
2191 |
|
|
+#define SPR_SR_TEE 0x00000002 /* Tick timer Exception Enable */
|
2192 |
|
|
+#define SPR_SR_SM 0x00000001 /* Supervisor Mode */
|
2193 |
|
|
+#define SPR_SR_FO_BIT 15
|
2194 |
|
|
+#define SPR_SR_EPH_BIT 14
|
2195 |
|
|
+#define SPR_SR_DSX_BIT 13
|
2196 |
|
|
+#define SPR_SR_OVE_BIT 12
|
2197 |
|
|
+#define SPR_SR_OV_BIT 11
|
2198 |
|
|
+#define SPR_SR_CY_BIT 10
|
2199 |
|
|
+#define SPR_SR_F_BIT 9
|
2200 |
|
|
+#define SPR_SR_CE_BIT 8
|
2201 |
|
|
+#define SPR_SR_LEE_BIT 7
|
2202 |
|
|
+#define SPR_SR_IME_BIT 6
|
2203 |
|
|
+#define SPR_SR_DME_BIT 5
|
2204 |
|
|
+#define SPR_SR_ICE_BIT 4
|
2205 |
|
|
+#define SPR_SR_DCE_BIT 3
|
2206 |
|
|
+#define SPR_SR_IEE_BIT 2
|
2207 |
|
|
+#define SPR_SR_TEE_BIT 1
|
2208 |
|
|
+#define SPR_SR_SM_BIT 0
|
2209 |
|
|
+
|
2210 |
|
|
+
|
2211 |
|
|
+/*
|
2212 |
|
|
+ * Bit definitions for the Data MMU Control Register
|
2213 |
|
|
+ *
|
2214 |
|
|
+ */
|
2215 |
|
|
+#define SPR_DMMUCR_P2S 0x0000003e /* Level 2 Page Size */
|
2216 |
|
|
+#define SPR_DMMUCR_P1S 0x000007c0 /* Level 1 Page Size */
|
2217 |
|
|
+#define SPR_DMMUCR_VADDR_WIDTH 0x0000f800 /* Virtual ADDR Width */
|
2218 |
|
|
+#define SPR_DMMUCR_PADDR_WIDTH 0x000f0000 /* Physical ADDR Width */
|
2219 |
|
|
+
|
2220 |
|
|
+/*
|
2221 |
|
|
+ * Bit definitions for the Instruction MMU Control Register
|
2222 |
|
|
+ *
|
2223 |
|
|
+ */
|
2224 |
|
|
+#define SPR_IMMUCR_P2S 0x0000003e /* Level 2 Page Size */
|
2225 |
|
|
+#define SPR_IMMUCR_P1S 0x000007c0 /* Level 1 Page Size */
|
2226 |
|
|
+#define SPR_IMMUCR_VADDR_WIDTH 0x0000f800 /* Virtual ADDR Width */
|
2227 |
|
|
+#define SPR_IMMUCR_PADDR_WIDTH 0x000f0000 /* Physical ADDR Width */
|
2228 |
|
|
+
|
2229 |
|
|
+/*
|
2230 |
|
|
+ * Bit definitions for the Data TLB Match Register
|
2231 |
|
|
+ *
|
2232 |
|
|
+ */
|
2233 |
|
|
+#define SPR_DTLBMR_V 0x00000001 /* Valid */
|
2234 |
|
|
+#define SPR_DTLBMR_PL1 0x00000002 /* Page Level 1 (if 0 then PL2) */
|
2235 |
|
|
+#define SPR_DTLBMR_CID 0x0000003c /* Context ID */
|
2236 |
|
|
+#define SPR_DTLBMR_LRU 0x000000c0 /* Least Recently Used */
|
2237 |
|
|
+#define SPR_DTLBMR_VPN 0xfffff000 /* Virtual Page Number */
|
2238 |
|
|
+
|
2239 |
|
|
+/*
|
2240 |
|
|
+ * Bit definitions for the Data TLB Translate Register
|
2241 |
|
|
+ *
|
2242 |
|
|
+ */
|
2243 |
|
|
+#define SPR_DTLBTR_CC 0x00000001 /* Cache Coherency */
|
2244 |
|
|
+#define SPR_DTLBTR_CI 0x00000002 /* Cache Inhibit */
|
2245 |
|
|
+#define SPR_DTLBTR_WBC 0x00000004 /* Write-Back Cache */
|
2246 |
|
|
+#define SPR_DTLBTR_WOM 0x00000008 /* Weakly-Ordered Memory */
|
2247 |
|
|
+#define SPR_DTLBTR_A 0x00000010 /* Accessed */
|
2248 |
|
|
+#define SPR_DTLBTR_D 0x00000020 /* Dirty */
|
2249 |
|
|
+#define SPR_DTLBTR_URE 0x00000040 /* User Read Enable */
|
2250 |
|
|
+#define SPR_DTLBTR_UWE 0x00000080 /* User Write Enable */
|
2251 |
|
|
+#define SPR_DTLBTR_SRE 0x00000100 /* Supervisor Read Enable */
|
2252 |
|
|
+#define SPR_DTLBTR_SWE 0x00000200 /* Supervisor Write Enable */
|
2253 |
|
|
+#define SPR_DTLBTR_PPN 0xfffff000 /* Physical Page Number */
|
2254 |
|
|
+#define DTLBTR_NO_LIMIT ( SPR_DTLBTR_URE | \
|
2255 |
|
|
+ SPR_DTLBTR_UWE | \
|
2256 |
|
|
+ SPR_DTLBTR_SRE | \
|
2257 |
|
|
+ SPR_DTLBTR_SWE )
|
2258 |
|
|
+
|
2259 |
|
|
+/*
|
2260 |
|
|
+ * Bit definitions for the Instruction TLB Match Register
|
2261 |
|
|
+ *
|
2262 |
|
|
+ */
|
2263 |
|
|
+#define SPR_ITLBMR_V 0x00000001 /* Valid */
|
2264 |
|
|
+#define SPR_ITLBMR_PL1 0x00000002 /* Page Level 1 (if 0 then PL2) */
|
2265 |
|
|
+#define SPR_ITLBMR_CID 0x0000003c /* Context ID */
|
2266 |
|
|
+#define SPR_ITLBMR_LRU 0x000000c0 /* Least Recently Used */
|
2267 |
|
|
+#define SPR_ITLBMR_VPN 0xfffff000 /* Virtual Page Number */
|
2268 |
|
|
+
|
2269 |
|
|
+/*
|
2270 |
|
|
+ * Bit definitions for the Instruction TLB Translate Register
|
2271 |
|
|
+ *
|
2272 |
|
|
+ */
|
2273 |
|
|
+#define SPR_ITLBTR_CC 0x00000001 /* Cache Coherency */
|
2274 |
|
|
+#define SPR_ITLBTR_CI 0x00000002 /* Cache Inhibit */
|
2275 |
|
|
+#define SPR_ITLBTR_WBC 0x00000004 /* Write-Back Cache */
|
2276 |
|
|
+#define SPR_ITLBTR_WOM 0x00000008 /* Weakly-Ordered Memory */
|
2277 |
|
|
+#define SPR_ITLBTR_A 0x00000010 /* Accessed */
|
2278 |
|
|
+#define SPR_ITLBTR_D 0x00000020 /* Dirty */
|
2279 |
|
|
+#define SPR_ITLBTR_SXE 0x00000040 /* User Read Enable */
|
2280 |
|
|
+#define SPR_ITLBTR_UXE 0x00000080 /* User Write Enable */
|
2281 |
|
|
+#define SPR_ITLBTR_PPN 0xfffff000 /* Physical Page Number */
|
2282 |
|
|
+#define ITLBTR_NO_LIMIT (SPR_ITLBTR_SXE | SPR_ITLBTR_UXE)
|
2283 |
|
|
+
|
2284 |
|
|
+/*
|
2285 |
|
|
+ * Bit definitions for Data Cache Control register
|
2286 |
|
|
+ *
|
2287 |
|
|
+ */
|
2288 |
|
|
+#define SPR_DCCR_EW 0x000000ff /* Enable ways */
|
2289 |
|
|
+
|
2290 |
|
|
+/*
|
2291 |
|
|
+ * Bit definitions for Insn Cache Control register
|
2292 |
|
|
+ *
|
2293 |
|
|
+ */
|
2294 |
|
|
+#define SPR_ICCR_EW 0x000000ff /* Enable ways */
|
2295 |
|
|
+
|
2296 |
|
|
+/*
|
2297 |
|
|
+ * Bit definitions for Debug Control registers
|
2298 |
|
|
+ *
|
2299 |
|
|
+ */
|
2300 |
|
|
+#define SPR_DCR_DP 0x00000001 /* DVR/DCR present */
|
2301 |
|
|
+#define SPR_DCR_CC 0x0000000e /* Compare condition */
|
2302 |
|
|
+#define SPR_DCR_SC 0x00000010 /* Signed compare */
|
2303 |
|
|
+#define SPR_DCR_CT 0x000000e0 /* Compare to */
|
2304 |
|
|
+
|
2305 |
|
|
+/*
|
2306 |
|
|
+ * Bit definitions for Debug Mode 1 register
|
2307 |
|
|
+ *
|
2308 |
|
|
+ */
|
2309 |
|
|
+#define SPR_DMR1_CW0 0x00000003 /* Chain watchpoint 0 */
|
2310 |
|
|
+#define SPR_DMR1_CW1 0x0000000c /* Chain watchpoint 1 */
|
2311 |
|
|
+#define SPR_DMR1_CW2 0x00000030 /* Chain watchpoint 2 */
|
2312 |
|
|
+#define SPR_DMR1_CW3 0x000000c0 /* Chain watchpoint 3 */
|
2313 |
|
|
+#define SPR_DMR1_CW4 0x00000300 /* Chain watchpoint 4 */
|
2314 |
|
|
+#define SPR_DMR1_CW5 0x00000c00 /* Chain watchpoint 5 */
|
2315 |
|
|
+#define SPR_DMR1_CW6 0x00003000 /* Chain watchpoint 6 */
|
2316 |
|
|
+#define SPR_DMR1_CW7 0x0000c000 /* Chain watchpoint 7 */
|
2317 |
|
|
+#define SPR_DMR1_CW8 0x00030000 /* Chain watchpoint 8 */
|
2318 |
|
|
+#define SPR_DMR1_CW9 0x000c0000 /* Chain watchpoint 9 */
|
2319 |
|
|
+#define SPR_DMR1_CW10 0x00300000 /* Chain watchpoint 10 */
|
2320 |
|
|
+#define SPR_DMR1_ST 0x00400000 /* Single-step trace*/
|
2321 |
|
|
+#define SPR_DMR1_BT 0x00800000 /* Branch trace */
|
2322 |
|
|
+#define SPR_DMR1_DXFW 0x01000000 /* Disable external force watchpoint */
|
2323 |
|
|
+
|
2324 |
|
|
+/*
|
2325 |
|
|
+ * Bit definitions for Debug Mode 2 register
|
2326 |
|
|
+ *
|
2327 |
|
|
+ */
|
2328 |
|
|
+#define SPR_DMR2_WCE0 0x00000001 /* Watchpoint counter 0 enable */
|
2329 |
|
|
+#define SPR_DMR2_WCE1 0x00000002 /* Watchpoint counter 0 enable */
|
2330 |
|
|
+#define SPR_DMR2_AWTC 0x00001ffc /* Assign watchpoints to counters */
|
2331 |
|
|
+#define SPR_DMR2_WGB 0x00ffe000 /* Watchpoints generating breakpoint */
|
2332 |
|
|
+
|
2333 |
|
|
+/*
|
2334 |
|
|
+ * Bit definitions for Debug watchpoint counter registers
|
2335 |
|
|
+ *
|
2336 |
|
|
+ */
|
2337 |
|
|
+#define SPR_DWCR_COUNT 0x0000ffff /* Count */
|
2338 |
|
|
+#define SPR_DWCR_MATCH 0xffff0000 /* Match */
|
2339 |
|
|
+
|
2340 |
|
|
+/*
|
2341 |
|
|
+ * Bit definitions for Debug stop register
|
2342 |
|
|
+ *
|
2343 |
|
|
+ */
|
2344 |
|
|
+#define SPR_DSR_RSTE 0x00000001 /* Reset exception */
|
2345 |
|
|
+#define SPR_DSR_BUSEE 0x00000002 /* Bus error exception */
|
2346 |
|
|
+#define SPR_DSR_DPFE 0x00000004 /* Data Page Fault exception */
|
2347 |
|
|
+#define SPR_DSR_IPFE 0x00000008 /* Insn Page Fault exception */
|
2348 |
|
|
+#define SPR_DSR_LPINTE 0x00000010 /* Low priority interrupt exception */
|
2349 |
|
|
+#define SPR_DSR_AE 0x00000020 /* Alignment exception */
|
2350 |
|
|
+#define SPR_DSR_IIE 0x00000040 /* Illegal Instruction exception */
|
2351 |
|
|
+#define SPR_DSR_HPINTE 0x00000080 /* High priority interrupt exception */
|
2352 |
|
|
+#define SPR_DSR_DME 0x00000100 /* DTLB miss exception */
|
2353 |
|
|
+#define SPR_DSR_IME 0x00000200 /* ITLB miss exception */
|
2354 |
|
|
+#define SPR_DSR_RE 0x00000400 /* Range exception */
|
2355 |
|
|
+#define SPR_DSR_SCE 0x00000800 /* System call exception */
|
2356 |
|
|
+#define SPR_DSR_BE 0x00001000 /* Breakpoint exception */
|
2357 |
|
|
+
|
2358 |
|
|
+/*
|
2359 |
|
|
+ * Bit definitions for Debug reason register
|
2360 |
|
|
+ *
|
2361 |
|
|
+ */
|
2362 |
|
|
+#define SPR_DRR_RSTE 0x00000001 /* Reset exception */
|
2363 |
|
|
+#define SPR_DRR_BUSEE 0x00000002 /* Bus error exception */
|
2364 |
|
|
+#define SPR_DRR_DPFE 0x00000004 /* Data Page Fault exception */
|
2365 |
|
|
+#define SPR_DRR_IPFE 0x00000008 /* Insn Page Fault exception */
|
2366 |
|
|
+#define SPR_DRR_LPINTE 0x00000010 /* Low priority interrupt exception */
|
2367 |
|
|
+#define SPR_DRR_AE 0x00000020 /* Alignment exception */
|
2368 |
|
|
+#define SPR_DRR_IIE 0x00000040 /* Illegal Instruction exception */
|
2369 |
|
|
+#define SPR_DRR_HPINTE 0x00000080 /* High priority interrupt exception */
|
2370 |
|
|
+#define SPR_DRR_DME 0x00000100 /* DTLB miss exception */
|
2371 |
|
|
+#define SPR_DRR_IME 0x00000200 /* ITLB miss exception */
|
2372 |
|
|
+#define SPR_DRR_RE 0x00000400 /* Range exception */
|
2373 |
|
|
+#define SPR_DRR_SCE 0x00000800 /* System call exception */
|
2374 |
|
|
+#define SPR_DRR_BE 0x00001000 /* Breakpoint exception */
|
2375 |
|
|
+
|
2376 |
|
|
+/*
|
2377 |
|
|
+ * Bit definitions for Performance counters mode registers
|
2378 |
|
|
+ *
|
2379 |
|
|
+ */
|
2380 |
|
|
+#define SPR_PCMR_CP 0x00000001 /* Counter present */
|
2381 |
|
|
+#define SPR_PCMR_UMRA 0x00000002 /* User mode read access */
|
2382 |
|
|
+#define SPR_PCMR_CISM 0x00000004 /* Count in supervisor mode */
|
2383 |
|
|
+#define SPR_PCMR_CIUM 0x00000008 /* Count in user mode */
|
2384 |
|
|
+#define SPR_PCMR_LA 0x00000010 /* Load access event */
|
2385 |
|
|
+#define SPR_PCMR_SA 0x00000020 /* Store access event */
|
2386 |
|
|
+#define SPR_PCMR_IF 0x00000040 /* Instruction fetch event*/
|
2387 |
|
|
+#define SPR_PCMR_DCM 0x00000080 /* Data cache miss event */
|
2388 |
|
|
+#define SPR_PCMR_ICM 0x00000100 /* Insn cache miss event */
|
2389 |
|
|
+#define SPR_PCMR_IFS 0x00000200 /* Insn fetch stall event */
|
2390 |
|
|
+#define SPR_PCMR_LSUS 0x00000400 /* LSU stall event */
|
2391 |
|
|
+#define SPR_PCMR_BS 0x00000800 /* Branch stall event */
|
2392 |
|
|
+#define SPR_PCMR_DTLBM 0x00001000 /* DTLB miss event */
|
2393 |
|
|
+#define SPR_PCMR_ITLBM 0x00002000 /* ITLB miss event */
|
2394 |
|
|
+#define SPR_PCMR_DDS 0x00004000 /* Data dependency stall event */
|
2395 |
|
|
+#define SPR_PCMR_WPE 0x03ff8000 /* Watchpoint events */
|
2396 |
|
|
+
|
2397 |
|
|
+/*
|
2398 |
|
|
+ * Bit definitions for the Power management register
|
2399 |
|
|
+ *
|
2400 |
|
|
+ */
|
2401 |
|
|
+#define SPR_PMR_SDF 0x00000001 /* Slow down factor */
|
2402 |
|
|
+#define SPR_PMR_DME 0x00000002 /* Doze mode enable */
|
2403 |
|
|
+#define SPR_PMR_SME 0x00000004 /* Sleep mode enable */
|
2404 |
|
|
+#define SPR_PMR_DCGE 0x00000008 /* Dynamic clock gating enable */
|
2405 |
|
|
+#define SPR_PMR_SUME 0x00000010 /* Suspend mode enable */
|
2406 |
|
|
+
|
2407 |
|
|
+/*
|
2408 |
|
|
+ * Bit definitions for PICMR
|
2409 |
|
|
+ *
|
2410 |
|
|
+ */
|
2411 |
|
|
+#define SPR_PICMR_IUM 0xfffffffc /* Interrupt unmask */
|
2412 |
|
|
+
|
2413 |
|
|
+/*
|
2414 |
|
|
+ * Bit definitions for PICPR
|
2415 |
|
|
+ *
|
2416 |
|
|
+ */
|
2417 |
|
|
+#define SPR_PICPR_IPRIO 0xfffffffc /* Interrupt priority */
|
2418 |
|
|
+
|
2419 |
|
|
+/*
|
2420 |
|
|
+ * Bit definitions for PICSR
|
2421 |
|
|
+ *
|
2422 |
|
|
+ */
|
2423 |
|
|
+#define SPR_PICSR_IS 0xffffffff /* Interrupt status */
|
2424 |
|
|
+
|
2425 |
|
|
+/*
|
2426 |
|
|
+ * Bit definitions for Tick Timer Control Register
|
2427 |
|
|
+ *
|
2428 |
|
|
+ */
|
2429 |
|
|
+#define SPR_TTCR_PERIOD 0x0fffffff /* Time Period */
|
2430 |
|
|
+#define SPR_TTMR_PERIOD SPR_TTCR_PERIOD
|
2431 |
|
|
+#define SPR_TTMR_IP 0x10000000 /* Interrupt Pending */
|
2432 |
|
|
+#define SPR_TTMR_IE 0x20000000 /* Interrupt Enable */
|
2433 |
|
|
+#define SPR_TTMR_RT 0x40000000 /* Restart tick */
|
2434 |
|
|
+#define SPR_TTMR_SR 0x80000000 /* Single run */
|
2435 |
|
|
+#define SPR_TTMR_CR 0xc0000000 /* Continuous run */
|
2436 |
|
|
+#define SPR_TTMR_M 0xc0000000 /* Tick mode */
|
2437 |
|
|
+
|
2438 |
|
|
+#endif
|
2439 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/string.h u-boot-2009.03/include/asm-or1200/string.h
|
2440 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/string.h 1969-12-31 16:00:00.000000000 -0800
|
2441 |
|
|
+++ u-boot-2009.03/include/asm-or1200/string.h 2008-07-02 09:36:02.312500000 -0700
|
2442 |
17 |
qaztronic |
@@ -0,0 +1,18 @@
|
2443 |
|
|
+#ifndef _OR32_STRING_H
|
2444 |
|
|
+#define _OR32_STRING_H
|
2445 |
|
|
+
|
2446 |
|
|
+
|
2447 |
|
|
+/* __PHX_TODO__: these are optimizations, will do later */
|
2448 |
|
|
+#if 0
|
2449 |
|
|
+
|
2450 |
|
|
+#define __HAVE_ARCH_MEMCPY
|
2451 |
|
|
+extern void *memcpy(void *, const void *, size_t);
|
2452 |
|
|
+
|
2453 |
|
|
+/* New and improved. In arch/cris/lib/memset.c */
|
2454 |
|
|
+
|
2455 |
|
|
+#define __HAVE_ARCH_MEMSET
|
2456 |
|
|
+extern void *memset(void *, int, size_t);
|
2457 |
|
|
+
|
2458 |
|
|
+#endif
|
2459 |
|
|
+
|
2460 |
|
|
+#endif
|
2461 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/system.h u-boot-2009.03/include/asm-or1200/system.h
|
2462 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/system.h 1969-12-31 16:00:00.000000000 -0800
|
2463 |
|
|
+++ u-boot-2009.03/include/asm-or1200/system.h 2008-07-02 09:36:02.312500000 -0700
|
2464 |
17 |
qaztronic |
@@ -0,0 +1,124 @@
|
2465 |
|
|
+/*
|
2466 |
|
|
+ * Based on:
|
2467 |
|
|
+ * include/asm-ppc/system.h
|
2468 |
|
|
+ * Copyright (C) 1999 Cort Dougan
|
2469 |
|
|
+ */
|
2470 |
|
|
+#ifndef __OR32_SYSTEM_H
|
2471 |
|
|
+#define __OR32_SYSTEM_H
|
2472 |
|
|
+
|
2473 |
|
|
+#include
|
2474 |
|
|
+
|
2475 |
|
|
+/* Memory bariers */
|
2476 |
|
|
+#define barrier() __asm__ __volatile__("": : :"memory")
|
2477 |
|
|
+#define mb() barrier()
|
2478 |
|
|
+#define rmb() mb()
|
2479 |
|
|
+#define wmb() mb()
|
2480 |
|
|
+#define read_barrier_depends() do { } while(0)
|
2481 |
|
|
+#define set_mb(var, value) do { var = value; mb(); } while (0)
|
2482 |
|
|
+#define set_wmb(var, value) do { var = value; wmb(); } while (0)
|
2483 |
|
|
+
|
2484 |
|
|
+#ifdef CONFIG_SMP
|
2485 |
|
|
+#define smp_mb() mb()
|
2486 |
|
|
+#define smp_rmb() rmb()
|
2487 |
|
|
+#define smp_wmb() wmb()
|
2488 |
|
|
+#define smp_read_barrier_depends() read_barrier_depends()
|
2489 |
|
|
+#else
|
2490 |
|
|
+#define smp_mb() barrier()
|
2491 |
|
|
+#define smp_rmb() barrier()
|
2492 |
|
|
+#define smp_wmb() barrier()
|
2493 |
|
|
+#define smp_read_barrier_depends() do { } while(0)
|
2494 |
|
|
+#endif
|
2495 |
|
|
+
|
2496 |
|
|
+#define nop() __asm__ __volatile__ ("l.nop"::)
|
2497 |
|
|
+
|
2498 |
|
|
+#ifdef __KERNEL__
|
2499 |
|
|
+
|
2500 |
|
|
+struct task_struct;
|
2501 |
|
|
+extern unsigned int rtas_data;
|
2502 |
|
|
+struct pt_regs;
|
2503 |
|
|
+
|
2504 |
|
|
+extern void show_regs(struct pt_regs * regs);
|
2505 |
|
|
+
|
2506 |
|
|
+extern void __save_flags(unsigned long *flags);
|
2507 |
|
|
+extern void __restore_flags(unsigned long flags);
|
2508 |
|
|
+extern void __save_and_cli(unsigned long *flags);
|
2509 |
|
|
+extern void __sti(void);
|
2510 |
|
|
+extern void __cli(void);
|
2511 |
|
|
+
|
2512 |
|
|
+
|
2513 |
|
|
+#define local_irq_disable() __cli()
|
2514 |
|
|
+#define local_irq_enable() __sti()
|
2515 |
|
|
+#define local_irq_save(flags) __save_and_cli(&(flags))
|
2516 |
|
|
+#define local_irq_restore(flags) __restore_flags(flags)
|
2517 |
|
|
+#define local_save_flags(flags) __save_flags(&(flags))
|
2518 |
|
|
+
|
2519 |
|
|
+#define prepare_to_switch() do { } while(0)
|
2520 |
|
|
+#define switch_to(prev,next,last) _switch_to((prev),(next),&(last))
|
2521 |
|
|
+
|
2522 |
|
|
+extern void _switch_to(struct task_struct *, struct task_struct *,
|
2523 |
|
|
+ struct task_struct **);
|
2524 |
|
|
+
|
2525 |
|
|
+struct __xchg_dummy { unsigned long a[100]; };
|
2526 |
|
|
+#define __xg(x) ((volatile struct __xchg_dummy *)(x))
|
2527 |
|
|
+#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
|
2528 |
|
|
+#define tas(ptr) (xchg((ptr),1))
|
2529 |
|
|
+
|
2530 |
|
|
+static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
|
2531 |
|
|
+{
|
2532 |
|
|
+ unsigned long tmp, flags;
|
2533 |
|
|
+
|
2534 |
|
|
+ local_irq_save(flags);
|
2535 |
|
|
+
|
2536 |
|
|
+ switch (size) {
|
2537 |
|
|
+ case 1:
|
2538 |
|
|
+ __asm__ __volatile__
|
2539 |
|
|
+ ("l.lbz %0,%2\n\t"
|
2540 |
|
|
+ "l.sb %2,%1"
|
2541 |
|
|
+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
|
2542 |
|
|
+ break;
|
2543 |
|
|
+ case 2:
|
2544 |
|
|
+ __asm__ __volatile__
|
2545 |
|
|
+ ("l.lhz %0,%2\n\t"
|
2546 |
|
|
+ "l.sh %2,%1"
|
2547 |
|
|
+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
|
2548 |
|
|
+ break;
|
2549 |
|
|
+ case 4:
|
2550 |
|
|
+ __asm__ __volatile__
|
2551 |
|
|
+ ("l.lwz %0,%2\n\t"
|
2552 |
|
|
+ "l.sw %2,%1"
|
2553 |
|
|
+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
|
2554 |
|
|
+ break;
|
2555 |
|
|
+ }
|
2556 |
|
|
+
|
2557 |
|
|
+ local_irq_restore(flags);
|
2558 |
|
|
+ return tmp;
|
2559 |
|
|
+}
|
2560 |
|
|
+
|
2561 |
|
|
+extern inline void * xchg_ptr(void * m, void * val)
|
2562 |
|
|
+{
|
2563 |
|
|
+ return (void *) __xchg((unsigned long)m, val, sizeof(unsigned long));
|
2564 |
|
|
+}
|
2565 |
|
|
+
|
2566 |
|
|
+static inline void mtspr(unsigned long add, unsigned long val)
|
2567 |
|
|
+{
|
2568 |
|
|
+ __asm__ __volatile__ ("l.mtspr %0,%1,0" :: "r" (add), "r" (val));
|
2569 |
|
|
+}
|
2570 |
|
|
+
|
2571 |
|
|
+static inline unsigned long mfspr(unsigned long add)
|
2572 |
|
|
+{
|
2573 |
|
|
+ unsigned long ret;
|
2574 |
|
|
+ __asm__ __volatile__ ("l.mfspr %0,%1,0" : "=r" (ret) : "r" (add));
|
2575 |
|
|
+ return ret;
|
2576 |
|
|
+}
|
2577 |
|
|
+
|
2578 |
|
|
+#define irqs_disabled() ((mfspr(SPR_SR) & (SPR_SR_IEE | SPR_SR_TEE)) == 0)
|
2579 |
|
|
+
|
2580 |
|
|
+#define arch_align_stack(x) (x)
|
2581 |
|
|
+
|
2582 |
|
|
+/*
|
2583 |
|
|
+ * debugging aid
|
2584 |
|
|
+ */
|
2585 |
|
|
+extern void __print(const char *fmt, ...);
|
2586 |
|
|
+
|
2587 |
|
|
+#endif /* __KERNEL__ */
|
2588 |
|
|
+#endif /* __OR32_SYSTEM_H */
|
2589 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/types.h u-boot-2009.03/include/asm-or1200/types.h
|
2590 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/types.h 1969-12-31 16:00:00.000000000 -0800
|
2591 |
|
|
+++ u-boot-2009.03/include/asm-or1200/types.h 2008-08-26 18:29:36.849449500 -0700
|
2592 |
17 |
qaztronic |
@@ -0,0 +1,62 @@
|
2593 |
|
|
+#ifndef _ETRAX_TYPES_H
|
2594 |
|
|
+#define _ETRAX_TYPES_H
|
2595 |
|
|
+
|
2596 |
|
|
+#ifndef __ASSEMBLY__
|
2597 |
|
|
+
|
2598 |
|
|
+typedef unsigned short umode_t;
|
2599 |
|
|
+
|
2600 |
|
|
+/*
|
2601 |
|
|
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
|
2602 |
|
|
+ * header files exported to user space
|
2603 |
|
|
+ */
|
2604 |
|
|
+/*typedef unsigned atomic_long_t;RGD I don't get this now using generic*/
|
2605 |
|
|
+typedef __signed__ char __s8;
|
2606 |
|
|
+typedef unsigned char __u8;
|
2607 |
|
|
+
|
2608 |
|
|
+typedef __signed__ short __s16;
|
2609 |
|
|
+typedef unsigned short __u16;
|
2610 |
|
|
+
|
2611 |
|
|
+typedef __signed__ int __s32;
|
2612 |
|
|
+typedef unsigned int __u32;
|
2613 |
|
|
+
|
2614 |
|
|
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
2615 |
|
|
+typedef __signed__ long long __s64;
|
2616 |
|
|
+typedef unsigned long long __u64;
|
2617 |
|
|
+#endif
|
2618 |
|
|
+
|
2619 |
|
|
+#endif /* __ASSEMBLY__ */
|
2620 |
|
|
+
|
2621 |
|
|
+/*
|
2622 |
|
|
+ * These aren't exported outside the kernel to avoid name space clashes
|
2623 |
|
|
+ */
|
2624 |
|
|
+#ifdef __KERNEL__
|
2625 |
|
|
+
|
2626 |
|
|
+#define BITS_PER_LONG 32
|
2627 |
|
|
+
|
2628 |
|
|
+#ifndef __ASSEMBLY__
|
2629 |
|
|
+
|
2630 |
|
|
+typedef signed char s8;
|
2631 |
|
|
+typedef unsigned char u8;
|
2632 |
|
|
+
|
2633 |
|
|
+typedef signed short s16;
|
2634 |
|
|
+typedef unsigned short u16;
|
2635 |
|
|
+
|
2636 |
|
|
+typedef signed int s32;
|
2637 |
|
|
+typedef unsigned int u32;
|
2638 |
|
|
+
|
2639 |
|
|
+typedef signed long long s64;
|
2640 |
|
|
+typedef unsigned long long u64;
|
2641 |
|
|
+
|
2642 |
|
|
+/* Dma addresses are 32-bits wide, just like our other addresses. */
|
2643 |
|
|
+
|
2644 |
|
|
+typedef u32 dma_addr_t;
|
2645 |
|
|
+typedef u32 dma64_addr_t;
|
2646 |
|
|
+
|
2647 |
|
|
+typedef unsigned long phys_addr_t;
|
2648 |
|
|
+typedef unsigned long phys_size_t;
|
2649 |
|
|
+
|
2650 |
|
|
+#endif /* __ASSEMBLY__ */
|
2651 |
|
|
+
|
2652 |
|
|
+#endif /* __KERNEL__ */
|
2653 |
|
|
+
|
2654 |
|
|
+#endif
|
2655 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/asm-or1200/u-boot.h u-boot-2009.03/include/asm-or1200/u-boot.h
|
2656 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/asm-or1200/u-boot.h 1969-12-31 16:00:00.000000000 -0800
|
2657 |
|
|
+++ u-boot-2009.03/include/asm-or1200/u-boot.h 2008-09-05 09:57:00.265625000 -0700
|
2658 |
17 |
qaztronic |
@@ -0,0 +1,53 @@
|
2659 |
|
|
+/*
|
2660 |
|
|
+ * (C) Copyright 2004 Atmark Techno, Inc.
|
2661 |
|
|
+ *
|
2662 |
|
|
+ * Yasushi SHOJI
|
2663 |
|
|
+ *
|
2664 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
2665 |
|
|
+ * project.
|
2666 |
|
|
+ *
|
2667 |
|
|
+ * This program is free software; you can redistribute it and/or
|
2668 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
2669 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
2670 |
|
|
+ * the License, or (at your option) any later version.
|
2671 |
|
|
+ *
|
2672 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
2673 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2674 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2675 |
|
|
+ * GNU General Public License for more details.
|
2676 |
|
|
+ *
|
2677 |
|
|
+ * You should have received a copy of the GNU General Public License
|
2678 |
|
|
+ * along with this program; if not, write to the Free Software
|
2679 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
2680 |
|
|
+ * MA 02111-1307 USA
|
2681 |
|
|
+ *
|
2682 |
|
|
+ ********************************************************************
|
2683 |
|
|
+ * NOTE: This header file defines an interface to U-Boot. Including
|
2684 |
|
|
+ * this (unmodified) header file in another file is considered normal
|
2685 |
|
|
+ * use of U-Boot, and does *not* fall under the heading of "derived
|
2686 |
|
|
+ * work".
|
2687 |
|
|
+ ********************************************************************
|
2688 |
|
|
+ */
|
2689 |
|
|
+
|
2690 |
|
|
+#ifndef _U_BOOT_H_
|
2691 |
|
|
+#define _U_BOOT_H_
|
2692 |
|
|
+
|
2693 |
|
|
+typedef struct bd_info {
|
2694 |
|
|
+ unsigned long bi_boot_params; /* start of DRAM memory */
|
2695 |
|
|
+ unsigned long bi_memstart; /* start of DRAM memory */
|
2696 |
|
|
+ unsigned long bi_memsize; /* size of DRAM memory in bytes */
|
2697 |
|
|
+ unsigned long bi_flashstart; /* start of FLASH memory */
|
2698 |
|
|
+ unsigned long bi_flashsize; /* size of FLASH memory */
|
2699 |
|
|
+ unsigned long bi_flashoffset; /* reserved area for startup monitor */
|
2700 |
|
|
+ unsigned long bi_sramstart; /* start of SRAM memory */
|
2701 |
|
|
+ unsigned long bi_sramsize; /* size of SRAM memory */
|
2702 |
|
|
+ unsigned long bi_ip_addr; /* IP Address */
|
2703 |
|
|
+ unsigned char bi_enetaddr[6]; /* Ethernet adress */
|
2704 |
|
|
+ unsigned long bi_baudrate; /* Console Baudrate */
|
2705 |
|
|
+ unsigned long post_code;
|
2706 |
|
|
+} bd_t;
|
2707 |
|
|
+
|
2708 |
|
|
+
|
2709 |
|
|
+#endif /* _U_BOOT_H_ */
|
2710 |
|
|
+
|
2711 |
|
|
+
|
2712 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/configs/de1_or1k.h u-boot-2009.03/include/configs/de1_or1k.h
|
2713 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/configs/de1_or1k.h 1969-12-31 16:00:00.000000000 -0800
|
2714 |
|
|
+++ u-boot-2009.03/include/configs/de1_or1k.h 2009-03-25 17:39:02.660456000 -0700
|
2715 |
17 |
qaztronic |
@@ -0,0 +1,154 @@
|
2716 |
|
|
+/*
|
2717 |
|
|
+ * (C) Copyright 2003
|
2718 |
|
|
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
2719 |
|
|
+ *
|
2720 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
2721 |
|
|
+ * project.
|
2722 |
|
|
+ *
|
2723 |
|
|
+ * This program is free software; you can redistribute it and/or
|
2724 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
2725 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
2726 |
|
|
+ * the License, or (at your option) any later version.
|
2727 |
|
|
+ *
|
2728 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
2729 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2730 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2731 |
|
|
+ * GNU General Public License for more details.
|
2732 |
|
|
+ *
|
2733 |
|
|
+ * You should have received a copy of the GNU General Public License
|
2734 |
|
|
+ * along with this program; if not, write to the Free Software
|
2735 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
2736 |
|
|
+ * MA 02111-1307 USA
|
2737 |
|
|
+ */
|
2738 |
|
|
+
|
2739 |
|
|
+/*
|
2740 |
|
|
+ *
|
2741 |
|
|
+ */
|
2742 |
|
|
+
|
2743 |
|
|
+#ifndef __CONFIG_H
|
2744 |
|
|
+#define __CONFIG_H
|
2745 |
|
|
+
|
2746 |
|
|
+
|
2747 |
|
|
+/*-----------------------------------------------------------------------
|
2748 |
|
|
+ * misc configuration.
|
2749 |
|
|
+ */
|
2750 |
|
|
+
|
2751 |
|
|
+#undef CONFIG_BZIP2
|
2752 |
|
|
+
|
2753 |
|
|
+#undef CONFIG_WATCHDOG
|
2754 |
|
|
+
|
2755 |
|
|
+#define CONFIG_CLOCKS_IN_MHZ 24
|
2756 |
|
|
+#define CONFIG_HZ (CONFIG_CLOCKS_IN_MHZ * 1000000)
|
2757 |
|
|
+
|
2758 |
|
|
+/*-----------------------------------------------------------------------
|
2759 |
|
|
+ * Command line configuration.
|
2760 |
|
|
+ */
|
2761 |
|
|
+#include
|
2762 |
|
|
+
|
2763 |
|
|
+#undef CONFIG_CMD_AUTOSCRIPT /* Autoscript Support */
|
2764 |
|
|
+#undef CONFIG_CMD_BDI /* bdinfo */
|
2765 |
|
|
+#undef CONFIG_CMD_BOOTD /* bootd */
|
2766 |
|
|
+// #undef CONFIG_CMD_CONSOLE /* coninfo */
|
2767 |
|
|
+#undef CONFIG_CMD_ECHO /* echo arguments */
|
2768 |
|
|
+#undef CONFIG_CMD_SAVEENV /* saveenv */
|
2769 |
|
|
+#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
|
2770 |
|
|
+#undef CONFIG_CMD_FPGA /* FPGA configuration Support */
|
2771 |
|
|
+#undef CONFIG_CMD_IMI /* iminfo */
|
2772 |
|
|
+#undef CONFIG_CMD_IMLS /* List all found images */
|
2773 |
|
|
+#undef CONFIG_CMD_ITEST /* Integer (and string) test */
|
2774 |
|
|
+#undef CONFIG_CMD_LOADB /* loadb */
|
2775 |
|
|
+#undef CONFIG_CMD_LOADS /* loads */
|
2776 |
|
|
+// #undef CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */
|
2777 |
|
|
+#undef CONFIG_CMD_MISC /* Misc functions like sleep etc*/
|
2778 |
|
|
+#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
|
2779 |
|
|
+#undef CONFIG_CMD_NFS /* NFS support */
|
2780 |
|
|
+#undef CONFIG_CMD_RUN /* run command in env variable */
|
2781 |
|
|
+#undef CONFIG_CMD_SETGETDCR /* DCR support on 4xx */
|
2782 |
|
|
+#undef CONFIG_CMD_XIMG /* Load part of Multi Image */
|
2783 |
|
|
+
|
2784 |
|
|
+
|
2785 |
|
|
+/*-----------------------------------------------------------------------
|
2786 |
|
|
+ * environment data configuration.
|
2787 |
|
|
+ */
|
2788 |
|
|
+
|
2789 |
|
|
+#define CONFIG_ENV_IS_NOWHERE
|
2790 |
|
|
+#define CONFIG_ENV_SIZE 1024
|
2791 |
|
|
+#define CONFIG_SYS_MAX_FLASH_SECT 1
|
2792 |
|
|
+#define CONFIG_SYS_NO_FLASH
|
2793 |
|
|
+
|
2794 |
|
|
+
|
2795 |
|
|
+/*-----------------------------------------------------------------------
|
2796 |
|
|
+ * boot configuration.
|
2797 |
|
|
+ */
|
2798 |
|
|
+#undef CONFIG_BOOTARGS
|
2799 |
|
|
+
|
2800 |
|
|
+#define CONFIG_BOOTDELAY 10 /* autoboot after 10 seconds */
|
2801 |
|
|
+#define CONFIG_TIMESTAMP /* Print image info with timestamp */
|
2802 |
|
|
+#define CONFIG_SYS_LOAD_ADDR 0x81000000
|
2803 |
|
|
+
|
2804 |
|
|
+
|
2805 |
|
|
+/*-----------------------------------------------------------------------
|
2806 |
|
|
+ * Console configuration.
|
2807 |
|
|
+ */
|
2808 |
|
|
+#define CONFIG_SYS_PROMPT "de1_or1k # " /* Monitor Command Prompt */
|
2809 |
|
|
+
|
2810 |
|
|
+#define CONFIG_AUTO_COMPLETE
|
2811 |
|
|
+#define CONFIG_CMDLINE_EDITING
|
2812 |
|
|
+
|
2813 |
|
|
+#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
|
2814 |
|
|
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
|
2815 |
|
|
+#define CONFIG_SYS_MAXARGS 16
|
2816 |
|
|
+
|
2817 |
|
|
+
|
2818 |
|
|
+/*-----------------------------------------------------------------------
|
2819 |
|
|
+ * Start addresses for the final memory configuration
|
2820 |
|
|
+ * (Set up by the startup code)
|
2821 |
|
|
+ * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
|
2822 |
|
|
+ */
|
2823 |
|
|
+#define CONFIG_SYS_SDRAM_BASE 0x30000000
|
2824 |
|
|
+#define CONFIG_SYS_SDRAM_SIZE 0x00020000
|
2825 |
|
|
+#define CONFIG_SYS_FLASH_BASE 0x20000000
|
2826 |
|
|
+#define CONFIG_SYS_FLASH_SIZE 0x00400000
|
2827 |
|
|
+
|
2828 |
|
|
+#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
|
2829 |
|
|
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE)
|
2830 |
|
|
+
|
2831 |
|
|
+#define CONFIG_SYS_MALLOC_BASE 0x30010000
|
2832 |
|
|
+#define CONFIG_SYS_MALLOC_LEN 32*1024
|
2833 |
|
|
+
|
2834 |
|
|
+
|
2835 |
|
|
+/*-----------------------------------------------------------------------
|
2836 |
|
|
+ * Definitions for initial stack pointer and data area
|
2837 |
|
|
+ */
|
2838 |
|
|
+
|
2839 |
|
|
+#define CONFIG_SYS_INIT_RAM_ADDR 0x30000000 /* inside of SDRAM */
|
2840 |
|
|
+#define CONFIG_SYS_INIT_RAM_END (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_SDRAM_SIZE) /* End of used area in RAM */
|
2841 |
|
|
+#define CONFIG_SYS_INIT_DATA_SIZE 128 /* size in bytes reserved for initial data */
|
2842 |
|
|
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_INIT_DATA_SIZE)
|
2843 |
|
|
+#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
|
2844 |
|
|
+
|
2845 |
|
|
+
|
2846 |
|
|
+/*-----------------------------------------------------------------------
|
2847 |
|
|
+ * serial port configuration.
|
2848 |
|
|
+ */
|
2849 |
|
|
+
|
2850 |
|
|
+#define CONFIG_BAUDRATE 57600
|
2851 |
|
|
+#define CONFIG_SYS_BAUDRATE_TABLE { 9600 , 19200 , 38400 , 57600, 115200 }
|
2852 |
|
|
+
|
2853 |
|
|
+#define CONFIG_CONS_INDEX 1
|
2854 |
|
|
+#define CONFIG_SYS_NS16550_SERIAL
|
2855 |
|
|
+#define CONFIG_SYS_NS16550
|
2856 |
|
|
+#define CONFIG_SYS_NS16550_REG_SIZE 1
|
2857 |
|
|
+#define CONFIG_SYS_NS16550_COM1 (0x50000000)
|
2858 |
|
|
+#define CONFIG_SYS_NS16550_CLK CONFIG_HZ
|
2859 |
|
|
+
|
2860 |
|
|
+
|
2861 |
|
|
+/*-----------------------------------------------------------------------
|
2862 |
|
|
+ * qaz debug
|
2863 |
|
|
+ */
|
2864 |
|
|
+
|
2865 |
|
|
+
|
2866 |
|
|
+
|
2867 |
|
|
+#endif /* __CONFIG_H */
|
2868 |
|
|
+
|
2869 |
|
|
+
|
2870 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/include/image.h u-boot-2009.03/include/image.h
|
2871 |
18 |
qaztronic |
--- u-boot-2009.03_orig/include/image.h 2009-03-21 14:04:41.000000000 -0700
|
2872 |
|
|
+++ u-boot-2009.03/include/image.h 2009-03-25 16:04:34.525496200 -0700
|
2873 |
|
|
@@ -478,6 +478,8 @@
|
2874 |
|
|
if (!image_check_arch (hdr, IH_ARCH_SH))
|
2875 |
|
|
#elif defined(__sparc__)
|
2876 |
|
|
if (!image_check_arch (hdr, IH_ARCH_SPARC))
|
2877 |
|
|
+#elif defined(__or1200__)
|
2878 |
|
|
+ if (!image_check_arch (hdr, IH_ARCH_INVALID))
|
2879 |
|
|
#else
|
2880 |
|
|
# error Unknown CPU type
|
2881 |
|
|
#endif
|
2882 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/lib_or1200/Makefile u-boot-2009.03/lib_or1200/Makefile
|
2883 |
18 |
qaztronic |
--- u-boot-2009.03_orig/lib_or1200/Makefile 1969-12-31 16:00:00.000000000 -0800
|
2884 |
|
|
+++ u-boot-2009.03/lib_or1200/Makefile 2009-03-24 13:36:12.366942000 -0700
|
2885 |
17 |
qaztronic |
@@ -0,0 +1,45 @@
|
2886 |
18 |
qaztronic |
+#
|
2887 |
|
|
+# (C) Copyright 2003-2006
|
2888 |
|
|
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
2889 |
|
|
+#
|
2890 |
|
|
+# See file CREDITS for list of people who contributed to this
|
2891 |
|
|
+# project.
|
2892 |
|
|
+#
|
2893 |
|
|
+# This program is free software; you can redistribute it and/or
|
2894 |
|
|
+# modify it under the terms of the GNU General Public License as
|
2895 |
|
|
+# published by the Free Software Foundation; either version 2 of
|
2896 |
|
|
+# the License, or (at your option) any later version.
|
2897 |
|
|
+#
|
2898 |
|
|
+# This program is distributed in the hope that it will be useful,
|
2899 |
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2900 |
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2901 |
|
|
+# GNU General Public License for more details.
|
2902 |
|
|
+#
|
2903 |
|
|
+# You should have received a copy of the GNU General Public License
|
2904 |
|
|
+# along with this program; if not, write to the Free Software
|
2905 |
|
|
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
2906 |
|
|
+# MA 02111-1307 USA
|
2907 |
|
|
+#
|
2908 |
|
|
+
|
2909 |
|
|
+include $(TOPDIR)/config.mk
|
2910 |
|
|
+
|
2911 |
|
|
+LIB = $(obj)lib$(ARCH).a
|
2912 |
|
|
+
|
2913 |
|
|
+SOBJS =
|
2914 |
|
|
+
|
2915 |
|
|
+COBJS = board.o bootm.o cache.o
|
2916 |
|
|
+
|
2917 |
|
|
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
2918 |
|
|
+OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
2919 |
|
|
+
|
2920 |
|
|
+$(LIB): $(obj).depend $(OBJS)
|
2921 |
|
|
+ $(AR) $(ARFLAGS) $@ $(OBJS)
|
2922 |
|
|
+
|
2923 |
|
|
+#########################################################################
|
2924 |
|
|
+
|
2925 |
|
|
+# defines $(obj).depend target
|
2926 |
|
|
+include $(SRCTREE)/rules.mk
|
2927 |
|
|
+
|
2928 |
|
|
+sinclude $(obj).depend
|
2929 |
|
|
+
|
2930 |
|
|
+#########################################################################
|
2931 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/lib_or1200/board.c u-boot-2009.03/lib_or1200/board.c
|
2932 |
18 |
qaztronic |
--- u-boot-2009.03_orig/lib_or1200/board.c 1969-12-31 16:00:00.000000000 -0800
|
2933 |
|
|
+++ u-boot-2009.03/lib_or1200/board.c 2009-03-25 17:41:25.221131200 -0700
|
2934 |
17 |
qaztronic |
@@ -0,0 +1,172 @@
|
2935 |
|
|
+/*
|
2936 |
|
|
+ * (C) Copyright 2007 Michal Simek
|
2937 |
|
|
+ * (C) Copyright 2004 Atmark Techno, Inc.
|
2938 |
|
|
+ *
|
2939 |
|
|
+ * Michal SIMEK
|
2940 |
|
|
+ * Yasushi SHOJI
|
2941 |
|
|
+ *
|
2942 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
2943 |
|
|
+ * project.
|
2944 |
|
|
+ *
|
2945 |
|
|
+ * This program is free software; you can redistribute it and/or
|
2946 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
2947 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
2948 |
|
|
+ * the License, or (at your option) any later version.
|
2949 |
|
|
+ *
|
2950 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
2951 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2952 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2953 |
|
|
+ * GNU General Public License for more details.
|
2954 |
|
|
+ *
|
2955 |
|
|
+ * You should have received a copy of the GNU General Public License
|
2956 |
|
|
+ * along with this program; if not, write to the Free Software
|
2957 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
2958 |
|
|
+ * MA 02111-1307 USA
|
2959 |
|
|
+ */
|
2960 |
|
|
+
|
2961 |
|
|
+#include
|
2962 |
|
|
+#include
|
2963 |
|
|
+#include
|
2964 |
|
|
+#include
|
2965 |
|
|
+#include
|
2966 |
|
|
+
|
2967 |
|
|
+DECLARE_GLOBAL_DATA_PTR;
|
2968 |
|
|
+
|
2969 |
|
|
+const char version_string[] = U_BOOT_VERSION " (" __DATE__ " - " __TIME__ ")";
|
2970 |
|
|
+
|
2971 |
|
|
+
|
2972 |
|
|
+int board_early_init_f (void);
|
2973 |
|
|
+void set_de1_post( unsigned int post_code );
|
2974 |
|
|
+void init_de1_post( void );
|
2975 |
|
|
+int de1_post_incr( void );
|
2976 |
|
|
+
|
2977 |
|
|
+
|
2978 |
|
|
+/*
|
2979 |
|
|
+ * Begin and End of memory area for malloc(), and current "brk"
|
2980 |
|
|
+ */
|
2981 |
|
|
+static ulong mem_malloc_start;
|
2982 |
|
|
+static ulong mem_malloc_end;
|
2983 |
|
|
+static ulong mem_malloc_brk;
|
2984 |
|
|
+
|
2985 |
|
|
+/*
|
2986 |
|
|
+ * The Malloc area is immediately below the monitor copy in DRAM
|
2987 |
|
|
+ * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
|
2988 |
|
|
+ * as our monitory code is run from SDRAM
|
2989 |
|
|
+ */
|
2990 |
|
|
+static void mem_malloc_init (void)
|
2991 |
|
|
+{
|
2992 |
|
|
+ mem_malloc_end = (CONFIG_SYS_MALLOC_BASE + CONFIG_SYS_MALLOC_LEN);
|
2993 |
|
|
+ mem_malloc_start = CONFIG_SYS_MALLOC_BASE;
|
2994 |
|
|
+ mem_malloc_brk = mem_malloc_start;
|
2995 |
|
|
+
|
2996 |
|
|
+// memset ((void *)mem_malloc_start, 0, mem_malloc_end - mem_malloc_start);
|
2997 |
|
|
+ memset ((void *)mem_malloc_start, 0, 4 );
|
2998 |
|
|
+}
|
2999 |
|
|
+
|
3000 |
|
|
+void *sbrk (ptrdiff_t increment)
|
3001 |
|
|
+{
|
3002 |
|
|
+ ulong old = mem_malloc_brk;
|
3003 |
|
|
+ ulong new = old + increment;
|
3004 |
|
|
+
|
3005 |
|
|
+ if ((new < mem_malloc_start) || (new > mem_malloc_end)) {
|
3006 |
|
|
+ return (NULL);
|
3007 |
|
|
+ }
|
3008 |
|
|
+ mem_malloc_brk = new;
|
3009 |
|
|
+ return ((void *)old);
|
3010 |
|
|
+}
|
3011 |
|
|
+
|
3012 |
|
|
+
|
3013 |
|
|
+/*
|
3014 |
|
|
+ * All attempts to come up with a "common" initialization sequence
|
3015 |
|
|
+ * that works for all boards and architectures failed: some of the
|
3016 |
|
|
+ * requirements are just _too_ different. To get rid of the resulting
|
3017 |
|
|
+ * mess of board dependend #ifdef'ed code we now make the whole
|
3018 |
|
|
+ * initialization sequence configurable to the user.
|
3019 |
|
|
+ *
|
3020 |
|
|
+ * The requirements for any new initalization function is simple: it
|
3021 |
|
|
+ * receives a pointer to the "global data" structure as it's only
|
3022 |
|
|
+ * argument, and returns an integer return code, where 0 means
|
3023 |
|
|
+ * "continue" and != 0 means "fatal error, hang the system".
|
3024 |
|
|
+ */
|
3025 |
|
|
+typedef int (init_fnc_t) (void);
|
3026 |
|
|
+
|
3027 |
|
|
+init_fnc_t *init_sequence[] = {
|
3028 |
|
|
+ env_init,
|
3029 |
|
|
+ de1_post_incr,
|
3030 |
|
|
+ serial_init,
|
3031 |
|
|
+ de1_post_incr,
|
3032 |
|
|
+ NULL,
|
3033 |
|
|
+};
|
3034 |
|
|
+
|
3035 |
|
|
+void board_init (void)
|
3036 |
|
|
+{
|
3037 |
|
|
+ bd_t *bd;
|
3038 |
|
|
+ init_fnc_t **init_fnc_ptr;
|
3039 |
|
|
+ gd = (gd_t *) (CONFIG_SYS_GBL_DATA_OFFSET);
|
3040 |
|
|
+
|
3041 |
|
|
+// #if defined(CONFIG_CMD_FLASH)
|
3042 |
|
|
+// ulong flash_size = 0;
|
3043 |
|
|
+// #endif
|
3044 |
|
|
+
|
3045 |
|
|
+ memset ((void *)gd, 0, CONFIG_SYS_INIT_DATA_SIZE);
|
3046 |
|
|
+ gd->bd = (bd_t *) (gd + 1); /* At end of global data */
|
3047 |
|
|
+ gd->baudrate = CONFIG_BAUDRATE;
|
3048 |
|
|
+ bd = gd->bd;
|
3049 |
|
|
+ bd->bi_baudrate = CONFIG_BAUDRATE;
|
3050 |
|
|
+ bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
|
3051 |
|
|
+ bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
|
3052 |
|
|
+
|
3053 |
|
|
+ init_de1_post();
|
3054 |
|
|
+
|
3055 |
|
|
+ /* Initialise malloc() area */
|
3056 |
|
|
+ mem_malloc_init ();
|
3057 |
|
|
+
|
3058 |
|
|
+ set_de1_post(0x00000100);
|
3059 |
|
|
+
|
3060 |
|
|
+ board_early_init_f();
|
3061 |
|
|
+
|
3062 |
|
|
+ set_de1_post(0x00000200);
|
3063 |
|
|
+
|
3064 |
|
|
+ for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
|
3065 |
|
|
+
|
3066 |
|
|
+ de1_post_incr();
|
3067 |
|
|
+ WATCHDOG_RESET ();
|
3068 |
|
|
+ de1_post_incr();
|
3069 |
|
|
+
|
3070 |
|
|
+ if ((*init_fnc_ptr) () != 0) {
|
3071 |
|
|
+ hang ();
|
3072 |
|
|
+ }
|
3073 |
|
|
+ }
|
3074 |
|
|
+
|
3075 |
|
|
+ set_de1_post(0x00000300);
|
3076 |
|
|
+
|
3077 |
|
|
+// #if defined(CONFIG_CMD_FLASH)
|
3078 |
|
|
+// bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
|
3079 |
|
|
+// if (0 < (flash_size = flash_init ())) {
|
3080 |
|
|
+// bd->bi_flashsize = flash_size;
|
3081 |
|
|
+// bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
|
3082 |
|
|
+// } else {
|
3083 |
|
|
+// puts ("Flash init FAILED");
|
3084 |
|
|
+// bd->bi_flashstart = 0;
|
3085 |
|
|
+// bd->bi_flashsize = 0;
|
3086 |
|
|
+// bd->bi_flashoffset = 0;
|
3087 |
|
|
+// }
|
3088 |
|
|
+// #endif
|
3089 |
|
|
+
|
3090 |
|
|
+ /* relocate environment function pointers etc. */
|
3091 |
|
|
+ env_relocate ();
|
3092 |
|
|
+
|
3093 |
|
|
+ set_de1_post(0x00000400);
|
3094 |
|
|
+
|
3095 |
|
|
+ /* main_loop */
|
3096 |
|
|
+ for (;;) {
|
3097 |
|
|
+ WATCHDOG_RESET ();
|
3098 |
|
|
+ main_loop ();
|
3099 |
|
|
+ }
|
3100 |
|
|
+}
|
3101 |
|
|
+
|
3102 |
|
|
+void hang (void)
|
3103 |
|
|
+{
|
3104 |
|
|
+ puts ("### ERROR ### Please RESET the board ###\n");
|
3105 |
|
|
+ for (;;) ;
|
3106 |
|
|
+}
|
3107 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/lib_or1200/bootm.c u-boot-2009.03/lib_or1200/bootm.c
|
3108 |
18 |
qaztronic |
--- u-boot-2009.03_orig/lib_or1200/bootm.c 1969-12-31 16:00:00.000000000 -0800
|
3109 |
|
|
+++ u-boot-2009.03/lib_or1200/bootm.c 2009-03-24 13:36:12.351353000 -0700
|
3110 |
17 |
qaztronic |
@@ -0,0 +1,34 @@
|
3111 |
18 |
qaztronic |
+/*
|
3112 |
|
|
+ * (C) Copyright 2003, Psyent Corporation
|
3113 |
|
|
+ * Scott McNutt
|
3114 |
|
|
+ *
|
3115 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
3116 |
|
|
+ * project.
|
3117 |
|
|
+ *
|
3118 |
|
|
+ * This program is free software; you can redistribute it and/or
|
3119 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
3120 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
3121 |
|
|
+ * the License, or (at your option) any later version.
|
3122 |
|
|
+ *
|
3123 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
3124 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
3125 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
3126 |
|
|
+ * GNU General Public License for more details.
|
3127 |
|
|
+ *
|
3128 |
|
|
+ * You should have received a copy of the GNU General Public License
|
3129 |
|
|
+ * along with this program; if not, write to the Free Software
|
3130 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
3131 |
|
|
+ * MA 02111-1307 USA
|
3132 |
|
|
+ */
|
3133 |
|
|
+
|
3134 |
|
|
+#include
|
3135 |
|
|
+#include
|
3136 |
|
|
+
|
3137 |
|
|
+/* FIXME: Once we find a stable version of uC-linux for nios
|
3138 |
|
|
+ * we can get this working. ;-)
|
3139 |
|
|
+ *
|
3140 |
|
|
+ */
|
3141 |
|
|
+void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
|
3142 |
|
|
+ bootm_headers_t *images)
|
3143 |
|
|
+{
|
3144 |
|
|
+}
|
3145 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/lib_or1200/cache.c u-boot-2009.03/lib_or1200/cache.c
|
3146 |
18 |
qaztronic |
--- u-boot-2009.03_orig/lib_or1200/cache.c 1969-12-31 16:00:00.000000000 -0800
|
3147 |
|
|
+++ u-boot-2009.03/lib_or1200/cache.c 2009-03-24 13:36:12.351353000 -0700
|
3148 |
17 |
qaztronic |
@@ -0,0 +1,32 @@
|
3149 |
18 |
qaztronic |
+/*
|
3150 |
|
|
+ * (C) Copyright 2003, Psyent Corporation
|
3151 |
|
|
+ * Scott McNutt
|
3152 |
|
|
+ *
|
3153 |
|
|
+ * See file CREDITS for list of people who contributed to this
|
3154 |
|
|
+ * project.
|
3155 |
|
|
+ *
|
3156 |
|
|
+ * This program is free software; you can redistribute it and/or
|
3157 |
|
|
+ * modify it under the terms of the GNU General Public License as
|
3158 |
|
|
+ * published by the Free Software Foundation; either version 2 of
|
3159 |
|
|
+ * the License, or (at your option) any later version.
|
3160 |
|
|
+ *
|
3161 |
|
|
+ * This program is distributed in the hope that it will be useful,
|
3162 |
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
3163 |
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
3164 |
|
|
+ * GNU General Public License for more details.
|
3165 |
|
|
+ *
|
3166 |
|
|
+ * You should have received a copy of the GNU General Public License
|
3167 |
|
|
+ * along with this program; if not, write to the Free Software
|
3168 |
|
|
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
3169 |
|
|
+ * MA 02111-1307 USA
|
3170 |
|
|
+ */
|
3171 |
|
|
+
|
3172 |
|
|
+#include
|
3173 |
|
|
+
|
3174 |
|
|
+
|
3175 |
|
|
+void flush_cache (ulong addr, ulong size)
|
3176 |
|
|
+{
|
3177 |
|
|
+ /* Nios cache is write-thru -- nothing to do here.
|
3178 |
|
|
+ */
|
3179 |
|
|
+ return;
|
3180 |
|
|
+}
|
3181 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/or1200_config.mk u-boot-2009.03/or1200_config.mk
|
3182 |
18 |
qaztronic |
--- u-boot-2009.03_orig/or1200_config.mk 1969-12-31 16:00:00.000000000 -0800
|
3183 |
|
|
+++ u-boot-2009.03/or1200_config.mk 2008-09-18 09:46:16.250000000 -0700
|
3184 |
|
|
@@ -0,0 +1,28 @@
|
3185 |
|
|
+#
|
3186 |
|
|
+# (C) Copyright 2004 Atmark Techno, Inc.
|
3187 |
|
|
+#
|
3188 |
|
|
+# Yasushi SHOJI
|
3189 |
|
|
+#
|
3190 |
|
|
+# See file CREDITS for list of people who contributed to this
|
3191 |
|
|
+# project.
|
3192 |
|
|
+#
|
3193 |
|
|
+# This program is free software; you can redistribute it and/or
|
3194 |
|
|
+# modify it under the terms of the GNU General Public License as
|
3195 |
|
|
+# published by the Free Software Foundation; either version 2 of
|
3196 |
|
|
+# the License, or (at your option) any later version.
|
3197 |
|
|
+#
|
3198 |
|
|
+# This program is distributed in the hope that it will be useful,
|
3199 |
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
3200 |
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
3201 |
|
|
+# GNU General Public License for more details.
|
3202 |
|
|
+#
|
3203 |
|
|
+# You should have received a copy of the GNU General Public License
|
3204 |
|
|
+# along with this program; if not, write to the Free Software
|
3205 |
|
|
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
3206 |
|
|
+# MA 02111-1307 USA
|
3207 |
|
|
+#
|
3208 |
17 |
qaztronic |
+
|
3209 |
18 |
qaztronic |
+PLATFORM_CPPFLAGS += -D__or1200__
|
3210 |
17 |
qaztronic |
+
|
3211 |
18 |
qaztronic |
+SYM_PREFIX = _
|
3212 |
17 |
qaztronic |
+
|
3213 |
19 |
qaztronic |
diff -NaurbBw --exclude-from=diff_exclude.txt u-boot-2009.03_orig/tools/Makefile u-boot-2009.03/tools/Makefile
|
3214 |
18 |
qaztronic |
--- u-boot-2009.03_orig/tools/Makefile 2009-03-21 14:04:41.000000000 -0700
|
3215 |
|
|
+++ u-boot-2009.03/tools/Makefile 2009-03-25 15:49:57.874856800 -0700
|
3216 |
17 |
qaztronic |
@@ -21,7 +21,8 @@
|
3217 |
|
|
# MA 02111-1307 USA
|
3218 |
|
|
#
|
3219 |
|
|
|
3220 |
|
|
-BIN_FILES = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
|
3221 |
|
|
+# BIN_FILES = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
|
3222 |
|
|
+BIN_FILES = img2srec$(SFX) envcrc$(SFX) ubsha1$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
|
3223 |
|
|
|
3224 |
|
|
OBJ_LINKS = env_embedded.o crc32.o md5.o sha1.o image.o
|
3225 |
|
|
OBJ_FILES = img2srec.o mkimage.o envcrc.o ubsha1.o gen_eth_addr.o bmp_logo.o
|