static void flash_get_offsets (ulong base, flash_info_t * info)
{
int i;
- OrgDef *pOrgDef;
- pOrgDef = OrgIntel_28F256L18T;
if (info->flash_id == FLASH_UNKNOWN) {
return;
}
printf (" done\n");
}
}
+ if (flag)
+ enable_interrupts();
+
return rcode;
}
{
FPWV *addr = (FPWV *) dest;
ulong status;
- int flag;
+ int flag, rc = 0;
ulong start;
/* Check if Flash is (sufficiently) erased */
if ((*addr & data) != data) {
- printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr);
- return (2);
+ printf("not erased at %08lx (%x)\n", (ulong) addr, *addr);
+ return 2;
}
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts ();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
- *addr = (FPW) 0x00FF00FF; /* restore read mode */
- return (1);
+ rc = 1;
+ goto done;
}
}
+done:
+ if (flag)
+ enable_interrupts();
+
*addr = (FPW) 0x00FF00FF; /* restore read mode */
- return (0);
+ return rc;
}
void inline spin_wheel (void)