Comments
Patch
===================================================================
@@ -997,10 +997,11 @@
*/
int spi_chip_write_1(struct flashchip *flash, uint8_t *buf)
{
- int total_size = 1024 * flash->total_size;
+ int total_size = 0x1C0000;
int i, result = 0;
spi_disable_blockprotect();
+#if 0
/* Erase first */
printf("Erasing flash before programming... ");
if (erase_flash(flash)) {
@@ -1008,6 +1009,11 @@
return -1;
}
printf("done.\n");
+#endif
+ if (check_erased_range(flash, 0, total_size)) {
+ fprintf(stderr, "WTF erased area failed erasecheck!\n");
+ return 1;
+ }
for (i = 0; i < total_size; i++) {
result = spi_byte_program(i, buf[i]);
if (result)