From patchwork Tue Nov 2 14:05:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinthu Raja X-Patchwork-Id: 1549750 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mistralsolutions.com header.i=@mistralsolutions.com header.a=rsa-sha256 header.s=google header.b=KZpuw28t; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HkBw630ynz9sS8 for ; Wed, 3 Nov 2021 01:23:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3CF1B83618; Tue, 2 Nov 2021 15:22:29 +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="KZpuw28t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF58281918; Tue, 2 Nov 2021 15:10:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from egress-ip4b.ess.de.barracuda.com (egress-ip4b.ess.de.barracuda.com [18.185.115.208]) (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 5F130815A8 for ; Tue, 2 Nov 2021 15:10:37 +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-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx-outbound16-237.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 02 Nov 2021 14:10:36 +0000 Received: by mail-pg1-f200.google.com with SMTP id e4-20020a630f04000000b002cc40fe16afso4201789pgl.23 for ; Tue, 02 Nov 2021 07:10:36 -0700 (PDT) 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=OvWO8lGOF7tswRaq8Msdfy0+fcHV3hbzXrUWgNWTmuk=; b=KZpuw28tE6ByKQWydVUw5IXqb0t4q6Plzop91uCP6tmGYRKKkYqaaakOAwgWIRagvL VjbLpRsW2FjR9HJBnp/dV+qQFnbQWBuwgQi9kpy5HyOHfc27tbScJd8clWAfTFcjqivq M+J6CShxXHtnzq8+mFjmH/ex1FWI7PQwRkiqg= 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=OvWO8lGOF7tswRaq8Msdfy0+fcHV3hbzXrUWgNWTmuk=; b=f4eOeOKWU5s4dnsvquLVD6Q4ZLgEcLvKKHbdb7KU5qr+PnejQjqpbVI755KAalKlvW U+KrfF2/43TIM/Y4EZ38+NMI2sRPHSrg6acv0YFqWeltsVnw+TI5hQ56ihVTs7eVZDn9 HTcs+6TnqhkbDbWFa76xdp88gY4jdhwGEqs+KCceRkwA0yQGYOEWvZMvCTWMRTgcFyMz jwSJCI2YRizhE2khyJi/owH6ve7MfwqWaglKLHXy1+upMlM9nSeIAe6O2uPwpYeXDNGr C0RuyRLNsN3nWR/kOklx8tW2X9La0/JNh2eWYq/P5TuDKaCC0w65GxvEEZ+p/XQvs8lx EBxA== X-Gm-Message-State: AOAM532+DQ6zOZM2qUkKXAwYyQPwd/0vWKMJdn8p6NbNwEsNXIEMsOSw /uK1ouEuimZgsN0wRQrd0CLdNKAASiizYsSIk/RYCFQGWZEonmjWrjs//OE/0rTeD+iyHyX+zv5 dDtWSVFf/xj8zb007DSc68M+lZk6A2hOuAXSz0A2NAacmZhhXkw== X-Received: by 2002:a17:90a:ba09:: with SMTP id s9mr7198923pjr.42.1635862234477; Tue, 02 Nov 2021 07:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI26AEj8vFNA++BpcQKJI2QdSuyhWS7XfIvRfbxkqK5NsXQXpxiEdhmhYVeLOK+zF13HCWBg== X-Received: by 2002:a17:90a:ba09:: with SMTP id s9mr7198569pjr.42.1635862231773; Tue, 02 Nov 2021 07:10:31 -0700 (PDT) Received: from LAP568U.mistral.in ([106.51.227.150]) by smtp.gmail.com with ESMTPSA id z22sm17985689pfa.214.2021.11.02.07.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 07:10:31 -0700 (PDT) From: Sinthu Raja X-Google-Original-From: Sinthu Raja To: u-boot@lists.denx.de Cc: Praneeth Bajjuri , Sinthu Raja Subject: [PATCH V2 08/17] board: ti: j721e: Add support for detecting multiple device trees Date: Tue, 2 Nov 2021 19:35:49 +0530 Message-Id: <20211102140558.32460-9-sinthu.raja@ti.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211102140558.32460-1-sinthu.raja@ti.com> References: <20211102140558.32460-1-sinthu.raja@ti.com> MIME-Version: 1.0 X-BESS-ID: 1635862235-304333-5387-12529-1 X-BESS-VER: 2019.1_20211101.1855 X-BESS-Apparent-Source-IP: 209.85.215.200 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.235584 [from cloudscan11-136.eu-central-1a.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-Mailman-Approved-At: Tue, 02 Nov 2021 15:22:01 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 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 --- Changes in V2: * J721E EAIK board name is changed to J721E SK, rename all occurrences of eaik to sk. 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 cb491ad950..31de53ea71 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) {