summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Lifshitz <lifshitz@compulab.co.il>2014-04-27 13:18:48 +0300
committerTom Rini <trini@ti.com>2014-05-23 19:40:39 -0400
commit1c8c36f57142a13eb03d783ff763391253d654ab (patch)
treed783aaa9a4ae436c481a63d06c9d369ad4b38e45
parenta9375f3328135d651d7500df3e4c43432e5db133 (diff)
downloadblackbird-obmc-uboot-1c8c36f57142a13eb03d783ff763391253d654ab.tar.gz
blackbird-obmc-uboot-1c8c36f57142a13eb03d783ff763391253d654ab.zip
cm-t54: add environment partition runtime detection
Add environment partition runtime detection callback. Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
-rw-r--r--board/compulab/cm_t54/cm_t54.c22
-rw-r--r--include/configs/cm_t54.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c
index 6b18b93e91..fadfddc077 100644
--- a/board/compulab/cm_t54/cm_t54.c
+++ b/board/compulab/cm_t54/cm_t54.c
@@ -13,6 +13,7 @@
#include <usb.h>
#include <mmc.h>
#include <palmas.h>
+#include <spl.h>
#include <asm/gpio.h>
#include <asm/arch/sys_proto.h>
@@ -74,6 +75,27 @@ static int cm_t54_palmas_regulator_set(u8 vreg, u8 vval, u8 creg, u8 cval)
return 0;
}
+/*
+ * Routine: mmc_get_env_part
+ * Description: setup environment storage device partition.
+ */
+#ifdef CONFIG_SYS_MMC_ENV_PART
+uint mmc_get_env_part(struct mmc *mmc)
+{
+ u32 bootmode = gd->arch.omap_boot_params.omap_bootmode;
+ uint bootpart = CONFIG_SYS_MMC_ENV_PART;
+
+ /*
+ * If booted from eMMC boot partition then force eMMC
+ * FIRST boot partition to be env storage
+ */
+ if (bootmode == BOOT_DEVICE_MMC2_2)
+ bootpart = 1;
+
+ return bootpart;
+}
+#endif
+
#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
#define SB_T54_CD_GPIO 228
#define SB_T54_WP_GPIO 229
diff --git a/include/configs/cm_t54.h b/include/configs/cm_t54.h
index 5e805c4019..db0409534e 100644
--- a/include/configs/cm_t54.h
+++ b/include/configs/cm_t54.h
@@ -49,6 +49,7 @@
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */
+#define CONFIG_SYS_MMC_ENV_PART 0
#define CONFIG_ENV_OFFSET 0xc0000 /* (in bytes) 768 KB */
#define CONFIG_ENV_SIZE (16 << 10) /* 16 KB */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
OpenPOWER on IntegriCloud