summaryrefslogtreecommitdiff
path: root/board/omap1610inn/flash.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-02-09 20:51:26 (GMT)
committerwdenk <wdenk>2004-02-09 20:51:26 (GMT)
commitb98fff1d6acc57cc54f01740028535ac095237cd (patch)
tree4d9f375a71582a8938e034dcf9082b8f71761b72 /board/omap1610inn/flash.c
parent5653fc335a450fa46d89989e1afe5e8bb9a0a52e (diff)
downloadu-boot-fsl-qoriq-b98fff1d6acc57cc54f01740028535ac095237cd.tar.xz
* Patch by Rahul Shanbhag, 28 Jan 2004:
Fix flash protection/locking handling for OMAP1610 innovator board. * Patch by Rolf Peukert, 28 Jan 2004: fix flash write problems on CSB226 board (write with 32 bit bus width) * Patches by Mark Jonas, 16 Jan 2004: - fix rounding error when calculating baudrates for MPC5200 PSCs - make sure CFG_RAMBOOT and CFG_LOWBOOT are not enabled at the same time which is not supported
Diffstat (limited to 'board/omap1610inn/flash.c')
-rw-r--r--board/omap1610inn/flash.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/board/omap1610inn/flash.c b/board/omap1610inn/flash.c
index e7d6515..ae7fb3b 100644
--- a/board/omap1610inn/flash.c
+++ b/board/omap1610inn/flash.c
@@ -93,6 +93,8 @@ unsigned long flash_init (void)
case 0:
flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
+ /* to reset the lock bit */
+ flash_unlock(&flash_info[i]);
break;
default:
panic ("configured too many flash banks!\n");
@@ -116,6 +118,19 @@ unsigned long flash_init (void)
/*-----------------------------------------------------------------------
*/
+flash_unlock(flash_info_t * info)
+{
+ int j;
+ for (j=2;j<CFG_MAX_FLASH_SECT;j++){
+ FPWV *addr = (FPWV *) (info->start[j]);
+ flash_unprotect_sectors (addr);
+ *addr = (FPW) 0x00500050;/* clear status register */
+ *addr = (FPW) 0x00FF00FF;/* resest to read mode */
+ }
+}
+
+/*-----------------------------------------------------------------------
+ */
static void flash_get_offsets (ulong base, flash_info_t * info)
{
int i;
@@ -447,7 +462,6 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr);
return (2);
}
- flash_unprotect_sectors (addr);
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts ();
*addr = (FPW) 0x00400040; /* write setup */