diff options
-rw-r--r-- | arch/avr32/boot/u-boot/head.S | 30 | ||||
-rw-r--r-- | arch/avr32/kernel/head.S | 20 |
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 |
54 | end_addr: | 70 | end_addr: |
55 | .long _end | 71 | .long _end |
72 | init_sr: | ||
73 | .long 0x007f0000 /* Supervisor mode, everything masked */ | ||
74 | stack_addr: | ||
75 | .long init_thread_union | ||
56 | 76 | ||
57 | no_tag_table: | 77 | no_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 |
18 | kernel_entry: | 16 | kernel_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 |
37 | init_sr: | ||
38 | .long 0x007f0000 /* Supervisor mode, everything masked */ | ||
39 | stack_addr: | ||
40 | .long init_thread_union | ||
41 | kernel_start_addr: | 21 | kernel_start_addr: |
42 | .long start_kernel | 22 | .long start_kernel |