Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp811192lqo; Fri, 17 May 2024 02:11:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkNlyZGz3xCD4VaitGoMo8rdPlOF/NnyAuuZ2KZmTn4waEKqvZypl7XH5s2CyLl4zbTMXwdyaOpmHztfkl7qRw2J22PxeM3wkOtzCQoA== X-Google-Smtp-Source: AGHT+IGMwzJDpX6X2Fsl6P9neCdat/4VwGlztfrWBicrSPqc7VLUVtV/88X+0Yz1WG0wKDBH+jut X-Received: by 2002:a05:6a21:1f04:b0:1af:d4dd:65e5 with SMTP id adf61e73a8af0-1afde0d554fmr17981379637.21.1715937074013; Fri, 17 May 2024 02:11:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715937073; cv=pass; d=google.com; s=arc-20160816; b=Xk7ro4ryPqJZnBMruFLtUi48VM7O30FYVWDMdIZHJjF47PeRuR1lDIxk92RzceSQfp U9+Knbazqri4UABmvglkOvGKMHzbh+YVsoP3Yv4spnqREi8NUcaSF9Liw6EC+qxD7Ym5 VEFd80C5PfTT/yQCbmgR6woLx1n/EWYBfZKFMYDHOXNBMmeywOrZR1UZ7HrZZi0no8oo QoExQXCwkrXW6qA9bkjWteyGNRq9q0oelb6KXCvsiD/I2ZxGUIoI2HDUVuSnLFw8PQDg Fhw5z0xWrvO4UuTVSTnVPl4/i6ruK44+huRJAw2palN0GI7J6ecl1LprPK/KxZmlKael 8dVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=AFbldK+YrNkPHEp7U+iGoJtDTLbUW/U0B2C/LsdOF6E=; fh=hGynCpO8BgwD6sxeeFTaU2YJRakK2Xsqmi16sdRz/oI=; b=ChNCS2Nhd5slJYTnq8A7EXeoZ1y+5gVMJjy4piNI/Op2O7idiQ3iMmxbCMvsY+j5ml 5iuxmajf9ywYXEjY1zES6SAXP2CapRYCAtVlQ11mUL2xolzI//HF4wZ5dAK8+HyuPu9I e/gw4dd4T45sOuvh5bHBhg7wXB+wi3hN+B+pbd2wcsI20jvz3RnSsFfURG6EAcU7728x 3xkgYpgn2dQEw4PRoQSXz3tw4fJQmMRieQiE/9abFoTqUJto2TefKHogZPtF0EWL3uoa T0+xXkTAeggCe+Q4595ozoFO4zSRGmpcVG1EqQdczgB2fP0j13mrnB/S6H3FjdJeuriQ ovOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=klGl0Tyc; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-181903-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c03b0f4si34092165ad.362.2024.05.17.02.11.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 02:11:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181903-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=klGl0Tyc; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-181903-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 932FA282A88 for ; Fri, 17 May 2024 09:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48C772E62C; Fri, 17 May 2024 09:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="klGl0Tyc" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BF0E23754; Fri, 17 May 2024 09:10:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715937027; cv=none; b=Nyt9+Q7fwO0tfWKkZUzMqHOVFmVW7lPdV5/lAlf/Kjz1N3kuqSIhYuVBGVdXzkdf9s3D6i8jTEQy7dYFdFsMRbIuKYN+eUgGRNc7DCyXF9ab0e4HEb5vm2RlOqMmst+QQ/spVGtSxNst8kqXv7E54bcTT/n333LyYu67z6a1lYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715937027; c=relaxed/simple; bh=S35cwDcF37dQ5mmiKFpcw7jseCSlFn4J7c+6yymc8Sg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sUsOtzpoKgrFMCXbyLDOJatSirMjGBhv+Mg1WWHepvVrdaLjIxCl3Q6dLumCdzVc0G3y6IxhhvsGSsZz+aHD6lD6cfGi36iZ4l4wcS7QW5wbcbp2gMe1RAXOjmoEph9oqp+ntz9ME0gHBSNE0W249qUnnTx6Y1NcgrhjmG/lKg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=klGl0Tyc; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id DCD142000E; Fri, 17 May 2024 09:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715937016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AFbldK+YrNkPHEp7U+iGoJtDTLbUW/U0B2C/LsdOF6E=; b=klGl0Tyc1SJDCTEgSMqT8gslZT1WoMIsRul91Fj6KHTBRJAkMGueFNTsdogwc9TTIuKN1+ q7MjMuwS4DRHn+A+7S93UAu0hDz7p60u9KHYUu4C+CjzctkD7KJTabkjw+07ZaR7IsMYee IQ8irHYV5w9J6dpkCjfXIDwwmKfPp7xT4Xd/oeA+5FXtbzeV6q2VGsqdvUqIFA3PhMk4ZU mFE1jtlJWKqLHOU7tYAliU5uHyctDNJZZzcUkIeEar5nTNNM7U4vNUV8jVs1E9x2VqOgjj qke6aaFRTiGT27xsBgU8+f48uqusnMcjyFeBQ0uLuXNsYFleQ6awAvYkBr7vfw== From: Thomas Bonnefille Date: Fri, 17 May 2024 11:09:55 +0200 Subject: [PATCH v2 3/3] riscv: dts: thead: Enable I2C on the BeagleV-Ahead Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240517-i2c-th1520-v2-3-d364d135ccc6@bootlin.com> References: <20240517-i2c-th1520-v2-0-d364d135ccc6@bootlin.com> In-Reply-To: <20240517-i2c-th1520-v2-0-d364d135ccc6@bootlin.com> To: Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Guo Ren , Fu Wei , Drew Fustini , Emil Renner Berthing , Conor Dooley Cc: Palmer Dabbelt , Albert Ou , Paul Walmsley , Thomas Petazzoni , =?utf-8?q?Miqu=C3=A8l_Raynal?= , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Thomas Bonnefille X-Mailer: b4 0.13.0 X-GND-Sasl: thomas.bonnefille@bootlin.com This commit enables the I2C0 controller of the TH1520, together with the FT24C32A EEPROM that is connected to it. In addition, this commit also enables the I2C controllers I2C2, I2C4 and I2C5 as they are all three exposed on headers (P9 19 and 20 for I2C2, P9 17 and 18 for I2C5 and MikroBus 7 and 5 for I2C4). It also defined the required pinctrl nodes. Signed-off-by: Thomas Bonnefille --- arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts index 57a2578123eb..aeb04f5159d5 100644 --- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts @@ -121,6 +121,47 @@ led-pins { }; }; +&padctrl1_apsys { + i2c0_pins: i2c0-0 { + i2c-pins { + pins = "I2C0_SDA", + "I2C0_SCL"; + function = "i2c"; + bias-pull-up = <2100>; + drive-strength = <7>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + }; + + i2c4_pins: i2c4-0 { + i2c-pins { + pins = "GPIO0_19", /*I2C4_SDA*/ + "GPIO0_18"; /*I2C4_SCL*/ + function = "i2c"; + bias-pull-up = <2100>; + drive-strength = <7>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + }; + + i2c5_pins: i2c5-0 { + i2c-pins { + pins = "QSPI1_D0_MOSI", /*I2C5_SDA*/ + "QSPI1_CSN0"; /*I2C5_SCL*/ + function = "i2c"; + bias-pull-up = <2100>; + drive-strength = <7>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + }; +}; + &padctrl0_apsys { uart0_pins: uart0-0 { tx-pins { @@ -143,6 +184,19 @@ rx-pins { slew-rate = <0>; }; }; + + i2c2_pins: i2c2-0 { + i2c-pins { + pins = "I2C2_SDA", + "I2C2_SCL"; + function = "i2c"; + bias-pull-up = <2100>; + drive-strength = <7>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + }; }; &uart0 { @@ -150,3 +204,33 @@ &uart0 { pinctrl-0 = <&uart0_pins>; status = "okay"; }; + +&i2c0 { + status = "okay"; + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + eeprom@50 { + compatible = "atmel,24c32"; + reg = <0x50>; + }; +}; + +&i2c2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; +}; + +&i2c4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c4_pins>; +}; + +&i2c5 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c5_pins>; +}; -- 2.45.1