diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:37:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:37:46 -0400 |
commit | 3a533374283aea50eab3976d8a6d30532175f009 (patch) | |
tree | 5944a2b40d8b40ec68818eb40235872c609ea741 | |
parent | fb6624ebd912e3d6907ca6490248e73368223da9 (diff) | |
parent | d17ffb4c9d86194bb74cbc30f4b65de59c27f6cd (diff) |
Merge branch 'for-linus' of git://www.jni.nu/cris
* 'for-linus' of git://www.jni.nu/cris:
[CRISv10] Clean up compressed/misc.c
[CRISv10] Correct whitespace damage.
[CRIS] Correct definition of subdirs for install_headers.
[CRIS] Correct image makefiles to allow using a separate OBJ-directory.
[CRIS] Build fixes for compressed and rescue images for v10 and v32:
It looks at least odd to apply spin_unlock to a mutex.
cris: compile fixes for 2.6.26-rc5
-rw-r--r-- | arch/cris/arch-v10/boot/Makefile | 1 | ||||
-rw-r--r-- | arch/cris/arch-v10/boot/compressed/Makefile | 14 | ||||
-rw-r--r-- | arch/cris/arch-v10/boot/compressed/decompress.ld | 3 | ||||
-rw-r--r-- | arch/cris/arch-v10/boot/compressed/head.S | 98 | ||||
-rw-r--r-- | arch/cris/arch-v10/boot/compressed/misc.c | 144 | ||||
-rw-r--r-- | arch/cris/arch-v10/boot/rescue/Makefile | 9 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/pcf8563.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/debugport.c | 20 | ||||
-rw-r--r-- | arch/cris/arch-v32/boot/Makefile | 1 | ||||
-rw-r--r-- | arch/cris/arch-v32/boot/compressed/Makefile | 6 | ||||
-rw-r--r-- | arch/cris/arch-v32/boot/rescue/Makefile | 3 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pcf8563.c | 2 | ||||
-rw-r--r-- | include/asm-cris/Kbuild | 5 |
13 files changed, 154 insertions, 154 deletions
diff --git a/arch/cris/arch-v10/boot/Makefile b/arch/cris/arch-v10/boot/Makefile index 20c83a53caf3..217203014433 100644 --- a/arch/cris/arch-v10/boot/Makefile +++ b/arch/cris/arch-v10/boot/Makefile | |||
@@ -2,7 +2,6 @@ | |||
2 | # arch/cris/arch-v10/boot/Makefile | 2 | # arch/cris/arch-v10/boot/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | OBJCOPY = objcopy-cris | ||
6 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 5 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
7 | 6 | ||
8 | subdir- := compressed rescue | 7 | subdir- := compressed rescue |
diff --git a/arch/cris/arch-v10/boot/compressed/Makefile b/arch/cris/arch-v10/boot/compressed/Makefile index 4a031cb27eb9..08d943ce4be7 100644 --- a/arch/cris/arch-v10/boot/compressed/Makefile +++ b/arch/cris/arch-v10/boot/compressed/Makefile | |||
@@ -2,12 +2,10 @@ | |||
2 | # arch/cris/arch-v10/boot/compressed/Makefile | 2 | # arch/cris/arch-v10/boot/compressed/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | CC = gcc-cris -melf $(LINUXINCLUDE) | 5 | asflags-y += $(LINUXINCLUDE) |
6 | ccflags-y += -O2 | 6 | ccflags-y += -O2 $(LINUXINCLUDE) |
7 | LD = ld-cris | 7 | ldflags-y += -T $(srctree)/$(obj)/decompress.ld |
8 | ldflags-y += -T $(obj)/decompress.ld | ||
9 | OBJECTS = $(obj)/head.o $(obj)/misc.o | 8 | OBJECTS = $(obj)/head.o $(obj)/misc.o |
10 | OBJCOPY = objcopy-cris | ||
11 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 9 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
12 | 10 | ||
13 | quiet_cmd_image = BUILD $@ | 11 | quiet_cmd_image = BUILD $@ |
@@ -21,12 +19,6 @@ $(obj)/decompress.o: $(OBJECTS) FORCE | |||
21 | $(obj)/decompress.bin: $(obj)/decompress.o FORCE | 19 | $(obj)/decompress.bin: $(obj)/decompress.o FORCE |
22 | $(call if_changed,objcopy) | 20 | $(call if_changed,objcopy) |
23 | 21 | ||
24 | $(obj)/head.o: $(obj)/head.S .config | ||
25 | @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@ | ||
26 | |||
27 | $(obj)/misc.o: $(obj)/misc.c .config | ||
28 | @$(CC) -D__KERNEL__ -c $< -o $@ | ||
29 | |||
30 | $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE | 22 | $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE |
31 | $(call if_changed,image) | 23 | $(call if_changed,image) |
32 | 24 | ||
diff --git a/arch/cris/arch-v10/boot/compressed/decompress.ld b/arch/cris/arch-v10/boot/compressed/decompress.ld index 0b0a14fe6177..e80f4594d543 100644 --- a/arch/cris/arch-v10/boot/compressed/decompress.ld +++ b/arch/cris/arch-v10/boot/compressed/decompress.ld | |||
@@ -1,4 +1,5 @@ | |||
1 | OUTPUT_FORMAT(elf32-us-cris) | 1 | /* OUTPUT_FORMAT(elf32-us-cris) */ |
2 | OUTPUT_FORMAT(elf32-cris) | ||
2 | 3 | ||
3 | MEMORY | 4 | MEMORY |
4 | { | 5 | { |
diff --git a/arch/cris/arch-v10/boot/compressed/head.S b/arch/cris/arch-v10/boot/compressed/head.S index 610bdb237553..981fbae84959 100644 --- a/arch/cris/arch-v10/boot/compressed/head.S +++ b/arch/cris/arch-v10/boot/compressed/head.S | |||
@@ -15,77 +15,77 @@ | |||
15 | #define COMMAND_LINE_MAGIC 0x87109563 | 15 | #define COMMAND_LINE_MAGIC 0x87109563 |
16 | 16 | ||
17 | ;; Exported symbols | 17 | ;; Exported symbols |
18 | |||
19 | .globl _input_data | ||
20 | 18 | ||
21 | 19 | .globl input_data | |
20 | |||
21 | |||
22 | .text | 22 | .text |
23 | 23 | ||
24 | nop | 24 | nop |
25 | di | 25 | di |
26 | 26 | ||
27 | ;; We need to initialze DRAM registers before we start using the DRAM | 27 | ;; We need to initialze DRAM registers before we start using the DRAM |
28 | 28 | ||
29 | cmp.d RAM_INIT_MAGIC, r8 ; Already initialized? | 29 | cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized? |
30 | beq dram_init_finished | 30 | beq dram_init_finished |
31 | nop | 31 | nop |
32 | 32 | ||
33 | #include "../../lib/dram_init.S" | 33 | #include "../../lib/dram_init.S" |
34 | 34 | ||
35 | dram_init_finished: | 35 | dram_init_finished: |
36 | 36 | ||
37 | ;; Initiate the PA and PB ports | 37 | ;; Initiate the PA and PB ports |
38 | 38 | ||
39 | move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0 | 39 | move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0 |
40 | move.b r0, [R_PORT_PA_DATA] | 40 | move.b $r0, [R_PORT_PA_DATA] |
41 | 41 | ||
42 | move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0 | 42 | move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0 |
43 | move.b r0, [R_PORT_PA_DIR] | 43 | move.b $r0, [R_PORT_PA_DIR] |
44 | 44 | ||
45 | move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0 | 45 | move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0 |
46 | move.b r0, [R_PORT_PB_DATA] | 46 | move.b $r0, [R_PORT_PB_DATA] |
47 | 47 | ||
48 | move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0 | 48 | move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0 |
49 | move.b r0, [R_PORT_PB_DIR] | 49 | move.b $r0, [R_PORT_PB_DIR] |
50 | 50 | ||
51 | ;; Setup the stack to a suitably high address. | 51 | ;; Setup the stack to a suitably high address. |
52 | ;; We assume 8 MB is the minimum DRAM in an eLinux | 52 | ;; We assume 8 MB is the minimum DRAM in an eLinux |
53 | ;; product and put the sp at the top for now. | 53 | ;; product and put the sp at the top for now. |
54 | 54 | ||
55 | move.d 0x40800000, sp | 55 | move.d 0x40800000, $sp |
56 | 56 | ||
57 | ;; Figure out where the compressed piggyback image is | 57 | ;; Figure out where the compressed piggyback image is |
58 | ;; in the flash (since we wont try to copy it to DRAM | 58 | ;; in the flash (since we wont try to copy it to DRAM |
59 | ;; before unpacking). It is at _edata, but in flash. | 59 | ;; before unpacking). It is at _edata, but in flash. |
60 | ;; Use (_edata - basse) as offset to the current PC. | 60 | ;; Use (_edata - basse) as offset to the current PC. |
61 | 61 | ||
62 | basse: move.d pc, r5 | 62 | basse: move.d $pc, $r5 |
63 | and.d 0x7fffffff, r5 ; strip any non-cache bit | 63 | and.d 0x7fffffff, $r5 ; strip any non-cache bit |
64 | subq 2, r5 ; compensate for the move.d pc instr | 64 | subq 2, $r5 ; compensate for the move.d $pc instr |
65 | move.d r5, r0 ; save for later - flash address of 'basse' | 65 | move.d $r5, $r0 ; save for later - flash address of 'basse' |
66 | add.d _edata, r5 | 66 | add.d _edata, $r5 |
67 | sub.d basse, r5 ; r5 = flash address of '_edata' | 67 | sub.d basse, $r5 ; $r5 = flash address of '_edata' |
68 | 68 | ||
69 | ;; Copy text+data to DRAM | 69 | ;; Copy text+data to DRAM |
70 | 70 | ||
71 | move.d basse, r1 ; destination | 71 | move.d basse, $r1 ; destination |
72 | move.d _edata, r2 ; end destination | 72 | move.d _edata, $r2 ; end destination |
73 | 1: move.w [r0+], r3 | 73 | 1: move.w [$r0+], $r3 |
74 | move.w r3, [r1+] | 74 | move.w $r3, [$r1+] |
75 | cmp.d r2, r1 | 75 | cmp.d $r2, $r1 |
76 | bcs 1b | 76 | bcs 1b |
77 | nop | 77 | nop |
78 | 78 | ||
79 | move.d r5, [_input_data] ; for the decompressor | 79 | move.d $r5, [input_data] ; for the decompressor |
80 | 80 | ||
81 | 81 | ||
82 | ;; Clear the decompressors BSS (between _edata and _end) | 82 | ;; Clear the decompressors BSS (between _edata and _end) |
83 | 83 | ||
84 | moveq 0, r0 | 84 | moveq 0, $r0 |
85 | move.d _edata, r1 | 85 | move.d _edata, $r1 |
86 | move.d _end, r2 | 86 | move.d _end, $r2 |
87 | 1: move.w r0, [r1+] | 87 | 1: move.w $r0, [$r1+] |
88 | cmp.d r2, r1 | 88 | cmp.d $r2, $r1 |
89 | bcs 1b | 89 | bcs 1b |
90 | nop | 90 | nop |
91 | 91 | ||
@@ -94,16 +94,16 @@ basse: move.d pc, r5 | |||
94 | move.d $r10, [$r12] | 94 | move.d $r10, [$r12] |
95 | move.d _cmd_line_addr, $r12 | 95 | move.d _cmd_line_addr, $r12 |
96 | move.d $r11, [$r12] | 96 | move.d $r11, [$r12] |
97 | |||
98 | ;; Do the decompression and save compressed size in _inptr | ||
99 | 97 | ||
100 | jsr _decompress_kernel | 98 | ;; Do the decompression and save compressed size in inptr |
101 | 99 | ||
102 | ;; Put start address of root partition in r9 so the kernel can use it | 100 | jsr decompress_kernel |
101 | |||
102 | ;; Put start address of root partition in $r9 so the kernel can use it | ||
103 | ;; when mounting from flash | 103 | ;; when mounting from flash |
104 | 104 | ||
105 | move.d [_input_data], r9 ; flash address of compressed kernel | 105 | move.d [input_data], $r9 ; flash address of compressed kernel |
106 | add.d [_inptr], r9 ; size of compressed kernel | 106 | add.d [inptr], $r9 ; size of compressed kernel |
107 | 107 | ||
108 | ;; Restore command line magic and address. | 108 | ;; Restore command line magic and address. |
109 | move.d _cmd_line_magic, $r10 | 109 | move.d _cmd_line_magic, $r10 |
@@ -112,12 +112,12 @@ basse: move.d pc, r5 | |||
112 | move.d [$r11], $r11 | 112 | move.d [$r11], $r11 |
113 | 113 | ||
114 | ;; Enter the decompressed kernel | 114 | ;; Enter the decompressed kernel |
115 | move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized | 115 | move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized |
116 | jump 0x40004000 ; kernel is linked to this address | 116 | jump 0x40004000 ; kernel is linked to this address |
117 | 117 | ||
118 | .data | 118 | .data |
119 | 119 | ||
120 | _input_data: | 120 | input_data: |
121 | .dword 0 ; used by the decompressor | 121 | .dword 0 ; used by the decompressor |
122 | _cmd_line_magic: | 122 | _cmd_line_magic: |
123 | .dword 0 | 123 | .dword 0 |
diff --git a/arch/cris/arch-v10/boot/compressed/misc.c b/arch/cris/arch-v10/boot/compressed/misc.c index 9a43ab19391e..18e13bce1400 100644 --- a/arch/cris/arch-v10/boot/compressed/misc.c +++ b/arch/cris/arch-v10/boot/compressed/misc.c | |||
@@ -29,12 +29,10 @@ | |||
29 | #define OF(args) args | 29 | #define OF(args) args |
30 | #define STATIC static | 30 | #define STATIC static |
31 | 31 | ||
32 | void* memset(void* s, int c, size_t n); | 32 | void *memset(void *s, int c, size_t n); |
33 | void* memcpy(void* __dest, __const void* __src, | 33 | void *memcpy(void *__dest, __const void *__src, size_t __n); |
34 | size_t __n); | ||
35 | |||
36 | #define memzero(s, n) memset ((s), 0, (n)) | ||
37 | 34 | ||
35 | #define memzero(s, n) memset((s), 0, (n)) | ||
38 | 36 | ||
39 | typedef unsigned char uch; | 37 | typedef unsigned char uch; |
40 | typedef unsigned short ush; | 38 | typedef unsigned short ush; |
@@ -62,57 +60,69 @@ static unsigned outcnt = 0; /* bytes in output buffer */ | |||
62 | #define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ | 60 | #define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ |
63 | #define RESERVED 0xC0 /* bit 6,7: reserved */ | 61 | #define RESERVED 0xC0 /* bit 6,7: reserved */ |
64 | 62 | ||
65 | #define get_byte() inbuf[inptr++] | 63 | #define get_byte() (inbuf[inptr++]) |
66 | 64 | ||
67 | /* Diagnostic functions */ | 65 | /* Diagnostic functions */ |
68 | #ifdef DEBUG | 66 | #ifdef DEBUG |
69 | # define Assert(cond,msg) {if(!(cond)) error(msg);} | 67 | # define Assert(cond, msg) do { \ |
68 | if (!(cond)) \ | ||
69 | error(msg); \ | ||
70 | } while (0) | ||
70 | # define Trace(x) fprintf x | 71 | # define Trace(x) fprintf x |
71 | # define Tracev(x) {if (verbose) fprintf x ;} | 72 | # define Tracev(x) do { \ |
72 | # define Tracevv(x) {if (verbose>1) fprintf x ;} | 73 | if (verbose) \ |
73 | # define Tracec(c,x) {if (verbose && (c)) fprintf x ;} | 74 | fprintf x; \ |
74 | # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;} | 75 | } while (0) |
76 | # define Tracevv(x) do { \ | ||
77 | if (verbose > 1) \ | ||
78 | fprintf x; \ | ||
79 | } while (0) | ||
80 | # define Tracec(c, x) do { \ | ||
81 | if (verbose && (c)) \ | ||
82 | fprintf x; \ | ||
83 | } while (0) | ||
84 | # define Tracecv(c, x) do { \ | ||
85 | if (verbose > 1 && (c)) \ | ||
86 | fprintf x; \ | ||
87 | } while (0) | ||
75 | #else | 88 | #else |
76 | # define Assert(cond,msg) | 89 | # define Assert(cond, msg) |
77 | # define Trace(x) | 90 | # define Trace(x) |
78 | # define Tracev(x) | 91 | # define Tracev(x) |
79 | # define Tracevv(x) | 92 | # define Tracevv(x) |
80 | # define Tracec(c,x) | 93 | # define Tracec(c, x) |
81 | # define Tracecv(c,x) | 94 | # define Tracecv(c, x) |
82 | #endif | 95 | #endif |
83 | 96 | ||
84 | static int fill_inbuf(void); | ||
85 | static void flush_window(void); | 97 | static void flush_window(void); |
86 | static void error(char *m); | 98 | static void error(char *m); |
87 | static void gzip_mark(void **); | ||
88 | static void gzip_release(void **); | ||
89 | 99 | ||
90 | extern char *input_data; /* lives in head.S */ | 100 | extern char *input_data; /* lives in head.S */ |
91 | 101 | ||
92 | static long bytes_out = 0; | 102 | static long bytes_out = 0; |
93 | static uch *output_data; | 103 | static uch *output_data; |
94 | static unsigned long output_ptr = 0; | 104 | static unsigned long output_ptr = 0; |
95 | 105 | ||
96 | static void *malloc(int size); | 106 | static void *malloc(int size); |
97 | static void free(void *where); | 107 | static void free(void *where); |
98 | static void error(char *m); | ||
99 | static void gzip_mark(void **); | 108 | static void gzip_mark(void **); |
100 | static void gzip_release(void **); | 109 | static void gzip_release(void **); |
101 | 110 | ||
102 | static void puts(const char *); | 111 | static void puts(const char *); |
103 | 112 | ||
104 | /* the "heap" is put directly after the BSS ends, at end */ | 113 | /* the "heap" is put directly after the BSS ends, at end */ |
105 | 114 | ||
106 | extern int end; | 115 | extern int _end; |
107 | static long free_mem_ptr = (long)&end; | 116 | static long free_mem_ptr = (long)&_end; |
108 | 117 | ||
109 | #include "../../../../../lib/inflate.c" | 118 | #include "../../../../../lib/inflate.c" |
110 | 119 | ||
111 | static void *malloc(int size) | 120 | static void *malloc(int size) |
112 | { | 121 | { |
113 | void *p; | 122 | void *p; |
114 | 123 | ||
115 | if (size <0) error("Malloc error"); | 124 | if (size < 0) |
125 | error("Malloc error"); | ||
116 | 126 | ||
117 | free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */ | 127 | free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */ |
118 | 128 | ||
@@ -142,44 +152,47 @@ static void | |||
142 | puts(const char *s) | 152 | puts(const char *s) |
143 | { | 153 | { |
144 | #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL | 154 | #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL |
145 | while(*s) { | 155 | while (*s) { |
146 | #ifdef CONFIG_ETRAX_DEBUG_PORT0 | 156 | #ifdef CONFIG_ETRAX_DEBUG_PORT0 |
147 | while(!(*R_SERIAL0_STATUS & (1 << 5))) ; | 157 | while (!(*R_SERIAL0_STATUS & (1 << 5))) ; |
148 | *R_SERIAL0_TR_DATA = *s++; | 158 | *R_SERIAL0_TR_DATA = *s++; |
149 | #endif | 159 | #endif |
150 | #ifdef CONFIG_ETRAX_DEBUG_PORT1 | 160 | #ifdef CONFIG_ETRAX_DEBUG_PORT1 |
151 | while(!(*R_SERIAL1_STATUS & (1 << 5))) ; | 161 | while (!(*R_SERIAL1_STATUS & (1 << 5))) ; |
152 | *R_SERIAL1_TR_DATA = *s++; | 162 | *R_SERIAL1_TR_DATA = *s++; |
153 | #endif | 163 | #endif |
154 | #ifdef CONFIG_ETRAX_DEBUG_PORT2 | 164 | #ifdef CONFIG_ETRAX_DEBUG_PORT2 |
155 | while(!(*R_SERIAL2_STATUS & (1 << 5))) ; | 165 | while (!(*R_SERIAL2_STATUS & (1 << 5))) ; |
156 | *R_SERIAL2_TR_DATA = *s++; | 166 | *R_SERIAL2_TR_DATA = *s++; |
157 | #endif | 167 | #endif |
158 | #ifdef CONFIG_ETRAX_DEBUG_PORT3 | 168 | #ifdef CONFIG_ETRAX_DEBUG_PORT3 |
159 | while(!(*R_SERIAL3_STATUS & (1 << 5))) ; | 169 | while (!(*R_SERIAL3_STATUS & (1 << 5))) ; |
160 | *R_SERIAL3_TR_DATA = *s++; | 170 | *R_SERIAL3_TR_DATA = *s++; |
161 | #endif | 171 | #endif |
162 | } | 172 | } |
163 | #endif | 173 | #endif |
164 | } | 174 | } |
165 | 175 | ||
166 | void* | 176 | void *memset(void *s, int c, size_t n) |
167 | memset(void* s, int c, size_t n) | ||
168 | { | 177 | { |
169 | int i; | 178 | int i; |
170 | char *ss = (char*)s; | 179 | char *ss = (char *)s; |
180 | |||
181 | for (i = 0; i < n; i++) | ||
182 | ss[i] = c; | ||
171 | 183 | ||
172 | for (i=0;i<n;i++) ss[i] = c; | 184 | return s; |
173 | } | 185 | } |
174 | 186 | ||
175 | void* | 187 | void *memcpy(void *__dest, __const void *__src, size_t __n) |
176 | memcpy(void* __dest, __const void* __src, | ||
177 | size_t __n) | ||
178 | { | 188 | { |
179 | int i; | 189 | int i; |
180 | char *d = (char *)__dest, *s = (char *)__src; | 190 | char *d = (char *)__dest, *s = (char *)__src; |
181 | 191 | ||
182 | for (i=0;i<__n;i++) d[i] = s[i]; | 192 | for (i = 0; i < __n; i++) |
193 | d[i] = s[i]; | ||
194 | |||
195 | return __dest; | ||
183 | } | 196 | } |
184 | 197 | ||
185 | /* =========================================================================== | 198 | /* =========================================================================== |
@@ -187,46 +200,44 @@ memcpy(void* __dest, __const void* __src, | |||
187 | * (Used for the decompressed data only.) | 200 | * (Used for the decompressed data only.) |
188 | */ | 201 | */ |
189 | 202 | ||
190 | static void | 203 | static void flush_window(void) |
191 | flush_window() | ||
192 | { | 204 | { |
193 | ulg c = crc; /* temporary variable */ | 205 | ulg c = crc; /* temporary variable */ |
194 | unsigned n; | 206 | unsigned n; |
195 | uch *in, *out, ch; | 207 | uch *in, *out, ch; |
196 | 208 | ||
197 | in = window; | 209 | in = window; |
198 | out = &output_data[output_ptr]; | 210 | out = &output_data[output_ptr]; |
199 | for (n = 0; n < outcnt; n++) { | 211 | for (n = 0; n < outcnt; n++) { |
200 | ch = *out++ = *in++; | 212 | ch = *out = *in; |
201 | c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8); | 213 | out++; |
202 | } | 214 | in++; |
203 | crc = c; | 215 | c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8); |
204 | bytes_out += (ulg)outcnt; | 216 | } |
205 | output_ptr += (ulg)outcnt; | 217 | crc = c; |
206 | outcnt = 0; | 218 | bytes_out += (ulg)outcnt; |
219 | output_ptr += (ulg)outcnt; | ||
220 | outcnt = 0; | ||
207 | } | 221 | } |
208 | 222 | ||
209 | static void | 223 | static void error(char *x) |
210 | error(char *x) | ||
211 | { | 224 | { |
212 | puts("\n\n"); | 225 | puts("\n\n"); |
213 | puts(x); | 226 | puts(x); |
214 | puts("\n\n -- System halted\n"); | 227 | puts("\n\n -- System halted\n"); |
215 | 228 | ||
216 | while(1); /* Halt */ | 229 | while (1); /* Halt */ |
217 | } | 230 | } |
218 | 231 | ||
219 | void | 232 | void setup_normal_output_buffer(void) |
220 | setup_normal_output_buffer() | ||
221 | { | 233 | { |
222 | output_data = (char *)KERNEL_LOAD_ADR; | 234 | output_data = (char *)KERNEL_LOAD_ADR; |
223 | } | 235 | } |
224 | 236 | ||
225 | void | 237 | void decompress_kernel(void) |
226 | decompress_kernel() | ||
227 | { | 238 | { |
228 | char revision; | 239 | char revision; |
229 | 240 | ||
230 | /* input_data is set in head.S */ | 241 | /* input_data is set in head.S */ |
231 | inbuf = input_data; | 242 | inbuf = input_data; |
232 | 243 | ||
@@ -257,11 +268,10 @@ decompress_kernel() | |||
257 | 268 | ||
258 | makecrc(); | 269 | makecrc(); |
259 | 270 | ||
260 | __asm__ volatile ("move vr,%0" : "=rm" (revision)); | 271 | __asm__ volatile ("move $vr,%0" : "=rm" (revision)); |
261 | if (revision < 10) | 272 | if (revision < 10) { |
262 | { | ||
263 | puts("You need an ETRAX 100LX to run linux 2.6\n"); | 273 | puts("You need an ETRAX 100LX to run linux 2.6\n"); |
264 | while(1); | 274 | while (1); |
265 | } | 275 | } |
266 | 276 | ||
267 | puts("Uncompressing Linux...\n"); | 277 | puts("Uncompressing Linux...\n"); |
diff --git a/arch/cris/arch-v10/boot/rescue/Makefile b/arch/cris/arch-v10/boot/rescue/Makefile index 2e5045b9e19c..07688da92708 100644 --- a/arch/cris/arch-v10/boot/rescue/Makefile +++ b/arch/cris/arch-v10/boot/rescue/Makefile | |||
@@ -2,12 +2,9 @@ | |||
2 | # Makefile for rescue (bootstrap) code | 2 | # Makefile for rescue (bootstrap) code |
3 | # | 3 | # |
4 | 4 | ||
5 | CC = gcc-cris -mlinux $(LINUXINCLUDE) | 5 | ccflags-y += -O2 $(LINUXINCLUDE) |
6 | ccflags-y += -O2 | 6 | asflags-y += $(LINUXINCLUDE) |
7 | asflags-y += -traditional | 7 | ldflags-y += -T $(srctree)/$(obj)/rescue.ld |
8 | LD = gcc-cris -mlinux -nostdlib | ||
9 | ldflags-y += -T $(obj)/rescue.ld | ||
10 | OBJCOPY = objcopy-cris | ||
11 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 8 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
12 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o | 9 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o |
13 | OBJECT := $(obj)/head.o | 10 | OBJECT := $(obj)/head.o |
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 52103d16dc6c..8769dc914073 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c | |||
@@ -233,7 +233,7 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
233 | 233 | ||
234 | if (copy_to_user((struct rtc_time *) arg, &tm, | 234 | if (copy_to_user((struct rtc_time *) arg, &tm, |
235 | sizeof tm)) { | 235 | sizeof tm)) { |
236 | spin_unlock(&rtc_lock); | 236 | mutex_unlock(&rtc_lock); |
237 | return -EFAULT; | 237 | return -EFAULT; |
238 | } | 238 | } |
239 | 239 | ||
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c index 04d5eee2c90c..3dc6e91ba39e 100644 --- a/arch/cris/arch-v10/kernel/debugport.c +++ b/arch/cris/arch-v10/kernel/debugport.c | |||
@@ -426,12 +426,18 @@ static int dummy_write(struct tty_struct * tty, | |||
426 | return count; | 426 | return count; |
427 | } | 427 | } |
428 | 428 | ||
429 | static int | 429 | static int dummy_write_room(struct tty_struct *tty) |
430 | dummy_write_room(struct tty_struct *tty) | ||
431 | { | 430 | { |
432 | return 8192; | 431 | return 8192; |
433 | } | 432 | } |
434 | 433 | ||
434 | static const struct tty_operations dummy_ops = { | ||
435 | .open = dummy_open, | ||
436 | .close = dummy_close, | ||
437 | .write = dummy_write, | ||
438 | .write_room = dummy_write_room, | ||
439 | }; | ||
440 | |||
435 | void __init | 441 | void __init |
436 | init_dummy_console(void) | 442 | init_dummy_console(void) |
437 | { | 443 | { |
@@ -444,14 +450,14 @@ init_dummy_console(void) | |||
444 | dummy_driver.type = TTY_DRIVER_TYPE_SERIAL; | 450 | dummy_driver.type = TTY_DRIVER_TYPE_SERIAL; |
445 | dummy_driver.subtype = SERIAL_TYPE_NORMAL; | 451 | dummy_driver.subtype = SERIAL_TYPE_NORMAL; |
446 | dummy_driver.init_termios = tty_std_termios; | 452 | dummy_driver.init_termios = tty_std_termios; |
453 | /* Normally B9600 default... */ | ||
447 | dummy_driver.init_termios.c_cflag = | 454 | dummy_driver.init_termios.c_cflag = |
448 | B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */ | 455 | B115200 | CS8 | CREAD | HUPCL | CLOCAL; |
449 | dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; | 456 | dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; |
457 | dummy_driver.init_termios.c_ispeed = 115200; | ||
458 | dummy_driver.init_termios.c_ospeed = 115200; | ||
450 | 459 | ||
451 | dummy_driver.open = dummy_open; | 460 | dummy_driver.ops = &dummy_ops; |
452 | dummy_driver.close = dummy_close; | ||
453 | dummy_driver.write = dummy_write; | ||
454 | dummy_driver.write_room = dummy_write_room; | ||
455 | if (tty_register_driver(&dummy_driver)) | 461 | if (tty_register_driver(&dummy_driver)) |
456 | panic("Couldn't register dummy serial driver\n"); | 462 | panic("Couldn't register dummy serial driver\n"); |
457 | } | 463 | } |
diff --git a/arch/cris/arch-v32/boot/Makefile b/arch/cris/arch-v32/boot/Makefile index 3f91349c5f12..99896ad60b30 100644 --- a/arch/cris/arch-v32/boot/Makefile +++ b/arch/cris/arch-v32/boot/Makefile | |||
@@ -2,7 +2,6 @@ | |||
2 | # arch/cris/arch-v32/boot/Makefile | 2 | # arch/cris/arch-v32/boot/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | OBJCOPY = objcopy-cris | ||
6 | OBJCOPYFLAGS = -O binary -R .note -R .comment | 5 | OBJCOPYFLAGS = -O binary -R .note -R .comment |
7 | 6 | ||
8 | subdir- := compressed rescue | 7 | subdir- := compressed rescue |
diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile index 2c8c2c3039c5..d6335f26083b 100644 --- a/arch/cris/arch-v32/boot/compressed/Makefile +++ b/arch/cris/arch-v32/boot/compressed/Makefile | |||
@@ -2,14 +2,10 @@ | |||
2 | # arch/cris/arch-v32/boot/compressed/Makefile | 2 | # arch/cris/arch-v32/boot/compressed/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE) | ||
6 | asflags-y += -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch | 5 | asflags-y += -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch |
7 | ccflags-y += -O2 -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch | 6 | ccflags-y += -O2 -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch |
8 | LD = gcc-cris -mlinux -march=v32 -nostdlib | 7 | ldflags-y += -T $(srctree)/$(obj)/decompress.ld |
9 | ldflags-y += -T $(obj)/decompress.ld | ||
10 | obj-y = head.o misc.o | ||
11 | OBJECTS = $(obj)/head.o $(obj)/misc.o | 8 | OBJECTS = $(obj)/head.o $(obj)/misc.o |
12 | OBJCOPY = objcopy-cris | ||
13 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 9 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
14 | 10 | ||
15 | quiet_cmd_image = BUILD $@ | 11 | quiet_cmd_image = BUILD $@ |
diff --git a/arch/cris/arch-v32/boot/rescue/Makefile b/arch/cris/arch-v32/boot/rescue/Makefile index c0987795dcb7..44ae0ad61f90 100644 --- a/arch/cris/arch-v32/boot/rescue/Makefile +++ b/arch/cris/arch-v32/boot/rescue/Makefile | |||
@@ -7,9 +7,8 @@ ccflags-y += -O2 -I $(srctree)/include/asm/arch/mach/ \ | |||
7 | -I $(srctree)/include/asm/arch | 7 | -I $(srctree)/include/asm/arch |
8 | asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch | 8 | asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch |
9 | LD = gcc-cris -mlinux -march=v32 -nostdlib | 9 | LD = gcc-cris -mlinux -march=v32 -nostdlib |
10 | ldflags-y += -T $(obj)/rescue.ld | 10 | ldflags-y += -T $(srctree)/$(obj)/rescue.ld |
11 | LDPOSTFLAGS = -lgcc | 11 | LDPOSTFLAGS = -lgcc |
12 | OBJCOPY = objcopy-cris | ||
13 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 12 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
14 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o | 13 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o |
15 | OBJECT := $(obj)/head.o | 14 | OBJECT := $(obj)/head.o |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index 53db3870ba04..f263ab571221 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c | |||
@@ -229,7 +229,7 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
229 | 229 | ||
230 | if (copy_to_user((struct rtc_time *) arg, &tm, | 230 | if (copy_to_user((struct rtc_time *) arg, &tm, |
231 | sizeof tm)) { | 231 | sizeof tm)) { |
232 | spin_unlock(&rtc_lock); | 232 | mutex_unlock(&rtc_lock); |
233 | return -EFAULT; | 233 | return -EFAULT; |
234 | } | 234 | } |
235 | 235 | ||
diff --git a/include/asm-cris/Kbuild b/include/asm-cris/Kbuild index 17455459c43f..b7037d80d461 100644 --- a/include/asm-cris/Kbuild +++ b/include/asm-cris/Kbuild | |||
@@ -1,7 +1,8 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | header-$(CONFIG_ETRAX_ARCH_V10) += arch-v10/ | 3 | header-y += arch/ |
4 | header-$(CONFIG_ETRAX_ARCH_V32) += arch-v32/ | 4 | header-y += arch-v10/ |
5 | header-y += arch-v32/ | ||
5 | 6 | ||
6 | header-y += ethernet.h | 7 | header-y += ethernet.h |
7 | header-y += rtc.h | 8 | header-y += rtc.h |