return NULL;
}
+int flash_get_bank_count()
+{
+ flash_bank_t *p;
+ int i = 0;
+ for (p = flash_banks; p; p = p->next)
+ {
+ i++;
+ }
+ return i;
+}
+
flash_bank_t *get_flash_bank_by_num(int num)
{
flash_bank_t *p = get_flash_bank_by_num_noprobe(num);
extern int flash_erase_address_range(target_t *target, u32 addr, u32 length);
extern int flash_write(target_t *target, image_t *image, u32 *written, int erase);
extern void flash_set_dirty(void);
+extern int flash_get_bank_count();
extern flash_bank_t *get_flash_bank_by_num(int num);
extern flash_bank_t *get_flash_bank_by_addr(target_t *target, u32 addr);
xml_printf(&retval, &xml, &pos, &size, "<memory-map>\n");
- int i = 0;
- for (;;)
+ int i;
+ for (i=0; i<flash_get_bank_count(); i++)
{
p = get_flash_bank_by_num(i);
if (p == NULL)
"<property name=\"blocksize\">0x%x</property>\n" \
"</memory>\n", \
p->base, p->size, blocksize);
- i++;
}
xml_printf(&retval, &xml, &pos, &size, "</memory-map>\n");