From mboxrd@z Thu Jan 1 00:00:00 1970 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 6820CC3601A for ; Sat, 5 Apr 2025 10:23:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58F3E82991; Sat, 5 Apr 2025 12:23:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=reject dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 30C42829C3; Sat, 5 Apr 2025 12:23:30 +0200 (CEST) Received: from inet11.abb.com (inet11.abb.com [138.225.1.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CB74B81FEE for ; Sat, 5 Apr 2025 12:23:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=reject dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bernhard.messerklinger@br-automation.com Received: from brsmtp01.br-automation.co.at ([10.43.60.20]) by inet11.abb.com (8.15.2/8.14.7) with ESMTPS id 5347SNlX674040 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 4 Apr 2025 09:28:23 +0200 Received: from extmail.br-automation.com ([192.168.112.26]) by brsmtp01.br-automation.co.at (HCL Domino Release 14.0FP3 HF8) with ESMTP id 2025040409282393-93035 ; Fri, 4 Apr 2025 09:28:23 +0200 Received: from ATEGGE3725.br-automation.co.at ([10.43.64.28]) by extmail.br-automation.com (HCL Domino Build V1202_05192022) with ESMTP id 2025040409282427-31368 ; Fri, 4 Apr 2025 09:28:24 +0200 From: "Bernhard Messerklinger" To: u-boot@lists.denx.de Cc: "Bernhard Messerklinger" , "Tom Rini" , "Wolfgang Wallner" Subject: [PATCH v4 2/4] board/BuR/common: add parameter for reset controller I2C bus selection Date: Fri, 4 Apr 2025 09:27:58 +0200 Message-ID: <20250404072819.69642-3-bernhard.messerklinger@br-automation.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404072819.69642-1-bernhard.messerklinger@br-automation.com> References: <20250404072819.69642-1-bernhard.messerklinger@br-automation.com> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on BRSMTPINTERN2/InternSMTP(Build V1202_05192022|May 19, 2022) at 04/04/2025 09:28:24 AM, Serialize by Router on BRSMTPINTERN2/InternSMTP(Build V1202_05192022|May 19, 2022) at 04/04/2025 09:28:24 AM, Itemize by SMTP Server on BRSMTP01/Eggelsberg/AT/B&R(Release 14.0FP3 HF8|December 13, 2024) at 04/04/2025 09:28:23 AM, Serialize by Router on BRSMTP01/Eggelsberg/AT/B&R(Release 14.0FP3 HF8|December 13, 2024) at 04/04/2025 09:28:24 AM, Serialize complete at 04/04/2025 09:28:24 AM X-TNEFEvaluated: 1 Content-Transfer-Encoding: quoted-printable 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.8 at phobos.denx.de X-Virus-Status: Clean Normally B&R reset controllers are located at I2C bus 0. This patch adds the possibility to change this bus number with the kconfig option BR=5FRESETC=5FI2CBUS. Signed-off-by: Bernhard Messerklinger --- (no changes since v2) Changes in v2: - Move BR=5FRESETC=5FI2CBUS to Kconfig board/BuR/common/Kconfig | 8 ++++++++ board/BuR/common/br=5Fresetc.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 board/BuR/common/Kconfig diff --git a/board/BuR/common/Kconfig b/board/BuR/common/Kconfig new file mode 100644 index 00000000000..490201e7407 --- /dev/null +++ b/board/BuR/common/Kconfig @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# B&R Industrial Automation GmbH - http://www.br-automation.com + +config BR=5FRESETC=5FI2CBUS + int "I2C Bus address of B&R reset controller" + depends on SYS=5FVENDOR =3D "BuR" && DM=5FI2C + default 0 diff --git a/board/BuR/common/br=5Fresetc.c b/board/BuR/common/br=5Fresetc.c index f5d09fef3d3..248064f974b 100644 --- a/board/BuR/common/br=5Fresetc.c +++ b/board/BuR/common/br=5Fresetc.c @@ -52,10 +52,16 @@ static int resetc=5Finit(void) { struct udevice *i2cbus; int rc; +#if !defined(BR=5FRESETC=5FI2CBUS) + int busno =3D 0; +#else + int busno =3D CONFIG=5FBR=5FRESETC=5FI2CBUS; +#endif + + rc =3D uclass=5Fget=5Fdevice=5Fby=5Fseq(UCLASS=5FI2C, busno, &i2cbus); =20 - rc =3D uclass=5Fget=5Fdevice=5Fby=5Fseq(UCLASS=5FI2C, 0, &i2cbus); if (rc) { - printf("Cannot find I2C bus #0!\n"); + printf("Cannot find I2C bus #%d!\n", busno); return -1; } =20 --=20 2.49.0