]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
km83xx: use CONFIG_ENV_ADDR for the newenv env command
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 17 Nov 2015 09:53:35 +0000 (10:53 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 18 Nov 2015 20:28:57 +0000 (15:28 -0500)
The hardcoded value are bad, since the address could change between
different boards.

Furthermore, the relevant #defines are set only if #undefined here, so
that they can be changed by some boards if required.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
include/configs/km/km83xx-common.h

index 4e355a7bd5417918506259a65c3b8f776d7ec0ca..30cf60c2597b5960a42e6cf8923b987ae0bdcaae 100644 (file)
 
 #ifndef CONFIG_SYS_RAMBOOT
 #define CONFIG_ENV_IS_IN_FLASH
+#ifndef CONFIG_ENV_ADDR
 #define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + \
                                        CONFIG_SYS_MONITOR_LEN)
+#endif
 #define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
 #define CONFIG_ENV_OFFSET      (CONFIG_SYS_MONITOR_LEN)
+#endif
 
 /* Address and size of Redundant Environment Sector    */
 #define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + \
        CONFIG_KM_DEF_ENV                                               \
        CONFIG_KM_DEF_ARCH                                              \
        "newenv="                                                       \
-               "prot off 0xF00C0000 +0x40000 && "                      \
-               "era 0xF00C0000 +0x40000\0"                             \
+               "prot off "__stringify(CONFIG_ENV_ADDR)" +0x40000 && "  \
+               "era "__stringify(CONFIG_ENV_ADDR)" +0x40000\0"         \
        "unlock=yes\0"                                                  \
        ""