Skip to contentSkip to conversation

TQMa6UL: read module data from EEPROM

PATCH Superseded Max Merchel 1 participant 5 messages Jul 1

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

cover TQMa6UL: read module data from EEPROM

Reading TQMa6UL module data from the module EEPROM using the tq-EEPROM-sysinfo driver.

Max Merchel (4):
sysinfo: tq_eeprom: select NVMEM
arm: dts: tqma6ul: add eeprom nvmem-layout
arm: dts: tqma6ul: integrate tq,eeprom sysinfo driver
boards: tqma6ul: select TQ_COMMON_SYSINFO

 arch/arm/dts/imx6ul-tqma6ul-common-u-boot.dtsi | 18 ++++++++++++++++++
 arch/arm/mach-imx/mx6/Kconfig                  |  1 +
 drivers/sysinfo/Kconfig                        |  1 +
 3 files changed, 20 insertions(+)

base-commit: 298d44464dc63a4f3f5489150acd7958f359f9bd

Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/4 sysinfo: tq_eeprom: select NVMEM

The SYSINFO_TQ_EEPROM driver requires NVMEM to access the SoM EEPROM.

---
 drivers/sysinfo/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/sysinfo/Kconfig +1 -0
index 6922dac9170..adcf1aed8a8 100644
@@ -63,6 +63,7 @@ config SYSINFO_TQ_EEPROM
 	bool "Enable TQ-Systems EEPROM sysinfo driver"
 	depends on I2C_EEPROM
 	depends on SPL_I2C_EEPROM || !SPL_SYSINFO
+	select NVMEM
 	help
 	  Support querying EEPROM of TQ-Systems SOMs to determine board
 	  information.
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/4 arm: dts: tqma6ul: add eeprom nvmem-layout

In reply to Max Merchel

TQMa6UL has board-information located in EEPROM at offset 0x20. Add necessary nodes and properties for nvmem-cells.

Revert this commit once the upstream linux device trees are accepted and synchronized.

---
 arch/arm/dts/imx6ul-tqma6ul-common-u-boot.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/dts/imx6ul-tqma6ul-common-u-boot.dtsi +12 -0
index 09f94f23074..1ed44c57f59 100644
@@ -24,6 +24,18 @@
 	bootph-pre-ram;
 };
 
+&m24c64_50 {
+	nvmem-layout {
+		compatible = "fixed-layout";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		module_info: module-info@20 {
+			reg = <0x20 0x60>;
+		};
+	};
+};
+
 &osc {
 	bootph-pre-ram;
 };
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/4 arm: dts: tqma6ul: integrate tq,eeprom sysinfo driver

In reply to Max Merchel

Add sysinfo node for tq,eeprom sysinfo driver.

---
 arch/arm/dts/imx6ul-tqma6ul-common-u-boot.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/dts/imx6ul-tqma6ul-common-u-boot.dtsi +6 -0
index 1ed44c57f59..c9e6cef38a2 100644
@@ -14,6 +14,12 @@
 		u-boot,mmc-env-offset = <0x100000>;
 		u-boot,mmc-env-offset-redundant = <0x110000>;
 	};
+
+	sysinfo: sysinfo {
+		compatible = "tq,eeprom-sysinfo";
+		nvmem-cells = <&module_info>;
+		nvmem-cell-names = "device_info";
+	};
 };
 
 &clks {
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/4 boards: tqma6ul: select TQ_COMMON_SYSINFO

In reply to Max Merchel

Select TQ_COMMON_SYSINFO to use the tq_eeprom sysinfo driver to read and print module EEPROM data.

---
 arch/arm/mach-imx/mx6/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-imx/mx6/Kconfig +1 -0
index 7ed4b24b751..2680eb8fa44 100644
@@ -637,6 +637,7 @@ config TARGET_TQMA6UL
 	bool "TQ-Systems TQMa6UL[L]x"
 	depends on MX6UL || MX6ULL
 	select TQ_COMMON_SOM
+	select TQ_COMMON_SYSINFO
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 	select OF_SYSTEM_SETUP
Signature · 1 line
2.43.0