[U-Boot] [linux-sunxi] [PATCH 11/17] sunxi: SPL: add FIT config selector for Pine64 boards

André Przywara andre.przywara at arm.com
Fri Mar 3 00:47:22 UTC 2017


On 01/03/17 03:03, Icenowy Zheng wrote:
> 
> 
> 01.03.2017, 10:26, "Andre Przywara" <andre.przywara at arm.com>:
>> For a board or platform to support FIT loading in the SPL, it has to
>> provide a board_fit_config_name_match() routine, which helps to select
>> one of possibly multiple DTBs contained in a FIT image.
>> Provide a simple function which chooses the DT name U-Boot was
>> configured with.
>> If the DT name is one of the two Pine64 versions, determine the exact
>> model by checking the DRAM size.
>>
> 
> I think we shouldn't have is specially for Pine64 here, but make a framework
> for other boards that can be easily checked.
> 
> Then make Pine64 series the first user of this framework.

Well, actually this whole board_fit_config_name_match() *is* the
framework to differentiate boards at runtime. I don't see a reason why
we should make it more complicated than it already is.
With that last patch in the series we leave it to the SPL header to
select the board.

So it's really just the two different Pine64 models that need extra hand
holding here.

So I would hold off the magic framework until we know that we really
need it (a second user) and *what* we really need.

Cheers,
Andre.

> 
>> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
>> ---
>>  board/sunxi/board.c | 23 +++++++++++++++++++++++
>>  1 file changed, 23 insertions(+)
>>
>> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
>> index a510422..2ddff28 100644
>> --- a/board/sunxi/board.c
>> +++ b/board/sunxi/board.c
>> @@ -725,3 +725,26 @@ int ft_board_setup(void *blob, bd_t *bd)
>>  #endif
>>          return 0;
>>  }
>> +
>> +#ifdef CONFIG_SPL_LOAD_FIT
>> +int board_fit_config_name_match(const char *name)
>> +{
>> + const char *cmp_str;
>> +
>> +#ifdef CONFIG_DEFAULT_DEVICE_TREE
>> + cmp_str = CONFIG_DEFAULT_DEVICE_TREE;
>> +#else
>> + return 0;
>> +#endif
>> +
>> +/* Differentiate the two Pine64 board DTs by their DRAM size. */
>> + if (strstr(name, "-pine64") && strstr(cmp_str, "-pine64")) {
>> + if ((gd->ram_size > 512 * 1024 * 1024))
>> + return !strstr(name, "plus");
>> + else
>> + return !!strstr(name, "plus");
>> + } else {
>> + return strcmp(name, cmp_str);
>> + }
>> +}
>> +#endif
>> --
>> 2.8.2
>>
>> --
>> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/listinfo/u-boot
> 



More information about the U-Boot mailing list