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 AB268C4332F for ; Wed, 4 Jan 2023 12:08:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EE10285586; Wed, 4 Jan 2023 13:07:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.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=ti.com header.i=@ti.com header.b="ytQeGAuU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2CB4B85587; Wed, 4 Jan 2023 13:07:37 +0100 (CET) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 0F4E185578 for ; Wed, 4 Jan 2023 13:07:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-francis@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 304C7QrC060817; Wed, 4 Jan 2023 06:07:26 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1672834047; bh=9DR8LSixXND4K8v8g2XZxqb6uyyr4+OxeQuvELXW+Ao=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=ytQeGAuU3RMHvdH/GjxobveZXA/8q8qCdEjGhaTCy8KkQ+9cX+G9WQg53b06kJIZG 5kkpG/d01ct0V3PG1NAIjakIbRgSLsKnsWPijz0JEl/IysekZAJJZPPgm0i1Eca2zb CRVmNJsZCHZNkIWURDxs6QowOpzwZtsjk3ZPY0Ts= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 304C7Q3D039122 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Jan 2023 06:07:26 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Wed, 4 Jan 2023 06:07:26 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Wed, 4 Jan 2023 06:07:26 -0600 Received: from [172.24.145.19] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 304C7NJW123979; Wed, 4 Jan 2023 06:07:24 -0600 Message-ID: <3131149c-9554-1821-551c-4893a3ff1530@ti.com> Date: Wed, 4 Jan 2023 17:37:23 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH V4 06/12] board: ti: j721s2: Add support for detecting multiple device trees Content-Language: en-US To: Sinthu Raja , , Tom Rini , Marcel Ziswiler , Marek Vasut , Vignesh Raghavendra CC: Sinthu Raja References: <20230104094350.19394-1-sinthu.raja@ti.com> <20230104094350.19394-7-sinthu.raja@ti.com> From: Neha Malcom Francis In-Reply-To: <20230104094350.19394-7-sinthu.raja@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Sinthu On 04/01/23 15:13, Sinthu Raja wrote: > 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/j721s2/evm.c | 30 ++++++++++++++++++++---------- > 1 file changed, 20 insertions(+), 10 deletions(-) > > diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c > index a3adb8704e..a7c4082a7a 100644 > --- a/board/ti/j721s2/evm.c > +++ b/board/ti/j721s2/evm.c > @@ -72,16 +72,6 @@ int dram_init_banksize(void) > return 0; > } > > -#ifdef CONFIG_SPL_LOAD_FIT > -int board_fit_config_name_match(const char *name) > -{ > - if (!strcmp(name, "k3-j721s2-common-proc-board")) > - return 0; > - > - return -1; > -} > -#endif > - Any reason why the modifications to board_fit_config_name_match was not made here itself and instead shifted, would make patch more readable. > #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) > int ft_board_setup(void *blob, struct bd_info *bd) > { > @@ -111,6 +101,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) { > @@ -179,6 +172,23 @@ static void setup_serial(void) > } > #endif > > +#ifdef CONFIG_SPL_LOAD_FIT > +int board_fit_config_name_match(const char *name) > +{ > + bool eeprom_read = board_ti_was_eeprom_read(); > + > + if (!eeprom_read || board_is_j721s2_som()) { > + if (!strcmp(name, "k3-j721s2-common-proc-board")) > + return 0; > + } else if (!eeprom_read || board_is_am68_sk_som()) { This second eeprom_read check is unnecessary. > + if (!strcmp(name, "k3-am68-sk-base-board")) > + return 0; > + } > + > + return -1; > +} > +#endif > + > int board_late_init(void) > { > if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) { -- Thanking You Neha Malcom Francis