aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/boot
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-31 09:20:16 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-31 09:20:16 -0400
commit7b70c4275f28702b76b273c8534c38f8313812e9 (patch)
tree1df2229ca02466bd1adda814ac5c37aa0a597db1 /arch/arm/boot
parentceb0885d3b01bb2e2f18765770e212914f2864be (diff)
parenta20df564d15bd28e3df24e1c65b885bd74d23f17 (diff)
Merge branch 'devel-stable' into devel
Conflicts: arch/arm/kernel/entry-armv.S arch/arm/kernel/setup.c arch/arm/mm/init.c
Diffstat (limited to 'arch/arm/boot')
-rw-r--r--arch/arm/boot/Makefile8
-rw-r--r--arch/arm/boot/compressed/Makefile11
-rw-r--r--arch/arm/boot/compressed/Makefile.debug23
-rw-r--r--arch/arm/boot/compressed/head.S40
-rw-r--r--arch/arm/boot/compressed/misc.c20
5 files changed, 33 insertions, 69 deletions
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 4a590f4113e2..f705213caa88 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -14,18 +14,16 @@
14MKIMAGE := $(srctree)/scripts/mkuboot.sh 14MKIMAGE := $(srctree)/scripts/mkuboot.sh
15 15
16ifneq ($(MACHINE),) 16ifneq ($(MACHINE),)
17include $(srctree)/$(MACHINE)/Makefile.boot 17-include $(srctree)/$(MACHINE)/Makefile.boot
18endif 18endif
19 19
20# Note: the following conditions must always be true: 20# Note: the following conditions must always be true:
21# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
22# PARAMS_PHYS must be within 4MB of ZRELADDR 21# PARAMS_PHYS must be within 4MB of ZRELADDR
23# INITRD_PHYS must be in RAM 22# INITRD_PHYS must be in RAM
24ZRELADDR := $(zreladdr-y)
25PARAMS_PHYS := $(params_phys-y) 23PARAMS_PHYS := $(params_phys-y)
26INITRD_PHYS := $(initrd_phys-y) 24INITRD_PHYS := $(initrd_phys-y)
27 25
28export ZRELADDR INITRD_PHYS PARAMS_PHYS 26export INITRD_PHYS PARAMS_PHYS
29 27
30targets := Image zImage xipImage bootpImage uImage 28targets := Image zImage xipImage bootpImage uImage
31 29
@@ -67,7 +65,7 @@ quiet_cmd_uimage = UIMAGE $@
67ifeq ($(CONFIG_ZBOOT_ROM),y) 65ifeq ($(CONFIG_ZBOOT_ROM),y)
68$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) 66$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
69else 67else
70$(obj)/uImage: LOADADDR=$(ZRELADDR) 68$(obj)/uImage: LOADADDR=$(CONFIG_ZRELADDR)
71endif 69endif
72 70
73ifeq ($(CONFIG_THUMB2_KERNEL),y) 71ifeq ($(CONFIG_THUMB2_KERNEL),y)
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 7a29301d516b..c2225fea3535 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -4,6 +4,7 @@
4# create a compressed vmlinuz image from the original vmlinux 4# create a compressed vmlinuz image from the original vmlinux
5# 5#
6 6
7AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
7HEAD = head.o 8HEAD = head.o
8OBJS = misc.o decompress.o 9OBJS = misc.o decompress.o
9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c 10FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
@@ -75,19 +76,9 @@ endif
75EXTRA_CFLAGS := -fpic -fno-builtin 76EXTRA_CFLAGS := -fpic -fno-builtin
76EXTRA_AFLAGS := -Wa,-march=all 77EXTRA_AFLAGS := -Wa,-march=all
77 78
78# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
79# linker symbols. We only define initrd_phys and params_phys if the
80# machine class defined the corresponding makefile variable.
81LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
82ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) 79ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
83LDFLAGS_vmlinux += --be8 80LDFLAGS_vmlinux += --be8
84endif 81endif
85ifneq ($(INITRD_PHYS),)
86LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
87endif
88ifneq ($(PARAMS_PHYS),)
89LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
90endif
91# ? 82# ?
92LDFLAGS_vmlinux += -p 83LDFLAGS_vmlinux += -p
93# Report unresolved symbol references 84# Report unresolved symbol references
diff --git a/arch/arm/boot/compressed/Makefile.debug b/arch/arm/boot/compressed/Makefile.debug
deleted file mode 100644
index 491a037b2973..000000000000
--- a/arch/arm/boot/compressed/Makefile.debug
+++ /dev/null
@@ -1,23 +0,0 @@
1#
2# linux/arch/arm/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7COMPRESSED_EXTRA=../../lib/ll_char_wr.o
8OBJECTS=misc-debug.o ll_char_wr.aout.o
9
10CFLAGS=-D__KERNEL__ -O2 -DSTDC_HEADERS -DSTANDALONE_DEBUG -Wall -I../../../../include -c
11
12test-gzip: piggy.aout.o $(OBJECTS)
13 $(CC) -o $@ $(OBJECTS) piggy.aout.o
14
15misc-debug.o: misc.c
16 $(CC) $(CFLAGS) -o $@ misc.c
17
18piggy.aout.o: piggy.o
19 arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux piggy.o piggy.aout.o
20
21ll_char_wr.aout.o: $(COMPRESSED_EXTRA)
22 arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux $(COMPRESSED_EXTRA) ll_char_wr.aout.o
23
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index c5191b1532e8..abf4d65acf62 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -170,9 +170,16 @@ not_angel:
170 170
171 .text 171 .text
172 adr r0, LC0 172 adr r0, LC0
173 ARM( ldmia r0, {r1, r2, r3, r4, r5, r6, r11, ip, sp}) 173 ARM( ldmia r0, {r1, r2, r3, r5, r6, r11, ip, sp})
174 THUMB( ldmia r0, {r1, r2, r3, r4, r5, r6, r11, ip} ) 174 THUMB( ldmia r0, {r1, r2, r3, r5, r6, r11, ip} )
175 THUMB( ldr sp, [r0, #32] ) 175 THUMB( ldr sp, [r0, #32] )
176#ifdef CONFIG_AUTO_ZRELADDR
177 @ determine final kernel image address
178 and r4, pc, #0xf8000000
179 add r4, r4, #TEXT_OFFSET
180#else
181 ldr r4, =CONFIG_ZRELADDR
182#endif
176 subs r0, r0, r1 @ calculate the delta offset 183 subs r0, r0, r1 @ calculate the delta offset
177 184
178 @ if delta is zero, we are 185 @ if delta is zero, we are
@@ -310,18 +317,17 @@ wont_overwrite: mov r0, r4
310LC0: .word LC0 @ r1 317LC0: .word LC0 @ r1
311 .word __bss_start @ r2 318 .word __bss_start @ r2
312 .word _end @ r3 319 .word _end @ r3
313 .word zreladdr @ r4
314 .word _start @ r5 320 .word _start @ r5
315 .word _image_size @ r6 321 .word _image_size @ r6
316 .word _got_start @ r11 322 .word _got_start @ r11
317 .word _got_end @ ip 323 .word _got_end @ ip
318 .word user_stack+4096 @ sp 324 .word user_stack_end @ sp
319LC1: .word reloc_end - reloc_start 325LC1: .word reloc_end - reloc_start
320 .size LC0, . - LC0 326 .size LC0, . - LC0
321 327
322#ifdef CONFIG_ARCH_RPC 328#ifdef CONFIG_ARCH_RPC
323 .globl params 329 .globl params
324params: ldr r0, =params_phys 330params: ldr r0, =0x10000100 @ params_phys for RPC
325 mov pc, lr 331 mov pc, lr
326 .ltorg 332 .ltorg
327 .align 333 .align
@@ -339,9 +345,8 @@ params: ldr r0, =params_phys
339 * r4 = kernel execution address 345 * r4 = kernel execution address
340 * r7 = architecture number 346 * r7 = architecture number
341 * r8 = atags pointer 347 * r8 = atags pointer
342 * r9 = run-time address of "start" (???)
343 * On exit, 348 * On exit,
344 * r1, r2, r3, r9, r10, r12 corrupted 349 * r0, r1, r2, r3, r9, r10, r12 corrupted
345 * This routine must preserve: 350 * This routine must preserve:
346 * r4, r5, r6, r7, r8 351 * r4, r5, r6, r7, r8
347 */ 352 */
@@ -396,12 +401,18 @@ __armv3_mpu_cache_on:
396 401
397 mov r0, #0 402 mov r0, #0
398 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3 403 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
404 /*
405 * ?? ARMv3 MMU does not allow reading the control register,
406 * does this really work on ARMv3 MPU?
407 */
399 mrc p15, 0, r0, c1, c0, 0 @ read control reg 408 mrc p15, 0, r0, c1, c0, 0 @ read control reg
400 @ .... .... .... WC.M 409 @ .... .... .... WC.M
401 orr r0, r0, #0x000d @ .... .... .... 11.1 410 orr r0, r0, #0x000d @ .... .... .... 11.1
411 /* ?? this overwrites the value constructed above? */
402 mov r0, #0 412 mov r0, #0
403 mcr p15, 0, r0, c1, c0, 0 @ write control reg 413 mcr p15, 0, r0, c1, c0, 0 @ write control reg
404 414
415 /* ?? invalidate for the second time? */
405 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3 416 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
406 mov pc, lr 417 mov pc, lr
407 418
@@ -771,8 +782,10 @@ proc_types:
771 * Turn off the Cache and MMU. ARMv3 does not support 782 * Turn off the Cache and MMU. ARMv3 does not support
772 * reading the control register, but ARMv4 does. 783 * reading the control register, but ARMv4 does.
773 * 784 *
774 * On exit, r0, r1, r2, r3, r9, r12 corrupted 785 * On exit,
775 * This routine must preserve: r4, r6, r7 786 * r0, r1, r2, r3, r9, r12 corrupted
787 * This routine must preserve:
788 * r4, r6, r7
776 */ 789 */
777 .align 5 790 .align 5
778cache_off: mov r3, #12 @ cache_off function 791cache_off: mov r3, #12 @ cache_off function
@@ -845,7 +858,7 @@ __armv3_mmu_cache_off:
845 * Clean and flush the cache to maintain consistency. 858 * Clean and flush the cache to maintain consistency.
846 * 859 *
847 * On exit, 860 * On exit,
848 * r1, r2, r3, r9, r11, r12 corrupted 861 * r1, r2, r3, r9, r10, r11, r12 corrupted
849 * This routine must preserve: 862 * This routine must preserve:
850 * r0, r4, r5, r6, r7 863 * r0, r4, r5, r6, r7
851 */ 864 */
@@ -988,7 +1001,7 @@ no_cache_id:
988__armv3_mmu_cache_flush: 1001__armv3_mmu_cache_flush:
989__armv3_mpu_cache_flush: 1002__armv3_mpu_cache_flush:
990 mov r1, #0 1003 mov r1, #0
991 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3 1004 mcr p15, 0, r1, c7, c0, 0 @ invalidate whole cache v3
992 mov pc, lr 1005 mov pc, lr
993 1006
994/* 1007/*
@@ -1001,6 +1014,7 @@ __armv3_mpu_cache_flush:
1001phexbuf: .space 12 1014phexbuf: .space 12
1002 .size phexbuf, . - phexbuf 1015 .size phexbuf, . - phexbuf
1003 1016
1017@ phex corrupts {r0, r1, r2, r3}
1004phex: adr r3, phexbuf 1018phex: adr r3, phexbuf
1005 mov r2, #0 1019 mov r2, #0
1006 strb r2, [r3, r1] 1020 strb r2, [r3, r1]
@@ -1015,6 +1029,7 @@ phex: adr r3, phexbuf
1015 strb r2, [r3, r1] 1029 strb r2, [r3, r1]
1016 b 1b 1030 b 1b
1017 1031
1032@ puts corrupts {r0, r1, r2, r3}
1018puts: loadsp r3, r1 1033puts: loadsp r3, r1
10191: ldrb r2, [r0], #1 10341: ldrb r2, [r0], #1
1020 teq r2, #0 1035 teq r2, #0
@@ -1029,12 +1044,14 @@ puts: loadsp r3, r1
1029 teq r0, #0 1044 teq r0, #0
1030 bne 1b 1045 bne 1b
1031 mov pc, lr 1046 mov pc, lr
1047@ putc corrupts {r0, r1, r2, r3}
1032putc: 1048putc:
1033 mov r2, r0 1049 mov r2, r0
1034 mov r0, #0 1050 mov r0, #0
1035 loadsp r3, r1 1051 loadsp r3, r1
1036 b 2b 1052 b 2b
1037 1053
1054@ memdump corrupts {r0, r1, r2, r3, r10, r11, r12, lr}
1038memdump: mov r12, r0 1055memdump: mov r12, r0
1039 mov r10, lr 1056 mov r10, lr
1040 mov r11, #0 1057 mov r11, #0
@@ -1070,3 +1087,4 @@ reloc_end:
1070 .align 1087 .align
1071 .section ".stack", "w" 1088 .section ".stack", "w"
1072user_stack: .space 4096 1089user_stack: .space 4096
1090user_stack_end:
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index d2b2ef41cd4f..e653a6d3c8d9 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -28,9 +28,6 @@ unsigned int __machine_arch_type;
28 28
29#include <asm/unaligned.h> 29#include <asm/unaligned.h>
30 30
31#ifdef STANDALONE_DEBUG
32#define putstr printf
33#else
34 31
35static void putstr(const char *ptr); 32static void putstr(const char *ptr);
36extern void error(char *x); 33extern void error(char *x);
@@ -116,7 +113,6 @@ static void putstr(const char *ptr)
116 flush(); 113 flush();
117} 114}
118 115
119#endif
120 116
121void *memcpy(void *__dest, __const void *__src, size_t __n) 117void *memcpy(void *__dest, __const void *__src, size_t __n)
122{ 118{
@@ -186,7 +182,6 @@ asmlinkage void __div0(void)
186 182
187extern void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)); 183extern void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
188 184
189#ifndef STANDALONE_DEBUG
190 185
191unsigned long 186unsigned long
192decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, 187decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
@@ -211,18 +206,3 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
211 putstr(" done, booting the kernel.\n"); 206 putstr(" done, booting the kernel.\n");
212 return output_ptr; 207 return output_ptr;
213} 208}
214#else
215
216char output_buffer[1500*1024];
217
218int main()
219{
220 output_data = output_buffer;
221
222 putstr("Uncompressing Linux...");
223 decompress(input_data, input_data_end - input_data,
224 NULL, NULL, output_data, NULL, error);
225 putstr("done.\n");
226 return 0;
227}
228#endif