OpenCores
URL https://opencores.org/ocsvn/or1200_soc/or1200_soc/trunk

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [sw/] [u-boot-2009.03_diff.txt] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.