100-compile_fixes.patch 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. --- a/arch/cris/arch-v10/boot/Makefile
  2. +++ b/arch/cris/arch-v10/boot/Makefile
  3. @@ -2,7 +2,6 @@
  4. # arch/cris/arch-v10/boot/Makefile
  5. #
  6. -OBJCOPY = objcopy-cris
  7. OBJCOPYFLAGS = -O binary --remove-section=.bss
  8. subdir- := compressed rescue
  9. @@ -14,7 +13,6 @@
  10. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  11. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  12. - $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
  13. $(obj)/zImage: $(obj)/compressed/vmlinux
  14. @cp $< $@
  15. --- a/arch/cris/arch-v10/boot/compressed/Makefile
  16. +++ b/arch/cris/arch-v10/boot/compressed/Makefile
  17. @@ -2,12 +2,10 @@
  18. # arch/cris/arch-v10/boot/compressed/Makefile
  19. #
  20. -CC = gcc-cris -melf $(LINUXINCLUDE)
  21. ccflags-y += -O2
  22. -LD = ld-cris
  23. +LD = $(CROSS_COMPILE)ld -m criself
  24. ldflags-y += -T $(obj)/decompress.ld
  25. OBJECTS = $(obj)/head.o $(obj)/misc.o
  26. -OBJCOPY = objcopy-cris
  27. OBJCOPYFLAGS = -O binary --remove-section=.bss
  28. quiet_cmd_image = BUILD $@
  29. @@ -22,10 +20,10 @@
  30. $(call if_changed,objcopy)
  31. $(obj)/head.o: $(obj)/head.S .config
  32. - @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
  33. + @$(CC) -D__ASSEMBLY__ -traditional -Wa,--em=criself -c $< -o $@
  34. $(obj)/misc.o: $(obj)/misc.c .config
  35. - @$(CC) -D__KERNEL__ -c $< -o $@
  36. + @$(CC) -D__KERNEL__ -Wa,--em=criself -c $< -o $@
  37. $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
  38. $(call if_changed,image)
  39. --- a/arch/cris/arch-v10/boot/compressed/misc.c
  40. +++ b/arch/cris/arch-v10/boot/compressed/misc.c
  41. @@ -5,7 +5,7 @@
  42. * adapted for Linux.
  43. *
  44. * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
  45. - * puts by Nick Holloway 1993, better puts by Martin Mares 1995
  46. + * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
  47. * adaptation for Linux/CRIS Axis Communications AB, 1999
  48. *
  49. */
  50. @@ -99,12 +99,12 @@
  51. static void gzip_mark(void **);
  52. static void gzip_release(void **);
  53. -static void puts(const char *);
  54. +static void putstr(const char *);
  55. /* the "heap" is put directly after the BSS ends, at end */
  56. -extern int end;
  57. -static long free_mem_ptr = (long)&end;
  58. +extern int _end;
  59. +static long free_mem_ptr = (long)&_end;
  60. #include "../../../../../lib/inflate.c"
  61. @@ -139,7 +139,7 @@
  62. /* decompressor info and error messages to serial console */
  63. static void
  64. -puts(const char *s)
  65. +putstr(const char *s)
  66. {
  67. #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
  68. while(*s) {
  69. @@ -209,9 +209,9 @@
  70. static void
  71. error(char *x)
  72. {
  73. - puts("\n\n");
  74. - puts(x);
  75. - puts("\n\n -- System halted\n");
  76. + putstr("\n\n");
  77. + putstr(x);
  78. + putstr("\n\n -- System halted\n");
  79. while(1); /* Halt */
  80. }
  81. @@ -257,14 +257,7 @@
  82. makecrc();
  83. - __asm__ volatile ("move vr,%0" : "=rm" (revision));
  84. - if (revision < 10)
  85. - {
  86. - puts("You need an ETRAX 100LX to run linux 2.6\n");
  87. - while(1);
  88. - }
  89. -
  90. - puts("Uncompressing Linux...\n");
  91. + putstr("Uncompressing Linux...\n");
  92. gunzip();
  93. - puts("Done. Now booting the kernel.\n");
  94. + putstr("Done. Now booting the kernel.\n");
  95. }
  96. --- a/arch/cris/arch-v10/mm/init.c
  97. +++ b/arch/cris/arch-v10/mm/init.c
  98. @@ -184,6 +184,9 @@
  99. free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
  100. }
  101. +void free_initrd_mem(unsigned long start, unsigned long end)
  102. +{
  103. +}
  104. /* Initialize remaps of some I/O-ports. It is important that this
  105. * is called before any driver is initialized.
  106. --- a/arch/cris/arch-v10/boot/compressed/head.S
  107. +++ b/arch/cris/arch-v10/boot/compressed/head.S
  108. @@ -10,13 +10,14 @@
  109. #define ASSEMBLER_MACROS_ONLY
  110. #include <asm/arch/sv_addr_ag.h>
  111. +#include <linux/autoconf.h>
  112. #define RAM_INIT_MAGIC 0x56902387
  113. #define COMMAND_LINE_MAGIC 0x87109563
  114. ;; Exported symbols
  115. - .globl _input_data
  116. + .globl input_data
  117. .text
  118. @@ -26,7 +27,7 @@
  119. ;; We need to initialze DRAM registers before we start using the DRAM
  120. - cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?
  121. + cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
  122. beq dram_init_finished
  123. nop
  124. @@ -36,91 +37,91 @@
  125. ;; Initiate the PA and PB ports
  126. - move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
  127. - move.b r0, [R_PORT_PA_DATA]
  128. + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
  129. + move.b $r0, [R_PORT_PA_DATA]
  130. - move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
  131. - move.b r0, [R_PORT_PA_DIR]
  132. + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
  133. + move.b $r0, [R_PORT_PA_DIR]
  134. - move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
  135. - move.b r0, [R_PORT_PB_DATA]
  136. + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
  137. + move.b $r0, [R_PORT_PB_DATA]
  138. - move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
  139. - move.b r0, [R_PORT_PB_DIR]
  140. + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
  141. + move.b $r0, [R_PORT_PB_DIR]
  142. ;; Setup the stack to a suitably high address.
  143. ;; We assume 8 MB is the minimum DRAM in an eLinux
  144. ;; product and put the sp at the top for now.
  145. - move.d 0x40800000, sp
  146. + move.d 0x40800000, $sp
  147. ;; Figure out where the compressed piggyback image is
  148. ;; in the flash (since we wont try to copy it to DRAM
  149. ;; before unpacking). It is at _edata, but in flash.
  150. ;; Use (_edata - basse) as offset to the current PC.
  151. -basse: move.d pc, r5
  152. - and.d 0x7fffffff, r5 ; strip any non-cache bit
  153. - subq 2, r5 ; compensate for the move.d pc instr
  154. - move.d r5, r0 ; save for later - flash address of 'basse'
  155. - add.d _edata, r5
  156. - sub.d basse, r5 ; r5 = flash address of '_edata'
  157. +basse: move.d $pc, $r5
  158. + and.d 0x7fffffff, $r5 ; strip any non-cache bit
  159. + subq 2, $r5 ; compensate for the move.d pc instr
  160. + move.d $r5, $r0 ; save for later - flash address of 'basse'
  161. + add.d _edata, $r5
  162. + sub.d basse, $r5 ; r5 = flash address of '_edata'
  163. ;; Copy text+data to DRAM
  164. - move.d basse, r1 ; destination
  165. - move.d _edata, r2 ; end destination
  166. -1: move.w [r0+], r3
  167. - move.w r3, [r1+]
  168. - cmp.d r2, r1
  169. + move.d basse, $r1 ; destination
  170. + move.d _edata, $r2 ; end destination
  171. +1: move.w [$r0+], $r3
  172. + move.w $r3, [$r1+]
  173. + cmp.d $r2, $r1
  174. bcs 1b
  175. nop
  176. - move.d r5, [_input_data] ; for the decompressor
  177. + move.d $r5, [input_data] ; for the decompressor
  178. ;; Clear the decompressors BSS (between _edata and _end)
  179. - moveq 0, r0
  180. - move.d _edata, r1
  181. - move.d _end, r2
  182. -1: move.w r0, [r1+]
  183. - cmp.d r2, r1
  184. + moveq 0, $r0
  185. + move.d _edata, $r1
  186. + move.d _end, $r2
  187. +1: move.w $r0, [$r1+]
  188. + cmp.d $r2, $r1
  189. bcs 1b
  190. nop
  191. ;; Save command line magic and address.
  192. - move.d _cmd_line_magic, $r12
  193. + move.d cmd_line_magic, $r12
  194. move.d $r10, [$r12]
  195. - move.d _cmd_line_addr, $r12
  196. + move.d cmd_line_addr, $r12
  197. move.d $r11, [$r12]
  198. ;; Do the decompression and save compressed size in _inptr
  199. - jsr _decompress_kernel
  200. + jsr decompress_kernel
  201. ;; Put start address of root partition in r9 so the kernel can use it
  202. ;; when mounting from flash
  203. - move.d [_input_data], r9 ; flash address of compressed kernel
  204. - add.d [_inptr], r9 ; size of compressed kernel
  205. + move.d [input_data], $r9 ; flash address of compressed kernel
  206. + add.d [inptr], $r9 ; size of compressed kernel
  207. ;; Restore command line magic and address.
  208. - move.d _cmd_line_magic, $r10
  209. + move.d cmd_line_magic, $r10
  210. move.d [$r10], $r10
  211. - move.d _cmd_line_addr, $r11
  212. + move.d cmd_line_addr, $r11
  213. move.d [$r11], $r11
  214. ;; Enter the decompressed kernel
  215. - move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
  216. + move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized
  217. jump 0x40004000 ; kernel is linked to this address
  218. .data
  219. -_input_data:
  220. +input_data:
  221. .dword 0 ; used by the decompressor
  222. -_cmd_line_magic:
  223. +cmd_line_magic:
  224. .dword 0
  225. -_cmd_line_addr:
  226. +cmd_line_addr:
  227. .dword 0
  228. #include "../../lib/hw_settings.S"
  229. --- a/arch/cris/arch-v10/boot/compressed/decompress.ld
  230. +++ b/arch/cris/arch-v10/boot/compressed/decompress.ld
  231. @@ -1,4 +1,4 @@
  232. -OUTPUT_FORMAT(elf32-us-cris)
  233. +OUTPUT_FORMAT(elf32-cris)
  234. MEMORY
  235. {