[PATCH 2/3] ARM: dts: renesas: Enable sysinfo on R-Car V3H Condor/Condor-I

Marek Vasut marek.vasut+renesas at mailbox.org
Mon Feb 27 23:58:47 CET 2023


From: Tam Nguyen <tam.nguyen.xa at renesas.com>

Add new sysinfo IDs for R-Car V3H Condor/Condor-I .

Enable support for sysinfo on R-Car V3H Condor/Condor-I. The sysinfo is
used e.g. to access and decode board-specific information and then in
turn used by board-info to print those information.

Reviewed-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
Signed-off-by: Tam Nguyen <tam.nguyen.xa at renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud at renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
[Marek: Drop compatible from I2C node, this is in r8a77980.dtsi already.
        Drop status = "okay" from EEPROM node.
	Add dts: tag.
	Update the commit message, note the new sysinfo IDs.
	Fix Kconfig EEPROM address to be 0x50 and match the DT, sync config.]
---
 arch/arm/dts/r8a77980-condor-u-boot.dts | 17 +++++++++++++++++
 configs/r8a77980_condor_defconfig       |  5 +++++
 drivers/sysinfo/rcar3.c                 | 15 +++++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/arch/arm/dts/r8a77980-condor-u-boot.dts b/arch/arm/dts/r8a77980-condor-u-boot.dts
index 576a74e6030..530abdb72bc 100644
--- a/arch/arm/dts/r8a77980-condor-u-boot.dts
+++ b/arch/arm/dts/r8a77980-condor-u-boot.dts
@@ -12,6 +12,23 @@
 	aliases {
 		spi0 = &rpc;
 	};
+
+	sysinfo {
+		compatible = "renesas,rcar-sysinfo";
+		i2c-eeprom = <&sysinfo_eeprom>;
+		u-boot,dm-pre-reloc;
+	};
+};
+
+&i2c0 {
+	u-boot,dm-pre-reloc;
+
+	sysinfo_eeprom: eeprom at 50 {
+		compatible = "rohm,br24t01", "atmel,24c01";
+		reg = <0x50>;
+		pagesize = <8>;
+		u-boot,dm-pre-reloc;
+	};
 };
 
 &rpc {
diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig
index 0c3493cdf8d..e1b3dc5d38a 100644
--- a/configs/r8a77980_condor_defconfig
+++ b/configs/r8a77980_condor_defconfig
@@ -33,6 +33,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_MAXARGS=64
 CONFIG_SYS_PBSIZE=2068
 CONFIG_CMD_BOOTZ=y
+CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=10
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -64,6 +65,9 @@ CONFIG_DFU_SF=y
 CONFIG_RCAR_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_RCAR_I2C=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x50
 CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS200_SUPPORT=y
@@ -84,6 +88,7 @@ CONFIG_SCIF_CONSOLE=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_RENESAS_RPC_SPI=y
+CONFIG_SYSINFO=y
 CONFIG_TEE=y
 CONFIG_OPTEE=y
 CONFIG_USB=y
diff --git a/drivers/sysinfo/rcar3.c b/drivers/sysinfo/rcar3.c
index c0afc92f675..7b127986da7 100644
--- a/drivers/sysinfo/rcar3.c
+++ b/drivers/sysinfo/rcar3.c
@@ -18,10 +18,12 @@
 #define BOARD_STARTER_KIT	0x2
 #define BOARD_EAGLE		0x3
 #define BOARD_SALVATOR_XS	0x4
+#define BOARD_CONDOR		0x6
 #define BOARD_DRAAK		0x7
 #define BOARD_EBISU		0x8
 #define BOARD_STARTER_KIT_PRE	0xB
 #define BOARD_EBISU_4D		0xD
+#define BOARD_CONDOR_I		0x10
 
 /**
  * struct sysinfo_rcar_priv - sysinfo private data
@@ -65,6 +67,7 @@ static void sysinfo_rcar_parse(struct sysinfo_rcar_priv *priv)
 	const u8 board_rev = priv->val & BOARD_REV_MASK;
 	bool salvator_xs = false;
 	bool ebisu_4d = false;
+	bool condor_i = false;
 	char rev_major = '?';
 	char rev_minor = '?';
 
@@ -138,6 +141,18 @@ static void sysinfo_rcar_parse(struct sysinfo_rcar_priv *priv)
 			 "Renesas Kriek board rev %c.%c",
 			 rev_major, rev_minor);
 		return;
+	case BOARD_CONDOR_I:
+		condor_i = true;
+		fallthrough;
+	case BOARD_CONDOR:
+		if (!board_rev) { /* Only rev 0 is valid */
+			rev_major = '1';
+			rev_minor = '0';
+		}
+		snprintf(priv->boardmodel, sizeof(priv->boardmodel),
+			"Renesas Condor%s board rev %c.%c",
+			condor_i ? "-I" : "", rev_major, rev_minor);
+		return;
 	default:
 		snprintf(priv->boardmodel, sizeof(priv->boardmodel),
 			 "Renesas -Unknown- board rev ?.?");
-- 
2.39.2



More information about the U-Boot mailing list