aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorAndreas Bießmann <andreas@biessmann.de>2013-10-24 06:31:03 -0400
committerHans-Christian Egtvedt <hegtvedt@cisco.com>2013-11-20 03:53:21 -0500
commit7a2a74f4b856993218aa7cdeeb6c3103101340db (patch)
treea33d46eda9bf3a8c28e90b34e0868426ecd7b0f8 /arch/avr32
parentb4789b8e6be3151a955ade74872822f30e8cd914 (diff)
avr32: setup crt for early panic()
Before the CRT was (fully) set up in kernel_entry (bss cleared before in _start, but also not before jump to panic() in no_tag_table case). This patch fixes this up to have a fully working CRT when branching to panic() in no_tag_table. Signed-off-by: Andreas Bießmann <andreas@biessmann.de> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/boot/u-boot/head.S30
-rw-r--r--arch/avr32/kernel/head.S20
2 files changed, 25 insertions, 25 deletions
diff --git a/arch/avr32/boot/u-boot/head.S b/arch/avr32/boot/u-boot/head.S
index 4488fa27fe94..d36d865308df 100644
--- a/arch/avr32/boot/u-boot/head.S
+++ b/arch/avr32/boot/u-boot/head.S
@@ -8,6 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <asm/setup.h> 10#include <asm/setup.h>
11#include <asm/thread_info.h>
12#include <asm/sysreg.h>
11 13
12 /* 14 /*
13 * The kernel is loaded where we want it to be and all caches 15 * The kernel is loaded where we want it to be and all caches
@@ -20,11 +22,6 @@
20 .section .init.text,"ax" 22 .section .init.text,"ax"
21 .global _start 23 .global _start
22_start: 24_start:
23 /* Check if the boot loader actually provided a tag table */
24 lddpc r0, magic_number
25 cp.w r12, r0
26 brne no_tag_table
27
28 /* Initialize .bss */ 25 /* Initialize .bss */
29 lddpc r2, bss_start_addr 26 lddpc r2, bss_start_addr
30 lddpc r3, end_addr 27 lddpc r3, end_addr
@@ -34,6 +31,25 @@ _start:
34 cp r2, r3 31 cp r2, r3
35 brlo 1b 32 brlo 1b
36 33
34 /* Initialize status register */
35 lddpc r0, init_sr
36 mtsr SYSREG_SR, r0
37
38 /* Set initial stack pointer */
39 lddpc sp, stack_addr
40 sub sp, -THREAD_SIZE
41
42#ifdef CONFIG_FRAME_POINTER
43 /* Mark last stack frame */
44 mov lr, 0
45 mov r7, 0
46#endif
47
48 /* Check if the boot loader actually provided a tag table */
49 lddpc r0, magic_number
50 cp.w r12, r0
51 brne no_tag_table
52
37 /* 53 /*
38 * Save the tag table address for later use. This must be done 54 * Save the tag table address for later use. This must be done
39 * _after_ .bss has been initialized... 55 * _after_ .bss has been initialized...
@@ -53,6 +69,10 @@ bss_start_addr:
53 .long __bss_start 69 .long __bss_start
54end_addr: 70end_addr:
55 .long _end 71 .long _end
72init_sr:
73 .long 0x007f0000 /* Supervisor mode, everything masked */
74stack_addr:
75 .long init_thread_union
56 76
57no_tag_table: 77no_tag_table:
58 sub r12, pc, (. - 2f) 78 sub r12, pc, (. - 2f)
diff --git a/arch/avr32/kernel/head.S b/arch/avr32/kernel/head.S
index 6163bd0acb95..59eae6dfbed2 100644
--- a/arch/avr32/kernel/head.S
+++ b/arch/avr32/kernel/head.S
@@ -10,33 +10,13 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/thread_info.h>
14#include <asm/sysreg.h>
15 13
16 .section .init.text,"ax" 14 .section .init.text,"ax"
17 .global kernel_entry 15 .global kernel_entry
18kernel_entry: 16kernel_entry:
19 /* Initialize status register */
20 lddpc r0, init_sr
21 mtsr SYSREG_SR, r0
22
23 /* Set initial stack pointer */
24 lddpc sp, stack_addr
25 sub sp, -THREAD_SIZE
26
27#ifdef CONFIG_FRAME_POINTER
28 /* Mark last stack frame */
29 mov lr, 0
30 mov r7, 0
31#endif
32
33 /* Start the show */ 17 /* Start the show */
34 lddpc pc, kernel_start_addr 18 lddpc pc, kernel_start_addr
35 19
36 .align 2 20 .align 2
37init_sr:
38 .long 0x007f0000 /* Supervisor mode, everything masked */
39stack_addr:
40 .long init_thread_union
41kernel_start_addr: 21kernel_start_addr:
42 .long start_kernel 22 .long start_kernel