]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: dts: renesas: Enable sysinfo on R-Car V3H Condor/Condor-I
authorTam Nguyen <tam.nguyen.xa@renesas.com>
Mon, 27 Feb 2023 22:58:47 +0000 (23:58 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Fri, 10 Mar 2023 16:46:09 +0000 (17:46 +0100)
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@mailbox.org>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@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
configs/r8a77980_condor_defconfig
drivers/sysinfo/rcar3.c

index 576a74e6030a11830a539af989319c9e8c91fe39..530abdb72bcc4749cb64c2df3fb4e66c6dd9a043 100644 (file)
        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@50 {
+               compatible = "rohm,br24t01", "atmel,24c01";
+               reg = <0x50>;
+               pagesize = <8>;
+               u-boot,dm-pre-reloc;
+       };
 };
 
 &rpc {
index 0c3493cdf8dfc50e49d50469b0b9a2c8bac9280a..e1b3dc5d38a9ebb0d4d306e9b5675da5f1c4d8cd 100644 (file)
@@ -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
index c0afc92f6758f22586a640de961aabfba35f68ec..7b127986da7e2e671af0bf17f6845b140545db82 100644 (file)
 #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 ?.?");