km/common: fix initial_boot_bank for bootpackages
authorThomas Herzmann <thomas.herzmann@keymile.com>
Fri, 8 Apr 2011 02:47:41 +0000 (02:47 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 10 May 2011 21:17:36 +0000 (23:17 +0200)
The initial_boot_bank can be set when more than one application is
used in a bootpackage. But a value n <> 0 never led to booting from
bank n. Instead, bank 0 was booted. This patch fixes this.

Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
include/configs/keymile-common.h

index cb6d0fb6c8d8d67abacbae011b53a2af0e1520b6..bc8a8961da92a47ac8bdfeffaae2eae886bf3401 100644 (file)
                "printbootargs boot "                                   \
                "\" && "                                                \
                "setenv bootcmd \'"                                     \
-               "run bootrunner; reset"                                 \
+               "run actual bootrunner; reset"                          \
                "\' && "                                                \
                "setenv altbootcmd \'"                                  \
-               "run actual0 bootcmd; reset"                            \
+               "run backup bootrunner; reset"                          \
                "\' && "                                                \
                "saveenv && "                                           \
                "reset\0"                                               \
        "addramfs="                                                     \
                "setenv bootargs \""                                    \
                "${bootargs} phram.phram="                              \
-               "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0"  \
+               "rootfs${boot_bank},${rootfsaddr},${rootfssize}\"\0"    \
        "addtty="                                                       \
                "setenv bootargs ${bootargs}"                           \
                " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0"      \
        "flashargs="                                                    \
                "setenv bootargs "                                      \
                "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " "             \
-               "root=mtdblock:rootfs${actual_bank} "                   \
+               "root=mtdblock:rootfs${boot_bank} "                     \
                "rootfstype=squashfs ro\0"                              \
        ""
 
                "cramfsload ${kernel_addr_r} uImage && "                \
                "setenv actual_kernel_addr ${kernel_addr_r}\0"          \
        "ubiattach=ubi part ${ubipartition}\0"                          \
-       "ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0"         \
+       "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0"           \
        "ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0"               \
        ""
 
  * - 'default': setup default environment
  */
 #define CONFIG_KM_DEF_ENV_CONSTANTS                                    \
-       "actual=setenv actual_bank ${initial_boot_bank}\0"              \
-       "actual0=setenv actual_bank 0\0"                                \
+       "actual=setenv boot_bank ${actual_bank}\0"                      \
+       "backup=setenv boot_bank ${backup_bank}\0"                      \
        "actual_bank=${initial_boot_bank}\0"                            \
+       "backup_bank=0\0"                                               \
        "default="                                                      \
                "setenv default 'run newenv; reset' &&  "               \
                "run release && saveenv; reset\0"                       \