Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E89EC433EF for ; Wed, 9 Feb 2022 09:38:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6CDAC83E62; Wed, 9 Feb 2022 10:38:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mistralsolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=mistralsolutions.com header.i=@mistralsolutions.com header.b="d4kX9IC8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6459283DDE; Wed, 9 Feb 2022 10:37:47 +0100 (CET) Received: from egress-ip33b.ess.de.barracuda.com (egress-ip33b.ess.de.barracuda.com [18.185.115.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ED52B83DBE for ; Wed, 9 Feb 2022 10:37:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mistralsolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sinthu.raja@mistralsolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx-outbound17-217.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 09 Feb 2022 09:37:30 +0000 Received: by mail-pj1-f71.google.com with SMTP id w18-20020a17090a461200b001b7ea83e29dso1463393pjg.4 for ; Wed, 09 Feb 2022 01:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mistralsolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t5RrUCwbBzb6y9seW4goreOly4IF2h6eRwpljxUIprE=; b=d4kX9IC8rX8DVMAI+J3aeaPScj+S2BU0xb9edqVAg0vasb3bspcNJWzspTZfvwqtEx dG+V4zR3ft+aSlRSs55kVGUGUVA9xENFG4YvDc+RQ/CxcOOexqafBya3i95NxbbTIxJf Ft94dxM5bfjTW7pJyxltFzzGs15NX8gwSgVq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t5RrUCwbBzb6y9seW4goreOly4IF2h6eRwpljxUIprE=; b=A4Iue/YRFHPXt5hHAaCBFyDzZbu/BLxQ4p9ETYOM33QV2EeMvIV8CL352ym5PyJSDf xmy6/JnHFDg6nwyn5HRX/+O82XgBEBqUtx9joJ+skksEUtFvR7ldCp853l5dq+vEpvjc zyDUH2N0u6LSEKEsLFKQmm1nTulTq7ELP+67lPnLNxF82Apr3jH0x9ojigotuNWe4IN+ GQ0kwZx3Ssmjk+UEHerNL5k/X6KeFij2gfX5VqZV4HtPpmMdRmJUBeidoN4csIwum3N0 kVBCgzLLZefmIRhqEZMU7RdYckT/8ruJANPAUiM+a7iJG4ajRv1eyOGjD1A4f9PFt+Xk MGJA== X-Gm-Message-State: AOAM530mgg7HvFHqqKYU/SYA69Y6nGu3SksRaPbw+tf83vg5plls3agU pKuhQF8MXYKxlu5mpf7ra4XaKlVD+xac4GeUNB9PDxNnaRdunLg+TKchVk1RkWgnQ+u9JLm7GiD FM7PUslYJw/WUHlC9hHhNakmdcM+Xzc8NUy34heuCJ4OsTYGcVg== X-Received: by 2002:a63:710:: with SMTP id 16mr117883pgh.440.1644399448947; Wed, 09 Feb 2022 01:37:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEgGLprIpoD6l9ZLOcSlwxUjD8QhJjqPm/LYy7rCWIqcPaWlGPJkDskS+Bc/fMf8NWY1fRlA== X-Received: by 2002:a63:710:: with SMTP id 16mr117871pgh.440.1644399448706; Wed, 09 Feb 2022 01:37:28 -0800 (PST) Received: from LAP568U.mistral.in ([106.51.69.35]) by smtp.gmail.com with ESMTPSA id g4sm18964255pfv.63.2022.02.09.01.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:37:26 -0800 (PST) From: Sinthu Raja X-Google-Original-From: Sinthu Raja To: u-boot@lists.denx.de Cc: Praneeth Bajjuri , Sinthu Raja Subject: [PATCH V3 07/16] board: ti: j721e: Add support for detecting multiple device trees Date: Wed, 9 Feb 2022 15:06:52 +0530 Message-Id: <20220209093701.16693-8-sinthu.raja@ti.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220209093701.16693-1-sinthu.raja@ti.com> References: <20220209093701.16693-1-sinthu.raja@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BESS-ID: 1644399449-304569-5577-9012-1 X-BESS-VER: 2019.1_20220208.1721 X-BESS-Apparent-Source-IP: 209.85.216.71 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.237841 [from cloudscan22-232.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS91090 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Sinthu Raja 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 --- board/ti/j721e/evm.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index c70ed7a84c..4c40f984ef 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -88,8 +88,17 @@ int dram_init_banksize(void) #ifdef CONFIG_SPL_LOAD_FIT int board_fit_config_name_match(const char *name) { - if (!strcmp(name, "k3-j721e-common-proc-board")) - return 0; + bool eeprom_read = board_ti_was_eeprom_read(); + + if (!eeprom_read || board_is_j721e_som()) { + if (!strcmp(name, "k3-j721e-common-proc-board") || + !strcmp(name, "k3-j721e-r5-common-proc-board")) + return 0; + } else if (board_is_j721e_sk()) { + if (!strcmp(name, "k3-j721e-sk") || + !strcmp(name, "k3-j721e-r5-sk")) + return 0; + } return -1; } @@ -153,6 +162,9 @@ int do_board_detect(void) { int ret; + if (board_ti_was_eeprom_read()) + return 0; + ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS); if (ret) { -- 2.35.0