Skip to contentSkip to conversation

ARM: dts: Turn Salvator-X into Multi-DTB config

PATCH New Marek Vasut 1 participant 1 message Dec 4, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: Turn Salvator-X into Multi-DTB config

Bundle DTBs for R8A7795, R8A7796, R8A77965 Salvator-X variants into the single U-Boot build and let U-Boot choose between them based on the CPU model.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 board/renesas/salvator-x/salvator-x.c | 22 ++++++++++++++++++++++
 configs/r8a7795_salvator-x_defconfig  |  2 ++
 configs/r8a77965_salvator-x_defconfig |  2 ++
 configs/r8a7796_salvator-x_defconfig  |  2 ++
 4 files changed, 28 insertions(+)
board/renesas/salvator-x/salvator-x.c +22 -0
index 8b15267d7b..9b37c34d66 100644
@@ -100,3 +100,25 @@ void reset_cpu(ulong addr)
 	writel(RST_CODE, RST_CA57RESCNT);
 #endif
 }
+
+#ifdef CONFIG_MULTI_DTB_FIT
+int board_fit_config_name_match(const char *name)
+{
+	/* PRR driver is not available yet */
+	u32 cpu_type = rmobile_get_cpu_type();
+
+	if ((cpu_type == RMOBILE_CPU_TYPE_R8A7795) &&
+	    !strcmp(name, "r8a7795-salvator-x-u-boot"))
+		return 0;
+
+	if ((cpu_type == RMOBILE_CPU_TYPE_R8A7796) &&
+	    !strcmp(name, "r8a7796-salvator-x-u-boot"))
+		return 0;
+
+	if ((cpu_type == RMOBILE_CPU_TYPE_R8A77965) &&
+	    !strcmp(name, "r8a77965-salvator-x-u-boot"))
+		return 0;
+
+	return -1;
+}
+#endif
configs/r8a7795_salvator-x_defconfig +2 -0
index 0899de16b4..823688f0b1 100644
@@ -33,6 +33,8 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7795-salvator-x-u-boot"
+CONFIG_OF_LIST="r8a7795-salvator-x-u-boot r8a7796-salvator-x-u-boot r8a77965-salvator-x-u-boot"
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
configs/r8a77965_salvator-x_defconfig +2 -0
index 4af3960c14..1753f03ea2 100644
@@ -34,6 +34,8 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a77965-salvator-x-u-boot"
+CONFIG_OF_LIST="r8a7795-salvator-x-u-boot r8a7796-salvator-x-u-boot r8a77965-salvator-x-u-boot"
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
configs/r8a7796_salvator-x_defconfig +2 -0
index 8d6763a944..84a87f6a59 100644
@@ -34,6 +34,8 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7796-salvator-x-u-boot"
+CONFIG_OF_LIST="r8a7795-salvator-x-u-boot r8a7796-salvator-x-u-boot r8a77965-salvator-x-u-boot"
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
Signature · 1 line
2.18.0