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 <gokulsri@codeaurora.org>
This commit is contained in:
Gokul Sriram Palanisamy 2017-09-12 15:34:38 +05:30
parent b77ce142bb
commit 8a3c619b47

View file

@ -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;