From: Holger Brunck <holger.bru...@keymile.com>

This environment variable is used to set the bootcount address
for the kernel.

Signed-off-by: Holger Brunck <holger.bru...@keymile.com>
Acked-by: Heiko Schocher <h...@denx.de>
cc: Wolfgang Denk <w...@denx.de>
cc: Detlev Zundel <d...@denx.de>
cc: Valentin Longchamp <valentin.longch...@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longch...@keymile.com>
---
 board/keymile/common/common.c |    7 +++++++
 include/configs/km_arm.h      |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 3a7980d..9ec0022 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -106,6 +106,13 @@ int set_km_env(void)
        varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
        sprintf((char *)buf, "0x%x", varaddr);
        setenv("varaddr", (char *)buf);
+
+#ifdef BOOTCOUNT_ADDR
+       unsigned int bootcountaddr;
+       bootcountaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM;
+       sprintf((char *)buf, "0x%x", bootcountaddr);
+       setenv("bootcountaddr", (char *)buf);
+#endif
        return 0;
 }
 
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 70113d4..89f9d35 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -64,6 +64,9 @@
 #define CONFIG_KM_KERNEL_ADDR  0x2000000       /* 4096KBytes */
 
 #define CONFIG_KM_DEF_ENV_CPU                                          \
+       "addbootcount="                                                 \
+               "setenv bootargs ${bootargs} "                          \
+               "bootcountaddr=${bootcountaddr}\0"                      \
        "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0"         \
        "boot=bootm ${actual_kernel_addr} - -\0"                        \
        "cramfsloadfdt=echo \\\\c\0"                                    \
-- 
1.7.0.5

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to