[U-Boot] [PATCH] arm: Add Prep subcommand support to bootm

Andreas Bießmann andreas.devel at googlemail.com
Mon Sep 5 17:25:19 CEST 2011


Dear Simon,

Am 05.09.2011 16:06, schrieb Simon Schwarz:
> Dear Andreas,
> 
> On 09/05/2011 12:58 PM, Andreas Bießmann wrote:
>> Dear Simon,
>>
>> Am Mo 29 Aug 2011 18:08:13 CEST, Simon Schwarz schrieb:

<snip>

>>
>>> +}
>>> +
>>> +/* Main Entry point for arm bootm implementation
>>> + *
>>> + * Modeled after the powerpc implementation
>>> + * DIFFERENCE: Instead of calling prep and go at the end
>>> + * they are called if subommand is equal 0.
>>
>> s/subommand/subcommand/
> done
>>
>>> + */
>>> +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t
>>> *images)
>>> +{
>>> +    if (flag&  BOOTM_STATE_OS_CMDLINE)
>>> +        boot_cmdline_linux(images);
>>> +
>>> +    if (flag&  BOOTM_STATE_OS_BD_T)
>>> +        boot_bd_t_linux(images);
>>
>> NAK, remove these two functions. Since the ARM linux boot requirements
>> are different to powerpc we do not need these two states of bootm at all.
>>
>> The powerpc entry_32.S (in linux) show they need commandline pointer
>> apart from 'residual board info' pointer. The arm implementation in
>> head.S (also linux source) says:
>>
>> ---8<---
>>   * This is normally called from the decompressor code.  The requirements
>>   * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
>>   * r1 = machine nr, r2 = atags or dtb pointer.
>> --->8---
>>
>> For arm we do not need to prepare the cmdline apart from 'bd_t', we just
>> need to setup the ATAGS (ord FDT) which contains all information we
>> need. This could all be done in the prep state.
>>
> 
> changed.
> 
> But they are shown in bootm help message regardles of the architecture.
> Shouldn't we add #ifdefs in the help message then? (or, and I really
> hate to bring this up, change the way the helpmessage is created if the
> function is arch dependent)

No, I don't think we should change the bootm command. We could either
return 'not implemented' or 'everything is ok' here for these two flags.
But we do not need extra empty functions for that.

How about:

/* OS_CMDLINE is not needed by ARM cause of ... the bootargs (==cmdline)
is set in ATAGS/FDT ... */
if (flag&  BOOTM_STATE_OS_CMDLINE)
	return 0; /* pretend everything is ok */

/* OS_BD_T is not needed by ARM casue of ... */
if (flag&  BOOTM_STATE_OS_BD_T)
	return 0; /* pretend everything is ok */

...

best regards

Andreas Bießmann


More information about the U-Boot mailing list