From 8a3c619b47ff73dd0102902aee7e8e772b97b449 Mon Sep 17 00:00:00 2001 From: Gokul Sriram Palanisamy Date: Tue, 12 Sep 2017 15:34:38 +0530 Subject: [PATCH] ARM: env_nand: Updated env to use complete partition nand env size was restricted to 256KB out of the available 512KB to keep it compatible with kernel. When a badblock is introduced, env fails to save due to the restricted range. With this patch, it can now use upto the end of partition upon skipping any badblocks but only saving 256KB. Change-Id: I27f6932fe537fa4c63d890bfe583c48e45fe156b Signed-off-by: Gokul Sriram Palanisamy --- common/env_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index 6b66d8e1e1..61096b8190 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -128,7 +128,7 @@ int nand_env_init(void) */ static int writeenv(size_t offset, u_char *buf) { - size_t end = offset + CONFIG_ENV_RANGE; + size_t end = offset + board_env_size; size_t amount_saved = 0; size_t blocksize, len; u_char *char_ptr; @@ -243,7 +243,7 @@ static int readenv(size_t offset, u_char *buf) #else static int readenv(size_t offset, u_char *buf) { - size_t end = offset + CONFIG_ENV_RANGE; + size_t end = offset + board_env_size; size_t amount_loaded = 0; size_t blocksize, len; u_char *char_ptr;