public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes
@ 2026-03-27 11:40 Yixun Lan
  2026-03-30  9:50 ` Troy Mitchell
  2026-03-30 10:38 ` Yixun Lan
  0 siblings, 2 replies; 4+ messages in thread
From: Yixun Lan @ 2026-03-27 11:40 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: spacemit, devicetree, linux-riscv, linux-kernel, Yixun Lan

Populate all I2C devicetree nodes for SpacemiT K3 SoC. The controller of
i2c3 is reserved for secure domain, and not available from Linux. The
controller of i2c7 simply doesn't exist from hardware perspective, as
vendor directly name the i2c controller used for PMIC as i2c8.

Signed-off-by: Yixun Lan <dlan@kernel.org>
---
This series try to introduce a compatible string for the I2C
controller found in K3 SoC, and add all devicetree nodes .
---
Changes in v2:
- drop compatible binding patch which merged into i2c subsystem
- add comments about why no i2c3 and i2c7
- Link to v1: https://lore.kernel.org/r/20260325-02-k3-i2c-v1-0-78f29c83d9ac@kernel.org
---
 arch/riscv/boot/dts/spacemit/k3.dtsi | 100 +++++++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index a3a8ceddabec..38e6e212fbf2 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -438,6 +438,76 @@ soc: soc {
 		dma-noncoherent;
 		ranges;
 
+		i2c0: i2c@d4010800 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd4010800 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <36 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI0>,
+				 <&syscon_apbc CLK_APBC_TWSI0_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI0>;
+			status = "disabled";
+		};
+
+		i2c1: i2c@d4011000 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd4011000 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <37 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI1>,
+				 <&syscon_apbc CLK_APBC_TWSI1_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI1>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@d4012000 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd4012000 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI2>,
+				 <&syscon_apbc CLK_APBC_TWSI2_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI2>;
+			status = "disabled";
+		};
+
+		i2c4: i2c@d4012800 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd4012800 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <40 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI4>,
+				 <&syscon_apbc CLK_APBC_TWSI4_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI4>;
+			status = "disabled";
+		};
+
+		i2c5: i2c@d4013800 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd4013800 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <41 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI5>,
+				 <&syscon_apbc CLK_APBC_TWSI5_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI5>;
+			status = "disabled";
+		};
+
 		syscon_apbc: system-controller@d4015000 {
 			compatible = "spacemit,k3-syscon-apbc";
 			reg = <0x0 0xd4015000 0x0 0x1000>;
@@ -564,6 +634,20 @@ uart9: serial@d4017800 {
 			status = "disabled";
 		};
 
+		i2c6: i2c@d4018800 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd4018800 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <70 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI6>,
+				 <&syscon_apbc CLK_APBC_TWSI6_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI6>;
+			status = "disabled";
+		};
+
 		gpio: gpio@d4019000 {
 			compatible = "spacemit,k3-gpio";
 			reg = <0x0 0xd4019000 0x0 0x100>;
@@ -582,6 +666,20 @@ gpio: gpio@d4019000 {
 				      <&pinctrl 3 0 96 32>;
 		};
 
+		i2c8: i2c@d401d800 {
+			compatible = "spacemit,k3-i2c", "spacemit,k1-i2c";
+			reg = <0x0 0xd401d800 0x0 0x38>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&syscon_apbc CLK_APBC_TWSI8>,
+				 <&syscon_apbc CLK_APBC_TWSI8_BUS>;
+			clock-names = "func", "bus";
+			clock-frequency = <400000>;
+			resets = <&syscon_apbc RESET_APBC_TWSI8>;
+			status = "disabled";
+		};
+
 		pinctrl: pinctrl@d401e000 {
 			compatible = "spacemit,k3-pinctrl";
 			reg = <0x0 0xd401e000 0x0 0x1000>;
@@ -677,6 +775,8 @@ clint: timer@e081c000 {
 					      <&cpu7_intc 3>, <&cpu7_intc 7>;
 		};
 
+		/* sec_i2c3: 0xf0614000, not available from Linux */
+
 		mimsic: interrupt-controller@f1000000 {
 			compatible = "spacemit,k3-imsics", "riscv,imsics";
 			reg = <0x0 0xf1000000 0x0 0x10000>;

---
base-commit: d72db7cc40947f208e77fbc6049f2da6ea6822f4
change-id: 20260311-02-k3-i2c-6ad52566a9a3

Best regards,
-- 
Yixun Lan <dlan@kernel.org>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes
  2026-03-27 11:40 [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes Yixun Lan
@ 2026-03-30  9:50 ` Troy Mitchell
  2026-03-30  9:56   ` Yixun Lan
  2026-03-30 10:38 ` Yixun Lan
  1 sibling, 1 reply; 4+ messages in thread
From: Troy Mitchell @ 2026-03-30  9:50 UTC (permalink / raw)
  To: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: spacemit, devicetree, linux-riscv, linux-kernel, Troy Mitchell

Hi Yixun,

On Fri, Mar 27, 2026 at 19:40:40 CST, Yixun Lan wrote:
> Populate all I2C devicetree nodes for SpacemiT K3 SoC. The controller of
> i2c3 is reserved for secure domain, and not available from Linux. The
> controller of i2c7 simply doesn't exist from hardware perspective, as
> vendor directly name the i2c controller used for PMIC as i2c8.
> 
> Signed-off-by: Yixun Lan <dlan@kernel.org>
It looks like my Reviewed-by tag got dropped.
The changes look good to me anyway.

Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes
  2026-03-30  9:50 ` Troy Mitchell
@ 2026-03-30  9:56   ` Yixun Lan
  0 siblings, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2026-03-30  9:56 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, spacemit, devicetree,
	linux-riscv, linux-kernel

Hi Troy,

On 17:50 Mon 30 Mar     , Troy Mitchell wrote:
> Hi Yixun,
> 
> On Fri, Mar 27, 2026 at 19:40:40 CST, Yixun Lan wrote:
> > Populate all I2C devicetree nodes for SpacemiT K3 SoC. The controller of
> > i2c3 is reserved for secure domain, and not available from Linux. The
> > controller of i2c7 simply doesn't exist from hardware perspective, as
> > vendor directly name the i2c controller used for PMIC as i2c8.
> > 
> > Signed-off-by: Yixun Lan <dlan@kernel.org>
> It looks like my Reviewed-by tag got dropped.
> The changes look good to me anyway.
> 
> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
I realized this afer sending this out..

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes
  2026-03-27 11:40 [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes Yixun Lan
  2026-03-30  9:50 ` Troy Mitchell
@ 2026-03-30 10:38 ` Yixun Lan
  1 sibling, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2026-03-30 10:38 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: spacemit, devicetree, linux-riscv, linux-kernel


On Fri, 27 Mar 2026 11:40:40 +0000, Yixun Lan wrote:
> Populate all I2C devicetree nodes for SpacemiT K3 SoC. The controller of
> i2c3 is reserved for secure domain, and not available from Linux. The
> controller of i2c7 simply doesn't exist from hardware perspective, as
> vendor directly name the i2c controller used for PMIC as i2c8.
> 
> 

Applied, thanks!

[1/1] dts: riscv: spacemit: k3: Add i2c nodes
      https://github.com/spacemit-com/linux/commit/cb322cbffb1e70b4ca1be7955ed19fe486de8295

Best regards,
-- 
Yixun Lan <dlan@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-30 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 11:40 [PATCH v2] dts: riscv: spacemit: k3: Add i2c nodes Yixun Lan
2026-03-30  9:50 ` Troy Mitchell
2026-03-30  9:56   ` Yixun Lan
2026-03-30 10:38 ` Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox