ipq806x: Customized environment size handling

To save space in NOR flash, environment loading from flash is
handled differently for NOR and NAND. The size for NOR flash
environment is taken from partition size itself.

Change-Id: I588471b679fad0e96b836d43dc1a0136c5400fc1
Signed-off-by: Antony Arun T <antothom@codeaurora.org>
This commit is contained in:
Antony Arun T 2018-02-19 16:11:21 +05:30
parent e703375fa3
commit 1279dad923
2 changed files with 9 additions and 0 deletions

View file

@ -633,6 +633,11 @@ char *getenv(const char *name)
hsearch_r(e, FIND, &ep, &env_htab, 0); hsearch_r(e, FIND, &ep, &env_htab, 0);
return ep ? ep->data : NULL; return ep ? ep->data : NULL;
} else {
#ifdef CONFIG_ENV_SIZE_MAX
/* for first time set maximum */
#define CONFIG_ENV_SIZE CONFIG_ENV_SIZE_MAX
#endif
} }
/* restricted capabilities before import */ /* restricted capabilities before import */

View file

@ -153,6 +153,10 @@ extern char *env_name_spec;
#define ENV_SIZE (CONFIG_ENV_RANGE - ENV_HEADER_SIZE) #define ENV_SIZE (CONFIG_ENV_RANGE - ENV_HEADER_SIZE)
#endif #endif
#ifndef CONFIG_ENV_SIZE_MAX
#define CONFIG_ENV_SIZE_MAX CONFIG_ENV_SIZE
#endif
typedef struct environment_s { typedef struct environment_s {
uint32_t crc; /* CRC32 over data bytes */ uint32_t crc; /* CRC32 over data bytes */
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT