#define PROBE_BUFFER_SIZE 1024
static unsigned char buffer[PROBE_BUFFER_SIZE];
-
#define SC520_MAX_FLASH_BANKS 1
#define SC520_FLASH_BANK0_BASE 0x38000000 /* BOOTCS */
#define SC520_FLASH_BANKSIZE 0x8000000
/*-----------------------------------------------------------------------
*/
-
static u32 _probe_flash(u32 addr, u32 bw, int il)
{
u32 result=0;
break;
}
-
return result;
}
enable_interrupts();
}
-
vendor = res >> 16;
device = res & 0xffff;
-
return res;
}
break;
}
-
printf(" Size: %ld MB in %d Sectors\n",
info->size >> 20, info->sector_count);
}
printf ("\n");
- done:
+done:
+ return;
}
/*-----------------------------------------------------------------------
*/
-
static u32 _amd_erase_flash(u32 addr, u32 sector)
{
unsigned elapsed;
*(volatile u16*)(addr + sector) = 0x0020; /* erase setup */
*(volatile u16*)(addr + sector) = 0x00D0; /* erase confirm */
-
/* Wait at least 80us - let's wait 1 ms */
__udelay(1000);
return 0;
}
-
extern int _intel_erase_flash_end;
asm ("_intel_erase_flash_end:\n"
".long 0\n");
printf ("\n");
}
-
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
enable_interrupts();
}
-
if (res) {
printf("Erase timed out, sector %d\n", sect);
return res;
}
}
-
return 0;
}
* 1 - write timeout
* 2 - Flash not erased
*/
-static int _amd_write_word(unsigned start, unsigned dest, unsigned data)
+static int _amd_write_word(unsigned start, unsigned dest, u16 data)
{
- volatile u16 *addr2 = (u16*)start;
- volatile u16 *dest2 = (u16*)dest;
- volatile u16 *data2 = (u16*)&data;
+ volatile u16 *addr2 = (volatile u16*)start;
+ volatile u16 *dest2 = (volatile u16*)dest;
+ volatile u16 *data2 = (volatile u16*)&data;
int i;
unsigned elapsed;
for (i = 0; i < 2; i++) {
-
addr2[0x5555] = 0x00AA;
addr2[0x2aaa] = 0x0055;
addr2[0x5555] = 0x00A0;
asm ("_amd_write_word_end:\n"
".long 0\n");
-
static int _intel_write_word(unsigned start, unsigned dest, unsigned data)
{
int i;
return 0;
-
}
extern int _intel_write_word_end;
asm ("_intel_write_word_end:\n"
".long 0\n");
-
/*-----------------------------------------------------------------------
* Copy memory to flash, returns:
* 0 - OK
return 3;
}
-
wp = (addr & ~3); /* get lower word aligned address */
-
/*
* handle unaligned start bytes
*/
}
return rc;
-
}