mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] riscv: dts: spacemit: enable onboard eeprom for OrangePi
@ 2026-09-01  8:00 Chukun Pan
  2026-09-05 17:05 ` Gong Shuai
  0 siblings, 1 reply; 2+ messages in thread
From: Chukun Pan @ 2026-09-01  8:00 UTC (permalink / raw)
  To: Yixun Lan
  Cc: Rob Herring, Paul Walmsley, Alexandre Ghiti, Albert Ou,
	Conor Dooley, Krzysztof Kozlowski, linux-riscv, linux-kernel,
	devicetree, spacemit, Chukun Pan

Enable the i2c2 bus and add the connected GT24C02B EEPROM.

[   6.766] TlvInfo Header:
[   6.766]    Id String:    TlvInfo
[   6.769]    Version:      1
[   6.772]    Total Length: 38
[   6.775] TLV Name             Code Len Value
[   6.779] -------------------- ---- --- -----
[   6.783] Base MAC Address     0x24   6 .....
[   6.788] MAC Addresses        0x2A   2 2
[   6.792] Product Name         0x21  15 x1_orangepi-r2s
[   6.797] Unknown              0x41   1  0x01
[   6.801] CRC-32               0xFE   4 0xE5A74B18
[   6.806] Checksum is valid.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
This patch depends on the following to avoid conflicts:
https://lore.kernel.org/lkml/20260802100101.327815-1-amadeus@jmu.edu.cn/
---
 .../boot/dts/spacemit/k1-orangepi-r2s.dts     | 30 ++++++++++++++++++
 .../boot/dts/spacemit/k1-orangepi-rv2.dts     | 31 +++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
index 2d1ba34cb00e..7125f2882ce8 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
@@ -13,6 +13,7 @@ / {
 	compatible = "xunlong,orangepi-r2s", "spacemit,k1";
 
 	aliases {
+		i2c2 = &i2c2;
 		i2c8 = &i2c8;
 		serial0 = &uart0;
 		ethernet0 = &eth0;
@@ -112,6 +113,35 @@ rgmii1: phy@1 {
 	};
 };
 
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_0_cfg>;
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		reg = <0x50>;
+		pagesize = <16>;
+		size = <256>;
+		read-only;
+		vcc-supply = <&buck3_1v8>;
+
+		nvmem-layout {
+			compatible = "onie,tlv-layout";
+
+			mac-address {
+				#nvmem-cell-cells = <1>;
+			};
+
+			num-macs {
+			};
+
+			product-name {
+			};
+		};
+	};
+};
+
 &i2c8 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c8_cfg>;
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index f7547a4da71a..837616255464 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -17,6 +17,8 @@ aliases {
 		serial0 = &uart0;
 		ethernet0 = &eth0;
 		ethernet1 = &eth1;
+		i2c2 = &i2c2;
+		i2c8 = &i2c8;
 		mmc0 = &emmc;
 		mmc1 = &sdhci0;
 	};
@@ -138,6 +140,35 @@ rgmii1: phy@1 {
 	};
 };
 
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_0_cfg>;
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		reg = <0x50>;
+		pagesize = <16>;
+		size = <256>;
+		read-only;
+		vcc-supply = <&buck3_1v8>;
+
+		nvmem-layout {
+			compatible = "onie,tlv-layout";
+
+			mac-address {
+				#nvmem-cell-cells = <1>;
+			};
+
+			num-macs {
+			};
+
+			product-name {
+			};
+		};
+	};
+};
+
 &i2c8 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c8_cfg>;
-- 
2.34.1


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

end of thread, other threads:[~2026-09-05 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01  8:00 [PATCH 1/1] riscv: dts: spacemit: enable onboard eeprom for OrangePi Chukun Pan
2026-09-05 17:05 ` Gong Shuai

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

all inboxes | Powered by JetHome®