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

Hello,
The ongoing new uImage format work that has been posted to the list in the form of patches, is now also available from the new-image branch of the u-boot-testing repository at Denx (thanks Wolfgang!).
You can browse the code by going to: http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-testing.git;a=shortlog...
Or you can pull it locally to take a closer look, test, etc, by using: git pull \ git://www.denx.de/git/u-boot-testing.git/ new-image:u-boot-testing/new-image
To recap the current state of development: the above branch contains clean-up and reorganization of the old format code, done in preparation for adding new format handling. As the reorganization touches a lot of common and critical code, people are encouraged to review, test and provide feedback
Current work on new format handling will be posted to the list and made available on the new-image branch as well.
Looking forward to the comments.
Regards, Bartlomiej

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;

Kumar Gala wrote:
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;
Hi Kumar,
In our development code for the new format we need even more data to be passed down to do_bootm_* flavors. We are doing this by passing a pointer to a structure:
- do_bootm_linux (cmdtp, flag, argc, argv, hdr, verify); + do_bootm_linux (cmdtp, flag, argc, argv, &images, verify);
Where images is of type bootm_headers_t, defined like this:
/* * Legacy and FIT format headers used by do_bootm() and do_bootm_<os>() * routines. */ typedef struct bootm_headers { /* * Legacy os image header, if it is a multi component image * then get_ramdisk() and get_fdt() will attempt to get * data from second and third component accordingly. */ image_header_t *legacy_hdr_os; ulong legacy_hdr_valid;
#if defined(CONFIG_FIT) void *fit_hdr_os; /* os FIT image header */ char *fit_uname_os; /* os subimage node unit name */
void *fit_hdr_rd; /* init ramdisk FIT img header */ char *fit_uname_rd; /* init ramdisk node unit name */
#if defined(CONFIG_PPC) void *fit_hdr_fdt; /* FDT blob FIT image header */ char *fit_uname_fdt; /* FDT blob node unit name */ #endif #endif } bootm_headers_t;
Perhaps it would be a good idea to add your load_end to bootm_headers? In any case, let's get back to this once the above mentioned code is posted to the ML.
Regards, Bartlomiej

On Feb 7, 2008, at 10:15 AM, Bartlomiej Sieka wrote:
Kumar Gala wrote:
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;
Hi Kumar,
In our development code for the new format we need even more data to be passed down to do_bootm_* flavors. We are doing this by passing a pointer to a structure:
do_bootm_linux (cmdtp, flag, argc, argv, hdr, verify);
do_bootm_linux (cmdtp, flag, argc, argv, &images, verify);
Where images is of type bootm_headers_t, defined like this:
/*
- Legacy and FIT format headers used by do_bootm() and do_bootm_<os>()
- routines.
*/ typedef struct bootm_headers { /* * Legacy os image header, if it is a multi component image * then get_ramdisk() and get_fdt() will attempt to get * data from second and third component accordingly. */ image_header_t *legacy_hdr_os; ulong legacy_hdr_valid;
#if defined(CONFIG_FIT) void *fit_hdr_os; /* os FIT image header */ char *fit_uname_os; /* os subimage node unit name */
void *fit_hdr_rd; /* init ramdisk FIT img header
*/ char *fit_uname_rd; /* init ramdisk node unit name */
#if defined(CONFIG_PPC) void *fit_hdr_fdt; /* FDT blob FIT image header */ char *fit_uname_fdt; /* FDT blob node unit name */ #endif #endif } bootm_headers_t;
Perhaps it would be a good idea to add your load_end to bootm_headers? In any case, let's get back to this once the above mentioned code is posted to the ML.
sounds good, any eta on when this patch will show up?
- k

On Feb 7, 2008, at 10:29 AM, Kumar Gala wrote:
On Feb 7, 2008, at 10:15 AM, Bartlomiej Sieka wrote:
Kumar Gala wrote:
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;
Hi Kumar,
In our development code for the new format we need even more data to be passed down to do_bootm_* flavors. We are doing this by passing a pointer to a structure:
do_bootm_linux (cmdtp, flag, argc, argv, hdr, verify);
do_bootm_linux (cmdtp, flag, argc, argv, &images,
verify);
Where images is of type bootm_headers_t, defined like this:
/*
- Legacy and FIT format headers used by do_bootm() and
do_bootm_<os>()
- routines.
*/ typedef struct bootm_headers { /* * Legacy os image header, if it is a multi component image * then get_ramdisk() and get_fdt() will attempt to get * data from second and third component accordingly. */ image_header_t *legacy_hdr_os; ulong legacy_hdr_valid;
#if defined(CONFIG_FIT) void *fit_hdr_os; /* os FIT image header */ char *fit_uname_os; /* os subimage node unit name */
void *fit_hdr_rd; /* init ramdisk FIT img header
*/ char *fit_uname_rd; /* init ramdisk node unit name */
#if defined(CONFIG_PPC) void *fit_hdr_fdt; /* FDT blob FIT image header */ char *fit_uname_fdt; /* FDT blob node unit name */ #endif #endif } bootm_headers_t;
Perhaps it would be a good idea to add your load_end to bootm_headers? In any case, let's get back to this once the above mentioned code is posted to the ML.
sounds good, any eta on when this patch will show up?
Any update on the patch?
One of the ideas I have is I'd like to see if we can make it possible to do the equiv of bootm via a series of commands from the u-boot command line.
For example, I don't believe we have a way today to just decompress a uImage file.
- k

In message F8B63E55-0B77-44DD-AAC4-0EC32409B413@kernel.crashing.org you wrote:
For example, I don't believe we have a way today to just decompress a uImage file.
Um... it you try hard enough there is one. See http://www.denx.de/wiki/view/DULG/HowCanILoadAndUncompressACompressedImage
Best regards,
Wolfgang Denk

On Feb 12, 2008, at 4:59 PM, Wolfgang Denk wrote:
In message <F8B63E55-0B77-44DD- AAC4-0EC32409B413@kernel.crashing.org> you wrote:
For example, I don't believe we have a way today to just decompress a uImage file.
Um... it you try hard enough there is one. See http://www.denx.de/wiki/view/DULG/HowCanILoadAndUncompressACompressedImage
Hmm, do you have objections to a imload command? [clearly you better know what you are doing]
- k

In message 06C5CD8F-435A-41BA-99E5-36CD8F2C3B76@kernel.crashing.org you wrote:
For example, I don't believe we have a way today to just decompress a uImage file.
Um... it you try hard enough there is one. See http://www.denx.de/wiki/view/DULG/HowCanILoadAndUncompressACompressedImage
Hmm, do you have objections to a imload command? [clearly you better know what you are doing]
What exactly would imload do?
Best regards,
Wolfgang Denk

Kumar Gala wrote: [...]
On Feb 7, 2008, at 10:15 AM, Bartlomiej Sieka wrote:
Kumar Gala wrote:
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.
[...]
In our development code for the new format we need even more data to be passed down to do_bootm_* flavors. We are doing this by passing a pointer to a structure:
do_bootm_linux (cmdtp, flag, argc, argv, hdr, verify);
do_bootm_linux (cmdtp, flag, argc, argv, &images, verify);
[...]
Perhaps it would be a good idea to add your load_end to bootm_headers? In any case, let's get back to this once the above mentioned code is posted to the ML.
sounds good, any eta on when this patch will show up?
Any update on the patch?
Hi Kumar,
Sorry for a delayed reply, I've been quite busy recently.
As to the patch adding passing more information to do_bootm_* -- it's a logical part of a bigger patchset that is not yet ready for posting. Please give me a few more days to get it in shape.
One of the ideas I have is I'd like to see if we can make it possible to do the equiv of bootm via a series of commands from the u-boot command line.
For example, I don't believe we have a way today to just decompress a uImage file.
Apart for using bootm machinery and the autostart env. variable (as pointed to by Wolfgang), there isn't a direct way to do this (like a U-Boot command for example).
Regards, Bartlomiej
participants (3)
-
Bartlomiej Sieka
-
Kumar Gala
-
Wolfgang Denk