read_memmapped: Use flashprog_read_chunked() for progress reporting

Read up to 64 KiB in one go to be able to report progress in between.
Otherwise, we might read the whole flash at once, without being able
to report progress.

Change-Id: I272a53f4be6e7c5bf2811d4332688a31a0080f24
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/74866
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/flashprog.c b/flashprog.c
index e525f48..859537b 100644
--- a/flashprog.c
+++ b/flashprog.c
@@ -194,13 +194,15 @@
 	}
 }
 
-int read_memmapped(struct flashctx *flash, uint8_t *buf, unsigned int start,
-		   int unsigned len)
+static int read_memmapped_chunk(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len)
 {
 	chip_readn(flash, buf, flash->virtual_memory + start, len);
-
 	return 0;
 }
+int read_memmapped(struct flashctx *flash, uint8_t *buf, unsigned int start, int unsigned len)
+{
+	return flashprog_read_chunked(flash, buf, start, len, MAX_DATA_READ_UNLIMITED, read_memmapped_chunk);
+}
 
 /* This is a somewhat hacked function similar in some ways to strtok().
  * It will look for needle with a subsequent '=' in haystack, return a copy of