aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/boot
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 12:15:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 12:15:15 -0500
commitac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (patch)
tree816e5ac643b15c2050c64a7075f0f7e13d86ea09 /arch/arm/boot
parentb1bf9368407ae7e89d8a005bb40beb70a41df539 (diff)
parent9f33be2c3a80bdc2cc08342dd77fac87652e0548 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (100 commits) ARM: Eliminate decompressor -Dstatic= PIC hack ARM: 5958/1: ARM: U300: fix inverted clk round rate ARM: 5956/1: misplaced parentheses ARM: 5955/1: ep93xx: move timer defines into core.c and document ARM: 5954/1: ep93xx: move gpio interrupt support to gpio.c ARM: 5953/1: ep93xx: fix broken build of clock.c ARM: 5952/1: ARM: MM: Add ARM_L1_CACHE_SHIFT_6 for handle inside each ARCH Kconfig ARM: 5949/1: NUC900 add gpio virtual memory map ARM: 5948/1: Enable timer0 to time4 clock support for nuc910 ARM: 5940/2: ARM: MMCI: remove custom DBG macro and printk ARM: make_coherent(): fix problems with highpte, part 2 MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself ARM: 5945/1: ep93xx: include correct irq.h in core.c ARM: 5933/1: amba-pl011: support hardware flow control ARM: 5930/1: Add PKMAP area description to memory.txt. ARM: 5929/1: Add checks to detect overlap of memory regions. ARM: 5928/1: Change type of VMALLOC_END to unsigned long. ARM: 5927/1: Make delimiters of DMA area globally visibly. ARM: 5926/1: Add "Virtual kernel memory..." printout. ARM: 5920/1: OMAP4: Enable L2 Cache ... Fix up trivial conflict in arch/arm/mach-mx25/clock.c
Diffstat (limited to 'arch/arm/boot')
-rw-r--r--arch/arm/boot/compressed/Makefile6
-rw-r--r--arch/arm/boot/compressed/decompress.c45
-rw-r--r--arch/arm/boot/compressed/head.S20
-rw-r--r--arch/arm/boot/compressed/misc.c109
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in8
5 files changed, 74 insertions, 114 deletions
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 2d4d88ba73bf..97c89e7de7d3 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -5,7 +5,7 @@
5# 5#
6 6
7HEAD = head.o 7HEAD = head.o
8OBJS = misc.o 8OBJS = misc.o decompress.o
9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c 9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
10 10
11# 11#
@@ -106,10 +106,6 @@ lib1funcs = $(obj)/lib1funcs.o
106$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE 106$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
107 $(call cmd,shipped) 107 $(call cmd,shipped)
108 108
109# Don't allow any static data in misc.o, which
110# would otherwise mess up our GOT table
111CFLAGS_misc.o := -Dstatic=
112
113$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ 109$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
114 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE 110 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
115 $(call if_changed,ld) 111 $(call if_changed,ld)
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
new file mode 100644
index 000000000000..0da382f33157
--- /dev/null
+++ b/arch/arm/boot/compressed/decompress.c
@@ -0,0 +1,45 @@
1#define _LINUX_STRING_H_
2
3#include <linux/compiler.h> /* for inline */
4#include <linux/types.h> /* for size_t */
5#include <linux/stddef.h> /* for NULL */
6#include <linux/linkage.h>
7#include <asm/string.h>
8
9extern unsigned long free_mem_ptr;
10extern unsigned long free_mem_end_ptr;
11extern void error(char *);
12
13#define STATIC static
14
15#define ARCH_HAS_DECOMP_WDOG
16
17/* Diagnostic functions */
18#ifdef DEBUG
19# define Assert(cond,msg) {if(!(cond)) error(msg);}
20# define Trace(x) fprintf x
21# define Tracev(x) {if (verbose) fprintf x ;}
22# define Tracevv(x) {if (verbose>1) fprintf x ;}
23# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
24# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
25#else
26# define Assert(cond,msg)
27# define Trace(x)
28# define Tracev(x)
29# define Tracevv(x)
30# define Tracec(c,x)
31# define Tracecv(c,x)
32#endif
33
34#ifdef CONFIG_KERNEL_GZIP
35#include "../../../../lib/decompress_inflate.c"
36#endif
37
38#ifdef CONFIG_KERNEL_LZO
39#include "../../../../lib/decompress_unlzo.c"
40#endif
41
42void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
43{
44 decompress(input, len, NULL, NULL, output, NULL, error);
45}
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 4fddc509e78e..99b75aa1c2ec 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -22,13 +22,13 @@
22#if defined(CONFIG_DEBUG_ICEDCC) 22#if defined(CONFIG_DEBUG_ICEDCC)
23 23
24#ifdef CONFIG_CPU_V6 24#ifdef CONFIG_CPU_V6
25 .macro loadsp, rb 25 .macro loadsp, rb, tmp
26 .endm 26 .endm
27 .macro writeb, ch, rb 27 .macro writeb, ch, rb
28 mcr p14, 0, \ch, c0, c5, 0 28 mcr p14, 0, \ch, c0, c5, 0
29 .endm 29 .endm
30#elif defined(CONFIG_CPU_V7) 30#elif defined(CONFIG_CPU_V7)
31 .macro loadsp, rb 31 .macro loadsp, rb, tmp
32 .endm 32 .endm
33 .macro writeb, ch, rb 33 .macro writeb, ch, rb
34wait: mrc p14, 0, pc, c0, c1, 0 34wait: mrc p14, 0, pc, c0, c1, 0
@@ -36,13 +36,13 @@ wait: mrc p14, 0, pc, c0, c1, 0
36 mcr p14, 0, \ch, c0, c5, 0 36 mcr p14, 0, \ch, c0, c5, 0
37 .endm 37 .endm
38#elif defined(CONFIG_CPU_XSCALE) 38#elif defined(CONFIG_CPU_XSCALE)
39 .macro loadsp, rb 39 .macro loadsp, rb, tmp
40 .endm 40 .endm
41 .macro writeb, ch, rb 41 .macro writeb, ch, rb
42 mcr p14, 0, \ch, c8, c0, 0 42 mcr p14, 0, \ch, c8, c0, 0
43 .endm 43 .endm
44#else 44#else
45 .macro loadsp, rb 45 .macro loadsp, rb, tmp
46 .endm 46 .endm
47 .macro writeb, ch, rb 47 .macro writeb, ch, rb
48 mcr p14, 0, \ch, c1, c0, 0 48 mcr p14, 0, \ch, c1, c0, 0
@@ -58,7 +58,7 @@ wait: mrc p14, 0, pc, c0, c1, 0
58 .endm 58 .endm
59 59
60#if defined(CONFIG_ARCH_SA1100) 60#if defined(CONFIG_ARCH_SA1100)
61 .macro loadsp, rb 61 .macro loadsp, rb, tmp
62 mov \rb, #0x80000000 @ physical base address 62 mov \rb, #0x80000000 @ physical base address
63#ifdef CONFIG_DEBUG_LL_SER3 63#ifdef CONFIG_DEBUG_LL_SER3
64 add \rb, \rb, #0x00050000 @ Ser3 64 add \rb, \rb, #0x00050000 @ Ser3
@@ -67,13 +67,13 @@ wait: mrc p14, 0, pc, c0, c1, 0
67#endif 67#endif
68 .endm 68 .endm
69#elif defined(CONFIG_ARCH_S3C2410) 69#elif defined(CONFIG_ARCH_S3C2410)
70 .macro loadsp, rb 70 .macro loadsp, rb, tmp
71 mov \rb, #0x50000000 71 mov \rb, #0x50000000
72 add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT 72 add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
73 .endm 73 .endm
74#else 74#else
75 .macro loadsp, rb 75 .macro loadsp, rb, tmp
76 addruart \rb 76 addruart \rb, \tmp
77 .endm 77 .endm
78#endif 78#endif
79#endif 79#endif
@@ -1025,7 +1025,7 @@ phex: adr r3, phexbuf
1025 strb r2, [r3, r1] 1025 strb r2, [r3, r1]
1026 b 1b 1026 b 1b
1027 1027
1028puts: loadsp r3 1028puts: loadsp r3, r1
10291: ldrb r2, [r0], #1 10291: ldrb r2, [r0], #1
1030 teq r2, #0 1030 teq r2, #0
1031 moveq pc, lr 1031 moveq pc, lr
@@ -1042,7 +1042,7 @@ puts: loadsp r3
1042putc: 1042putc:
1043 mov r2, r0 1043 mov r2, r0
1044 mov r0, #0 1044 mov r0, #0
1045 loadsp r3 1045 loadsp r3, r1
1046 b 2b 1046 b 2b
1047 1047
1048memdump: mov r12, r0 1048memdump: mov r12, r0
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 56a0d116d271..d32bc71c1f78 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -23,8 +23,8 @@ unsigned int __machine_arch_type;
23#include <linux/compiler.h> /* for inline */ 23#include <linux/compiler.h> /* for inline */
24#include <linux/types.h> /* for size_t */ 24#include <linux/types.h> /* for size_t */
25#include <linux/stddef.h> /* for NULL */ 25#include <linux/stddef.h> /* for NULL */
26#include <asm/string.h>
27#include <linux/linkage.h> 26#include <linux/linkage.h>
27#include <asm/string.h>
28 28
29#include <asm/unaligned.h> 29#include <asm/unaligned.h>
30 30
@@ -117,57 +117,7 @@ static void putstr(const char *ptr)
117 117
118#endif 118#endif
119 119
120#define __ptr_t void * 120void *memcpy(void *__dest, __const void *__src, size_t __n)
121
122#define memzero(s,n) __memzero(s,n)
123
124/*
125 * Optimised C version of memzero for the ARM.
126 */
127void __memzero (__ptr_t s, size_t n)
128{
129 union { void *vp; unsigned long *ulp; unsigned char *ucp; } u;
130 int i;
131
132 u.vp = s;
133
134 for (i = n >> 5; i > 0; i--) {
135 *u.ulp++ = 0;
136 *u.ulp++ = 0;
137 *u.ulp++ = 0;
138 *u.ulp++ = 0;
139 *u.ulp++ = 0;
140 *u.ulp++ = 0;
141 *u.ulp++ = 0;
142 *u.ulp++ = 0;
143 }
144
145 if (n & 1 << 4) {
146 *u.ulp++ = 0;
147 *u.ulp++ = 0;
148 *u.ulp++ = 0;
149 *u.ulp++ = 0;
150 }
151
152 if (n & 1 << 3) {
153 *u.ulp++ = 0;
154 *u.ulp++ = 0;
155 }
156
157 if (n & 1 << 2)
158 *u.ulp++ = 0;
159
160 if (n & 1 << 1) {
161 *u.ucp++ = 0;
162 *u.ucp++ = 0;
163 }
164
165 if (n & 1)
166 *u.ucp++ = 0;
167}
168
169static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
170 size_t __n)
171{ 121{
172 int i = 0; 122 int i = 0;
173 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src; 123 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src;
@@ -204,59 +154,20 @@ static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
204/* 154/*
205 * gzip delarations 155 * gzip delarations
206 */ 156 */
207#define STATIC static
208
209/* Diagnostic functions */
210#ifdef DEBUG
211# define Assert(cond,msg) {if(!(cond)) error(msg);}
212# define Trace(x) fprintf x
213# define Tracev(x) {if (verbose) fprintf x ;}
214# define Tracevv(x) {if (verbose>1) fprintf x ;}
215# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
216# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
217#else
218# define Assert(cond,msg)
219# define Trace(x)
220# define Tracev(x)
221# define Tracevv(x)
222# define Tracec(c,x)
223# define Tracecv(c,x)
224#endif
225
226static void error(char *m);
227
228extern char input_data[]; 157extern char input_data[];
229extern char input_data_end[]; 158extern char input_data_end[];
230 159
231static unsigned char *output_data; 160unsigned char *output_data;
232static unsigned long output_ptr; 161unsigned long output_ptr;
233
234static void error(char *m);
235 162
236static void putstr(const char *); 163unsigned long free_mem_ptr;
237 164unsigned long free_mem_end_ptr;
238static unsigned long free_mem_ptr;
239static unsigned long free_mem_end_ptr;
240
241#ifdef STANDALONE_DEBUG
242#define NO_INFLATE_MALLOC
243#endif
244
245#define ARCH_HAS_DECOMP_WDOG
246
247#ifdef CONFIG_KERNEL_GZIP
248#include "../../../../lib/decompress_inflate.c"
249#endif
250
251#ifdef CONFIG_KERNEL_LZO
252#include "../../../../lib/decompress_unlzo.c"
253#endif
254 165
255#ifndef arch_error 166#ifndef arch_error
256#define arch_error(x) 167#define arch_error(x)
257#endif 168#endif
258 169
259static void error(char *x) 170void error(char *x)
260{ 171{
261 arch_error(x); 172 arch_error(x);
262 173
@@ -272,6 +183,8 @@ asmlinkage void __div0(void)
272 error("Attempting division by 0!"); 183 error("Attempting division by 0!");
273} 184}
274 185
186extern void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
187
275#ifndef STANDALONE_DEBUG 188#ifndef STANDALONE_DEBUG
276 189
277unsigned long 190unsigned long
@@ -292,8 +205,8 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
292 output_ptr = get_unaligned_le32(tmp); 205 output_ptr = get_unaligned_le32(tmp);
293 206
294 putstr("Uncompressing Linux..."); 207 putstr("Uncompressing Linux...");
295 decompress(input_data, input_data_end - input_data, 208 do_decompress(input_data, input_data_end - input_data,
296 NULL, NULL, output_data, NULL, error); 209 output_data, error);
297 putstr(" done, booting the kernel.\n"); 210 putstr(" done, booting the kernel.\n");
298 return output_ptr; 211 return output_ptr;
299} 212}
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index a5924b9b88bd..7ca9ecff652f 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -14,6 +14,13 @@ SECTIONS
14 /DISCARD/ : { 14 /DISCARD/ : {
15 *(.ARM.exidx*) 15 *(.ARM.exidx*)
16 *(.ARM.extab*) 16 *(.ARM.extab*)
17 /*
18 * Discard any r/w data - this produces a link error if we have any,
19 * which is required for PIC decompression. Local data generates
20 * GOTOFF relocations, which prevents it being relocated independently
21 * of the text/got segments.
22 */
23 *(.data)
17 } 24 }
18 25
19 . = TEXT_START; 26 . = TEXT_START;
@@ -40,7 +47,6 @@ SECTIONS
40 .got : { *(.got) } 47 .got : { *(.got) }
41 _got_end = .; 48 _got_end = .;
42 .got.plt : { *(.got.plt) } 49 .got.plt : { *(.got.plt) }
43 .data : { *(.data) }
44 _edata = .; 50 _edata = .;
45 51
46 . = BSS_START; 52 . = BSS_START;