Skip to contentSkip to conversation

riscv: dts: spacemit: add eeprom for K3 CoM260

PATCH Applied Jennifer Berringer 3 participants 6 messages Jul 22 – Jul 28

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover riscv: dts: spacemit: add eeprom for K3 CoM260

SpacemiT K3 CoM260 Dev Kit has two eeproms: one on the compute module and one on the carrier board. Both use a Giantec GT24C02B-2TFLI-TR.

Jennifer Berringer (2):
riscv: dts: spacemit: k3-com260: add eeprom on i2c2
riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1

 .../riscv/boot/dts/spacemit/k3-com260-ifx.dts | 15 +++++++++
 arch/riscv/boot/dts/spacemit/k3-com260.dtsi   | 32 +++++++++++++++++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi  | 12 +++++++
 3 files changed, 59 insertions(+)

base-commit: 199380e4d8cd22e539a08d4949e9582b09390bd5

Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/2 riscv: dts: spacemit: k3-com260: add eeprom on i2c2

Enable i2c2 on the K3 CoM260 compute module and use it for a 24c02 eeprom. This eeprom stores the product name, a MAC address, and a serial number.

---
 arch/riscv/boot/dts/spacemit/k3-com260.dtsi | 32 +++++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +32 -0
index a38d7b738258d..a6f160dca19de 100644
@@ -26,6 +26,38 @@ reg_5v_sys: regulator-5v-sys {
 	};
 };
 
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_1_cfg>;
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		pagesize = <8>;
+		reg = <0x50>;
+		read-only;
+		size = <256>;
+		status = "okay";
+
+		nvmem-layout {
+			compatible = "onie,tlv-layout";
+
+			mac-address {
+				#nvmem-cell-cells = <1>;
+			};
+
+			num-macs {
+			};
+
+			product-name {
+			};
+
+			serial-number {
+			};
+		};
+	};
+};
+
 &i2c8 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c8_cfg>;
Signature · 1 line
2.55.0
#2 lore raw

PATCH 2/2 riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1

In reply to Jennifer Berringer

Enable i2c1 for k3-com260-ifx and use it for a 24c02 eeprom. This eeprom, unlike the one connected to i2c2, is part of the carrier board. Some boards do not have any data programmed on this eeprom from factory.

---
 arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts | 15 +++++++++++++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi   | 12 ++++++++++++
 2 files changed, 27 insertions(+)
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +15 -0
index e7f76cd24b903..a5c08a7a781a9 100644
@@ -20,6 +20,21 @@ chosen {
 	};
 };
 
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_1_cfg>;
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		pagesize = <8>;
+		reg = <0x50>;
+		read-only;
+		size = <256>;
+		status = "okay";
+	};
+};
+
 &sdhci0 {
 	pinctrl-names = "default","uhs";
 	pinctrl-0 = <&mmc1_cfg>;
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +12 -0
index 5b9045e014345..6482d24be1394 100644
@@ -78,6 +78,18 @@ gmac1-phy-0-pins {
 		};
 	};
 
+	/omit-if-no-ref/
+	i2c1_1_cfg: i2c1-1-cfg {
+		i2c1-1-pins {
+			pinmux = <K3_PADCONF(54, 5)>,	/* i2c1 scl */
+				 <K3_PADCONF(55, 5)>;	/* i2c1 sda */
+
+			bias-pull-up = <1>;
+			drive-strength = <25>;
+			power-source = <1800>;
+		};
+	};
+
 	/omit-if-no-ref/
 	i2c2_1_cfg: i2c2-1-cfg {
 		i2c2-1-pins {
Signature · 1 line
2.55.0
#3 lore raw

Re: [PATCH 2/2] riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The unprogrammed carrier board EEPROM is incorrectly marked `read-only`, preventing it from…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The unprogrammed carrier board EEPROM is incorrectly marked read-only, preventing it from being programmed. --

--- Patch [2]: [PATCH 2/2] riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1 --- commit 94048b36205e1670d5a85578a1cb608f4a7a0439
Author: Jennifer Berringer <[email protected]>

riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1

Enable i2c1 for the k3-com260-ifx board and attach a 24c02 EEPROM. The commit message notes that this carrier board EEPROM comes unprogrammed from the factory on some boards.

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +0 -0
index e7f76cd24b903..a5c08a7a781a9 100644

[ ... ]

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +0 -0
@@ -20,6 +20,21 @@ chosen {
 	};
 };
 

arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts chosen { · line 32

Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +10 -0
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_1_cfg>;
+	status = "okay";
+
+	eeprom@50 {
+		compatible = "atmel,24c02";
+		pagesize = <8>;
+		reg = <0x50>;
+		read-only;

[Severity: Medium]
The commit message mentions that some boards do not have any data programmed on this EEPROM from the factory. Does marking this eeprom@50 node as read-only prevent users or provisioning scripts from writing the initial configuration data to the EEPROM from Linux?

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +4 -0
+		size = <256>;
+		status = "okay";
+	};
+};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
maintainer Reviewed-by on the v1 series
#4 lore raw
In reply to Jennifer Berringer

Hi Jennifer,

Quoted 4 lines · Jennifer Berringer

SpacemiT K3 CoM260 Dev Kit has two eeproms: one on the compute module and one on the carrier board. Both use a Giantec GT24C02B-2TFLI-TR.

Patch looks good, so

Quoted 14 lines

Jennifer Berringer (2):
riscv: dts: spacemit: k3-com260: add eeprom on i2c2
riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1

 .../riscv/boot/dts/spacemit/k3-com260-ifx.dts | 15 +++++++++
 arch/riscv/boot/dts/spacemit/k3-com260.dtsi   | 32 +++++++++++++++++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi  | 12 +++++++
 3 files changed, 59 insertions(+)

base-commit: 199380e4d8cd22e539a08d4949e9582b09390bd5

Signature · 1 line
2.55.0
Signature · 1 line
Yixun Lan (dlan)
maintainer Applied
#5 lore raw
In reply to Jennifer Berringer
Quoted 9 lines · Jennifer Berringer

SpacemiT K3 CoM260 Dev Kit has two eeproms: one on the compute module and one on the carrier board. Both use a Giantec GT24C02B-2TFLI-TR.

Jennifer Berringer (2):
riscv: dts: spacemit: k3-com260: add eeprom on i2c2
riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1

[...]

Applied, thanks!

[1/2] riscv: dts: spacemit: k3-com260: add eeprom on i2c2

      https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=259f5639b4b1a04cef9a7f79a95ef9ab928264cd
[2/2] riscv: dts: spacemit: k3-com260-ifx: add eeprom on i2c1
      https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=b1d7f3e7da4230815ad732f764f7978049737bb6

Best regards,

Signature · 1 line
Yixun Lan <[email protected]>