aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10
diff options
context:
space:
mode:
authorMikael Starvik <mikael.starvik@axis.com>2005-07-27 14:44:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 19:26:00 -0400
commit7cf32cad153d63ac4f6f2d5dd16ddd32ad72d578 (patch)
tree1072d64f49092ba87ff0d5079e37f58f646f7356 /arch/cris/arch-v10
parent2e0cea1decf7f21df0496571c218df3b3b8cce99 (diff)
[PATCH] CRIS update: misc patches
* Start threads with IRQs enabled. * Move symbol exports to arch specific file. * Prepare for real command line in the future. * Handle csum for partition that crosses flash boundary. * Set utsname. Signed-off-by: Mikael Starvik <starvik@axis.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r--arch/cris/arch-v10/boot/compressed/head.S22
-rw-r--r--arch/cris/arch-v10/boot/rescue/head.S33
-rw-r--r--arch/cris/arch-v10/kernel/entry.S54
-rw-r--r--arch/cris/arch-v10/kernel/kgdb.c17
-rw-r--r--arch/cris/arch-v10/kernel/process.c3
5 files changed, 97 insertions, 32 deletions
diff --git a/arch/cris/arch-v10/boot/compressed/head.S b/arch/cris/arch-v10/boot/compressed/head.S
index 4cbdd4b1d9d6..e73f44c998d9 100644
--- a/arch/cris/arch-v10/boot/compressed/head.S
+++ b/arch/cris/arch-v10/boot/compressed/head.S
@@ -13,7 +13,8 @@
13#include <asm/arch/sv_addr_ag.h> 13#include <asm/arch/sv_addr_ag.h>
14 14
15#define RAM_INIT_MAGIC 0x56902387 15#define RAM_INIT_MAGIC 0x56902387
16 16#define COMMAND_LINE_MAGIC 0x87109563
17
17 ;; Exported symbols 18 ;; Exported symbols
18 19
19 .globl _input_data 20 .globl _input_data
@@ -88,6 +89,12 @@ basse: move.d pc, r5
88 cmp.d r2, r1 89 cmp.d r2, r1
89 bcs 1b 90 bcs 1b
90 nop 91 nop
92
93 ;; Save command line magic and address.
94 move.d _cmd_line_magic, $r12
95 move.d $r10, [$r12]
96 move.d _cmd_line_addr, $r12
97 move.d $r11, [$r12]
91 98
92 ;; Do the decompression and save compressed size in _inptr 99 ;; Do the decompression and save compressed size in _inptr
93 100
@@ -98,7 +105,13 @@ basse: move.d pc, r5
98 105
99 move.d [_input_data], r9 ; flash address of compressed kernel 106 move.d [_input_data], r9 ; flash address of compressed kernel
100 add.d [_inptr], r9 ; size of compressed kernel 107 add.d [_inptr], r9 ; size of compressed kernel
101 108
109 ;; Restore command line magic and address.
110 move.d _cmd_line_magic, $r10
111 move.d [$r10], $r10
112 move.d _cmd_line_addr, $r11
113 move.d [$r11], $r11
114
102 ;; Enter the decompressed kernel 115 ;; Enter the decompressed kernel
103 move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized 116 move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
104 jump 0x40004000 ; kernel is linked to this address 117 jump 0x40004000 ; kernel is linked to this address
@@ -107,5 +120,8 @@ basse: move.d pc, r5
107 120
108_input_data: 121_input_data:
109 .dword 0 ; used by the decompressor 122 .dword 0 ; used by the decompressor
110 123_cmd_line_magic:
124 .dword 0
125_cmd_line_addr:
126 .dword 0
111#include "../../lib/hw_settings.S" 127#include "../../lib/hw_settings.S"
diff --git a/arch/cris/arch-v10/boot/rescue/head.S b/arch/cris/arch-v10/boot/rescue/head.S
index 8689ea972c46..addb2194de0f 100644
--- a/arch/cris/arch-v10/boot/rescue/head.S
+++ b/arch/cris/arch-v10/boot/rescue/head.S
@@ -1,4 +1,4 @@
1/* $Id: head.S,v 1.6 2003/04/09 08:12:43 pkj Exp $ 1/* $Id: head.S,v 1.7 2005/03/07 12:11:06 starvik Exp $
2 * 2 *
3 * Rescue code, made to reside at the beginning of the 3 * Rescue code, made to reside at the beginning of the
4 * flash-memory. when it starts, it checks a partition 4 * flash-memory. when it starts, it checks a partition
@@ -121,12 +121,13 @@
121 ;; 0x80000000 if loaded in flash (as it should be) 121 ;; 0x80000000 if loaded in flash (as it should be)
122 ;; since etrax actually starts at address 2 when booting from flash, we 122 ;; since etrax actually starts at address 2 when booting from flash, we
123 ;; put a nop (2 bytes) here first so we dont accidentally skip the di 123 ;; put a nop (2 bytes) here first so we dont accidentally skip the di
124 124
125 nop 125 nop
126 di 126 di
127 127
128 jump in_cache ; enter cached area instead 128 jump in_cache ; enter cached area instead
129in_cache: 129in_cache:
130
130 131
131 ;; first put a jump test to give a possibility of upgrading the rescue code 132 ;; first put a jump test to give a possibility of upgrading the rescue code
132 ;; without erasing/reflashing the sector. we put a longword of -1 here and if 133 ;; without erasing/reflashing the sector. we put a longword of -1 here and if
@@ -325,9 +326,29 @@ flash_ok:
325 ;; result will be in r0 326 ;; result will be in r0
326checksum: 327checksum:
327 moveq 0, $r0 328 moveq 0, $r0
3281: addu.b [$r1+], $r0 329 moveq CONFIG_ETRAX_FLASH1_SIZE, $r6
329 subq 1, $r2 330
330 bne 1b 331 ;; If the first physical flash memory is exceeded wrap to the second one.
332 btstq 26, $r1 ; Are we addressing first flash?
333 bpl 1f
334 nop
335 clear.d $r6
336
3371: test.d $r6 ; 0 = no wrapping
338 beq 2f
339 nop
340 lslq 20, $r6 ; Convert MB to bytes
341 sub.d $r1, $r6
342
3432: addu.b [$r1+], $r0
344 subq 1, $r6 ; Flash memory left
345 beq 3f
346 subq 1, $r2 ; Length left
347 bne 2b
331 nop 348 nop
332 ret 349 ret
333 nop 350 nop
351
3523: move.d MEM_CSE1_START, $r1 ; wrap to second flash
353 ba 2b
354 nop
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index 1bc44f481c34..c0163bf94a50 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -1,4 +1,4 @@
1/* $Id: entry.S,v 1.23 2004/10/19 13:07:37 starvik Exp $ 1/* $Id: entry.S,v 1.28 2005/06/20 05:06:30 starvik Exp $
2 * 2 *
3 * linux/arch/cris/entry.S 3 * linux/arch/cris/entry.S
4 * 4 *
@@ -7,6 +7,22 @@
7 * Authors: Bjorn Wesen (bjornw@axis.com) 7 * Authors: Bjorn Wesen (bjornw@axis.com)
8 * 8 *
9 * $Log: entry.S,v $ 9 * $Log: entry.S,v $
10 * Revision 1.28 2005/06/20 05:06:30 starvik
11 * Remove unnecessary diff to kernel.org tree
12 *
13 * Revision 1.27 2005/03/04 08:16:16 starvik
14 * Merge of Linux 2.6.11.
15 *
16 * Revision 1.26 2005/01/11 13:49:47 starvik
17 * Added NMI handler.
18 *
19 * Revision 1.25 2004/12/27 11:18:32 starvik
20 * Merge of Linux 2.6.10 (not functional yet).
21 *
22 * Revision 1.24 2004/12/22 10:41:23 starvik
23 * Updates to make v10 compile with the latest SMP aware generic code (even
24 * though v10 will never have SMP).
25 *
10 * Revision 1.23 2004/10/19 13:07:37 starvik 26 * Revision 1.23 2004/10/19 13:07:37 starvik
11 * Merge of Linux 2.6.9 27 * Merge of Linux 2.6.9
12 * 28 *
@@ -279,6 +295,7 @@
279#ifdef CONFIG_PREEMPT 295#ifdef CONFIG_PREEMPT
280 ; Check if preemptive kernel scheduling should be done 296 ; Check if preemptive kernel scheduling should be done
281_resume_kernel: 297_resume_kernel:
298 di
282 ; Load current task struct 299 ; Load current task struct
283 movs.w -8192, $r0 ; THREAD_SIZE = 8192 300 movs.w -8192, $r0 ; THREAD_SIZE = 8192
284 and.d $sp, $r0 301 and.d $sp, $r0
@@ -291,12 +308,7 @@ _need_resched:
291 bpl _Rexit 308 bpl _Rexit
292 nop 309 nop
293 ; Ok, lets's do some preemptive kernel scheduling 310 ; Ok, lets's do some preemptive kernel scheduling
294 move.d PREEMPT_ACTIVE, $r10 311 jsr preempt_schedule_irq
295 move.d $r10, [$r0+TI_preempt_count] ; Mark as active
296 ei
297 jsr schedule
298 clear.d [$r0+TI_preempt_count] ; Mark as inactive
299 di
300 ; Load new task struct 312 ; Load new task struct
301 movs.w -8192, $r0 ; THREAD_SIZE = 8192 313 movs.w -8192, $r0 ; THREAD_SIZE = 8192
302 and.d $sp, $r0 314 and.d $sp, $r0
@@ -590,15 +602,15 @@ mmu_bus_fault:
590 move.d $r0, [$sp+16] 602 move.d $r0, [$sp+16]
5911: btstq 12, $r1 ; Refill? 6031: btstq 12, $r1 ; Refill?
592 bpl 2f 604 bpl 2f
593 lsrq PMD_SHIFT, $r1 ; Get PMD index into PGD (bit 24-31) 605 lsrq 24, $r1 ; Get PGD index (bit 24-31)
594 move.d [current_pgd], $r0 ; PGD for the current process 606 move.d [per_cpu__current_pgd], $r0 ; PGD for the current process
595 move.d [$r0+$r1.d], $r0 ; Get PMD 607 move.d [$r0+$r1.d], $r0 ; Get PMD
596 beq 2f 608 beq 2f
597 nop 609 nop
598 and.w PAGE_MASK, $r0 ; Remove PMD flags 610 and.w PAGE_MASK, $r0 ; Remove PMD flags
599 move.d [R_MMU_CAUSE], $r1 611 move.d [R_MMU_CAUSE], $r1
600 lsrq PAGE_SHIFT, $r1 612 lsrq PAGE_SHIFT, $r1
601 and.d 0x7ff, $r1 ; Get PTE index into PMD (bit 13-24) 613 and.d 0x7ff, $r1 ; Get PTE index into PGD (bit 13-23)
602 move.d [$r0+$r1.d], $r1 ; Get PTE 614 move.d [$r0+$r1.d], $r1 ; Get PTE
603 beq 2f 615 beq 2f
604 nop 616 nop
@@ -656,11 +668,6 @@ hwbreakpoint:
656 nop 668 nop
657 669
658IRQ1_interrupt: 670IRQ1_interrupt:
659
660#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
661;; If we receive a watchdog interrupt while it is not expected, then set
662;; up a canonical frame and dump register contents before dying.
663
664 ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! 671 ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!!
665 move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame 672 move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame
666 push $srp 673 push $srp
@@ -672,9 +679,16 @@ IRQ1_interrupt:
672 push $r10 ; push orig_r10 679 push $r10 ; push orig_r10
673 clear.d [$sp=$sp-4] ; frametype == 0, normal frame 680 clear.d [$sp=$sp-4] ; frametype == 0, normal frame
674 681
675;; We don't check that we actually were bit by the watchdog as opposed to 682 move.d [R_IRQ_MASK0_RD], $r1 ; External NMI or watchdog?
676;; an external NMI, since there is currently no handler for external NMI. 683 and.d 0x80000000, $r1
677 684 beq wdog
685 move.d $sp, $r10
686 jsr handle_nmi
687 setf m ; Enable NMI again
688 retb ; Return from NMI
689 nop
690wdog:
691#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
678;; Check if we're waiting for reset to happen, as signalled by 692;; Check if we're waiting for reset to happen, as signalled by
679;; hard_reset_now setting cause_of_death to a magic value. If so, just 693;; hard_reset_now setting cause_of_death to a magic value. If so, just
680;; get stuck until reset happens. 694;; get stuck until reset happens.
@@ -1118,6 +1132,10 @@ sys_call_table:
1118 .long sys_mq_getsetattr 1132 .long sys_mq_getsetattr
1119 .long sys_ni_syscall /* reserved for kexec */ 1133 .long sys_ni_syscall /* reserved for kexec */
1120 .long sys_waitid 1134 .long sys_waitid
1135 .long sys_ni_syscall /* 285 */ /* available */
1136 .long sys_add_key
1137 .long sys_request_key
1138 .long sys_keyctl
1121 1139
1122 /* 1140 /*
1123 * NOTE!! This doesn't have to be exact - we just have 1141 * NOTE!! This doesn't have to be exact - we just have
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
index 7d368c877ee9..b72e6a91a639 100644
--- a/arch/cris/arch-v10/kernel/kgdb.c
+++ b/arch/cris/arch-v10/kernel/kgdb.c
@@ -18,6 +18,10 @@
18*! Jul 21 1999 Bjorn Wesen eLinux port 18*! Jul 21 1999 Bjorn Wesen eLinux port
19*! 19*!
20*! $Log: kgdb.c,v $ 20*! $Log: kgdb.c,v $
21*! Revision 1.6 2005/01/14 10:12:17 starvik
22*! KGDB on separate port.
23*! Console fixes from 2.4.
24*!
21*! Revision 1.5 2004/10/07 13:59:08 starvik 25*! Revision 1.5 2004/10/07 13:59:08 starvik
22*! Corrected call to set_int_vector 26*! Corrected call to set_int_vector
23*! 27*!
@@ -71,7 +75,7 @@
71*! 75*!
72*!--------------------------------------------------------------------------- 76*!---------------------------------------------------------------------------
73*! 77*!
74*! $Id: kgdb.c,v 1.5 2004/10/07 13:59:08 starvik Exp $ 78*! $Id: kgdb.c,v 1.6 2005/01/14 10:12:17 starvik Exp $
75*! 79*!
76*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN 80*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN
77*! 81*!
@@ -225,6 +229,7 @@
225#include <linux/kernel.h> 229#include <linux/kernel.h>
226#include <linux/delay.h> 230#include <linux/delay.h>
227#include <linux/linkage.h> 231#include <linux/linkage.h>
232#include <linux/reboot.h>
228 233
229#include <asm/setup.h> 234#include <asm/setup.h>
230#include <asm/ptrace.h> 235#include <asm/ptrace.h>
@@ -1344,12 +1349,11 @@ handle_exception (int sigval)
1344 } 1349 }
1345} 1350}
1346 1351
1347/* The jump is to the address 0x00000002. Performs a complete re-start 1352/* Performs a complete re-start from scratch. */
1348 from scratch. */
1349static void 1353static void
1350kill_restart () 1354kill_restart ()
1351{ 1355{
1352 __asm__ volatile ("jump 2"); 1356 machine_restart("");
1353} 1357}
1354 1358
1355/********************************** Breakpoint *******************************/ 1359/********************************** Breakpoint *******************************/
@@ -1506,6 +1510,11 @@ kgdb_handle_serial:
1506 bne goback 1510 bne goback
1507 nop 1511 nop
1508 1512
1513 move.d [reg+0x5E], $r10 ; Get DCCR
1514 btstq 8, $r10 ; Test the U-flag.
1515 bmi goback
1516 nop
1517
1509;; 1518;;
1510;; Handle the communication 1519;; Handle the communication
1511;; 1520;;
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index 87ff37790827..69e28b4057e8 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -1,4 +1,4 @@
1/* $Id: process.c,v 1.9 2004/10/19 13:07:37 starvik Exp $ 1/* $Id: process.c,v 1.12 2004/12/27 11:18:32 starvik Exp $
2 * 2 *
3 * linux/arch/cris/kernel/process.c 3 * linux/arch/cris/kernel/process.c
4 * 4 *
@@ -101,6 +101,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
101 regs.r11 = (unsigned long)fn; 101 regs.r11 = (unsigned long)fn;
102 regs.r12 = (unsigned long)arg; 102 regs.r12 = (unsigned long)arg;
103 regs.irp = (unsigned long)kernel_thread_helper; 103 regs.irp = (unsigned long)kernel_thread_helper;
104 regs.dccr = 1 << I_DCCR_BITNR;
104 105
105 /* Ok, create the new process.. */ 106 /* Ok, create the new process.. */
106 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 107 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);