]> git.sur5r.net Git - u-boot/commitdiff
configs: am335x_evm: Switch to env on FAT SD by default
authorTom Rini <trini@ti.com>
Mon, 16 May 2016 06:02:49 +0000 (11:32 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 27 May 2016 19:47:50 +0000 (15:47 -0400)
Re-org env sections so that we can fall back to env is in FAT on SD
card, for broader board compatibility

Signed-off-by: Tom Rini <trini@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
include/configs/am335x_evm.h

index 16935a105a17f7e4cab327876321555f816f4e4f..dfd00de6e26f2991df439a967acee1c8d3450081 100644 (file)
                                        "8m(NAND.kernel)," \
                                        "-(NAND.file-system)"
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0x000c0000
-#undef CONFIG_ENV_IS_NOWHERE
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET              0x001c0000
-#define CONFIG_ENV_OFFSET_REDUND       0x001e0000
-#define CONFIG_SYS_ENV_SECT_SIZE       CONFIG_SYS_NAND_BLOCK_SIZE
 /* NAND: SPL related configs */
 #ifdef CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_AM33XX_BCH
                                        "128k(u-boot-env2),3464k(kernel)," \
                                        "-(rootfs)"
 #elif defined(CONFIG_EMMC_BOOT)
-#undef CONFIG_ENV_IS_NOWHERE
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SPL_ENV_SUPPORT
 #define CONFIG_SYS_MMC_ENV_DEV         1
 #define CONFIG_ENV_OFFSET              0x0
 #define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#elif defined(CONFIG_NOR_BOOT)
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_SECT_SIZE           (128 << 10)     /* 128 KiB */
+#define CONFIG_ENV_OFFSET              (512 << 10)     /* 512 KiB */
+#define CONFIG_ENV_OFFSET_REDUND       (768 << 10)     /* 768 KiB */
+#define MTDIDS_DEFAULT                 "nor0=physmap-flash.0"
+#define MTDPARTS_DEFAULT               "mtdparts=physmap-flash.0:" \
+                                       "512k(u-boot)," \
+                                       "128k(u-boot-env1)," \
+                                       "128k(u-boot-env2)," \
+                                       "4m(kernel),-(rootfs)"
+#elif defined(CONFIG_ENV_IS_IN_NAND)
+#define CONFIG_ENV_OFFSET              0x001c0000
+#define CONFIG_ENV_OFFSET_REDUND       0x001e0000
+#define CONFIG_SYS_ENV_SECT_SIZE       CONFIG_SYS_NAND_BLOCK_SIZE
+#elif !defined(CONFIG_ENV_IS_NOWHERE)
+/* Not NAND, SPI, NOR or eMMC env, so put ENV in a file on FAT */
+#define CONFIG_ENV_IS_IN_FAT
+#define FAT_ENV_INTERFACE              "mmc"
+#define FAT_ENV_DEVICE_AND_PART                "0:1"
+#define FAT_ENV_FILE                   "uboot.env"
 #endif
 
 /* SPI flash. */
 #define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_16BIT
 #define CONFIG_SYS_FLASH_SIZE          0x01000000
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
-/* Reduce SPL size by removing unlikey targets */
-#ifdef CONFIG_NOR_BOOT
-#define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_SECT_SIZE           (128 << 10)     /* 128 KiB */
-#define CONFIG_ENV_OFFSET              (512 << 10)     /* 512 KiB */
-#define CONFIG_ENV_OFFSET_REDUND       (768 << 10)     /* 768 KiB */
-#define MTDIDS_DEFAULT                 "nor0=physmap-flash.0"
-#define MTDPARTS_DEFAULT               "mtdparts=physmap-flash.0:" \
-                                       "512k(u-boot)," \
-                                       "128k(u-boot-env1)," \
-                                       "128k(u-boot-env2)," \
-                                       "4m(kernel),-(rootfs)"
-#endif
 #endif  /* NOR support */
 
 #endif /* ! __CONFIG_AM335X_EVM_H */