Commit 1c8c36f57142a13eb03d783ff763391253d654ab

Authored by Dmitry Lifshitz
Committed by Tom Rini
1 parent a9375f3328

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>

Showing 2 changed files with 23 additions and 0 deletions Side-by-side Diff

board/compulab/cm_t54/cm_t54.c
... ... @@ -13,6 +13,7 @@
13 13 #include <usb.h>
14 14 #include <mmc.h>
15 15 #include <palmas.h>
  16 +#include <spl.h>
16 17  
17 18 #include <asm/gpio.h>
18 19 #include <asm/arch/sys_proto.h>
... ... @@ -73,6 +74,27 @@
73 74  
74 75 return 0;
75 76 }
  77 +
  78 +/*
  79 + * Routine: mmc_get_env_part
  80 + * Description: setup environment storage device partition.
  81 + */
  82 +#ifdef CONFIG_SYS_MMC_ENV_PART
  83 +uint mmc_get_env_part(struct mmc *mmc)
  84 +{
  85 + u32 bootmode = gd->arch.omap_boot_params.omap_bootmode;
  86 + uint bootpart = CONFIG_SYS_MMC_ENV_PART;
  87 +
  88 + /*
  89 + * If booted from eMMC boot partition then force eMMC
  90 + * FIRST boot partition to be env storage
  91 + */
  92 + if (bootmode == BOOT_DEVICE_MMC2_2)
  93 + bootpart = 1;
  94 +
  95 + return bootpart;
  96 +}
  97 +#endif
76 98  
77 99 #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
78 100 #define SB_T54_CD_GPIO 228
include/configs/cm_t54.h
... ... @@ -49,6 +49,7 @@
49 49  
50 50 #define CONFIG_ENV_IS_IN_MMC
51 51 #define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */
  52 +#define CONFIG_SYS_MMC_ENV_PART 0
52 53 #define CONFIG_ENV_OFFSET 0xc0000 /* (in bytes) 768 KB */
53 54 #define CONFIG_ENV_SIZE (16 << 10) /* 16 KB */
54 55 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)