/* cycle through bank list */
for (c = flash_banks; c; c = c->next) {
+ if (c->target != target)
+ continue;
+
int retval;
retval = c->driver->auto_probe(c);
return retval;
}
/* check whether address belongs to this flash bank */
- if ((addr >= c->base) && (addr <= c->base + (c->size - 1)) && target == c->target) {
+ if ((addr >= c->base) && (addr <= c->base + (c->size - 1))) {
*result_bank = c;
return ERROR_OK;
}
if (retval != ERROR_OK)
goto done;
if (c == NULL) {
- LOG_WARNING("no flash bank found for address %x", run_address);
+ LOG_WARNING("no flash bank found for address %" PRIx32, run_address);
section++; /* and skip it */
section_offset = 0;
continue;
/* see if we need to pad the section */
while (padding[section]--)
- (buffer + buffer_size)[size_read++] = 0xff;
+ (buffer + buffer_size)[size_read++] = c->default_padded_value;
buffer_size += size_read;
section_offset += size_read;