[U-Boot-Users] [new uImage] Code available on new-image branch of u-boot-testing repo

Kumar Gala galak at kernel.crashing.org
Thu Feb 7 16:30:58 CET 2008


Here is a rough patch to common/cmd_bootm.c that passed load_end down to
the do_bootm_* commands.  I haven't updated the lib_*/bootm.c at this
point.

I think this is useful to help the bootm commands know exactly what memory
is used and what is freed.  There are situations that I'd like to get
working with the new code like being able to boot a kernel at 256M and
have the ramdisk and device tree exist about this 256M base.

- k

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 2ddb191..b36d09e 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -90,7 +90,7 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 typedef void boot_os_fn (cmd_tbl_t *cmdtp, int flag,
 			int argc, char *argv[],
 			image_header_t *hdr,	/* of image to boot */
-			int verify);		/* getenv("verify")[0] != 'n' */
+			int verify, ulong load_end);	/* getenv("verify")[0] != 'n' */

 extern boot_os_fn do_bootm_linux;
 static boot_os_fn do_bootm_netbsd;
@@ -234,36 +234,36 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #ifdef CONFIG_SILENT_CONSOLE
 	    fixup_silent_linux();
 #endif
-	    do_bootm_linux (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_linux (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;

 	case IH_OS_NETBSD:
-	    do_bootm_netbsd (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_netbsd (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;

 #ifdef CONFIG_LYNXKDI
 	case IH_OS_LYNXOS:
-	    do_bootm_lynxkdi (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_lynxkdi (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;
 #endif

 	case IH_OS_RTEMS:
-	    do_bootm_rtems (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_rtems (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;

 #if defined(CONFIG_CMD_ELF)
 	case IH_OS_VXWORKS:
-	    do_bootm_vxworks (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_vxworks (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;

 	case IH_OS_QNX:
-	    do_bootm_qnxelf (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_qnxelf (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;
 #endif

 #ifdef CONFIG_ARTOS
 	case IH_OS_ARTOS:
-	    do_bootm_artos (cmdtp, flag, argc, argv, hdr, verify);
+	    do_bootm_artos (cmdtp, flag, argc, argv, hdr, verify, load_end);
 	    break;
 #endif
 	}
@@ -626,7 +626,7 @@ static void fixup_silent_linux ()

 static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
 			    int argc, char *argv[],
-			    image_header_t *hdr, int verify)
+			    image_header_t *hdr, int verify, ulong load_end)
 {
 	void (*loader)(bd_t *, image_header_t *, char *, char *);
 	image_header_t *img_addr;
@@ -702,7 +702,7 @@ static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
 #ifdef CONFIG_LYNXKDI
 static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
 			     int argc, char *argv[],
-			     image_header_t *hdr, int verify)
+			     image_header_t *hdr, int verify, ulong load_end)
 {
 	lynxkdi_boot (hdr);
 }
@@ -710,7 +710,7 @@ static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,

 static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
 			   int argc, char *argv[],
-			   image_header_t *hdr, int verify)
+			   image_header_t *hdr, int verify, ulong load_end)
 {
 	void (*entry_point)(bd_t *);

@@ -731,7 +731,7 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
 #if defined(CONFIG_CMD_ELF)
 static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,
 			     int argc, char *argv[],
-			     image_header_t *hdr, int verify)
+			     image_header_t *hdr, int verify, ulong load_end)
 {
 	char str[80];

@@ -742,7 +742,7 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,

 static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
 			    int argc, char *argv[],
-			    image_header_t *hdr, int verify)
+			    image_header_t *hdr, int verify, ulong load_end)
 {
 	char *local_args[2];
 	char str[16];
@@ -757,7 +757,7 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
 #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
 static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
 			   int argc, char *argv[],
-			   image_header_t *hdr, int verify)
+			   image_header_t *hdr, int verify, ulong load_end)
 {
 	ulong top;
 	char *s, *cmdline;




More information about the U-Boot mailing list