Skip to contentSkip to conversation

ARM: clearfog: add run-time board detect

PATCH New Baruch Siach 2 participants 15 messages Jan 20, 2020 – Jan 21, 2020

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

v2 cover ARM: clearfog: add run-time board detect

Newer revisions of SolidRun Clearfog Base/Pro carriers and Armada 388 SOM add EEPROM storage for board detection. This patch series adds support for reading EEPROM stored board information, and using it to set RAM training parameters, serdes configuration, and kernel DT selection.

The information is stored in EEPROM in TLV format defined for the ONIE project.

https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html

This series add the sys_eeprom command from ONIE carried U-Boot patch, with a number for changes as described in the patch log. The TLV format is unchanged.

This series also adds support for the newly introduced single board, Aramda 385 based Clearfog GTR system. RAM configuration on that system requires both Armada 38x DDR clocks to be enabled. The first patch in this series adds the necessary code to allow per-board selection of DDR clock.

Changes in v2:

* Fix checkpatch issues in TLV EEPROM code

* Make TLV EEPROM API independent of static storage for compatibility with pre-relocation code

* Rename sys_eeprom to less generic tlv_eeprom throughout the code

* Drop typedefs

* Move board level TLV parse code to the common/ sub-directory for easier reuse in other SolidRun platforms

* Integrate fixes from Joel Johnson: add missing u-boot/crc.h include; select SPL_DRIVERS_MISC_SUPPORT; fix build with CMD_TLV_EEPROM unset

* Add review tags from Stefan Roese

Baruch Siach (10):
ddr: marvell: a38x: allow board specific clock out setup
arm: mvebu: clearfog: enable both DDR clocks
cmd: add tlv_eeprom command
ARM: mvebu: clearfog: add EEPROM devices
ARM: mvebu: clearfog: add support for EEPROM TLV info
ARM: mvebu: clearfog: read basic TLV data
ARM: mvebu: clearfog: print TLV stored product name
ARM: mvebu: clearfog: run-time selection of DT file
ARM: mvebu: clearfog: add Clearfog GTR support
ARM: mvebu: clearfog: add Clearfog Base serdes configuration

 arch/arm/dts/armada-388-clearfog-u-boot.dtsi  |   12 +
 arch/arm/dts/armada-388-clearfog.dts          |    6 +
 .../arm/dts/armada-38x-solidrun-microsom.dtsi |    8 +
 arch/arm/mach-mvebu/Kconfig                   |    1 +
 board/solidrun/clearfog/clearfog.c            |   72 +-
 board/solidrun/common/Makefile                |    5 +
 board/solidrun/common/tlv_data.c              |  102 ++
 board/solidrun/common/tlv_data.h              |   18 +
 cmd/Kconfig                                   |   14 +
 cmd/Makefile                                  |    2 +
 cmd/tlv_eeprom.c                              | 1105 +++++++++++++++++
 configs/clearfog_defconfig                    |    4 +
 drivers/ddr/marvell/a38x/ddr3_training.c      |   10 +-
 drivers/ddr/marvell/a38x/ddr_topology_def.h   |    3 +
 include/tlv_eeprom.h                          |  164 +++
 15 files changed, 1522 insertions(+), 4 deletions(-)
 create mode 100644 board/solidrun/common/Makefile
 create mode 100644 board/solidrun/common/tlv_data.c
 create mode 100644 board/solidrun/common/tlv_data.h
 create mode 100644 cmd/tlv_eeprom.c
 create mode 100644 include/tlv_eeprom.h
Signature · 1 line
2.24.1
#1 lore raw

PATCH v2 1/10 ddr: marvell: a38x: allow board specific clock out setup

DDR clock out might be unrelated to the number of active chip-select. For example, the board might have two DDR components, but only one chip-select. The clk_enable mask allows the board to enable DDR clocks regardless of active chip-selects.

---
 drivers/ddr/marvell/a38x/ddr3_training.c    | 10 ++++++++--
 drivers/ddr/marvell/a38x/ddr_topology_def.h |  3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/ddr/marvell/a38x/ddr3_training.c +8 -2
index c7be700d641f..9718f18c3024 100644
@@ -280,8 +280,14 @@ int ddr3_tip_configure_cs(u32 dev_num, u32 if_id, u32 cs_num, u32 enable)
 {
 	u32 data, addr_hi, data_high;
 	u32 mem_index;
+	u32 clk_enable;
 	struct mv_ddr_topology_map *tm = mv_ddr_topology_map_get();
 
+	if (tm->clk_enable & (1 << cs_num))
+		clk_enable = 1;
+	else
+		clk_enable = enable;
+
 	if (enable == 1) {
 		data = (tm->interface_params[if_id].bus_width ==
 			MV_DDR_DEV_WIDTH_8BIT) ? 0 : 1;
@@ -316,13 +322,13 @@ int ddr3_tip_configure_cs(u32 dev_num, u32 if_id, u32 cs_num, u32 enable)
 	case 2:
 		CHECK_STATUS(ddr3_tip_if_write
 			     (dev_num, ACCESS_TYPE_UNICAST, if_id,
-			      DUNIT_CTRL_LOW_REG, (enable << (cs_num + 11)),
+			      DUNIT_CTRL_LOW_REG, (clk_enable << (cs_num + 11)),
 			      1 << (cs_num + 11)));
 		break;
 	case 3:
 		CHECK_STATUS(ddr3_tip_if_write
 			     (dev_num, ACCESS_TYPE_UNICAST, if_id,
-			      DUNIT_CTRL_LOW_REG, (enable << 15), 1 << 15));
+			      DUNIT_CTRL_LOW_REG, (clk_enable << 15), 1 << 15));
 		break;
 	}
 
drivers/ddr/marvell/a38x/ddr_topology_def.h +3 -0
index e6fe8a04289b..950f296ff984 100644
@@ -124,6 +124,9 @@ struct mv_ddr_topology_map {
 
 	/* electrical parameters */
 	unsigned int electrical_data[MV_DDR_EDATA_LAST];
+
+	/* Clock enable mask */
+	u32 clk_enable;
 };
 
 enum mv_ddr_iface_mode {
Signature · 1 line
2.24.1
#2 lore raw

PATCH v2 2/10 arm: mvebu: clearfog: enable both DDR clocks

In reply to Baruch Siach

Enabled both DDR clock signals to support Clearfog variants (currently, Clearfog GTR) that need both clocks.

---
 board/solidrun/clearfog/clearfog.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
board/solidrun/clearfog/clearfog.c +4 -1
index 03724fee10c1..8b6381194688 100644
@@ -68,7 +68,10 @@ static struct mv_ddr_topology_map board_topology_map = {
 	BUS_MASK_32BIT,			/* Busses mask */
 	MV_DDR_CFG_DEFAULT,		/* ddr configuration data source */
 	{ {0} },			/* raw spd data */
-	{0}				/* timing parameters */
+	{0},				/* timing parameters */
+	{ {0} },			/* electrical configuration */
+	{0,},				/* electrical parameters */
+	0x3,				/* clock enable mask */
 };
 
 struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
Signature · 1 line
2.24.1
#3 lore raw

PATCH v2 3/10 cmd: add tlv_eeprom command

In reply to Baruch Siach

Add support for read/write of ONIE "Tlvinfo" EEPROM data format. TLV stands for Type-Length-Value. The data format is described here:

https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html#board-eeprom-information-format

Based on U-Boot patch from the Open Compute project:

https://github.com/opencomputeproject/onie/blob/ec87e872d46b9805565d2c6124b2f701ef1c07b1/patches/u-boot/common/feature-sys-eeprom-tlv-common.patch

Keep only I2C EEPROM support. Use the generic eeprom driver. Fix checkpatch issues.

Add support for multiple EEPROM TLV stores on the same system. This is useful in case of SOM and carrier that both provide ID and hardware configuration information.

Add option to enable for SPL. This allows selection of RAM configuration based on EEPROM stored board identification.

---
 cmd/Kconfig          |   14 +
 cmd/Makefile         |    2 +
 cmd/tlv_eeprom.c     | 1105 ++++++++++++++++++++++++++++++++++++++++++
 include/tlv_eeprom.h |  164 +++++++
 4 files changed, 1285 insertions(+)
 create mode 100644 cmd/tlv_eeprom.c
 create mode 100644 include/tlv_eeprom.h
cmd/Kconfig +14 -0
index 298feae24d3f..b094f15ee155 100644
@@ -242,6 +242,20 @@ config CMD_REGINFO
 	help
 	  Register dump
 
+config CMD_TLV_EEPROM
+	bool "tlv_eeprom"
+	depends on I2C_EEPROM
+	help
+	  Display and program the system EEPROM data block in ONIE Tlvinfo
+	  format. TLV stands for Type-Length-Value.
+
+config SPL_CMD_TLV_EEPROM
+	bool "tlv_eeprom for SPL"
+	depends on SPL_I2C_EEPROM
+	select SPL_DRIVERS_MISC_SUPPORT
+	help
+	  Read system EEPROM data block in ONIE Tlvinfo format from SPL.
+
 endmenu
 
 menu "Boot commands"
cmd/Makefile +2 -0
index ecf687d49f38..ddc1368c7aea 100644
@@ -184,6 +184,8 @@ obj-$(CONFIG_X86) += x86/
 obj-$(CONFIG_ARCH_MVEBU) += mvebu/
 endif # !CONFIG_SPL_BUILD
 
+obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o
+
 # core command
 obj-y += nvedit.o
 
cmd/tlv_eeprom.c new file +1105 -0

1,105 lines not on this page · raw message

include/tlv_eeprom.h new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
2.24.1
#5 lore raw

PATCH v2 4/10 ARM: mvebu: clearfog: add EEPROM devices

In reply to Baruch Siach

Add device-tree description for the EEPROM devices on Armada 388 SOM rev 2.1.

Another EEPROM is now on Clearfog Pro carrier rev 2.2, and Clearfog Base rev 1.3.

---
 arch/arm/dts/armada-388-clearfog-u-boot.dtsi   | 12 ++++++++++++
 arch/arm/dts/armada-388-clearfog.dts           |  6 ++++++
 arch/arm/dts/armada-38x-solidrun-microsom.dtsi |  8 ++++++++
 3 files changed, 26 insertions(+)
arch/arm/dts/armada-388-clearfog-u-boot.dtsi +12 -0
index 9c694089454f..0befcdae298a 100644
@@ -24,3 +24,15 @@
 &ahci1 {
 	u-boot,dm-spl;
 };
+
+&i2c0 {
+	u-boot,dm-spl;
+
+	eeprom at 52 {
+		u-boot,dm-spl;
+	};
+
+	eeprom at 53 {
+		u-boot,dm-spl;
+	};
+};
arch/arm/dts/armada-388-clearfog.dts +6 -0
index 4ddeaa02f122..e4164f49b24d 100644
@@ -259,6 +259,12 @@
 		compatible = "microchip,mcp3021";
 		reg = <0x4c>;
 	};
+
+	eeprom at 52 {
+		compatible = "atmel,24c02";
+		reg = <0x52>;
+		pagesize = <16>;
+	};
 };
 
 &i2c1 {
arch/arm/dts/armada-38x-solidrun-microsom.dtsi +8 -0
index a2627223ce3b..a322a28c215c 100644
@@ -99,3 +99,11 @@
 	status = "okay";
 	u-boot,dm-pre-reloc;
 };
+
+&i2c0 {
+	eeprom at 53 {
+		compatible = "atmel,24c02";
+		reg = <0x53>;
+		pagesize = <16>;
+	};
+};
Signature · 1 line
2.24.1
#6 lore raw

PATCH v2 5/10 ARM: mvebu: clearfog: add support for EEPROM TLV info

In reply to Baruch Siach
---
 configs/clearfog_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/clearfog_defconfig +4 -0
index 28ce0715926f..e2399a97391d 100644
@@ -28,6 +28,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x1
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_CMD_TLV_EEPROM=y
+CONFIG_SPL_CMD_TLV_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -49,6 +51,8 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SPL_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_SDHCI=y
Signature · 1 line
2.24.1
#8 lore raw

PATCH v2 6/10 ARM: mvebu: clearfog: read basic TLV data

In reply to Baruch Siach

Read RAM die capacity from the EEPROM TLV.

Follow the ONIE standard that defines the Vendor Extension entry type for vendor specific data. We have no Private Enterprise Number at the moment as the standard requires. Use the dummy all 0xff value for now.

---
 board/solidrun/clearfog/clearfog.c |  28 ++++++++
 board/solidrun/common/Makefile     |   5 ++
 board/solidrun/common/tlv_data.c   | 102 +++++++++++++++++++++++++++++
 board/solidrun/common/tlv_data.h   |  18 +++++
 4 files changed, 153 insertions(+)
 create mode 100644 board/solidrun/common/Makefile
 create mode 100644 board/solidrun/common/tlv_data.c
 create mode 100644 board/solidrun/common/tlv_data.h
board/solidrun/clearfog/clearfog.c +28 -0
index 8b6381194688..39a24aa69ae8 100644
@@ -10,6 +10,7 @@
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
+#include "../common/tlv_data.h"
 
 #include "../drivers/ddr/marvell/a38x/ddr3_init.h"
 #include <../serdes/a38x/high_speed_env_spec.h>
@@ -28,6 +29,19 @@ DECLARE_GLOBAL_DATA_PTR;
 #define BOARD_GPP_POL_LOW	0x0
 #define BOARD_GPP_POL_MID	0x0
 
+static struct tlv_data cf_tlv_data;
+
+static void cf_read_tlv_data(void)
+{
+	static bool read_once;
+
+	if (read_once)
+		return;
+	read_once = true;
+
+	read_tlv_data(&cf_tlv_data);
+}
+
 static struct serdes_map board_serdes_map[] = {
 	{SATA0, SERDES_SPEED_3_GBPS, SERDES_DEFAULT_MODE, 0, 0},
 	{SGMII1, SERDES_SPEED_1_25_GBPS, SERDES_DEFAULT_MODE, 0, 0},
@@ -76,6 +90,20 @@ static struct mv_ddr_topology_map board_topology_map = {
 
 struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
 {
+	struct if_params *ifp = &board_topology_map.interface_params[0];
+
+	cf_read_tlv_data();
+
+	switch (cf_tlv_data.ram_size) {
+	case 4:
+	default:
+		ifp->memory_size = MV_DDR_DIE_CAP_4GBIT;
+		break;
+	case 8:
+		ifp->memory_size = MV_DDR_DIE_CAP_8GBIT;
+		break;
+	}
+
 	/* Return the board topology as defined in the board code */
 	return &board_topology_map;
 }
board/solidrun/common/Makefile new file +5 -0
new file mode 100644
index 000000000000..a72ac1b7b999
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) SolidRun
+
+obj-$(CONFIG_TARGET_CLEARFOG) += tlv_data.o
board/solidrun/common/tlv_data.c new file +102 -0

102 lines not on this page · raw message

board/solidrun/common/tlv_data.h new file +18 -0
new file mode 100644
index 000000000000..a1432e4b8e1d
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 SolidRun
+ */
+
+#ifndef __BOARD_SR_COMMON_H_
+#define __BOARD_SR_COMMON_H_
+
+struct tlv_data {
+	/* Store product name of both SOM and carrier */
+	char tlv_product_name[2][32];
+	unsigned int ram_size;
+};
+
+void read_tlv_data(struct tlv_data *td);
+bool sr_product_is(const struct tlv_data *td, const char *product);
+
+#endif /* __BOARD_SR_COMMON_H_ */
Signature · 1 line
2.24.1
#10 lore raw

PATCH v2 7/10 ARM: mvebu: clearfog: print TLV stored product name

In reply to Baruch Siach

Use the data from EEPROM TLV to display the board identity.

---
 board/solidrun/clearfog/clearfog.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
board/solidrun/clearfog/clearfog.c +10 -1
index 39a24aa69ae8..8050cca55ab7 100644
@@ -156,7 +156,16 @@ int board_init(void)
 
 int checkboard(void)
 {
-	puts("Board: SolidRun ClearFog\n");
+	char *board = "ClearFog";
+
+	cf_read_tlv_data();
+	if (strlen(cf_tlv_data.tlv_product_name[0]) > 0)
+		board = cf_tlv_data.tlv_product_name[0];
+
+	printf("Board: SolidRun %s", board);
+	if (strlen(cf_tlv_data.tlv_product_name[1]) > 0)
+		printf(", %s", cf_tlv_data.tlv_product_name[1]);
+	puts("\n");
 
 	return 0;
 }
Signature · 1 line
2.24.1
#11 lore raw

PATCH v2 8/10 ARM: mvebu: clearfog: run-time selection of DT file

In reply to Baruch Siach

Set the kernel device-tree file (fdtfile environment variable) based on run-time detection of the platform.

---
 arch/arm/mach-mvebu/Kconfig        |  1 +
 board/solidrun/clearfog/clearfog.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
arch/arm/mach-mvebu/Kconfig +1 -0
index fdd39685b75d..bc5eaa5a7679 100644
@@ -91,6 +91,7 @@ choice
 config TARGET_CLEARFOG
 	bool "Support ClearFog"
 	select 88F6820
+	select BOARD_LATE_INIT
 
 config TARGET_HELIOS4
 	bool "Support Helios4"
board/solidrun/clearfog/clearfog.c +14 -0
index 8050cca55ab7..e178b06cd34d 100644
@@ -175,3 +175,17 @@ int board_eth_init(bd_t *bis)
 	cpu_eth_init(bis); /* Built in controller(s) come first */
 	return pci_eth_init(bis);
 }
+
+int board_late_init(void)
+{
+	cf_read_tlv_data();
+
+	if (sr_product_is(&cf_tlv_data, "Clearfog Base"))
+		env_set("fdtfile", "armada-388-clearfog-base.dtb");
+	else if (sr_product_is(&cf_tlv_data, "Clearfog GTR S4"))
+		env_set("fdtfile", "armada-385-clearfog-gtr-s4.dtb");
+	else if (sr_product_is(&cf_tlv_data, "Clearfog GTR L8"))
+		env_set("fdtfile", "armada-385-clearfog-gtr-l8.dtb");
+
+	return 0;
+}
Signature · 1 line
2.24.1
#12 lore raw

PATCH v2 9/10 ARM: mvebu: clearfog: add Clearfog GTR support

In reply to Baruch Siach

Select the serdes configuration table based on the platform identity read from EEPROM TLV data. Clearfog GTR needs a slightly different serdes configuration.

---
 board/solidrun/clearfog/clearfog.c | 8 ++++++++
 1 file changed, 8 insertions(+)
board/solidrun/clearfog/clearfog.c +8 -0
index e178b06cd34d..3bc9ce0839a9 100644
@@ -53,6 +53,14 @@ static struct serdes_map board_serdes_map[] = {
 
 int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
 {
+	cf_read_tlv_data();
+
+	if (sr_product_is(&cf_tlv_data, "Clearfog GTR")) {
+		board_serdes_map[0].serdes_type = PEX0;
+		board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
+		board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
+	}
+
 	*serdes_map_array = board_serdes_map;
 	*count = ARRAY_SIZE(board_serdes_map);
 	return 0;
Signature · 1 line
2.24.1
#13 lore raw

PATCH v2 10/10 ARM: mvebu: clearfog: add Clearfog Base serdes configuration

In reply to Baruch Siach

Clearfog Base carrier uses serdes lane #5 as USB host. Use EEPROM stored device identification to configure the serdes accordingly when available.

---
 board/solidrun/clearfog/clearfog.c | 6 ++++++
 1 file changed, 6 insertions(+)
board/solidrun/clearfog/clearfog.c +6 -0
index 3bc9ce0839a9..e268ef55a2a0 100644
@@ -61,6 +61,12 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
 		board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
 	}
 
+	if (sr_product_is(&cf_tlv_data, "Clearfog Base")) {
+		board_serdes_map[4].serdes_type = USB3_HOST0;
+		board_serdes_map[4].serdes_speed = SERDES_SPEED_5_GBPS;
+		board_serdes_map[4].serdes_mode = SERDES_DEFAULT_MODE;
+	}
+
 	*serdes_map_array = board_serdes_map;
 	*count = ARRAY_SIZE(board_serdes_map);
 	return 0;
Signature · 1 line
2.24.1
#4 lore raw

PATCH v2 3/10 cmd: add tlv_eeprom command

In reply to Baruch Siach
Quoted 20 lines · Baruch Siach

Add support for read/write of ONIE "Tlvinfo" EEPROM data format. TLV stands for Type-Length-Value. The data format is described here:

https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html#board-eeprom-information-format

Based on U-Boot patch from the Open Compute project:

   https://github.com/opencomputeproject/onie/blob/ec87e872d46b9805565d2c6124b2f701ef1c07b1/patches/u-boot/common/feature-sys-eeprom-tlv-common.patch

Keep only I2C EEPROM support. Use the generic eeprom driver. Fix checkpatch issues.

Add support for multiple EEPROM TLV stores on the same system. This is useful in case of SOM and carrier that both provide ID and hardware configuration information.

Add option to enable for SPL. This allows selection of RAM configuration based on EEPROM stored board identification.

Quoted 8 lines
---
  cmd/Kconfig          |   14 +
  cmd/Makefile         |    2 +
  cmd/tlv_eeprom.c     | 1105 ++++++++++++++++++++++++++++++++++++++++++
  include/tlv_eeprom.h |  164 +++++++
  4 files changed, 1285 insertions(+)

create mode 100644 cmd/tlv_eeprom.c
create mode 100644 include/tlv_eeprom.h

Thanks,
Stefan

#7 lore raw

PATCH v2 5/10 ARM: mvebu: clearfog: add support for EEPROM TLV info

In reply to Baruch Siach
Quoted 20 lines · Baruch Siach
---
  configs/clearfog_defconfig | 4 ++++
  1 file changed, 4 insertions(+)
configs/clearfog_defconfig +2 -0
index 28ce0715926f..e2399a97391d 100644
@@ -28,6 +28,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
  CONFIG_DISPLAY_BOARDINFO_LATE=y
  CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x1
  CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_CMD_TLV_EEPROM=y
+CONFIG_SPL_CMD_TLV_EEPROM=y
  # CONFIG_CMD_FLASH is not set
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_I2C=y

configs/clearfog_defconfig CONFIG_DM_GPIO=y · line 58

Quoted 8 lines
configs/clearfog_defconfig +2 -0
@@ -49,6 +51,8 @@ CONFIG_DM_GPIO=y
  CONFIG_DM_PCA953X=y
  CONFIG_DM_I2C=y
  CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SPL_I2C_EEPROM=y
  CONFIG_DM_MMC=y
  CONFIG_SUPPORT_EMMC_BOOT=y
  CONFIG_MMC_SDHCI=y

Thanks,
Stefan

#9 lore raw

PATCH v2 6/10 ARM: mvebu: clearfog: read basic TLV data

In reply to Baruch Siach
Quoted 7 lines · Baruch Siach

Read RAM die capacity from the EEPROM TLV.

Follow the ONIE standard that defines the Vendor Extension entry type for vendor specific data. We have no Private Enterprise Number at the moment as the standard requires. Use the dummy all 0xff value for now.

Thanks,
Stefan

#14 lore raw

v2 cover ARM: clearfog: add run-time board detect

In reply to Baruch Siach
Quoted 36 lines · Baruch Siach

Newer revisions of SolidRun Clearfog Base/Pro carriers and Armada 388 SOM add EEPROM storage for board detection. This patch series adds support for reading EEPROM stored board information, and using it to set RAM training parameters, serdes configuration, and kernel DT selection.

The information is stored in EEPROM in TLV format defined for the ONIE project.

https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html

This series add the sys_eeprom command from ONIE carried U-Boot patch, with a number for changes as described in the patch log. The TLV format is unchanged.

This series also adds support for the newly introduced single board, Aramda 385 based Clearfog GTR system. RAM configuration on that system requires both Armada 38x DDR clocks to be enabled. The first patch in this series adds the necessary code to allow per-board selection of DDR clock.

Changes in v2:

* Fix checkpatch issues in TLV EEPROM code

* Make TLV EEPROM API independent of static storage for compatibility with pre-relocation code

* Rename sys_eeprom to less generic tlv_eeprom throughout the code

* Drop typedefs

* Move board level TLV parse code to the common/ sub-directory for easier reuse in other SolidRun platforms

* Integrate fixes from Joel Johnson: add missing u-boot/crc.h include; select SPL_DRIVERS_MISC_SUPPORT; fix build with CMD_TLV_EEPROM unset

* Add review tags from Stefan Roese

Quoted 11 lines

Baruch Siach (10):
ddr: marvell: a38x: allow board specific clock out setup
arm: mvebu: clearfog: enable both DDR clocks
cmd: add tlv_eeprom command
ARM: mvebu: clearfog: add EEPROM devices
ARM: mvebu: clearfog: add support for EEPROM TLV info
ARM: mvebu: clearfog: read basic TLV data
ARM: mvebu: clearfog: print TLV stored product name
ARM: mvebu: clearfog: run-time selection of DT file
ARM: mvebu: clearfog: add Clearfog GTR support
ARM: mvebu: clearfog: add Clearfog Base serdes configuration

Complete series:

Applied to u-boot-marvell/master

Thanks,
Stefan