[U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program
Masahiro Yamada
yamada.m at jp.panasonic.com
Fri May 17 08:35:52 CEST 2013
When CONFIG_SYS_MONITOR_BASE is not defined
and CONFIG_SYS_FLASH_BASE is defined as zero,
compile failed with an error.
We can work around this problem by defining
CONFIG_SYS_MONITOR_BASE as any value
even though a monitor program is not used.
But this is not a correct way.
Using CFI driver should not depend on the use of
a monitor program.
So, this commit corrects the build error by adding
"if defined(CONFIG_SYS_MONITOR_BASE)" condition.
Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
---
drivers/mtd/cfi_flash.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 22d8440..e418c22 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2308,7 +2308,8 @@ void flash_protect_default(void)
#endif
/* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+#if defined(CONFIG_SYS_MONITOR_BASE) && \
+ (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
(!defined(CONFIG_MONITOR_IS_IN_RAM))
flash_protect(FLAG_PROTECT_SET,
CONFIG_SYS_MONITOR_BASE,
--
1.7.9.5
More information about the U-Boot
mailing list