1 // SPDX-License-Identifier: GPL-2.0+
4 * Lei Wen <leiwen@marvell.com>, Marvell Inc.
10 static int do_zip(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
12 unsigned long src
, dst
;
13 unsigned long src_len
, dst_len
= ~0UL;
17 dst_len
= simple_strtoul(argv
[4], NULL
, 16);
20 src
= simple_strtoul(argv
[1], NULL
, 16);
21 src_len
= simple_strtoul(argv
[2], NULL
, 16);
22 dst
= simple_strtoul(argv
[3], NULL
, 16);
25 return cmd_usage(cmdtp
);
28 if (gzip((void *) dst
, &dst_len
, (void *) src
, src_len
) != 0)
31 printf("Compressed size: %lu = 0x%lX\n", dst_len
, dst_len
);
32 env_set_hex("filesize", dst_len
);
39 "zip a memory region",
40 "srcaddr srcsize dstaddr [dstsize]"