linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
To: Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Jisheng Zhang <jszhang@kernel.org>,  Guo Ren <guoren@kernel.org>,
	Fu Wei <wefu@redhat.com>,
	 Drew Fustini <dfustini@tenstorrent.com>,
	 Emil Renner Berthing <emil.renner.berthing@canonical.com>,
	 Conor Dooley <conor@kernel.org>,
	 Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: "Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Miquèl Raynal" <miquel.raynal@bootlin.com>,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>
Subject: [PATCH v3 3/3] riscv: dts: thead: Enable I2C on the BeagleV-Ahead
Date: Tue, 18 Jun 2024 09:42:40 +0200	[thread overview]
Message-ID: <20240618-i2c-th1520-v3-3-3042590a16b1@bootlin.com> (raw)
In-Reply-To: <20240618-i2c-th1520-v3-0-3042590a16b1@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 <thomas.bonnefille@bootlin.com>
---
 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..b5c4f1811955 100644
--- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts
+++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts
@@ -122,6 +122,19 @@ led-pins {
 };
 
 &padctrl0_apsys {
+	i2c2_pins: i2c2-0 {
+		i2c-pins {
+			pins = "I2C2_SDA",
+			       "I2C2_SCL";
+			function = "i2c";
+			bias-pull-up = <48000>;
+			drive-strength = <7>;
+			input-enable;
+			input-schmitt-enable;
+			slew-rate = <0>;
+		};
+	};
+
 	uart0_pins: uart0-0 {
 		tx-pins {
 			pins = "UART0_TXD";
@@ -145,8 +158,79 @@ rx-pins {
 	};
 };
 
+&padctrl1_apsys {
+	i2c0_pins: i2c0-0 {
+		i2c-pins {
+			pins = "I2C0_SDA",
+			       "I2C0_SCL";
+			function = "i2c";
+			bias-pull-up = <48000>;
+			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 = <48000>;
+			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 = <48000>;
+			drive-strength = <7>;
+			input-enable;
+			input-schmitt-enable;
+			slew-rate = <0>;
+		};
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins>;
 	status = "okay";
 };
+
+&i2c0 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c32";
+		reg = <0x50>;
+	};
+};
+
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_pins>;
+	status = "okay";
+};
+
+&i2c4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c4_pins>;
+	status = "okay";
+};
+
+&i2c5 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c5_pins>;
+	status = "okay";
+};

-- 
2.45.2


  parent reply	other threads:[~2024-06-18  7:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  7:42 [PATCH v3 0/3] Add I2C support on TH1520 Thomas Bonnefille
2024-06-18  7:42 ` [PATCH v3 1/3] dt-bindings: i2c: dw: Document compatible thead,th1520-i2c Thomas Bonnefille
2024-06-19  6:40   ` Jarkko Nikula
2024-06-19  7:37     ` Icenowy Zheng
2024-06-19  7:39     ` Krzysztof Kozlowski
2024-06-19 13:42       ` Jarkko Nikula
2024-06-18  7:42 ` [PATCH v3 2/3] riscv: dts: thead: Add TH1520 I2C nodes Thomas Bonnefille
2024-06-25 21:30   ` Drew Fustini
2024-06-18  7:42 ` Thomas Bonnefille [this message]
2024-06-25 21:30   ` [PATCH v3 3/3] riscv: dts: thead: Enable I2C on the BeagleV-Ahead Drew Fustini
2024-07-21 22:47   ` Emil Renner Berthing
2024-06-25 21:28 ` [PATCH v3 0/3] Add I2C support on TH1520 Drew Fustini
2024-06-28  9:30 ` Andi Shyti
2024-06-28 10:49   ` Conor Dooley
2024-07-10  7:48 ` (subset) " Andi Shyti
2024-07-10  8:21   ` Krzysztof Kozlowski
2024-07-10 13:01     ` Andi Shyti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240618-i2c-th1520-v3-3-3042590a16b1@bootlin.com \
    --to=thomas.bonnefille@bootlin.com \
    --cc=andi.shyti@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dfustini@tenstorrent.com \
    --cc=emil.renner.berthing@canonical.com \
    --cc=guoren@kernel.org \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jszhang@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wefu@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).