]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
] fix monitor protection for CONFIG_MONITOR_IS_IN_RAM
authorWolfgang Wegner <w.wegner@astro-kom.de>
Tue, 2 Mar 2010 09:59:19 +0000 (10:59 +0100)
committerStefan Roese <sr@denx.de>
Thu, 4 Mar 2010 09:07:12 +0000 (10:07 +0100)
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@astro-kom.de>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_flash.c

index 24eb33f0f6e053357b0baa7d82980c618a9217af..fdba297c88b075cbc098b6a92fa474a2f8c54d65 100644 (file)
@@ -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,