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

Kumar Gala galak at kernel.crashing.org
Wed Oct 22 00:22:56 CEST 2008


On Oct 21, 2008, at 2:30 PM, Wolfgang Denk wrote:

> 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?

I've tested this on FSL 85xx HW.  I'm able to boot using a sequence of  
bootm subcommands + a few other commands as well as plain old bootm.

>> --- 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;

Hmm, this isn't equivalent:

0 ^ BOOTM_STATE_OS_GO => BOOTM_STATE_OS_GO
BOOTM_STATE_OS_GO != 0
return 1.

- k


More information about the U-Boot mailing list