From b98fff1d6acc57cc54f01740028535ac095237cd Mon Sep 17 00:00:00 2001 From: wdenk Date: Mon, 9 Feb 2004 20:51:26 +0000 Subject: * 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 --- board/omap1610inn/flash.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'board/omap1610inn') diff --git a/board/omap1610inn/flash.c b/board/omap1610inn/flash.c index e7d65157f7..ae7fb3b69a 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"); @@ -114,6 +116,19 @@ unsigned long flash_init (void) return size; } +/*----------------------------------------------------------------------- + */ +flash_unlock(flash_info_t * info) +{ + int j; + for (j=2;jstart[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) @@ -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 */ -- cgit v1.2.3