[U-Boot] [PATCH 1/2] bootm: Add subcommands

Wolfgang Denk wd at denx.de
Tue Oct 21 21:30:06 CEST 2008


Dear Kumar Gala,

In message <1224520091-26756-1-git-send-email-galak at kernel.crashing.org> you wrote:
> Add the ability to break the steps of the bootm command into several
> subcommands: start, loados, ramdisk, fdt, bdt, cmdline, prep, go.
> 
> This allows us to do things like manipulate device trees before
> they are passed to a booting kernel or setup memory for a secondary
> core in multicore situations.
> 
> Not all OS types support all subcommands (currently only start, loados,
> ramdisk, fdt, and go are supported).
> 
> Signed-off-by: Kumar Gala <galak at kernel.crashing.org>

This looks mostly OK to me, but I haven't actually tested any of this
code yet - can you please comment to what extend you tested it?

> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
...
> @@ -1022,6 +1170,9 @@ static int do_bootm_netbsd (int flag, int argc, char *argv[],
>  	char *consdev;
>  	char *cmdline;
>  
> +	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
> +		return 1;
> +

This is a test that repeats quite often... Maybe e can optimize this
as

	if ((flag ^ BOOTM_STATE_OS_GO) != 0)
		return 1;

?

Best regards,

Wolfgang Denk

-- 
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
"More software projects have gone awry for lack of calendar time than
for all other causes combined."
                         - Fred Brooks, Jr., _The Mythical Man Month_


More information about the U-Boot mailing list