icorem6: Make SPL to pick suitable fdt

SPL FIT is able to pick the suitable fdt file for u-boot,
so add that function through board_fit_config_name_match.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
diff --git a/board/engicam/icorem6/MAINTAINERS b/board/engicam/icorem6/MAINTAINERS
index 6116648..26b4b56 100644
--- a/board/engicam/icorem6/MAINTAINERS
+++ b/board/engicam/icorem6/MAINTAINERS
@@ -3,10 +3,8 @@
 S:	Maintained
 F:	board/engicam/icorem6
 F:	include/configs/imx6qdl_icore.h
-F:	configs/imx6q_icore_mmc_defconfig
-F:	configs/imx6q_icore_nand_defconfig
-F:	configs/imx6dl_icore_mmc_defconfig
-F:	configs/imx6dl_icore_nand_defconfig
+F:	configs/imx6qdl_icore_mmc_defconfig
+F:	configs/imx6qdl_icore_nand_defconfig
 F:	arch/arm/dts/imx6qdl-icore.dtsi
 F:	arch/arm/dts/imx6q-icore.dts
 F:	arch/arm/dts/imx6dl-icore.dts
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index 0687329..c8aaad1 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -353,6 +353,18 @@
 }
 #endif
 
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+	if (is_mx6dq() && !strcmp(name, "imx6q-icore"))
+		return 0;
+	else if ((is_mx6dl() || is_mx6solo()) && !strcmp(name, "imx6dl-icore"))
+		return 0;
+	else
+		return -1;
+}
+#endif
+
 /*
  * Driving strength:
  *   0x30 == 40 Ohm
diff --git a/board/engicam/icorem6_rqs/MAINTAINERS b/board/engicam/icorem6_rqs/MAINTAINERS
index 2d2295c..74470ba 100644
--- a/board/engicam/icorem6_rqs/MAINTAINERS
+++ b/board/engicam/icorem6_rqs/MAINTAINERS
@@ -3,8 +3,7 @@
 S:	Maintained
 F:	board/engicam/icorem6_rqs
 F:	include/configs/imx6qdl_icore_rqs.h
-F:	configs/imx6q_icore_rqs_mmc_defconfig
-F:	configs/imx6dl_icore_rqs_mmc_defconfig
+F:	configs/imx6qdl_icore_rqs_mmc_defconfig
 F:	arch/arm/dts/imx6qdl-icore-rqs.dtsi
 F:	arch/arm/dts/imx6q-icore-rqs.dts
 F:	arch/arm/dts/imx6dl-icore-rqs.dts
diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c b/board/engicam/icorem6_rqs/icorem6_rqs.c
index e95c165..2027b28 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -224,6 +224,18 @@
 #endif
 #endif
 
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+	if (is_mx6dq() && !strcmp(name, "imx6q-icore-rqs"))
+		return 0;
+	else if ((is_mx6dl() || is_mx6solo()) && !strcmp(name, "imx6dl-icore-rqs"))
+		return 0;
+	else
+		return -1;
+}
+#endif
+
 /*
  * Driving strength:
  *   0x30 == 40 Ohm