[U-Boot-Users] Re: [PATCH] 2/4: bootz command

Wolfgang Denk wd at denx.de
Fri Jun 20 00:09:40 CEST 2003


In message <20030614163157.GC26793 at pengutronix.de> you wrote:
> 
> Some time ago Holger Schurig has sent a command to boot normal zImages.
> Here's the patch against current CVS. 

This needs to be cleaned up first.

And please, submit as a single patch!

> --- u-boot/include/cmd_bootz.h	1970-01-01 01:00:00.000000000 +0100
> +++ u-boot-ptx/include/cmd_bootz.h	2003-06-14 16:43:44.000000000 +0200
...
> +    ulong addr = 0x40000;

Please do not use any magic hardwired constants.

Can we use existent logic again, i. e. load_addr ?

> +    ulong initrd_start = 0;
> +    ulong initrd_end = 0;
> +    ulong data;
> +    void (*theKernel)(int zero, int arch, struct tag *params);
> +    bd_t *bd = gd->bd;
> +#ifdef CONFIG_CMDLINE_TAG
> +    char *commandline = getenv("bootargs");
> +#endif
> +    addr = simple_strtoul(argv[1], NULL, 16);
> +
> +    theKernel = (void (*)(int, int, struct tag*))addr;
> +
> +    SHOW_BOOT_PROGRESS (14);
> +
> +#ifdef DEBUG
> +    printf ("## Transferring control to Linux (at address %08lx) ...\n",
> +            (ulong)theKernel);
> +#endif
> +
> +#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
> +    defined (CONFIG_CMDLINE_TAG) || \
> +    defined (CONFIG_INITRD_TAG) || \
> +    defined (CONFIG_VFD)
> +    setup_start_tag(bd);
> +#ifdef CONFIG_SETUP_MEMORY_TAGS
> +    setup_memory_tags(bd);
> +#endif
> +#ifdef CONFIG_CMDLINE_TAG
> +    setup_commandline_tag(bd, commandline);
> +#endif
> +#ifdef CONFIG_INITRD_TAG
> +    setup_initrd_tag(bd, initrd_start, initrd_end);
> +#endif
> +#if 0
> +    setup_ramdisk_tag(bd);
> +#endif
> +#if defined (CONFIG_VFD)
> +    setup_videolfb_tag(gd);
> +#endif
> +    setup_end_tag(bd);
> +#endif
> +
> +    /* we assume that the kernel is in place */
> +    printf("\nStarting kernel ...\n\n");
> +
> +    cleanup_before_linux();

Did this really compile for any PowerPC or MIPS board?

On  PowerPC,  there  is  neither  a  header  file   "tag.h"   nor   a
cleanup_before_linux() function...

Please don't submit untested code!


Also, all of this is just dead code, as you don't add an entry to the
commands table.

And you don't add the files to any Makefile, either.



Sorry, but I can only reject this.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
I haven't lost my mind -- it's backed up on tape somewhere.




More information about the U-Boot mailing list