* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
/* 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;
}
return ERROR_OK;
}
-int default_flash_mem_blank_check(struct flash_bank *bank)
+static int default_flash_mem_blank_check(struct flash_bank *bank)
{
struct target *target = bank->target;
const int buffer_size = 1024;
if (retval != ERROR_OK)
goto done;
if (c == NULL) {
+ 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;