nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
523 stars 293 forks source link

Improve speed of burning #426

Open MihanLee opened 1 month ago

MihanLee commented 1 month ago

Hi author

We found that it takes nearly 20 minutes to burn an image which is about 4GB Is there any command to improve the speed or which code could we modify for that?

Best regards Mingheng

nxpfrankli commented 1 month ago

what's method do you use burn image? If use uuu -b emmc_all *wic, which should be some minutes.

MihanLee commented 1 month ago

Now we are using "uuu -b emmc_al *.wic" takes about 20mins, wic file size is about 4GB.

nxpfrankli commented 1 month ago

try change uboot, some emmc is slow when write small chunk data.

commit 268f06af821001d2b399022cc44a41a61c5f8d83
Author: Frank Li <Frank.Li@nxp.com>
Date:   Mon Oct 24 16:45:36 2022 -0400

    LF-7382: fastboot: improve emmc write speed
    tested at iMX8MM platfrom reduce almost half write time.
    (499s vs 1000s).
    About 1/4 improve at 8DXL platform.
    100*512 = 51k, which small than emmc erase block size 64k,
    which may cause more page management in emmc.
    Increase to 4096, about 2M write to emmc each time.
    Signed-off-by: Frank Li <Frank.Li@nxp.com>
    Reviewed-by: Ye Li <ye.li@nxp.com>

diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index b255d3acc0b..a90d51624e8 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -55,7 +55,7 @@ static lbaint_t write_sparse_chunk_raw(struct sparse_storage *info,
                                       void *data,
                                       char *response)
{
-       lbaint_t n = blkcnt, write_blks, blks = 0, aligned_buf_blks = 100;
+       lbaint_t n = blkcnt, write_blks, blks = 0, aligned_buf_blks = 4096;
        uint32_t *aligned_buf = NULL;
        if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) {