BOOT: Add "bootz" command to boot Linux zImage
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.
--- common/Makefile | 1 + common/cmd_bootm.c | 29 +-------- common/cmd_bootz.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++++ common/image.c | 25 ++++++++ include/image.h | 8 +++ 5 files changed, 210 insertions(+), 28 deletions(-) create mode 100644 common/cmd_bootz.c
V2: Use CONFIG_BOOTZ_MAX_KERNEL_LMB_SIZE to reserve kernel LMB
V3: Compute the LMB size at runtime (obsoletes V2)
Move shared code to image.c/image.h
Sync with latest U-Boot
Note: The FDT works ok, but I don't know about ramdisk, this might be a subject of subsequent patch (to support raw ramdisk image).
common/Makefile +1 -0
@@ -39,6 +39,7 @@ COBJS-y += xyzModem.o # core command COBJS-y += cmd_boot.o COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o +COBJS-$(CONFIG_CMD_BOOTZ) += cmd_bootz.o COBJS-y += cmd_help.o COBJS-y += cmd_nvedit.o COBJS-y += cmd_version.o
common/cmd_bootm.c +1 -28
@@ -160,35 +160,8 @@ static boot_os_fn *boot_os[] = {bootm_headers_t images;/* pointers to os/initrd/fdt images */ -/* Allow for arch specific config before we boot */ -void __arch_preboot_os (void ) -{ -/* please define platform specific arch_preboot_os() */ -} -void arch_preboot_os (void ) __attribute__((weak,alias ("__arch_preboot_os" ))); -#define IH_INITRD_ARCH IH_ARCH_DEFAULT -static void bootm_start_lmb (void ) -{ -#ifdef CONFIG_LMB -ulong mem_start; -phys_size_t mem_size; - -lmb_init (&images.lmb); - - mem_start =getenv_bootm_low (); - mem_size =getenv_bootm_size (); - -lmb_add (&images.lmb, (phys_addr_t )mem_start, mem_size); - -arch_lmb_reserve (&images.lmb); -board_lmb_reserve (&images.lmb); -#else -# define lmb_reserve (lmb, base, size) -#endif -} -static int bootm_start (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {void *os_hdr;
@@ -197,7 +170,7 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]memset ((void *)&images,0 ,sizeof (images)); images.verify =getenv_yesno ("verify" ); -bootm_start_lmb (); +boot_start_lmb (&images);/* get kernel image header, start address and length */ os_hdr = boot_get_kernel(cmdtp, flag, argc, argv,
common/cmd_bootz.c new file +175 -0
175 lines not on this page · raw message
common/image.c +25 -0
@@ -3190,3 +3190,28 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch, }#endif /* USE_HOSTCC */ #endif /* CONFIG_FIT */ + +#ifdef CONFIG_LMB +void boot_start_lmb (bootm_headers_t *images) +{ +ulong mem_start; +phys_size_t mem_size; + +lmb_init (&images->lmb); + + mem_start =getenv_bootm_low (); + mem_size =getenv_bootm_size (); + +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); + +arch_lmb_reserve (&images->lmb); +board_lmb_reserve (&images->lmb); +} +#endif + +/* Allow for arch specific config before we boot */ +void __arch_preboot_os (void ) +{ +/* please define platform specific arch_preboot_os() */ +} +void arch_preboot_os (void ) __attribute__((weak,alias ("__arch_preboot_os" )));
include/image.h +8 -0
@@ -486,6 +486,14 @@ void image_multi_getimg(const image_header_t *hdr, ulong idx,void image_print_contents (const void *hdr); +#ifdef CONFIG_LMB +void boot_start_lmb (bootm_headers_t *images); +#else +static inline void boot_start_lmb (bootm_headers_t *image) { } +#endif + +extern void arch_preboot_os (void ); +#ifndef USE_HOSTCC static inline int image_check_target_arch (const image_header_t *hdr) {
Signature · 1 line
1.7.9
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Marek Vasut,
Quoted 3 lines · In message <[email protected]> you wrote:
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
I have but a few formal questions / issues.
...
Quoted 7 lines
common/cmd_bootm.c +0
-1@@ -160,35 +160,8 @@ static boot_os_fn *boot_os[] = {bootm_headers_t images;/* pointers to os/initrd/fdt images */ -/* Allow for arch specific config before we boot */
common/cmd_bootm.c static boot_os_fn *boot_os[] = { · line 173
Quoted 10 lines
common/cmd_bootm.c +0
-8-void __arch_preboot_os (void ) -{ -/* please define platform specific arch_preboot_os() */ -} -void arch_preboot_os (void ) __attribute__((weak,alias ("__arch_preboot_os" ))); -#define IH_INITRD_ARCH IH_ARCH_DEFAULT -static void bootm_start_lmb (void ) -{
...
Note: this is bootm (or boot*) related code.
common/image.c static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
Quoted 3 lines
common/image.c +0
-0@@ -3190,3 +3190,28 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
This is a file that deals with U-Boot images etc. It is in no way related to any of the "boot*" commands.
Quoted 14 lines
common/image.c +14
-0+#ifdef CONFIG_LMB +void boot_start_lmb (bootm_headers_t *images) +{ +ulong mem_start; +phys_size_t mem_size; + +lmb_init (&images->lmb); + + mem_start =getenv_bootm_low (); + mem_size =getenv_bootm_size (); + +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); + +arch_lmb_reserve (&images->lmb);
common/image.c static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch, · line 3217
Quoted 10 lines
common/image.c +10
-0+ board_lmb_reserve(&images->lmb); +} +#endif + +/* Allow for arch specific config before we boot */ +void __arch_preboot_os (void ) +{ +/* please define platform specific arch_preboot_os() */ +} +void arch_preboot_os (void ) __attribute__((weak,alias ("__arch_preboot_os" )));
Putting this code here makes no sense. You could chose any othewr random file as well.
Quoted 5 lines
include/image.h +0
-0
include/image.h void image_multi_getimg(const image_header_t *hdr, ulong idx, · line 495
Quoted 10 lines
include/image.h +7
-0@@ -486,6 +486,14 @@ void image_multi_getimg(const image_header_t *hdr, ulong idx,void image_print_contents (const void *hdr); +#ifdef CONFIG_LMB +void boot_start_lmb (bootm_headers_t *images); +#else +static inline void boot_start_lmb (bootm_headers_t *image) { } +#endif + +extern void arch_preboot_os (void );
Sorry, no. image.[ch] is definitely not the right place for this stuff.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de How many QA engineers does it take to screw in a lightbulb? 3: 1 to screw it in and 2 to say "I told you so" when it doesn't work.
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Wolfgang Denk,
Quoted 7 lines
Dear Marek Vasut,
Quoted 2 lines · In message <[email protected]> you wrote:
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
I have but a few formal questions / issues.
I had a dilemma about the image.[ch] indeed. I was quite unsure where to put those, can you suggest proper location? I didn't want to create new file only for that matter.
Quoted 83 lines
...
Quoted 16 lines
common/cmd_bootm.c +0
-6@@ -160,35 +160,8 @@ static boot_os_fn *boot_os[] = {bootm_headers_t images;/* pointers to os/initrd/fdt images */ -/* Allow for arch specific config before we boot */ -void __arch_preboot_os (void ) -{ -/* please define platform specific arch_preboot_os() */ -} -void arch_preboot_os(void) __attribute__((weak,
alias("__arch_preboot_os"))); -#define
IH_INITRD_ARCHIH_ARCH_DEFAULTcommon/cmd_bootm.c static boot_os_fn *boot_os[] = { · line 173
Quoted 2 lines
common/cmd_bootm.c +0
-2-static void bootm_start_lmb (void ) -{...
Note: this is bootm (or boot*) related code.
common/image.c static int fit_check_ramdisk(const void *fit, int · line 3190
Quoted 4 lines
common/image.c +0
-0@@ -3190,3 +3190,28 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,This is a file that deals with U-Boot images etc. It is in no way related to any of the "boot*" commands.
Quoted 15 lines
common/image.c +15
-0+#ifdef CONFIG_LMB +void boot_start_lmb (bootm_headers_t *images) +{ +ulong mem_start; +phys_size_t mem_size; + +lmb_init (&images->lmb); + + mem_start =getenv_bootm_low (); + mem_size =getenv_bootm_size (); + +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); + +arch_lmb_reserve (&images->lmb); +board_lmb_reserve (&images->lmb);common/image.c static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
Quoted 10 lines
common/image.c +9
-0+} +#endif + +/* Allow for arch specific config before we boot */ +void __arch_preboot_os (void ) +{ +/* please define platform specific arch_preboot_os() */ +} +void arch_preboot_os (void ) __attribute__((weak,alias ("__arch_preboot_os" )));Putting this code here makes no sense. You could chose any othewr random file as well.
Quoted 6 lines
include/image.h +0
-0@@ -486,6 +486,14 @@ void image_multi_getimg(const image_header_t *hdr, ulong idx,include/image.h void image_multi_getimg(const image_header_t *hdr, · line 496
Quoted 10 lines
include/image.h +7
-0void image_print_contents (const void *hdr); +#ifdef CONFIG_LMB +void boot_start_lmb (bootm_headers_t *images); +#else +static inline void boot_start_lmb (bootm_headers_t *image) { } +#endif + +extern void arch_preboot_os (void );Sorry, no. image.[ch] is definitely not the right place for this stuff.
Quoted 3 lines
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Marek Vasut,
btw - there is no need to full-quote.
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 2 lines
I have but a few formal questions / issues.
I had a dilemma about the image.[ch] indeed. I was quite unsure where to put those, can you suggest proper location? I didn't want to create new file only for that matter.
Sorry, I have no good idea either.
If you omit comment header and includes, common/cmd_bootz.c adds less than 10% to common/cmd_bootm.c - unless we extrace more common code from other boot* commands, you might even add it to cmd_bootm.c (with #ifdef's).
While we are at it:
+ zi = (struct zimage_header *)images->ep;
+
+ if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC) {
Do we have to care about endianess here?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Now here's something you're really going to like!" - Rocket J. Squirrel
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Wolfgang Denk,
Quoted 21 lines
Dear Marek Vasut,
btw - there is no need to full-quote.
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 1 line
I have but a few formal questions / issues.
I had a dilemma about the image.[ch] indeed. I was quite unsure where to put those, can you suggest proper location? I didn't want to create new file only for that matter.
Sorry, I have no good idea either.
If you omit comment header and includes,
common/cmd_bootz.cadds less than 10% tocommon/cmd_bootm.c- unless we extrace more common code from other boot* commands, you might even add it tocmd_bootm.c(with #ifdef's).While we are at it:
common/cmd_bootz.c line 90
Quoted 3 lines
common/cmd_bootz.c new file +3
-0+ zi = (struct zimage_header *)images->ep; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) {
This gave me an idea ... this might be how to check for zImage inside bootm and be done with it. Simply squash those two together.
Quoted 2 lines
Do we have to care about endianess here?
We should make bootz arm-specific until more people (with different arches) step up and verify it works for them.
Quoted 4 lines
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Hi Marek, Wolfgang,
Quoted 11 lines · Marek Vasut
Dear Wolfgang Denk,
Quoted 6 lines
While we are at it:
+ ? ? zi = (struct
zimage_header*)images->ep; +
+ ? ? if (zi->zi_magic!=LINUX_ARM_ZIMAGE_MAGIC) {This gave me an idea ... this might be how to check for zImage inside bootm and be done with it. Simply squash those two together.
While we are on the subject - Do either of you think support for the x86 zimage/bzImage format should end up here in common code? Not that the x86 (b)zImage header is unique (see arch/x86/include/asm/bootparam.h) and decompressing vmlinux out of an x86 (b)zImage is non-trivial given the header and decompression stub
Regards,
Graeme
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Graeme Russ,
Quoted 3 lines · In message <CALButCLDyKZnsZqGXhxcu-UEv9nySg77f1XwaUvmgb9gc7BPNQ@mail.gmail.com>…
While we are on the subject - Do either of you think support for the x86 zimage/bzImage format should end up here in common code? Not that the x86
The common coe should be architecture-neutral. It might cann architecture-specific routines, which may (or may not) get added later, depending if somebody cares about adding such support.
Quoted 3 lines
(b)zImage header is unique (see
arch/x86/include/asm/bootparam.h) and decompressing vmlinux out of an x86 (b)zImage is non-trivial given the header and decompression stub
I have to admit that I never understood the fuzz about being able to boot zImages. I see more disadvanatges than advantages for this, but some ARM people go frenzy when this topic pops up - see recent discussions about removal of uImage support on the AKML.
Frankly: I see no benefit in adding x86 support.
I see no benefit in adding ARM support either, but YMMV...
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Prof: So the American government went to IBM to come up with a
data encryption standard and they came up with ...
Student: EBCDIC!PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Hi Wolfgang,
Quoted 11 lines · Wolfgang Denk
Dear Graeme Russ,
Quoted 3 lines · In message <CALButCLDyKZnsZqGXhxcu-UEv9nySg77f1XwaUvmgb9gc7BPNQ@mail.gmail.com>…
While we are on the subject - Do either of you think support for the x86 zimage/bzImage format should end up here in common code? Not that the x86
The common coe should be architecture-neutral. ?It might cann architecture-specific routines, which may (or may not) get added later, depending if somebody cares about adding such support.
Quoted 6 lines
Quoted 3 lines
(b)zImage header is unique (see
arch/x86/include/asm/bootparam.h) and decompressing vmlinux out of an x86 (b)zImage is non-trivial given the header and decompression stubI have to admit that I never understood the fuzz about being able to boot zImages. ?I see more disadvanatges than advantages for this, but
Ah grasshopper - remember from whence Linux evolved ;)
Bootable zImage for x86 came from the desire to write the image to a floppy (using dd) and have it boot. This was way before GRUB and LILO
I remember the days of the kernel on one floppy and the root fs on a second floppy and you would be prompted to change disks :)
And then the kernel grew too big, so it got compressed and to still allow booting from a floppy, the decompression stub was added to the kernel image
And then came loadlin so you could boot linux from DOS (or Winodws) and the header was used to tell loadlin where to load the kernel in memory - but the decompression routine was already in the zImage and DOS ran in real-mode so there was no need to change how it booted
And then the kernel grew some more and the limitations of the zImage format were reached - bzImage (Big zImage) format was born, but the header and decompression stub pretty much remained intact so existing bootloaders did need to jump through hoops to handle the change
And in the mix is loadable modules and initial ram disks et al.
And then someone decided it would be a pretty neat idea to shove linux into a tiny little box running an ARM processor :P
Quoted 4 lines
some ARM people go frenzy when this topic pops up - see recent discussions about removal of uImage support on the AKML.
Frankly: I see no benefit in adding x86 support.
Ouch! - Do you mean in common code or in general?
Quoted 1 line
I see no benefit in adding ARM support either, but YMMV...
Hmm, methinks the Android guys might have a bone to pick with that statement ;)
Regards,
Graeme
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Graeme Russ,
Quoted 4 lines · In message <CALButCL4xxwfaLf1XDpsRgJV4V8YHYnX_dVD9bSU3AXuhYzsig@mail.gmail.com>…
Quoted 2 lines
Frankly: I see no benefit in adding x86 support.
Ouch! - Do you mean in common code or in general?
I mean: I see no benefit in adding support for a "bootz" command for x86 systems - and I don't see it on Power Architecture either.
Quoted 4 lines
Quoted 1 line
I see no benefit in adding ARM support either, but YMMV...
Hmm, methinks the Android guys might have a bone to pick with that statement ;)
Andoid? What or who is that? ;-)
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "It's like deja vu all over again." - Yogi Berra
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Wolfgang Denk,
Quoted 3 lines
Dear Graeme Russ,
In message
Quoted 6 lines · <CALButCL4xxwfaLf1XDpsRgJV4V8YHYnX_dVD9bSU3AXuhYzsig@mail.gmail.com> you wrote:
Quoted 3 lines
Quoted 1 line
Frankly: I see no benefit in adding x86 support.
Ouch! - Do you mean in common code or in general?
I mean: I see no benefit in adding support for a "bootz" command for x86 systems - and I don't see it on Power Architecture either.
Well x86 might benefit from it ;-)
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
I see no benefit in adding ARM support either, but YMMV...
Hmm, methinks the Android guys might have a bone to pick with that statement ;)
Andoid? What or who is that? ;-)
Google SpyOS :)
Quoted 4 lines
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
In reply to Wolfgang DenkDear Wolfgang Denk,
Quoted 3 lines
Dear Graeme Russ,
In message <CALButCLDyKZnsZqGXhxcu-
Quoted 7 lines · [email protected]> you wrote:
Quoted 2 lines
While we are on the subject - Do either of you think support for the x86 zimage/bzImage format should end up here in common code? Not that the x86
The common coe should be architecture-neutral. It might cann architecture-specific routines, which may (or may not) get added later, depending if somebody cares about adding such support.
Quoted 8 lines
Quoted 3 lines
(b)zImage header is unique (see
arch/x86/include/asm/bootparam.h) and decompressing vmlinux out of an x86 (b)zImage is non-trivial given the header and decompression stubI have to admit that I never understood the fuzz about being able to boot zImages. I see more disadvanatges than advantages for this, but some ARM people go frenzy when this topic pops up - see recent discussions about removal of uImage support on the AKML.
Sure, but let's try to offer them a compromise. Everyone will be happy that way at least to some extent.
Quoted 8 lines
Frankly: I see no benefit in adding x86 support.
I see no benefit in adding ARM support either, but YMMV...
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Marek Vasut,
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines
I have to admit that I never understood the fuzz about being able to boot zImages. I see more disadvanatges than advantages for this, but some ARM people go frenzy when this topic pops up - see recent discussions about removal of uImage support on the AKML.
Sure, but let's try to offer them a compromise. Everyone will be happy that way at least to some extent.
I have nothing against compromizes. But are you soure about the "everyone" in the second sentence? I think we know a few guys who mightnot.
And actually it might backfire as well - I see JC argumenting: now they (finally!) support the one true image format, no let's throw out their stupid uImage support, nobody needs this any more.
Just like nobody needs to be able to use a ramdisk image from NOR flash without loading it to RAM before, etc.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de G's Third Law: In spite of all evidence to the contra- ry, the entire universe is composed of only two basic substances: magic and bullshit. H's Dictum: There is no magic ...
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Wolfgang Denk,
Quoted 8 lines
Dear Marek Vasut,
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 4 lines
I have to admit that I never understood the fuzz about being able to boot zImages. I see more disadvanatges than advantages for this, but some ARM people go frenzy when this topic pops up - see recent discussions about removal of uImage support on the AKML.
Quoted 6 lines
Quoted 2 lines
Sure, but let's try to offer them a compromise. Everyone will be happy that way at least to some extent.
I have nothing against compromizes. But are you soure about the "everyone" in the second sentence? I think we know a few guys who mightnot.
That's like in calculus, the epsilon might be infinitelly small :)
Quoted 4 lines
And actually it might backfire as well - I see JC argumenting: now they (finally!) support the one true image format, no let's throw out their stupid uImage support, nobody needs this any more.
I believe there is a way to avoid this.
Quoted 3 lines
Just like nobody needs to be able to use a ramdisk image from NOR flash without loading it to RAM before, etc.
:-)
Quoted 3 lines
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
In reply to Marek VasutDear Marek Vasut,
Quoted 7 lines · In message <[email protected]> you wrote:
common/cmd_bootz.c line 90
Quoted 4 lines
common/cmd_bootz.c new file +3
-0+ zi = (struct zimage_header *)images->ep; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) {This gave me an idea ... this might be how to check for zImage inside bootm and be done with it. Simply squash those two together.
Hm... but this must not be the only test, then, or you will run the risk of false positives...
Quoted 4 lines
Quoted 1 line
Do we have to care about endianess here?
We should make bootz arm-specific until more people (with different arches) step up and verify it works for them.
NAK. Please implement in an architecture independent way right from the beginning.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The only perfect science is hind-sight.
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Dear Wolfgang Denk,
Quoted 10 lines
Dear Marek Vasut,
Quoted 6 lines · In message <[email protected]> you wrote:
common/cmd_bootz.c line 90
Quoted 3 lines
common/cmd_bootz.c new file +3
-0+ zi = (struct zimage_header *)images->ep; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) {This gave me an idea ... this might be how to check for zImage inside bootm and be done with it. Simply squash those two together.
Quoted 2 lines
Hm... but this must not be the only test, then, or you will run the risk of false positives...
Certainly.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Do we have to care about endianess here?
We should make bootz arm-specific until more people (with different arches) step up and verify it works for them.
NAK. Please implement in an architecture independent way right from the beginning.
Can someone tell if the the zImage format differs per-arch or is it the same? Graeme, what is it about that x86 stuff?
Quoted 4 lines
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
Hi Marek,
Quoted 20 lines · Marek Vasut
Dear Wolfgang Denk,
Quoted 7 lines
Dear Marek Vasut,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines
+ zi = (struct
zimage_header*)images->ep;
+
+ if (zi->zi_magic!=LINUX_ARM_ZIMAGE_MAGIC) {Quoted 5 lines
Quoted 2 lines
This gave me an idea ... this might be how to check for zImage inside bootm and be done with it. Simply squash those two together.
Hm... but this must not be the only test, then, or you will run the risk of false positives...
Certainly.
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Do we have to care about endianess here?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
We should make bootz arm-specific until more people (with different arches) step up and verify it works for them.
NAK. ?Please implement in an architecture independent way right from the beginning.
Can someone tell if the the zImage format differs per-arch or is it the same? Graeme, what is it about that x86 stuff?
Do you really want to know? How long have you got ;)
There are three options:
1 Keep the kernel packaged up in the bzImage
2 Extract the 'header' externally to U-Boot and put it, the corresponding
vmlinux (compressed) and an initrd (compressed) in a uImage
3 Extract the 'header' and vmlinux from a bzImage within U-Boot
Option 1 means I have to keep the crappy 16-bit Real Mode BIOS stub in U-Boot which is a PITA. It also means more memory copy operations to get the kernel up and running - I've spoken to Gabe Black who did the coreboot patches for U-Boot and he is fine with us dropping this (his patches added code to bypass it anyway)
Option 2 is messy
Option 3 is nice - If you have enough onboard NAND flash, you can but the bzImage there and decompress it straight to its 'in RAM' resting place. Boot times are brutal!
I may be wrong, but I zImages are generally a header followed by a compressed vmlinux (x86 has a built-in decompression stub). So if the U-Boot zImage code called an arch-specific function that passed in the location of the (b)zImage and reference variables for the:
- Location of the compressed vmlinux
- Compression algorith used to compress vmlinux (although U-Boot could figure this out from the first few bytes)
- Length of the compressed data
- Length of the decompressed data (if known)
And a functions to process the header, command line, initrd etc I think we would have an arch-neutral way forward
Regards,
Graeme
PATCH v3 1/1 BOOT: Add "bootz" command to boot Linux zImage
In reply to Marek VasutQuoted 4 lines · On Monday 12 March 2012 17:34:21 Marek Vasut wrote:
common/Makefile | 1 + common/cmd_bootm.c | 29 +-------- common/cmd_bootz.c | 175 include/image.h | 8 +++
new commands should be in include/config_cmd_all.h and the top level README
common/cmd_bootz.c
Quoted 4 lines
common/cmd_bootz.c new file +1
-0+* Copyright (C) 2011 Marek Vasut <[email protected]>
it's 2012 now
common/cmd_bootz.c line 45
Quoted 10 lines
common/cmd_bootz.c new file +10
-0+#include <watchdog.h> +#include <malloc.h> +#include <u-boot/zlib.h> +#include <bzlib.h> +#include <environment.h> +#include <linux/ctype.h> +#include <asm/byteorder.h> +#if defined(CONFIG_SYS_HUSH_PARSER ) +#include <hush.h> +#endif
seems like these are all unused
Quoted 1 line
+#define
IH_INITRD_ARCHIH_ARCH_DEFAULT
this gets used in one place. just inline its usage
common/cmd_bootz.c line 56
Quoted 2 lines
common/cmd_bootz.c new file +2
-0+extern int do_bootm_linux (int flag,int argc,char *const argv[], +bootm_headers_t *images);
should get moved to include/command.h instead of copying it to more places
common/image.c
Quoted 4 lines
common/image.c +1
-0+#ifdef CONFIG_LMB
should be a space after #ifdef, not a tab
Quoted 1 line
+void
__arch_preboot_os(void)
static
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120312/56d7bd6e/attachment.pgp>
A message that is not in the archive (sent off-list or not yet received): Message-Id: <[email protected]
PATCH v4 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.
NOTE: This currently only supports ARM, but other architectures can be easily added by defining bootz_setup().
--- arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141 +++++++++++++++++++++++++++++++++++++++++++--- include/config_cmd_all.h | 1 + 3 files changed, 163 insertions(+), 9 deletions(-)
V2: Use CONFIG_BOOTZ_MAX_KERNEL_LMB_SIZE to reserve kernel LMB
V3: Compute the LMB size at runtime (obsoletes V2)
Move shared code to image.c/image.h
Sync with latest U-Boot
V4: Add all this into cmd_bootm. Therefore, this is part of cmd_bootm (basically
it's stripped-down version). Also, separate out arm-specific component into arm-specific location.
arch/arm/lib/bootm.c +30 -0
@@ -344,3 +344,33 @@ static ulong get_sp(void) asm("mov %0, sp" :"=r" (ret) : );return ret; } + +#ifdef CONFIG_CMD_BOOTZ + +struct zimage_header { +uint32_t code[9 ]; +uint32_t zi_magic; +uint32_t zi_start; +uint32_t zi_end; +}; + +#define LINUX_ARM_ZIMAGE_MAGIC 0x016f2818 + +int bootz_setup (void *image,void **start,void **end) +{ +struct zimage_header *zi = (struct zimage_header *)image; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) { +puts ("Bad Linux ARM zImage magic!\n" ); +return 1 ; + } + + *start = (void *)zi->zi_start; + *end = (void *)zi->zi_end; + +debug ("Kernel image @ 0x%08x [ 0x%08x - 0x%08x ]\n" , + (uint32_t )image, (uint32_t )*start, (uint32_t )*end); + +return 0 ; +} +#endif /* CONFIG_CMD_BOOTZ */
common/cmd_bootm.c +132 -9
167 lines not on this page · raw message
include/config_cmd_all.h +1 -0
@@ -20,6 +20,7 @@#define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTZ /* boot zImage */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */
Signature · 1 line
1.7.9
PATCH v4 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 3 lines · On Tuesday 13 March 2012 21:38:13 Marek Vasut wrote:
arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141
include/config_cmd_all.h|
still missing README
arch/arm/lib/bootm.c
Quoted 4 lines
arch/arm/lib/bootm.c +1
-0+#ifdef CONFIG_CMD_BOOTZ
don't use tabs to indent these tokens
common/cmd_bootm.c
Quoted 4 lines
common/cmd_bootm.c +1
-0+int __bootz_setup (void *image,void **start,void **end)
static
Quoted 1 line
+int
do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120313/91c1d6ee/attachment.pgp>
PATCH v4 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Mike Frysinger,
Quoted 6 lines · On Tuesday 13 March 2012 21:38:13 Marek Vasut wrote:
Quoted 3 lines
arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141
include/config_cmd_all.h|still missing README
Where exactly would you squash it in there?
Quoted 11 lines
arch/arm/lib/bootm.c
Quoted 5 lines
arch/arm/lib/bootm.c +1
-0+#ifdef CONFIG_CMD_BOOTZ don't use tabs to indent these tokens
Quoted 3 lines
common/cmd_bootm.c +0
-0
Quoted 8 lines
Quoted 1 line
+int
__bootz_setup(void *image, void **start, void **end)static
Quoted 1 line
+int
do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])static
-mike
Best regards,
Marek Vasut
PATCH v4 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 8 lines · On Tuesday 13 March 2012 22:40:05 Marek Vasut wrote:
Quoted 6 lines · On Tuesday 13 March 2012 21:38:13 Marek Vasut wrote:
Quoted 3 lines
arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141
include/config_cmd_all.h|still missing README
Where exactly would you squash it in there?
there should at least be mention in Monitor Functions and Monitor Commands. grepping for "bootm" shows other perhaps relevant sections like Boot Linux. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120313/bcc394ce/attachment.pgp>
A message that is not in the archive (sent off-list or not yet received): Message-Id: <[email protected]
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.
NOTE: This currently only supports ARM, but other architectures can be easily added by defining bootz_setup().
--- README | 8 +++ arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141 +++++++++++++++++++++++++++++++++++++++++++--- include/config_cmd_all.h | 1 + 4 files changed, 171 insertions(+), 9 deletions(-)
V2: Use CONFIG_BOOTZ_MAX_KERNEL_LMB_SIZE to reserve kernel LMB
V3: Compute the LMB size at runtime (obsoletes V2)
Move shared code to image.c/image.h
Sync with latest U-Boot
V4: Add all this into cmd_bootm. Therefore, this is part of cmd_bootm (basically
it's stripped-down version). Also, separate out arm-specific component into arm-specific location.
V5: Staticize bootz_setup(), add information into README.
README +8 -0
@@ -3594,6 +3594,7 @@ go - start application at address 'addr' run - run commands in an environment variable bootm - boot application image from memory bootp - boot image via network using BootP/TFTP protocol +bootz - boot zImage from memory tftpboot- boot image via network using TFTP protocol and env variables "ipaddr" and "serverip" (and eventually "gatewayip")
@@ -4414,6 +4415,13 @@ U-Boot supports the following image types: useful when you configure U-Boot to use a real shell (hush) as command interpreter. +Booting the Linux zImage: +------------------------- + +On some platforms, it's possible to boot Linux zImage. This is done +using the "bootz" command. The syntax of "bootz" command is the same +as the syntax of "bootm" command. + Standalone HOWTO: =================
arch/arm/lib/bootm.c +30 -0
@@ -344,3 +344,33 @@ static ulong get_sp(void) asm("mov %0, sp" :"=r" (ret) : );return ret; } + +#ifdef CONFIG_CMD_BOOTZ + +struct zimage_header { +uint32_t code[9 ]; +uint32_t zi_magic; +uint32_t zi_start; +uint32_t zi_end; +}; + +#define LINUX_ARM_ZIMAGE_MAGIC 0x016f2818 + +int bootz_setup (void *image,void **start,void **end) +{ +struct zimage_header *zi = (struct zimage_header *)image; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) { +puts ("Bad Linux ARM zImage magic!\n" ); +return 1 ; + } + + *start = (void *)zi->zi_start; + *end = (void *)zi->zi_end; + +debug ("Kernel image @ 0x%08x [ 0x%08x - 0x%08x ]\n" , + (uint32_t )image, (uint32_t )*start, (uint32_t )*end); + +return 0 ; +} +#endif /* CONFIG_CMD_BOOTZ */
common/cmd_bootm.c +132 -9
167 lines not on this page · raw message
include/config_cmd_all.h +1 -0
@@ -20,6 +20,7 @@#define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTZ /* boot zImage */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */
Signature · 1 line
1.7.9
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 2 lines · On Tuesday 13 March 2012 23:47:56 Marek Vasut wrote:
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Quoted 1 line
+int
do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120314/c939c10f/attachment.pgp>
Marek Vasut
NAKPATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Mike Frysinger,
Quoted 7 lines · On Tuesday 13 March 2012 23:47:56 Marek Vasut wrote:
Quoted 2 lines
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Does anyone else but RMK have a working netwinder these days? >:-)
Quoted 4 lines
Quoted 2 lines
+int
do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])static
NAK, compiler won't chew that
Quoted 1 line
-mike
Best regards,
Marek Vasut
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 9 lines · On Wednesday 14 March 2012 01:38:45 Marek Vasut wrote:
Quoted 7 lines · On Tuesday 13 March 2012 23:47:56 Marek Vasut wrote:
Quoted 2 lines
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Does anyone else but RMK have a working netwinder these days? >:-)
i've got 3, but only one is actively running
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
+int
do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])static
NAK, compiler won't chew that
what are you talking about ? you need to provide real details when making statements like this. plenty of other cmd's in u-boot mark their do_xxx func static and they work just fine. this do_bootz isn't used externally, so it makes no sense to have it be public.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120314/abc179b9/attachment.pgp>
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Mike Frysinger,
Quoted 5 lines · On Wednesday 14 March 2012 01:38:45 Marek Vasut wrote:
Quoted 4 lines
Quoted 4 lines · On Tuesday 13 March 2012 23:47:56 Marek Vasut wrote:
Quoted 2 lines
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Does anyone else but RMK have a working netwinder these days? >:-)
i've got 3, but only one is actively running
You should run DNA test on yourself against RMK's bloodsample :)
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
+int
do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
static
NAK, compiler won't chew that
what are you talking about ? you need to provide real details when making statements like this. plenty of other cmd's in u-boot mark their
do_xxxfunc static and they work just fine. thisdo_bootzisn't used externally, so it makes no sense to have it be public.
Oh you mean staticize the function, not the weak stuff, ok.
Quoted 1 line
-mike
Best regards,
Marek Vasut
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Marek VasutDear Marek Vasut,
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 4 lines
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Does anyone else but RMK have a working netwinder these days? >:-)
And I bet a crate of beer that _him_ is not using U-Boot to boot it.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Disobedience: The silver lining to the cloud of servitude. - Ambrose Bierce
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Wolfgang Denk,
Quoted 10 lines
Dear Marek Vasut,
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Does anyone else but RMK have a working netwinder these days? >:-)
And I bet a crate of beer that _him_ is not using U-Boot to boot it.
Dang, that'd be hard to convince him to switch to uboot to win this one ;-)
Quoted 4 lines
Best regards,
Wolfgang Denk
Best regards,
Marek Vasut
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Wolfgang DenkQuoted 8 lines · On Thursday 15 March 2012 12:09:43 Wolfgang Denk wrote:
Quoted 5 lines · Marek Vasut
Quoted 3 lines
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Does anyone else but RMK have a working netwinder these days? >:-)
And I bet a crate of beer that _him_ is not using U-Boot to boot it.
i'm still using nettrom on my netwinder. the main guy (Ralph) has the source to it iirc, but wasn't able to release it. a u-boot port at this point wouldn't work without those board details :(.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120315/5cbbae1b/attachment.pgp>
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Mike Frysinger,
Quoted 6 lines · On Thursday 15 March 2012 12:09:43 Wolfgang Denk wrote:
Quoted 5 lines
Quoted 4 lines · Marek Vasut
Quoted 3 lines
i've got no opinion on the matter of supporting zImage directly (although, i guess it'd be nice since some legacy platforms still use it like netwinders)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Does anyone else but RMK have a working netwinder these days? >:-)
And I bet a crate of beer that _him_ is not using U-Boot to boot it.
i'm still using nettrom on my netwinder. the main guy (Ralph) has the source to it iirc, but wasn't able to release it. a u-boot port at this point wouldn't work without those board details :(.
But a crete of beer is a good motivation to do it :-)
Best regards,
Marek Vasut
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Marek VasutQuoted 5 lines · Marek Vasut
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Quoted 7 lines
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.NOTE: This currently only supports ARM, but other architectures can be easily added by defining
bootz_setup().Signed-off-by Marek Vasut <[email protected]>
On Tegra20 Harmony with and without device tree (against mainline) and Tegra30 Cardhu with device tree (against an NVIDIA-internal U-Boot tree),
The code looks good too; I believe you've take care of any comments I had on the first very you posted.
Thanks very much - this is awesome!
PATCH v5 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Stephen Warren,
Quoted 17 lines · Marek Vasut
Quoted 5 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Quoted 7 lines
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.NOTE: This currently only supports ARM, but other architectures can be easily added by defining
bootz_setup().Signed-off-by Marek Vasut <[email protected]>On Tegra20 Harmony with and without device tree (against mainline) and Tegra30 Cardhu with device tree (against an NVIDIA-internal U-Boot tree),
Quoted 6 lines
Tested-by Stephen Warren <[email protected]>The code looks good too; I believe you've take care of any comments I had on the first very you posted.
Thanks very much - this is awesome!
You're welcome :) I'm glad we're finally going to squash one of the biggest sources of friction between linux-arm and uboot :)
Best regards,
Marek Vasut
A message that is not in the archive (sent off-list or not yet received): Message-Id: <[email protected]
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.
NOTE: This currently only supports ARM, but other architectures can be easily added by defining bootz_setup().
--- README | 8 +++ arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141 +++++++++++++++++++++++++++++++++++++++++++--- include/config_cmd_all.h | 1 + 4 files changed, 171 insertions(+), 9 deletions(-)
V2: Use CONFIG_BOOTZ_MAX_KERNEL_LMB_SIZE to reserve kernel LMB
V3: Compute the LMB size at runtime (obsoletes V2)
Move shared code to image.c/image.h
Sync with latest U-Boot
V4: Add all this into cmd_bootm. Therefore, this is part of cmd_bootm (basically
it's stripped-down version). Also, separate out arm-specific component into arm-specific location.
V5: Staticize bootz_setup(), add information into README.
V6: Make cmd_bootz() static.
README +8 -0
@@ -3594,6 +3594,7 @@ go - start application at address 'addr' run - run commands in an environment variable bootm - boot application image from memory bootp - boot image via network using BootP/TFTP protocol +bootz - boot zImage from memory tftpboot- boot image via network using TFTP protocol and env variables "ipaddr" and "serverip" (and eventually "gatewayip")
@@ -4414,6 +4415,13 @@ U-Boot supports the following image types: useful when you configure U-Boot to use a real shell (hush) as command interpreter. +Booting the Linux zImage: +------------------------- + +On some platforms, it's possible to boot Linux zImage. This is done +using the "bootz" command. The syntax of "bootz" command is the same +as the syntax of "bootm" command. + Standalone HOWTO: =================
arch/arm/lib/bootm.c +30 -0
@@ -344,3 +344,33 @@ static ulong get_sp(void) asm("mov %0, sp" :"=r" (ret) : );return ret; } + +#ifdef CONFIG_CMD_BOOTZ + +struct zimage_header { +uint32_t code[9 ]; +uint32_t zi_magic; +uint32_t zi_start; +uint32_t zi_end; +}; + +#define LINUX_ARM_ZIMAGE_MAGIC 0x016f2818 + +int bootz_setup (void *image,void **start,void **end) +{ +struct zimage_header *zi = (struct zimage_header *)image; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) { +puts ("Bad Linux ARM zImage magic!\n" ); +return 1 ; + } + + *start = (void *)zi->zi_start; + *end = (void *)zi->zi_end; + +debug ("Kernel image @ 0x%08x [ 0x%08x - 0x%08x ]\n" , + (uint32_t )image, (uint32_t )*start, (uint32_t )*end); + +return 0 ; +} +#endif /* CONFIG_CMD_BOOTZ */
common/cmd_bootm.c +132 -9
167 lines not on this page · raw message
include/config_cmd_all.h +1 -0
@@ -20,6 +20,7 @@#define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTZ /* boot zImage */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */
Signature · 1 line
1.7.9
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 5 lines · Marek Vasut
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
This is great! However, the initrd is still in the u-boot image format, right?
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Rob
Quoted 282 lines
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.NOTE: This currently only supports ARM, but other architectures can be easily added by defining
bootz_setup().Signed-off-by Marek Vasut <[email protected]>Cc Tom Warren <[email protected]>Cc albert.u.boot at aribaud.netCc afleming at gmail.com,Cc Simon Glass <[email protected]>,Cc Stephen Warren <[email protected]>Cc Nicolas Pitre <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>--- README | 8 +++ arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141 +++++++++++++++++++++++++++++++++++++++++++--- include/config_cmd_all.h | 1 + 4 files changed, 171 insertions(+), 9 deletions(-)V2: Use
CONFIG_BOOTZ_MAX_KERNEL_LMB_SIZEto reserve kernel LMB
V3: Compute the LMB size at runtime (obsoletes V2)
Move shared code toimage.c/image.h
Sync with latest U-Boot
V4: Add all this intocmd_bootm. Therefore, this is part ofcmd_bootm(basically
it's stripped-down version). Also, separate out arm-specific component into arm-specific location.
V5: Staticizebootz_setup(), add information into README.
V6: Makecmd_bootz()static.README +8
-0@@ -3594,6 +3594,7 @@ go - start application at address 'addr' run - run commands in an environment variable bootm - boot application image from memory bootp - boot image via network using BootP/TFTP protocol +bootz - boot zImage from memory tftpboot- boot image via network using TFTP protocol and env variables "ipaddr" and "serverip" (and eventually "gatewayip")@@ -4414,6 +4415,13 @@ U-Boot supports the following image types: useful when you configure U-Boot to use a real shell (hush) as command interpreter. +Booting the Linux zImage: +------------------------- + +On some platforms, it's possible to boot Linux zImage. This is done +using the "bootz" command. The syntax of "bootz" command is the same +as the syntax of "bootm" command. + Standalone HOWTO: =================arch/arm/lib/bootm.c +30
-0@@ -344,3 +344,33 @@ static ulong get_sp(void) asm("mov %0, sp" :"=r" (ret) : );return ret; } + +#ifdef CONFIG_CMD_BOOTZ + +struct zimage_header { +uint32_t code[9 ]; +uint32_t zi_magic; +uint32_t zi_start; +uint32_t zi_end; +}; + +#define LINUX_ARM_ZIMAGE_MAGIC 0x016f2818 + +int bootz_setup (void *image,void **start,void **end) +{ +struct zimage_header *zi = (struct zimage_header *)image; + +if (zi->zi_magic !=LINUX_ARM_ZIMAGE_MAGIC ) { +puts ("Bad Linux ARM zImage magic!\n" ); +return 1 ; + } + + *start = (void *)zi->zi_start; + *end = (void *)zi->zi_end; + +debug ("Kernel image @ 0x%08x [ 0x%08x - 0x%08x ]\n" , + (uint32_t )image, (uint32_t )*start, (uint32_t )*end); + +return 0 ; +} +#endif /* CONFIG_CMD_BOOTZ */ common/cmd_bootm.c +132
-9@@ -169,25 +169,25 @@ void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));#define IH_INITRD_ARCH IH_ARCH_DEFAULT -static void bootm_start_lmb (void ) -{#ifdef CONFIG_LMB +static void boot_start_lmb (bootm_headers_t *images) +{ulong mem_start;phys_size_t mem_size; -lmb_init (&images.lmb); +lmb_init (&images->lmb); mem_start =getenv_bootm_low (); mem_size =getenv_bootm_size (); -lmb_add (&images.lmb, (phys_addr_t )mem_start, mem_size); +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); -arch_lmb_reserve (&images.lmb); -board_lmb_reserve (&images.lmb); +arch_lmb_reserve (&images->lmb); +board_lmb_reserve (&images->lmb); +}#else -# define lmb_reserve (lmb, base, size) +static inline void boot_start_lmb (bootm_headers_t *images) { }#endif -}static int bootm_start (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {@@ -197,7 +197,7 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]memset ((void *)&images,0 ,sizeof (images)); images.verify =getenv_yesno ("verify" ); -bootm_start_lmb (); +boot_start_lmb (&images);/* get kernel image header, start address and length */ os_hdr = boot_get_kernel(cmdtp, flag, argc, argv,@@ -1523,3 +1523,126 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[],return 1 ; }#endif + +#ifdef CONFIG_CMD_BOOTZ + +static int __bootz_setup (void *image,void **start,void **end) +{ +/* Please define bootz_setup() for your platform */ + +puts ("Your platform's zImage format isn't supported yet!\n" ); +return -1 ; +} +int bootz_setup (void *image,void **start,void **end) + __attribute__((weak,alias ("__bootz_setup" ))); + +/* +* zImage booting support +*/ +static int bootz_start (cmd_tbl_t *cmdtp,int flag,int argc, +char *const argv[],bootm_headers_t *images) +{ +int ret; +void *zi_start, *zi_end; + +memset (images,0 ,sizeof (bootm_headers_t)); + +boot_start_lmb (images); + +/* Setup Linux kernel zImage entry point */ +if (argc <2 ) { + images->ep = load_addr; +debug ("* kernel: default image load address = 0x%08lx\n" , + load_addr); + }else { + images->ep =simple_strtoul (argv[1 ],NULL ,16 ); +debug ("* kernel: cmdline image address = 0x%08lx\n" , + images->ep); + } + + ret =bootz_setup ((void *)images->ep, &zi_start, &zi_end); +if (ret !=0 ) +return 1 ; + +lmb_reserve (&images->lmb, images->ep, zi_end - zi_start); + +/* Find ramdisk */ + ret =boot_get_ramdisk (argc, argv, images,IH_INITRD_ARCH , + &images->rd_start, &images->rd_end); +if (ret) { +puts ("Ramdisk image is corrupt or invalid\n" ); +return 1 ; + } + +#if defined(CONFIG_OF_LIBFDT ) +/* find flattened device tree */ + ret =boot_get_fdt (flag, argc, argv, images, + &images->ft_addr, &images->ft_len); +if (ret) { +puts ("Could not find a valid device tree\n" ); +return 1 ; + } + +set_working_fdt_addr (images->ft_addr); +#endif + +return 0 ; +} + +static int do_bootz (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +ulong iflag; +bootm_headers_t images; + +if (bootz_start (cmdtp, flag, argc, argv, &images)) +return 1 ; + +/* +* We have reached the point of no return: we are going to +* overwrite all exception vector code, so we cannot easily +* recover from any failures any more... +*/ + iflag =disable_interrupts (); + +#if defined(CONFIG_CMD_USB ) +/* +* turn off USB to prevent the host controller from writing to the +* SDRAM while Linux is booting. This could happen (at least for OHCI +* controller), because the HCCA (Host Controller Communication Area) +* lies within the SDRAM and the host controller writes continously to +* this area (as busmaster!). The HccaFrameNumber is for example +* updated every 1 ms within the HCCA structure in SDRAM! For more +* details see the OpenHCI specification. +*/ +usb_stop (); +#endif + +#ifdef CONFIG_SILENT_CONSOLE +fixup_silent_linux (); +#endif +arch_preboot_os (); + +do_bootm_linux (0 , argc, argv, &images); +#ifdef DEBUG +puts ("\n## Control returned to monitor - resetting...\n" ); +#endif +do_reset (cmdtp, flag, argc, argv); + +return 1 ; +} + +U_BOOT_CMD ( + bootz,CONFIG_SYS_MAXARGS ,1 , do_bootz, +"boot Linux zImage image from memory" , +"[addr [initrd] [fdt]]\n - boot Linux zImage stored in memory\n" +"\tThe argument 'initrd' is optional and specifies the address\n" +"\tof the initrd in memory.\n" +#if defined(CONFIG_OF_LIBFDT) +"\tWhen booting a Linux kernel which requires a flat device-tree\n" +"\ta third argument is required which is the address of the\n" +"\tdevice-tree blob. To boot that kernel without an initrd image,\n" +"\tuse a '-' for the second argument. If you do not pass a third\n" +"\ta bd_info struct will be passed instead\n" +#endif +); +#endif /* CONFIG_CMD_BOOTZ */ include/config_cmd_all.h +1
-0@@ -20,6 +20,7 @@#define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTZ /* boot zImage */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Rob Herring,
Quoted 6 lines · Marek Vasut
Quoted 4 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Quoted 6 lines
This is great! However, the initrd is still in the u-boot image format, right?
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Yes. Initrd still needs a bit of work, ideas?
Best regards,
Marek Vasut
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 8 lines · Marek Vasut
Dear Rob Herring,
Quoted 6 lines · Marek Vasut
Quoted 4 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Quoted 8 lines
Quoted 6 lines
This is great! However, the initrd is still in the u-boot image format, right?
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Yes. Initrd still needs a bit of work, ideas?
How about:
bootz <kern addr> [<fdt addr> [<initrd addr> [<initrd size>]]]
I changed the order so the size can be optional without resorting to using a "-". Then no size means u-boot image format.
File load commands would need to set loadsize env var.
Another idea is to prepend the u-boot image header on file loading. This would need some way to disable the crc check and specify any other data. It would probably be hard to do without changing existing commands.
Rob
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Rob Herring,
Quoted 9 lines · Marek Vasut
Quoted 8 lines
Dear Rob Herring,
Quoted 6 lines · Marek Vasut
Quoted 4 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
This is great! However, the initrd is still in the u-boot image format, right?
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Yes. Initrd still needs a bit of work, ideas?
You lost some people in the Cc ;-)
Quoted 3 lines
How about:
bootz <kern addr> [<fdt addr> [<initrd addr> [<initrd size>]]]
What about bootz <kern addr> <initrd addr>[:<initrd size>] <fdt addr>
example: bootz 0x12000000 0x13000000:0x40000 0x14000000
Quoted 5 lines
I changed the order so the size can be optional without resorting to using a "-". Then no size means u-boot image format.
File load commands would need to set loadsize env var.
If you load kernel after initrd, that's screw things up.
Quoted 4 lines
Another idea is to prepend the u-boot image header on file loading. This would need some way to disable the crc check and specify any other data. It would probably be hard to do without changing existing commands.
Naw, this is weird. What do you think about my idea with the addr:size stuff?
Quoted 2 lines
Rob
Best regards,
Marek Vasut
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 14 lines · Marek Vasut
Dear Rob Herring,
Quoted 12 lines · Marek Vasut
Quoted 11 lines
Dear Rob Herring,
Quoted 9 lines · Marek Vasut
Quoted 4 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
This is great! However, the initrd is still in the u-boot image format, right?
Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Yes. Initrd still needs a bit of work, ideas?
You lost some people in the Cc ;-)
They weren't in the original email header, only in the commit log as Cc's.
Quoted 8 lines
Quoted 3 lines
How about:
bootz <kern addr> [<fdt addr> [<initrd addr> [<initrd size>]]]
What about bootz <kern addr> <initrd addr>[:<initrd size>] <fdt addr>
example: bootz
0x120000000x13000000:0x400000x14000000
Sure. That works for me.
Quoted 7 lines
Quoted 5 lines
I changed the order so the size can be optional without resorting to using a "-". Then no size means u-boot image format.
File load commands would need to set loadsize env var.
If you load kernel after initrd, that's screw things up.
Yes, but you already have to be aware of some commands which will change env vars. This has to be script-able to be useful. The only other way I see is adding a command to get the size of a file. Perhaps the ls commands when given a single file can do that.
Rob
Quoted 11 lines
Quoted 4 lines
Another idea is to prepend the u-boot image header on file loading. This would need some way to disable the crc check and specify any other data. It would probably be hard to do without changing existing commands.
Naw, this is weird. What do you think about my idea with the addr:size stuff?
Quoted 2 lines
Rob
Best regards,
Marek Vasut
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 42 lines · Rob Herring
Quoted 14 lines · Marek Vasut
Dear Rob Herring,
Quoted 12 lines · Marek Vasut
Quoted 11 lines
Dear Rob Herring,
Quoted 9 lines · Marek Vasut
Quoted 4 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
This is great! However, the initrd is still in the u-boot image format, right?
Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Yes. Initrd still needs a bit of work, ideas?
You lost some people in the Cc ;-)
They weren't in the original email header, only in the commit log as Cc's.
Quoted 8 lines
Quoted 3 lines
How about:
bootz <kern addr> [<fdt addr> [<initrd addr> [<initrd size>]]]
What about bootz <kern addr> <initrd addr>[:<initrd size>] <fdt addr>
example: bootz
0x120000000x13000000:0x400000x14000000Sure. That works for me.
Quoted 4 lines
Quoted 4 lines
I changed the order so the size can be optional without resorting to using a "-". Then no size means u-boot image format.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
File load commands would need to set loadsize env var.
If you load kernel after initrd, that's screw things up.
Yes, but you already have to be aware of some commands which will change env vars. This has to be script-able to be useful. The only other way I see is adding a command to get the size of a file. Perhaps the ls commands when given a single file can do that.
Turns out there is already a filesize variable that gets set on file load commands.
And RTFM didn't help as that one is not documented... ;)
Rob
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Rob Herring,
Quoted 49 lines · Rob Herring
Quoted 39 lines · Marek Vasut
Quoted 14 lines
Dear Rob Herring,
Quoted 12 lines · Marek Vasut
Quoted 11 lines
Dear Rob Herring,
Quoted 9 lines · Marek Vasut
Quoted 4 lines
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
This is great! However, the initrd is still in the u-boot image format, right?
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
If a raw initrd is supported, then we could get rid of flash-kernel on disk-based debian/ubuntu systems. The file size is known from the filesystem, but then needs to get to the bootz command somehow.
Yes. Initrd still needs a bit of work, ideas?
You lost some people in the Cc ;-)
They weren't in the original email header, only in the commit log as Cc's.
Quoted 7 lines
Quoted 3 lines
How about:
bootz <kern addr> [<fdt addr> [<initrd addr> [<initrd size>]]]
What about bootz <kern addr> <initrd addr>[:<initrd size>] <fdt addr>
example: bootz
0x120000000x13000000:0x400000x14000000Sure. That works for me.
Quoted 3 lines
Quoted 3 lines
I changed the order so the size can be optional without resorting to using a "-". Then no size means u-boot image format.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
File load commands would need to set loadsize env var.
If you load kernel after initrd, that's screw things up.
Yes, but you already have to be aware of some commands which will change env vars. This has to be script-able to be useful. The only other way I see is adding a command to get the size of a file. Perhaps the ls commands when given a single file can do that.
Quoted 4 lines
Turns out there is already a filesize variable that gets set on file load commands.
And RTFM didn't help as that one is not documented... ;)
Rob, I just send in support for RAW initrd. Can you give it a go?
Best regards,
Marek Vasut
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Rob HerringDear Rob Herring,
Quoted 5 lines · In message <[email protected]> you wrote:
Turns out there is already a filesize variable that gets set on file load commands.
And RTFM didn't help as that one is not documented... ;)
Are you sure? I'm pretty sure I can see it in the section of the manual that deals with environment variables. See
http://www.denx.de/wiki/view/DULG/UBootEnvVariables
You may have to scroll down to the end of the file.
Best regards,
Wolfgang Denk
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Repeat after me:
Usenet is not a word processor; it's a medium where aesthetics count.
Mozilla is not a newsreader; it's a web browser.
Windows is not an operating system; it's a GUI on a program loader.
-- Tom Christiansen in <[email protected]>PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Quoted 7 lines · Wolfgang Denk
Dear Rob Herring,
Quoted 4 lines · In message <[email protected]> you wrote:
Turns out there is already a filesize variable that gets set on file load commands.
Quoted 7 lines
Quoted 1 line
And RTFM didn't help as that one is not documented... ;)
Are you sure? I'm pretty sure I can see it in the section of the manual that deals with environment variables. See
http://www.denx.de/wiki/view/DULG/UBootEnvVariablesYou may have to scroll down to the end of the file.
Okay. I was referring to the README and any other docs in the source tree.
Regards,
Rob
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Rob HerringDear Rob,
Quoted 4 lines · In message <[email protected]> you wrote:
How about:
bootz <kern addr> [<fdt addr> [<initrd addr> [<initrd size>]]]
No. We hav ebeen used for 12 years to the order first kernel address, then ramdisk address (and a little less longer ), then dtb address.
Don't change this now, and don;t make it inconsistent for different commands.
Quoted 4 lines
I changed the order so the size can be optional without resorting to using a "-". Then no size means u-boot image format.
File load commands would need to set loadsize env var.
What's "loadsize"?
Quoted 2 lines
Another idea is to prepend the u-boot image header on file loading. This would need some way to disable the crc check and specify any other data.
CRC checking can be disabled by setting "verify" to "no" (RTFM). The rest of the data is not really relevant here. Also note that we have enverything in place to compute the CRC, so you could implement a real "mkimage" commands. Assuming someone thinks this makes sense.
What is the problem of running this on the host?
Quoted 1 line
It would probably be hard to do without changing existing commands.
How so?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de EMACS belongs in <sys/errno.h>: Editor too big!
Wolfgang Denk
AppliedPATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Marek VasutDear Marek Vasut,
Quoted 20 lines · In message <[email protected]> you wrote:
From: Marek Vasut <[email protected]>
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported.
Tested on i.MX28 based DENX M28EVK
Tested on PXA270 based Voipac PXA270.NOTE: This currently only supports ARM, but other architectures can be easily added by defining
bootz_setup().Signed-off-by Marek Vasut <[email protected]>Cc Tom Warren <[email protected]>Cc albert.u.boot at aribaud.netCc afleming at gmail.com,Cc Simon Glass <[email protected]>,Cc Stephen Warren <[email protected]>Cc Nicolas Pitre <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>
Quoted 6 lines
--- README | 8 +++ arch/arm/lib/bootm.c | 30 ++++++++++ common/cmd_bootm.c | 141 +++++++++++++++++++++++++++++++++++++++++++--- include/config_cmd_all.h | 1 + 4 files changed, 171 insertions(+), 9 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Hi there! This is just a note from me, to you, to tell you, the per- son reading this note, that I can't think up any more famous quotes, jokes, nor bizarre stories, so you may as well go home.
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
In reply to Marek VasutQuoted 20 lines · On Thursday 15 March 2012 03:52:45 Marek Vasut wrote:
common/cmd_bootm.c +4
-4-static void bootm_start_lmb (void ) -{#ifdef CONFIG_LMB +static void boot_start_lmb (bootm_headers_t *images) +{ulong mem_start;phys_size_t mem_size; -lmb_init (&images.lmb); +lmb_init (&images->lmb); mem_start =getenv_bootm_low (); mem_size =getenv_bootm_size (); -lmb_add (&images.lmb, (phys_addr_t )mem_start, mem_size); +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size);
common/cmd_bootm.c void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os"))); · line 190
Quoted 10 lines
common/cmd_bootm.c +4
-4-arch_lmb_reserve (&images.lmb); -board_lmb_reserve (&images.lmb); +arch_lmb_reserve (&images->lmb); + board_lmb_reserve(&images->lmb); +}#else -# define lmb_reserve (lmb, base, size) +static inline void boot_start_lmb (bootm_headers_t *images) { }#endif -}
this breaks all non-lmb configs. before, lmb_reverse() was stubbed out, but now it's not, leading to build failures:
cmd_bootm.c: In function ?do_bootm_subcommand?:
cmd_bootm.c:518:23: error: ?bootm_headers_t? has no member named ?lmb? cmd_bootm.c: In function ?do_bootm?:
cmd_bootm.c:665:21: error: ?bootm_headers_t? has no member named ?lmb? make[2]: *** [cmd_bootm.o] Error 1
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120331/853a7adb/attachment.pgp>
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Mike Frysinger,
Quoted 42 lines · On Thursday 15 March 2012 03:52:45 Marek Vasut wrote:
Quoted 27 lines
common/cmd_bootm.c +6
-6-static void bootm_start_lmb (void ) -{#ifdef CONFIG_LMB +static void boot_start_lmb (bootm_headers_t *images) +{ulong mem_start;phys_size_t mem_size; -lmb_init (&images.lmb); +lmb_init (&images->lmb); mem_start =getenv_bootm_low (); mem_size =getenv_bootm_size (); -lmb_add (&images.lmb, (phys_addr_t )mem_start, mem_size); +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); -arch_lmb_reserve (&images.lmb); -board_lmb_reserve (&images.lmb); +arch_lmb_reserve (&images->lmb); +board_lmb_reserve (&images->lmb);common/cmd_bootm.c
Quoted 10 lines
common/cmd_bootm.c +2
-2+}#else -# define lmb_reserve (lmb, base, size) +static inline void boot_start_lmb (bootm_headers_t *images) { }#endif -}this breaks all non-lmb configs. before,
lmb_reverse()was stubbed out, but now it's not, leading to build failures:
Quoted 6 lines
cmd_bootm.c: In function ?do_bootm_subcommand?:
cmd_bootm.c:518:23: error: ?bootm_headers_t? has no member named ?lmb?cmd_bootm.c: In function ?do_bootm?:
cmd_bootm.c:665:21: error: ?bootm_headers_t? has no member named ?lmb? make[2]: *** [cmd_bootm.o] Error 1
-mike
Well tested on arm/ppc ... can you submit patch for these platforms please ?
I'll be able to run mips/x86 next week.
Best regards,
Marek Vasut
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Hi Marek,
Quoted 44 lines · Marek Vasut
Dear Mike Frysinger,
Quoted 42 lines · On Thursday 15 March 2012 03:52:45 Marek Vasut wrote:
Quoted 27 lines
common/cmd_bootm.c +6
-6-static void bootm_start_lmb (void ) -{#ifdef CONFIG_LMB +static void boot_start_lmb (bootm_headers_t *images) +{ulong mem_start;phys_size_t mem_size; -lmb_init (&images.lmb); +lmb_init (&images->lmb); mem_start =getenv_bootm_low (); mem_size =getenv_bootm_size (); -lmb_add (&images.lmb, (phys_addr_t )mem_start, mem_size); +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); -arch_lmb_reserve (&images.lmb); -board_lmb_reserve (&images.lmb); +arch_lmb_reserve (&images->lmb); +board_lmb_reserve (&images->lmb);common/cmd_bootm.c
Quoted 10 lines
common/cmd_bootm.c +2
-2+}#else -# define lmb_reserve (lmb, base, size) +static inline void boot_start_lmb (bootm_headers_t *images) { }#endif -}this breaks all non-lmb configs. before,
lmb_reverse()was stubbed out, but now it's not, leading to build failures:
Quoted 8 lines
Quoted 6 lines
cmd_bootm.c: In function ?do_bootm_subcommand?:
cmd_bootm.c:518:23: error: ?bootm_headers_t? has no member named ?lmb?cmd_bootm.c: In function ?do_bootm?:
cmd_bootm.c:665:21: error: ?bootm_headers_t? has no member named ?lmb? make[2]: *** [cmd_bootm.o] Error 1
-mikeWell tested on arm/ppc ... can you submit patch for these platforms please ?
I think the 'You Break, You Fix' rule applies ;)
Quoted 1 line
I'll be able to run mips/x86 next week.
Dang, I need it building now :P
I'm going to but in some really dodgy hacks just to get my build going again, but I would appreciate a fix ASAP
Regards,
Graeme
PATCH v6 1/1 BOOT: Add "bootz" command to boot Linux zImage on ARM
Dear Graeme Russ,
Quoted 61 lines
Hi Marek,
Quoted 51 lines · Marek Vasut
Dear Mike Frysinger,
Quoted 42 lines · On Thursday 15 March 2012 03:52:45 Marek Vasut wrote:
Quoted 27 lines
common/cmd_bootm.c +6
-6-static void bootm_start_lmb (void ) -{#ifdef CONFIG_LMB +static void boot_start_lmb (bootm_headers_t *images) +{ulong mem_start;phys_size_t mem_size; -lmb_init (&images.lmb); +lmb_init (&images->lmb); mem_start =getenv_bootm_low (); mem_size =getenv_bootm_size (); -lmb_add (&images.lmb, (phys_addr_t )mem_start, mem_size); +lmb_add (&images->lmb, (phys_addr_t )mem_start, mem_size); -arch_lmb_reserve (&images.lmb); -board_lmb_reserve (&images.lmb); +arch_lmb_reserve (&images->lmb); +board_lmb_reserve (&images->lmb);common/cmd_bootm.c
Quoted 10 lines
common/cmd_bootm.c +2
-2+}#else -# define lmb_reserve (lmb, base, size) +static inline void boot_start_lmb (bootm_headers_t *images) { }#endif -}this breaks all non-lmb configs. before,
lmb_reverse()was stubbed out, but now it's not, leading to build failures:Quoted 6 lines
cmd_bootm.c: In function ?do_bootm_subcommand?:
cmd_bootm.c:518:23: error: ?bootm_headers_t? has no member named ?lmb?cmd_bootm.c: In function ?do_bootm?:
cmd_bootm.c:665:21: error: ?bootm_headers_t? has no member named ?lmb? make[2]: *** [cmd_bootm.o] Error 1
-mikeQuoted 2 lines
Well tested on arm/ppc ... can you submit patch for these platforms please ?
I think the 'You Break, You Fix' rule applies ;)
Quoted 1 line
I'll be able to run mips/x86 next week.
Quoted 8 lines
Dang, I need it building now :P
I'm going to but in some really dodgy hacks just to get my build going again, but I would appreciate a fix ASAP
Regards,
Graeme
Sent.
Best regards,
Marek Vasut