[U-Boot] [PATCH [v3]] fix monitor protection for CONFIG_MONITOR_IS_IN_RAM

Wolfgang Wegner w.wegner at astro-kom.de
Tue Mar 2 10:59:19 CET 2010


For platforms with flash below ram addresses, the current check to
activate monitor protection is wrong/insufficient. This patch fixes
CONFIG_MONITOR_IS_IN_RAM for these systems by adding a check for
this configuration.

Signed-off-by: Wolfgang Wegner <w.wegner at astro-kom.de>
---
This patch is the CFI-relevant part of
"[PATCH] allow MCF532x to use CONFIG_MONITOR_IS_IN_RAM" dated 16.02.2010
to allow integration by the CFI maintainer independent of coldfire stuff.

 drivers/mtd/cfi_flash.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 24eb33f..fdba297 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1980,7 +1980,8 @@ unsigned long flash_init (void)
 	}
 
 	/* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE)
+#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+	(!defined(CONFIG_MONITOR_IS_IN_RAM))
 	flash_protect (FLAG_PROTECT_SET,
 		       CONFIG_SYS_MONITOR_BASE,
 		       CONFIG_SYS_MONITOR_BASE + monitor_flash_len  - 1,
-- 
1.5.6.5



More information about the U-Boot mailing list