bios/boot/copy_image_from_sdcard_to_ram: use chunks of 32KB to increase speed.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 10 Jun 2020 06:21:54 +0000 (08:21 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 10 Jun 2020 06:21:54 +0000 (08:21 +0200)
litex/soc/software/bios/boot.c

index c80dbb603eb86cb4dd9bd8c58cbe72092dba72f8..634a1eb93d42896600d7f9482064d11d5951f3e7 100644 (file)
@@ -563,11 +563,10 @@ static int copy_image_from_sdcard_to_ram(const char * filename, unsigned int ram
                init_progression_bar(f_size(&file));
                offset = 0;
                for (;;) {
-                       fr = f_read(&file, (void *) ram_address + offset, 512, &br);
+                       fr = f_read(&file, (void *) ram_address + offset,  0x8000, &br);
                        if (br == 0) break;
                        offset += br;
-                       if (offset%(512*128) == 0)
-                               show_progress(offset);
+                       show_progress(offset);
                }
                show_progress(offset);
                printf("\n");