[PATCH 06/11] board: ti: j721s2: Add support for detecting multiple device trees

Tom Rini trini at konsulko.com
Thu Oct 27 15:02:23 CEST 2022


On Thu, Oct 27, 2022 at 04:18:41PM +0530, Sinthu Raja wrote:
> From: Sinthu Raja <sinthu.raja at ti.com>
> 
> Update the board_fit_config_name_match() to choose the right dtb
> based on the board name read from EEPROM.
> 
> Also restrict multpile EEPROM reads by verifying if EEPROM is already
> read
> 
> Signed-off-by: Sinthu Raja <sinthu.raja at ti.com>
> ---
>  board/ti/j721s2/evm.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c
> index 8ada924e3f..25667900ce 100644
> --- a/board/ti/j721s2/evm.c
> +++ b/board/ti/j721s2/evm.c
> @@ -79,8 +79,17 @@ int dram_init_banksize(void)
>  #ifdef CONFIG_SPL_LOAD_FIT
>  int board_fit_config_name_match(const char *name)
>  {
> -	if (!strcmp(name, "k3-j721s2-common-proc-board"))
> -		return 0;
> +	bool eeprom_read = board_ti_was_eeprom_read();
> +
> +	if (!eeprom_read || board_is_j721s2_som()) {
> +		if (!strcmp(name, "k3-j721s2-common-proc-board") ||
> +		    !strcmp(name, "k3-j721s2-r5-common-proc-board"))
> +			return 0;
> +	} else if (!eeprom_read || board_is_am68_sk_som()) {
> +		if (!strcmp(name, "k3-am68-sk-base-board") ||
> +		    !strcmp(name, "k3-am68-sk-r5-base-board"))
> +			return 0;
> +	}
>  
>  	return -1;
>  }

Do we actually need a different DTB to be used in SPL, in order to get
the right DTB for full U-Boot? It's an intentional design decision here
that we go board-specific as late as possible, so that it's clearer for
custom designs what they do and do not need to modify.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20221027/9effffcc/attachment.sig>


More information about the U-Boot mailing list