[U-Boot] [PATCH][for 1.3.4] Fix fallout from autostart revert

Kumar Gala galak at kernel.crashing.org
Mon Aug 11 16:20:53 CEST 2008


The autostart revert caused a bit of duplicated code as well as
code that was using images->autostart that needs to get removed so
we can build again.

Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
---
 common/cmd_bootm.c     |    5 ++---
 common/image.c         |   17 -----------------
 lib_arm/bootm.c        |    6 +-----
 lib_avr32/bootm.c      |    6 +-----
 lib_blackfin/bootm.c   |    6 +-----
 lib_i386/bootm.c       |    6 +-----
 lib_m68k/bootm.c       |    5 +----
 lib_microblaze/bootm.c |    6 +-----
 lib_mips/bootm.c       |    6 +-----
 lib_nios2/bootm.c      |    6 +-----
 lib_ppc/bootm.c        |    5 +----
 lib_sh/bootm.c         |    6 +-----
 lib_sparc/bootm.c      |    6 +-----
 13 files changed, 13 insertions(+), 73 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 2dffdfa..5295969 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -361,10 +361,9 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	show_boot_progress (-9);
 #ifdef DEBUG
 	puts ("\n## Control returned to monitor - resetting...\n");
-	if (images.autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 #endif
-	if (!images.autostart && iflag)
+	if (iflag)
 		enable_interrupts();

 	return 1;
diff --git a/common/image.c b/common/image.c
index 1807348..6d2ce32 100644
--- a/common/image.c
+++ b/common/image.c
@@ -189,23 +189,6 @@ int image_check_dcrc (image_header_t *hdr)
 	return (dcrc == image_get_dcrc (hdr));
 }

-void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
-{
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-	while (len > 0) {
-		size_t tail = (len > chunksz) ? chunksz : len;
-		WATCHDOG_RESET ();
-		memmove (to, from, tail);
-		to += tail;
-		from += tail;
-		len -= tail;
-	}
-#else	/* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-	memmove (to, from, len);
-#endif	/* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-}
-#endif /* USE_HOSTCC */
-
 /**
  * image_multi_count - get component (sub-image) count
  * @hdr: pointer to the header of the multi component image
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c
index b838c37..955a1ae 100644
--- a/lib_arm/bootm.c
+++ b/lib_arm/bootm.c
@@ -137,9 +137,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	setup_end_tag (bd);
 #endif

-	if (!images->autostart)
-		return ;
-
 	/* we assume that the kernel is in place */
 	printf ("\nStarting kernel ...\n\n");

@@ -157,8 +154,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }

diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c
index 5ff8c79..60e6b36 100644
--- a/lib_avr32/bootm.c
+++ b/lib_avr32/bootm.c
@@ -221,9 +221,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	params = setup_ethernet_tags(params);
 	setup_end_tag(params);

-	if (!images->autostart)
-		return ;
-
 	printf("\nStarting kernel at %p (params at %p)...\n\n",
 	       theKernel, params_start);

@@ -234,7 +231,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }
diff --git a/lib_blackfin/bootm.c b/lib_blackfin/bootm.c
index ef4b112..54f69a9 100644
--- a/lib_blackfin/bootm.c
+++ b/lib_blackfin/bootm.c
@@ -40,9 +40,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	char	*cmdline;
 	ulong	ep = 0;

-	if (!images->autostart)
-		return;
-
 #ifdef SHARED_RESOURCES
 	swap_to(FLASH);
 #endif
@@ -74,6 +71,5 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return;

  error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 }
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
index d959107..452eef7 100644
--- a/lib_i386/bootm.c
+++ b/lib_i386/bootm.c
@@ -84,9 +84,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],

 	}

-	if (!images->autostart)
-		return ;
-
 #ifdef DEBUG
 	printf ("## Transferring control to Linux (at address %08x) ...\n",
 		(u32)base_ptr);
@@ -100,7 +97,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }
diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c
index 61f1a36..b45203d 100644
--- a/lib_m68k/bootm.c
+++ b/lib_m68k/bootm.c
@@ -129,8 +129,6 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,

 	show_boot_progress (15);

-	if (!images->autostart)
-		return;
 	/*
 	 * Linux Kernel Parameters (passing board info data):
 	 *   r3: ptr to board info data
@@ -144,8 +142,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
 	return ;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return ;
 }

diff --git a/lib_microblaze/bootm.c b/lib_microblaze/bootm.c
index 30a03ef..68edcdb 100644
--- a/lib_microblaze/bootm.c
+++ b/lib_microblaze/bootm.c
@@ -67,15 +67,11 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 		(ulong) theKernel);
 #endif

-	if (!images->autostart)
-		return ;
-
 	theKernel (commandline);
 	/* does not return */
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }
diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c
index 5c46a5a..53e8e19 100644
--- a/lib_mips/bootm.c
+++ b/lib_mips/bootm.c
@@ -120,9 +120,6 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 		linux_env_set("eth1addr", cp);
 	}

-	if (!images->autostart)
-		return ;
-
 	/* we assume that the kernel is in place */
 	printf ("\nStarting kernel ...\n\n");

@@ -131,8 +128,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }

diff --git a/lib_nios2/bootm.c b/lib_nios2/bootm.c
index 01f4e87..18cf773 100644
--- a/lib_nios2/bootm.c
+++ b/lib_nios2/bootm.c
@@ -50,9 +50,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	}
 	void (*kernel)(void) = (void (*)(void))ep;

-	if (!images->autostart)
-		return ;
-
 	/* For now we assume the Microtronix linux ... which only
 	 * needs to be called ;-)
 	 */
@@ -61,7 +58,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 81803dd..cbe5592 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -277,8 +277,6 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
 	unlock_ram_in_cache();
 #endif
-	if (!images->autostart)
-		return ;

 #if defined(CONFIG_OF_LIBFDT)
 	if (of_flat_tree) {	/* device tree; boot new style */
@@ -311,8 +309,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return ;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return ;
 }

diff --git a/lib_sh/bootm.c b/lib_sh/bootm.c
index dd32a3e..4ee7ff3 100644
--- a/lib_sh/bootm.c
+++ b/lib_sh/bootm.c
@@ -83,9 +83,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	}
 	void (*kernel) (void) = (void (*)(void))ep;

-	if (!images->autostart)
-		return ;
-
 	/* Setup parameters */
 	memset(PARAM, 0, 0x1000);	/* Clear zero page */
 	strcpy(COMMAND_LINE, bootargs);
@@ -95,7 +92,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	return;

 error:
-	if (images->autostart)
-		do_reset (cmdtp, flag, argc, argv);
+	do_reset (cmdtp, flag, argc, argv);
 	return;
 }
diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c
index 8900b2e..b1a3d98 100644
--- a/lib_sparc/bootm.c
+++ b/lib_sparc/bootm.c
@@ -204,9 +204,6 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 	bootargs = getenv("bootargs");
 	prepare_bootargs(bootargs);

-	if (!images->autostart)
-		return;
-
 	/* turn on mmu & setup context table & page table for process 0 (kernel) */
 	srmmu_init_cpu((unsigned int)kernel);

@@ -220,7 +217,6 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
 	while (1) ;

       error:
-	if (images->autostart)
-		do_reset(cmdtp, flag, argc, argv);
+	do_reset(cmdtp, flag, argc, argv);
 	return;
 }
-- 
1.5.5.1




More information about the U-Boot mailing list