public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Soeren Moch <smoch@web.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] board: tbs2910: Autoselect environment device when booting from SD
Date: Thu,  4 Feb 2016 14:41:16 +0100	[thread overview]
Message-ID: <1454593276-3883-2-git-send-email-smoch@web.de> (raw)
In-Reply-To: <1454593276-3883-1-git-send-email-smoch@web.de>

Implement board specific functions to select the environment device and
partition when booting from SD/MMC.

SD2:  mmc 0 0
SD3:  mmc 1 0
eMMC: mmc 2 1

Signed-off-by: Soeren Moch <smoch@web.de>
---
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: u-boot at lists.denx.de
---
 board/tbs/tbs2910/tbs2910.c | 11 +++++++++++
 include/configs/tbs2910.h   |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/board/tbs/tbs2910/tbs2910.c b/board/tbs/tbs2910/tbs2910.c
index 0b509b6..d302fc2 100644
--- a/board/tbs/tbs2910/tbs2910.c
+++ b/board/tbs/tbs2910/tbs2910.c
@@ -257,6 +257,17 @@ int board_mmc_init(bd_t *bis)
 	}
 	return 0;
 }
+
+/* set environment device to boot device when booting from SD */
+int board_mmc_get_env_dev(int devno)
+{
+	return devno - 1;
+}
+
+int board_mmc_get_env_part(int devno)
+{
+	return (devno == 3) ? 1 : 0; /* part 0 for SD2 / SD3, part 1 for eMMC */
+}
 #endif /* CONFIG_FSL_ESDHC */
 
 #ifdef CONFIG_VIDEO_IPUV3
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index 17b0213..0f23034 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -176,8 +176,8 @@
 
 /* Environment organization */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_SYS_MMC_ENV_DEV		2
-#define CONFIG_SYS_MMC_ENV_PART		1
+#define CONFIG_SYS_MMC_ENV_DEV		2 /* overwritten on SD boot */
+#define CONFIG_SYS_MMC_ENV_PART		1 /* overwritten on SD boot */
 #define CONFIG_ENV_SIZE			(8 * 1024)
 #define CONFIG_ENV_OFFSET		(384 * 1024)
 #define CONFIG_ENV_OVERWRITE
-- 
1.9.1

  reply	other threads:[~2016-02-04 13:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 13:41 [U-Boot] [PATCH 1/2] imx: mx6: Implement mmc_get_env_part Soeren Moch
2016-02-04 13:41 ` Soeren Moch [this message]
2016-02-21 10:35 ` 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=1454593276-3883-2-git-send-email-smoch@web.de \
    --to=smoch@web.de \
    --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