cleanup use of CFG_ENV_IS_IN_FLASH

- #if CFG_ENV_IS_IN_FLASH
- #if (CFG_ENV_IS_IN_FLASH == 1)
- #define CFG_ENV_IS_IN_FLASH 0
Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
parent 0cf4fd3c
......@@ -224,7 +224,7 @@ unsigned long flash_init(void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
flash_protect(FLAG_PROTECT_SET,
CFG_ENV_ADDR,
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
......
......@@ -224,7 +224,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
flash_protect (FLAG_PROTECT_SET,
CFG_ENV_ADDR,
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
......
......@@ -174,7 +174,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
#if CFG_ENV_ADDR >= CFG_FLASH_BASE + FLASH_BANK_SIZE
flash_protect (FLAG_PROTECT_SET,
CFG_ENV_ADDR,
......
......@@ -230,7 +230,7 @@ unsigned long flash_init (void)
#endif
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -236,7 +236,7 @@ unsigned long flash_init (void)
#endif
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -135,7 +135,7 @@ unsigned long flash_init(void)
#endif
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
#if CFG_ENV_ADDR >= CFG_FLASH_BASE + FLASH_BANK_SIZE
flash_protect(FLAG_PROTECT_SET,
CFG_ENV_ADDR,
......
......@@ -157,7 +157,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -126,7 +126,7 @@ unsigned long flash_init (void)
#endif
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
flash_protect(FLAG_PROTECT_SET,
CFG_ENV_ADDR,
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
......
......@@ -100,7 +100,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -212,7 +212,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
flash_protect (FLAG_PROTECT_SET,
CFG_ENV_ADDR,
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
......
......@@ -73,7 +73,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -144,7 +144,7 @@ unsigned long flash_init (void)
# endif
#endif /* CONFIG_BOOT_ROM */
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -144,7 +144,7 @@ unsigned long flash_init (void)
# endif
#endif /* CONFIG_BOOT_ROM */
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -197,7 +197,7 @@ unsigned long flash_init (void)
CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -71,7 +71,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -131,7 +131,7 @@ unsigned long flash_init (void)
&flash_info[1]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -230,7 +230,7 @@ flash_init(void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
flash_protect(FLAG_PROTECT_SET,
CFG_ENV_ADDR,
CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
......
......@@ -67,7 +67,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -207,7 +207,7 @@ unsigned long flash_init (void)
CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -139,7 +139,7 @@ unsigned long flash_init (void)
#endif
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
#if CFG_ENV_ADDR >= CFG_FLASH_BASE + FLASH_BANK_SIZE
flash_protect ( FLAG_PROTECT_SET,
CFG_ENV_ADDR,
......
......@@ -207,7 +207,7 @@ unsigned long flash_init (void)
CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
# ifndef CFG_ENV_SIZE
# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
# endif
......
......@@ -169,7 +169,7 @@ unsigned long flash_init (void)
&flash_info[0]);
#endif
#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
#if defined(CFG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR)
flash_protect (FLAG_PROTECT_SET, CFG_ENV_ADDR,
CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
#endif
......
......@@ -572,7 +572,7 @@
#define CFG_FLASH_LOCK_TOUT 500 /* Timeout for Flash Lock (in ms) */
#if 0
#define CFG_ENV_IS_IN_FLASH 0
#define CFG_ENV_IS_IN_FLASH
#define CFG_ENV_SIZE 0x1000 /* Total Size of Environment Sector */
#define CFG_ENV_SECT_SIZE 0x10000
#define CFG_ENV_ADDR 0xFFF78000 /* Marvell 8-Bit Bootflash last sector */
......
......@@ -210,7 +210,7 @@
* Environment settings
*/
#define CONFIG_ENV_IS_NOWHERE 1
/*#define CFG_ENV_IS_IN_FLASH 0*/
/*#define CFG_ENV_IS_IN_FLASH*/
/*#define CFG_ENV_SIZE 0x8000*/
#define CFG_ENV_SECT_SIZE 0x40000
#define CONFIG_ENV_OVERWRITE 1
......
......@@ -207,7 +207,7 @@
* Environment settings
*/
#define CONFIG_ENV_IS_NOWHERE 1
/*#define CFG_ENV_IS_IN_FLASH 0*/
/*#define CFG_ENV_IS_IN_FLASH*/
/*#define CFG_ENV_SIZE 0x8000*/
#define CFG_ENV_SECT_SIZE 0x40000
#define CONFIG_ENV_OVERWRITE 1
......
......@@ -205,7 +205,7 @@
* Environment settings
*/
#if 1 /* test-only */
#define CFG_ENV_IS_IN_FLASH 0
#define CFG_ENV_IS_IN_FLASH
#define CFG_ENV_SIZE 0x10000
#define CFG_ENV_SECT_SIZE 0x10000
#define CONFIG_ENV_OVERWRITE 1
......
......@@ -405,7 +405,7 @@ extern unsigned long offsetOfEnvironment;
#define CFG_WRITE_SWAPPED_DATA /* swap Databytes between reading/writing */
#define CFG_ENV_IS_IN_FLASH 1
#if CFG_ENV_IS_IN_FLASH
#ifdef CFG_ENV_IS_IN_FLASH
#define CFG_ENV_OFFSET 0x00000000 /* Offset of Environment Sector in bottom type */
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
#define CFG_ENV_SECT_SIZE 0x4000 /* see README - env sector total size */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment