Преглед на файлове

Merge branch 'next' of git://git.denx.de/u-boot-nios

Wolfgang Denk преди 14 години
родител
ревизия
6050c754b0
променени са 3 файла, в които са добавени 11 реда и са изтрити 7 реда
  1. 5 6
      arch/nios2/cpu/cpu.c
  2. 5 0
      arch/nios2/include/asm/system.h
  3. 1 1
      arch/nios2/lib/bootm.c

+ 5 - 6
arch/nios2/cpu/cpu.c

@@ -40,11 +40,10 @@ int checkcpu (void)
 	return (0);
 	return (0);
 }
 }
 
 
-
-int do_reset (void)
+int do_reset(void)
 {
 {
-	void (*rst)(void) = (void(*)(void))CONFIG_SYS_RESET_ADDR;
-	disable_interrupts ();
-	rst();
-	return(0);
+	disable_interrupts();
+	/* indirect call to go beyond 256MB limitation of toolchain */
+	nios2_callr(CONFIG_SYS_RESET_ADDR);
+	return 0;
 }
 }

+ 5 - 0
arch/nios2/include/asm/system.h

@@ -56,4 +56,9 @@
 	((flags & NIOS2_STATUS_PIE_MSK) == 0x0);	\
 	((flags & NIOS2_STATUS_PIE_MSK) == 0x0);	\
 })
 })
 
 
+/* indirect call to go beyond 256MB limitation of toolchain */
+#define nios2_callr(addr) __asm__ __volatile__ (	\
+	"callr	%0"					\
+	: : "r" (addr))
+
 #endif /* __ASM_NIOS2_SYSTEM_H */
 #endif /* __ASM_NIOS2_SYSTEM_H */

+ 1 - 1
arch/nios2/lib/bootm.c

@@ -42,7 +42,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
 	if (boot_get_fdt(flag, argc, argv, images, &of_flat_tree, &of_size))
 	if (boot_get_fdt(flag, argc, argv, images, &of_flat_tree, &of_size))
 		return 1;
 		return 1;
 #endif
 #endif
-	if (!of_flat_tree)
+	if (!of_flat_tree && argc > 3)
 		of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
 		of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
 	if (of_flat_tree)
 	if (of_flat_tree)
 		initrd_end = (ulong)of_flat_tree;
 		initrd_end = (ulong)of_flat_tree;