From: Mike Frysinger Date: Fri, 23 Jan 2009 13:00:17 -0500 Subject: [U-Boot] [PATCH 16/40] Blackfin: respect CONFIG_SYS_MONITOR_LEN for default flash protection In-Reply-To: <1232733641-29276-1-git-send-email-vapier@gentoo.org> References: <1232733641-29276-1-git-send-email-vapier@gentoo.org> Message-ID: <1232733641-29276-17-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Respect the CONFIG_SYS_MONITOR_LEN define rather than assuming a size of 128kB when setting up the default flash protection region for U-Boot itself. Signed-off-by: Mike Frysinger --- lib_blackfin/board.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c index 2feb64b..809c68c 100644 --- a/lib_blackfin/board.c +++ b/lib_blackfin/board.c @@ -348,14 +348,14 @@ void board_init_r(gd_t * id, ulong dest_addr) #endif #if !defined(CONFIG_SYS_NO_FLASH) - /* There are some other pointer constants we must deal with */ - /* configure available FLASH banks */ + /* Initialize the flash and protect u-boot by default */ extern flash_info_t flash_info[]; ulong size = flash_init(); puts("Flash: "); print_size(size, "\n"); flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_FLASH_BASE, - CONFIG_SYS_FLASH_BASE + 0x1ffff, &flash_info[0]); + CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN - 1, + &flash_info[0]); bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; bd->bi_flashsize = size; bd->bi_flashoffset = 0; -- 1.6.1