* [PATCH 0/2] riscv: dts: spacemit: define all missing I2C controller nodes
@ 2025-11-05 3:37 Troy Mitchell
2025-11-05 3:37 ` [PATCH 1/2] riscv: dts: spacemit: reorder i2c2 node Troy Mitchell
2025-11-05 3:37 ` [PATCH 2/2] riscv: dts: spacemit: define all missing I2C controller nodes Troy Mitchell
0 siblings, 2 replies; 3+ messages in thread
From: Troy Mitchell @ 2025-11-05 3:37 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan,
Encrow Thorne
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Troy Mitchell
Some I2C controllers exist in the hardware but are missing in the dtsi
file.
This series adds the corresponding nodes.
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Troy Mitchell (2):
riscv: dts: spacemit: reorder i2c2 node
riscv: dts: spacemit: define all missing I2C controller nodes
arch/riscv/boot/dts/spacemit/k1.dtsi | 90 ++++++++++++++++++++++++++++++++++--
1 file changed, 85 insertions(+), 5 deletions(-)
---
base-commit: 17490bd0527f59d841168457b245581f314b5fa0
change-id: 20251105-k1-add-i2c-node-df8b50b64ef7
Best regards,
--
Troy Mitchell <troy.mitchell@linux.spacemit.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] riscv: dts: spacemit: reorder i2c2 node
2025-11-05 3:37 [PATCH 0/2] riscv: dts: spacemit: define all missing I2C controller nodes Troy Mitchell
@ 2025-11-05 3:37 ` Troy Mitchell
2025-11-05 3:37 ` [PATCH 2/2] riscv: dts: spacemit: define all missing I2C controller nodes Troy Mitchell
1 sibling, 0 replies; 3+ messages in thread
From: Troy Mitchell @ 2025-11-05 3:37 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan,
Encrow Thorne
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Troy Mitchell
Reorder the i2c2 node to its correct position according to its
register address.This improves the readability and maintainability
of the device tree file by adhering to the established ordering convention.
No functional change is introduced by this reordering.
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
arch/riscv/boot/dts/spacemit/k1.dtsi | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index af35f9cd643513a1c68a00ccfb3ead688a8b1929..5b46ce2edb059e22d878890b3b6192118dfdb2f4 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -358,6 +358,19 @@ syscon_rcpu2: system-controller@c0888000 {
#reset-cells = <1>;
};
+ i2c2: i2c@d4012000 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd4012000 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI2>,
+ <&syscon_apbc CLK_TWSI2_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <38>;
+ status = "disabled";
+ };
+
syscon_apbc: system-controller@d4015000 {
compatible = "spacemit,k1-syscon-apbc";
reg = <0x0 0xd4015000 0x0 0x1000>;
@@ -459,19 +472,6 @@ pwm7: pwm@d401bc00 {
status = "disabled";
};
- i2c2: i2c@d4012000 {
- compatible = "spacemit,k1-i2c";
- reg = <0x0 0xd4012000 0x0 0x38>;
- #address-cells = <1>;
- #size-cells = <0>;
- clocks = <&syscon_apbc CLK_TWSI2>,
- <&syscon_apbc CLK_TWSI2_BUS>;
- clock-names = "func", "bus";
- clock-frequency = <400000>;
- interrupts = <38>;
- status = "disabled";
- };
-
i2c8: i2c@d401d800 {
compatible = "spacemit,k1-i2c";
reg = <0x0 0xd401d800 0x0 0x38>;
--
2.51.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] riscv: dts: spacemit: define all missing I2C controller nodes
2025-11-05 3:37 [PATCH 0/2] riscv: dts: spacemit: define all missing I2C controller nodes Troy Mitchell
2025-11-05 3:37 ` [PATCH 1/2] riscv: dts: spacemit: reorder i2c2 node Troy Mitchell
@ 2025-11-05 3:37 ` Troy Mitchell
1 sibling, 0 replies; 3+ messages in thread
From: Troy Mitchell @ 2025-11-05 3:37 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan,
Encrow Thorne
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Troy Mitchell
The SpacemiT K1 SoC is equipped with a total of nine I2C controllers,
ranging from I2C0 to I2C8.
Prior to this change, only I2C2 and I2C8 were explicitly defined
within the `k1.dtsi` device tree. This patch comprehensively adds
the device tree node definitions for I2C0, I2C1, I2C4, I2C5, I2C6 and I2C7.
The I2C3 node is not defined because it belongs exclusively to
the secure domain.
All newly defined I2C nodes are initially set to "disabled", allowing
board-specific device tree enable and configure them.
This ensures that all I2C controllers(not include secure domain and
remote-cpu domain) are now available for use across
the K1 platform.
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
arch/riscv/boot/dts/spacemit/k1.dtsi | 80 ++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index 5b46ce2edb059e22d878890b3b6192118dfdb2f4..843b7f3e2eef25fd3a44c4bec2b2280e33523f8c 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -358,6 +358,32 @@ syscon_rcpu2: system-controller@c0888000 {
#reset-cells = <1>;
};
+ i2c0: i2c@d4010800 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd4010800 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI0>,
+ <&syscon_apbc CLK_TWSI0_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <36>;
+ status = "disabled";
+ };
+
+ i2c1: i2c@d4011000 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd4011000 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI1>,
+ <&syscon_apbc CLK_TWSI1_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <37>;
+ status = "disabled";
+ };
+
i2c2: i2c@d4012000 {
compatible = "spacemit,k1-i2c";
reg = <0x0 0xd4012000 0x0 0x38>;
@@ -371,6 +397,32 @@ i2c2: i2c@d4012000 {
status = "disabled";
};
+ i2c4: i2c@d4012800 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd4012800 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI4>,
+ <&syscon_apbc CLK_TWSI4_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <40>;
+ status = "disabled";
+ };
+
+ i2c5: i2c@d4013800 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd4013800 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI5>,
+ <&syscon_apbc CLK_TWSI5_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <41>;
+ status = "disabled";
+ };
+
syscon_apbc: system-controller@d4015000 {
compatible = "spacemit,k1-syscon-apbc";
reg = <0x0 0xd4015000 0x0 0x1000>;
@@ -382,6 +434,19 @@ syscon_apbc: system-controller@d4015000 {
#reset-cells = <1>;
};
+ i2c6: i2c@d4018800 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd4018800 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI6>,
+ <&syscon_apbc CLK_TWSI6_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <70>;
+ status = "disabled";
+ };
+
gpio: gpio@d4019000 {
compatible = "spacemit,k1-gpio";
reg = <0x0 0xd4019000 0x0 0x100>;
@@ -472,6 +537,19 @@ pwm7: pwm@d401bc00 {
status = "disabled";
};
+ i2c7: i2c@d401d000 {
+ compatible = "spacemit,k1-i2c";
+ reg = <0x0 0xd401d000 0x0 0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&syscon_apbc CLK_TWSI7>,
+ <&syscon_apbc CLK_TWSI7_BUS>;
+ clock-names = "func", "bus";
+ clock-frequency = <400000>;
+ interrupts = <18>;
+ status = "disabled";
+ };
+
i2c8: i2c@d401d800 {
compatible = "spacemit,k1-i2c";
reg = <0x0 0xd401d800 0x0 0x38>;
@@ -669,6 +747,8 @@ syscon_apbc2: system-controller@f0610000 {
#reset-cells = <1>;
};
+ /* sec_i2c3: 0xf0614000, not available from Linux */
+
camera-bus {
compatible = "simple-bus";
ranges;
--
2.51.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-05 3:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 3:37 [PATCH 0/2] riscv: dts: spacemit: define all missing I2C controller nodes Troy Mitchell
2025-11-05 3:37 ` [PATCH 1/2] riscv: dts: spacemit: reorder i2c2 node Troy Mitchell
2025-11-05 3:37 ` [PATCH 2/2] riscv: dts: spacemit: define all missing I2C controller nodes Troy Mitchell
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).