100-compile_fixes.patch 8.0 KB

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