[U-Boot] [PATCH resend 2/2] arm/boards: Define a new config option CONFIG_BOOT_PARAMS_P

Stefan Roese sr at denx.de
Thu Dec 6 12:26:07 CET 2012


On 12/06/2012 10:56 AM, Vipin Kumar wrote:

<snip>

>>> +#ifdef CONFIG_BOOT_PARAMS_P
>>> +	/* Boot params passed to Linux */
>>> +	gd->bd->bi_boot_params = CONFIG_BOOT_PARAMS_P;
>>> +#endif
>>
>> Again an ugly #ifdef. Why not something like this instead:
>>
>> Define a default earlier in the code (is 0x100 the best default?):
>>
>> #ifndef CONFIG_BOOT_PARAMS_P
>> #define CONFIG_BOOT_PARAMS_P	0x100
>> #endif
>>
>> then here just:
>>
>> 	/* Boot params passed to Linux */
>> 	gd->bd->bi_boot_params = CONFIG_BOOT_PARAMS_P;
>>
>
> This would mean that I am forcing the boot params at 0x100 for all
> boards. Is that the right thing to do
>
> Off-course, all of them might already be initializing
> gd->bd->bi_boot_params on their own

Yes. Before or after this initialization? Will the board_init code
overwrite this one here?

But I also think this could be confusing. The generic way to implement
this would be to remove *all* local board specific assignments of
gd->bd->bi_boot_params and define CONFIG_BOOT_PARAMS_P in their board
config header. But this will be quite intrusive and could be error-prone.

>> without the #ifdef.
>>
>>> +
>>>   	addr_sp -= sizeof (gd_t);
>>>   	id = (gd_t *) addr_sp;
>>>   	debug("Reserving %zu Bytes for Global Data at: %08lx\n",
>>> @@ -468,6 +473,13 @@ void board_init_f(ulong bootflag)
>>>   static char *failed = "*** failed ***\n";
>>>   #endif
>>>
>>> +static int __def_board_init(bd_t *bis)
>>> +{
>>> +	return -1;
>>
>> Is -1 a good value to return as default board_init()?
>>
>
> The return value is not checked as of today

Then I suggest to use 0.

Thanks,
Stefan



More information about the U-Boot mailing list