Skip to contentSkip to conversation

riscv: dts: spacemit: serial/i2c/ethernet improvements for the K3 Pico-ITX board

PATCH Superseded Aurelien Jarno 3 participants 9 messages Jun 20 – Jun 21

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover riscv: dts: spacemit: serial/i2c/ethernet improvements for the K3 Pico-ITX board

This patch series tries to improve the K3 Pico-ITX board DTS by configuring the default baud rate for the serial port, enabling the 24c02 eeprom on i2c2, adding aliases for i2c2 and i2c8 ports, and enabling power saving features on the RTL8211F PHY.

Aurelien Jarno (5):
riscv: dts: spacemit: set console baud rate on K3 Pico-ITX board
riscv: dts: spacemit: enable the i2c2 adapter on K3 Pico-ITX board
riscv: dts: spacemit: add 24c02 eeprom on K3 Pico-ITX board
riscv: dts: spacemit: add i2c aliases on K3 Pico-ITX board
riscv: dts: spacemit: improve RTL8211F PHY configuration on K3
Pico-ITX board

 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 42 +++++++++++++++++++-
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 11 +++++
 2 files changed, 52 insertions(+), 1 deletion(-)
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#7 lore raw

PATCH 4/5 riscv: dts: spacemit: add i2c aliases on K3 Pico-ITX board

Add i2c aliases for i2c2 and i2c8 on K3 Pico-ITX board. This is useful to keep a stable number for the /dev entries after loading the i2c-dev module.

---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +2 -0
index 0a0c221c99e74..bf64b6c6f867f 100644
@@ -14,6 +14,8 @@ / {
 
 	aliases {
 		ethernet0 = &eth0;
+		i2c2 = &i2c2;
+		i2c8 = &i2c8;
 		serial0 = &uart0;
 	};
 
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#3 lore raw

PATCH 2/5 riscv: dts: spacemit: enable the i2c2 adapter on K3 Pico-ITX board

In reply to Aurelien Jarno

Define I2C2 pinctrl properties, and enable it on the K3 Pico-ITX board. It will be used by the 24c02 eeprom.

---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  6 ++++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 11 +++++++++++
 2 files changed, 17 insertions(+)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +6 -0
index 509cebc0c9568..5fe9041ec5702 100644
@@ -43,6 +43,12 @@ reg_aux_vcc5v: regulator-aux-vcc5v {
 	};
 };
 
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_1_cfg>;
+	status = "okay";
+};
+
 &i2c8 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c8_cfg>;
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +11 -0
index 3ee1471f37985..2017aa14fb424 100644
@@ -78,6 +78,17 @@ gmac1-phy-0-pins {
 		};
 	};
 
+	/omit-if-no-ref/
+	i2c2_1_cfg: i2c2-1-cfg {
+		i2c2-0-pins {
+			pinmux = <K3_PADCONF(46, 5)>,	/* i2c2 scl */
+				 <K3_PADCONF(47, 5)>;	/* i2c2 sda */
+
+			bias-pull-up= <0>;
+			drive-strength = <25>;
+		};
+	};
+
 	/omit-if-no-ref/
 	i2c8_cfg: i2c8-cfg {
 		i2c8-pins {
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#8 lore raw

PATCH 5/5 riscv: dts: spacemit: improve RTL8211F PHY configuration on K3 Pico-ITX board

In reply to Aurelien Jarno

Vendor kernel enabled ALDPS (Advanced Link Down Power Saving) on the RTL8211F PHY to save power when link down.

Vendor kernel also disabled the 125MHz clkout clock signal, and indeed the schematics confirms that it only goes to a test point (TP14), so let's do the same.

---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +2 -0
index bf64b6c6f867f..e12d798b48a49 100644
@@ -234,6 +234,8 @@ phy0: phy@1 {
 			reset-gpios = <&gpio 0 15 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
 			reset-deassert-us = <10000>;
+			realtek,aldps-enable;
+			realtek,clkout-disable;
 		};
 	};
 };
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw

PATCH 1/5 riscv: dts: spacemit: set console baud rate on K3 Pico-ITX board

In reply to Aurelien Jarno

Because the default console's baud rate is not set, defconfig kernels do not have any serial output on this platform. Set the baud rate to 115200, matching what is used by U-Boot etc on this platform.

Fixes 7a6131804986 ("riscv: dts: spacemit: add K3 Pico-ITX board support")
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +1 -1
index b89c1521e6649..509cebc0c9568 100644
@@ -18,7 +18,7 @@ aliases {
 	};
 
 	chosen {
-		stdout-path = "serial0";
+		stdout-path = "serial0:115200n8";
 	};
 
 	memory@100000000 {
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#6 lore raw

PATCH 3/5 riscv: dts: spacemit: add 24c02 eeprom on K3 Pico-ITX board

In reply to Aurelien Jarno

The K3 Pico-ITX board includes a 24c02 eeprom, that stores the product name, the part name, the MAC address of the network interfaces and the board's serial number. These values are also exposed via an onie,tlv-layout nvmem layout.

The eeprom is marked as read-only since its contents are not supposed to be modified.

---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +30 -0
index 5fe9041ec5702..0a0c221c99e74 100644
@@ -47,6 +47,36 @@ &i2c2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c2_1_cfg>;
 	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		reg = <0x50>;
+		pagesize = <8>;
+		read-only;
+		size = <256>;
+		status = "okay";
+
+		nvmem-layout {
+			compatible = "onie,tlv-layout";
+
+			mac-address {
+				#nvmem-cell-cells = <1>;
+			};
+
+			num-macs {
+			};
+
+			part-number {
+			};
+
+			product-name {
+			};
+
+			serial-number {
+			};
+
+		};
+	};
 };
 
 &i2c8 {
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#4 lore raw

Re: [PATCH 2/5] riscv: dts: spacemit: enable the i2c2 adapter on K3 Pico-ITX board

In reply to Aurelien Jarno
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] The pinctrl subnode is named `i2c2-0-pins` but belongs to the `i2c2-1-cfg` parent node. - [Low]…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The pinctrl subnode is named i2c2-0-pins but belongs to the i2c2-1-cfg parent node.
- [Low] Missing space before the assignment operator in bias-pull-up= <0>;.
--

commit 4dc6c92d42831e85b38f3350c15707d0e2b3af18
Author: Aurelien Jarno <[email protected]>

riscv: dts: spacemit: enable the i2c2 adapter on K3 Pico-ITX board

This commit defines the I2C2 pinctrl properties and enables the adapter on the K3 Pico-ITX board. It will be used by the 24c02 eeprom.

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +0 -0
index 23899d3f308a0..c9fe9c2e5aeee 100644

[ ... ]

arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi gmac0-phy-0-pins { · line 50

Quoted 7 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +3 -0
@@ -45,6 +45,17 @@ gmac0-phy-0-pins {
 		};
 	};
 
+	/omit-if-no-ref/
+	i2c2_1_cfg: i2c2-1-cfg {
+		i2c2-0-pins {

[Severity: Low]
This isn't a bug, but should this subnode be named i2c2-1-pins to match the i2c2-1-cfg parent node? It seems to diverge from the standard naming pattern where the suffix of the parent and child matches.

arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi gmac1-phy-0-pins { · line 87

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +4 -0
+			pinmux = <K3_PADCONF(46, 5)>,	/* i2c2 scl */
+				 <K3_PADCONF(47, 5)>;	/* i2c2 sda */
+
+			bias-pull-up= <0>;

[Severity: Low]
This isn't a bug, but there is a missing space before the equals sign here, which diverges from the spacing used in the surrounding code.

Quoted 3 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +3 -0
+			drive-strength = <25>;
+		};
+	};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] riscv: dts: spacemit: set console baud rate on K3 Pico-ITX board

In reply to Aurelien Jarno

Hi Aurelien,

Quoted 6 lines · Aurelien Jarno

Because the default console's baud rate is not set, defconfig kernels do not have any serial output on this platform. Set the baud rate to 115200, matching what is used by U-Boot etc on this platform.

Fixes 7a6131804986 ("riscv: dts: spacemit: add K3 Pico-ITX board support")

Thanks for the patch.

Quoted 25 lines

---
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +1 -1
index b89c1521e6649..509cebc0c9568 100644
@@ -18,7 +18,7 @@ aliases {
 	};
 
 	chosen {
-		stdout-path = "serial0";
+		stdout-path = "serial0:115200n8";
 	};
 
 	memory@100000000 {
Signature · 7 lines
2.53.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#5 lore raw

Re: [PATCH 2/5] riscv: dts: spacemit: enable the i2c2 adapter on K3 Pico-ITX board

In reply to [email protected]

Both issues reported by Sashiko AI (see below) are valid, I'll submit a v2 fixing them, but I'll first leave a few more days for humans to also have a look at the patches.

Regards
Aurelien

Quoted 49 lines · On 2026-06-20 06:29, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The pinctrl subnode is named i2c2-0-pins but belongs to the i2c2-1-cfg parent node.
- [Low] Missing space before the assignment operator in bias-pull-up= <0>;.
--

commit 4dc6c92d42831e85b38f3350c15707d0e2b3af18
Author: Aurelien Jarno <[email protected]>

riscv: dts: spacemit: enable the i2c2 adapter on K3 Pico-ITX board

This commit defines the I2C2 pinctrl properties and enables the adapter on the K3 Pico-ITX board. It will be used by the 24c02 eeprom.

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +0 -0
index 23899d3f308a0..c9fe9c2e5aeee 100644

[ ... ]

arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi gmac0-phy-0-pins { · line 50

Quoted 7 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +3 -0
@@ -45,6 +45,17 @@ gmac0-phy-0-pins {
 		};
 	};
 
+	/omit-if-no-ref/
+	i2c2_1_cfg: i2c2-1-cfg {
+		i2c2-0-pins {

[Severity: Low]
This isn't a bug, but should this subnode be named i2c2-1-pins to match the i2c2-1-cfg parent node? It seems to diverge from the standard naming pattern where the suffix of the parent and child matches.

arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi gmac1-phy-0-pins { · line 87

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +4 -0
+			pinmux = <K3_PADCONF(46, 5)>,	/* i2c2 scl */
+				 <K3_PADCONF(47, 5)>;	/* i2c2 sda */
+
+			bias-pull-up= <0>;

[Severity: Low]
This isn't a bug, but there is a missing space before the equals sign here, which diverges from the spacing used in the surrounding code.

Quoted 3 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +3 -0
+			drive-strength = <25>;
+		};
+	};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net