]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/compulab/cm_t54/cm_t54.c
Merge branch 'master' of git://git.denx.de/u-boot-arc
[karo-tx-uboot.git] / board / compulab / cm_t54 / cm_t54.c
index 6b18b93e91dec9bfe2fd2bad0835490dae7b0372..944b7234d63eade73441918c8f8d910f4c5fa6e5 100644 (file)
@@ -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>
@@ -42,7 +43,7 @@ const struct omap_sysinfo sysinfo = {
  */
 int board_init(void)
 {
-       gd->bd->bi_boot_params = (CONFIG_SYS_SDRAM_BASE + 0x100); /* boot param addr */
+       gd->bd->bi_boot_params = (CONFIG_SYS_SDRAM_BASE + 0x100);
 
        return 0;
 }
@@ -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)
+               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
@@ -147,7 +169,7 @@ static int handle_mac_address(void)
                return 0;
 
        ret = cl_eeprom_read_mac_addr(enetaddr);
-       if (!ret || !is_valid_ether_addr(enetaddr))
+       if (ret || !is_valid_ether_addr(enetaddr))
                generate_mac_addr(enetaddr);
 
        if (!is_valid_ether_addr(enetaddr))