public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jagan Teki <jagannadh.teki@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] i.MX6: engicam: Move set_fdt_file to common
Date: Wed, 20 Sep 2017 00:07:58 +0530	[thread overview]
Message-ID: <1505846281-19020-4-git-send-email-jteki@openedev.com> (raw)
In-Reply-To: <1505846281-19020-1-git-send-email-jteki@openedev.com>

From: Jagan Teki <jagan@amarulasolutions.com>

setenv_fdt_file to common code and set dtb based on
CONFIG_DEFAULT_DEVICE_TREE and cpu_type.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 board/engicam/common/board.c            | 24 ++++++++++++++++++++++++
 board/engicam/common/board.h            |  1 -
 board/engicam/geam6ul/geam6ul.c         |  6 ------
 board/engicam/icorem6/icorem6.c         |  8 --------
 board/engicam/icorem6_rqs/icorem6_rqs.c |  8 --------
 board/engicam/isiotmx6ul/isiotmx6ul.c   | 11 -----------
 6 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index c7ec55f..f86fb2b 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -32,6 +32,30 @@ static void mmc_late_init(void)
 }
 #endif
 
+static void setenv_fdt_file(void)
+{
+	const char *cmp_dtb = CONFIG_DEFAULT_DEVICE_TREE;
+
+	if (!strcmp(cmp_dtb, "imx6q-icore")) {
+		if (is_mx6dq())
+			env_set("fdt_file", "imx6q-icore.dtb");
+		else if(is_mx6dl() || is_mx6solo())
+			env_set("fdt_file", "imx6dl-icore.dtb");
+	} else if (!strcmp(cmp_dtb, "imx6q-icore-rqs")) {
+		if (is_mx6dq())
+			env_set("fdt_file", "imx6q-icore-rqs.dtb");
+		else if(is_mx6dl() || is_mx6solo())
+			env_set("fdt_file", "imx6dl-icore-rqs.dtb");
+	} else if (!strcmp(cmp_dtb, "imx6ul-geam-kit"))
+		env_set("fdt_file", "imx6ul-geam-kit.dtb");
+	else if (!strcmp(cmp_dtb, "imx6ul-isiot-mmc"))
+		env_set("fdt_file", "imx6ul-isiot-mmc.dtb");
+	else if (!strcmp(cmp_dtb, "imx6ul-isiot-emmc"))
+		env_set("fdt_file", "imx6ul-isiot-emmc.dtb");
+	else if (!strcmp(cmp_dtb, "imx6ul-isiot-nand"))
+		env_set("fdt_file", "imx6ul-isiot-nand.dtb");
+}
+
 int board_late_init(void)
 {
 	switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >>
diff --git a/board/engicam/common/board.h b/board/engicam/common/board.h
index f364a23..c720b0b 100644
--- a/board/engicam/common/board.h
+++ b/board/engicam/common/board.h
@@ -6,7 +6,6 @@
 
 #ifndef _BOARD_H_
 #define _BOARD_H_
-void setenv_fdt_file(void);
 void setup_gpmi_nand(void);
 void setup_display(void);
 #endif /* _BOARD_H_ */
diff --git a/board/engicam/geam6ul/geam6ul.c b/board/engicam/geam6ul/geam6ul.c
index ffd383a..15bd8b2 100644
--- a/board/engicam/geam6ul/geam6ul.c
+++ b/board/engicam/geam6ul/geam6ul.c
@@ -90,12 +90,6 @@ void setup_gpmi_nand(void)
 }
 #endif /* CONFIG_NAND_MXS */
 
-void setenv_fdt_file(void)
-{
-	if (is_mx6ul())
-		env_set("fdt_file", "imx6ul-geam-kit.dtb");
-}
-
 #ifdef CONFIG_SPL_BUILD
 /* MMC board initialization is needed till adding DM support in SPL */
 #if defined(CONFIG_FSL_ESDHC) && !defined(CONFIG_DM_MMC)
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index 3d4f713..59c085b 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -192,14 +192,6 @@ void setup_display(void)
 }
 #endif /* CONFIG_VIDEO_IPUV3 */
 
-void setenv_fdt_file(void)
-{
-	if (is_mx6dq())
-		env_set("fdt_file", "imx6q-icore.dtb");
-	else if(is_mx6dl() || is_mx6solo())
-		env_set("fdt_file", "imx6dl-icore.dtb");
-}
-
 #ifdef CONFIG_SPL_BUILD
 /* MMC board initialization is needed till adding DM support in SPL */
 #if defined(CONFIG_FSL_ESDHC) && !defined(CONFIG_DM_MMC)
diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c b/board/engicam/icorem6_rqs/icorem6_rqs.c
index 2a321dc..edf9d086 100644
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ b/board/engicam/icorem6_rqs/icorem6_rqs.c
@@ -32,14 +32,6 @@ int board_mmc_get_env_dev(int devno)
 }
 #endif
 
-void setenv_fdt_file(void)
-{
-	if (is_mx6dq())
-		env_set("fdt_file", "imx6q-icore-rqs.dtb");
-	else if(is_mx6dl() || is_mx6solo())
-		env_set("fdt_file", "imx6dl-icore-rqs.dtb");
-}
-
 #ifdef CONFIG_SPL_BUILD
 #include <spl.h>
 
diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c b/board/engicam/isiotmx6ul/isiotmx6ul.c
index fbf1724..9afa8e4 100644
--- a/board/engicam/isiotmx6ul/isiotmx6ul.c
+++ b/board/engicam/isiotmx6ul/isiotmx6ul.c
@@ -98,17 +98,6 @@ int board_mmc_get_env_dev(int devno)
 }
 #endif
 
-void setenv_fdt_file(void)
-{
-	if (is_mx6ul()) {
-#ifdef CONFIG_ENV_IS_IN_MMC
-		env_set("fdt_file", "imx6ul-isiot-emmc.dtb");
-#else
-		env_set("fdt_file", "imx6ul-isiot-nand.dtb");
-#endif
-	}
-}
-
 #ifdef CONFIG_SPL_BUILD
 #include <spl.h>
 
-- 
2.7.4

  parent reply	other threads:[~2017-09-19 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 18:37 [U-Boot] [PATCH 0/6] i.MX6Q: Add SPL_OF_CONTROL support Jagan Teki
2017-09-19 18:37 ` [U-Boot] [PATCH 1/6] i.MX6: engicam: Fix MAINTAINERS/README Jagan Teki
2017-09-19 18:37 ` [U-Boot] [PATCH 2/6] imx6ul: geam6ul/isiot: Fix to MMC devices Jagan Teki
2017-09-19 18:37 ` Jagan Teki [this message]
2017-09-19 18:37 ` [U-Boot] [PATCH 4/6] i.MX6Q: icorem6: Move spl load fit to common/spl Jagan Teki
2017-09-19 18:38 ` [U-Boot] [PATCH 5/6] i.MX6Q: icore: Add SPL_OF_CONTROL support Jagan Teki
2017-09-19 18:38 ` [U-Boot] [PATCH 6/6] i.MX6Q: icore: Add imx6q board for icore/icore_rqs Jagan Teki
2017-10-02 13:29 ` [U-Boot] [PATCH 0/6] i.MX6Q: Add SPL_OF_CONTROL support Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505846281-19020-4-git-send-email-jteki@openedev.com \
    --to=jagannadh.teki@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox