Commit ba481c58dff1dcfa6adb8b69bbf11ffef8ccdaa0

Authored by Tom Rini
1 parent 3e51b7c8b8

am335x_evm: Consolidate DFU environment parts into the DFU part of the file

To make managing the environment easier, add DFUARGS to
CONFIG_EXTRA_ENV_SETTINGS.  Then we set DFUARGS down in the DFU part of
the file, and include (or not) the NAND part, based on if NAND is set.

Signed-off-by: Tom Rini <trini@ti.com>

Showing 1 changed file with 15 additions and 8 deletions Side-by-side Diff

include/configs/am335x_evm.h
... ... @@ -39,7 +39,6 @@
39 39 "${optargs} " \
40 40 "root=${nandroot} " \
41 41 "rootfstype=${nandrootfstype}\0" \
42   - "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
43 42 "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \
44 43 "nandrootfstype=ubifs rootwait=1\0" \
45 44 "nandboot=echo Booting from nand ...; " \
... ... @@ -66,8 +65,6 @@
66 65 "fdtfile=undefined\0" \
67 66 "console=ttyO0,115200n8\0" \
68 67 "optargs=\0" \
69   - "dfu_alt_info_mmc=" DFU_ALT_INFO_MMC "\0" \
70   - "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \
71 68 "mmcdev=0\0" \
72 69 "mmcroot=/dev/mmcblk0p2 ro\0" \
73 70 "mmcrootfstype=ext4 rootwait\0" \
... ... @@ -99,7 +96,6 @@
99 96 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
100 97 "importbootenv=echo Importing environment from mmc ...; " \
101 98 "env import -t $loadaddr $filesize\0" \
102   - "dfu_alt_info_ram=" DFU_ALT_INFO_RAM "\0" \
103 99 "ramargs=setenv bootargs console=${console} " \
104 100 "${optargs} " \
105 101 "root=${ramroot} " \
... ... @@ -162,7 +158,8 @@
162 158 "setenv fdtfile am335x-evmsk.dtb; fi; " \
163 159 "if test $fdtfile = undefined; then " \
164 160 "echo WARNING: Could not determine device tree to use; fi; \0" \
165   - NANDARGS
  161 + NANDARGS \
  162 + DFUARGS
166 163 #endif
167 164  
168 165 #define CONFIG_BOOTCOMMAND \
... ... @@ -309,6 +306,7 @@
309 306 #define CONFIG_DFU_MMC
310 307 #define CONFIG_CMD_DFU
311 308 #define DFU_ALT_INFO_MMC \
  309 + "dfu_alt_info_mmc=" \
312 310 "boot part 0 1;" \
313 311 "rootfs part 0 2;" \
314 312 "MLO fat 0 1;" \
315 313  
... ... @@ -319,10 +317,11 @@
319 317 "spl-os-args fat 0 1;" \
320 318 "spl-os-image fat 0 1;" \
321 319 "u-boot.img fat 0 1;" \
322   - "uEnv.txt fat 0 1"
  320 + "uEnv.txt fat 0 1\0"
323 321 #ifdef CONFIG_NAND
324 322 #define CONFIG_DFU_NAND
325 323 #define DFU_ALT_INFO_NAND \
  324 + "dfu_alt_info_nand=" \
326 325 "SPL part 0 1;" \
327 326 "SPL.backup1 part 0 2;" \
328 327 "SPL.backup2 part 0 3;" \
329 328  
330 329  
... ... @@ -330,13 +329,21 @@
330 329 "u-boot part 0 5;" \
331 330 "u-boot-spl-os part 0 6;" \
332 331 "kernel part 0 8;" \
333   - "rootfs part 0 9"
  332 + "rootfs part 0 9\0"
  333 +#else
  334 +#define DFU_ALT_INFO_NAND ""
334 335 #endif
335 336 #define CONFIG_DFU_RAM
336 337 #define DFU_ALT_INFO_RAM \
  338 + "dfu_alt_info_ram=" \
337 339 "kernel ram 0x80200000 0xD80000;" \
338 340 "fdt ram 0x80F80000 0x80000;" \
339   - "ramdisk ram 0x81000000 0x4000000"
  341 + "ramdisk ram 0x81000000 0x4000000\0"
  342 +#define DFUARGS \
  343 + "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \
  344 + DFU_ALT_INFO_MMC \
  345 + DFU_ALT_INFO_RAM \
  346 + DFU_ALT_INFO_NAND
340 347  
341 348 /*
342 349 * Default to using SPI for environment, etc.