From: Wolfgang Denk Date: Thu, 6 Apr 2006 13:03:42 +0000 (+0200) Subject: MCC200 Board: fix flash unprotection code for flash > 32 MB. X-Git-Tag: LABEL_2006_04_18_1106~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3a5e21881a194f4d4e053be8410d82a2458e8544;p=u-boot MCC200 Board: fix flash unprotection code for flash > 32 MB. --- diff --git a/board/mcc200/mcc200.c b/board/mcc200/mcc200.c index 456411dd92..5fe239f234 100644 --- a/board/mcc200/mcc200.c +++ b/board/mcc200/mcc200.c @@ -238,6 +238,16 @@ int misc_init_r (void) &flash_info[CFG_MAX_FLASH_BANKS - 1]); } + if (gd->bd->bi_flashsize > (32 << 20)) { + /* Unprotect the upper bank of the Flash */ + *(volatile int*)MPC5XXX_CS0_CFG |= (1 << 6); + flash_protect (FLAG_PROTECT_CLEAR, + flash_info[0].start[0], + (flash_info[0].start[0] + flash_info[0].size) / 2 - 1, + &flash_info[0]); + *(volatile int*)MPC5XXX_CS0_CFG &= ~(1 << 6); + } + return (0); }