]> Git Repo - J-u-boot.git/blobdiff - cmd/unzip.c
Merge patch series "Apply SoM overlays on phyCORE-AM6xx SoMs"
[J-u-boot.git] / cmd / unzip.c
index 9b28328a1d76c72574045a1b3bbefa457995beff..e7a3f9808b2c51fa1acf18ac1344298977665635 100644 (file)
@@ -4,11 +4,12 @@
  * Wolfgang Denk, DENX Software Engineering, [email protected].
  */
 
-#include <common.h>
 #include <command.h>
 #include <env.h>
 #include <gzip.h>
+#include <mapmem.h>
 #include <part.h>
+#include <vsprintf.h>
 
 static int do_unzip(struct cmd_tbl *cmdtp, int flag, int argc,
                    char *const argv[])
@@ -18,17 +19,18 @@ static int do_unzip(struct cmd_tbl *cmdtp, int flag, int argc,
 
        switch (argc) {
                case 4:
-                       dst_len = simple_strtoul(argv[3], NULL, 16);
+                       dst_len = hextoul(argv[3], NULL);
                        /* fall through */
                case 3:
-                       src = simple_strtoul(argv[1], NULL, 16);
-                       dst = simple_strtoul(argv[2], NULL, 16);
+                       src = hextoul(argv[1], NULL);
+                       dst = hextoul(argv[2], NULL);
                        break;
                default:
                        return CMD_RET_USAGE;
        }
 
-       if (gunzip((void *) dst, dst_len, (void *) src, &src_len) != 0)
+       if (gunzip(map_sysmem(dst, dst_len), dst_len, map_sysmem(src, 0),
+                  &src_len) != 0)
                return 1;
 
        printf("Uncompressed size: %lu = 0x%lX\n", src_len, src_len);
@@ -60,11 +62,11 @@ static int do_gzwrite(struct cmd_tbl *cmdtp, int flag,
        if (ret < 0)
                return CMD_RET_FAILURE;
 
-       addr = (unsigned char *)simple_strtoul(argv[3], NULL, 16);
-       length = simple_strtoul(argv[4], NULL, 16);
+       addr = (unsigned char *)hextoul(argv[3], NULL);
+       length = hextoul(argv[4], NULL);
 
        if (5 < argc) {
-               writebuf = simple_strtoul(argv[5], NULL, 16);
+               writebuf = hextoul(argv[5], NULL);
                if (6 < argc) {
                        startoffs = simple_strtoull(argv[6], NULL, 16);
                        if (7 < argc)
This page took 0.026495 seconds and 4 git commands to generate.