return 1;
}
+ if (strncmp(argv[0], "read", 4) != 0 && flash->flash_is_unlocked &&
+ !flash->flash_is_unlocked(flash, offset, len)) {
+ printf("ERROR: flash area is locked\n");
+ return 1;
+ }
+
buf = map_physmem(addr, len, MAP_WRBACK);
if (!buf && addr) {
puts("Failed to map physical memory\n");
return 1;
}
+ if (flash->flash_is_unlocked &&
+ !flash->flash_is_unlocked(flash, offset, len)) {
+ printf("ERROR: flash area is locked\n");
+ return 1;
+ }
+
ret = spi_flash_erase(flash, offset, size);
printf("SF: %zu bytes @ %#x Erased: ", (size_t)size, (u32)offset);
if (ret)