1 // SPDX-License-Identifier: GPL-2.0+
4 * FUJITSU COMPUTERTECHNOLOGIES LIMITED. All rights reserved.
11 #include <u-boot/lz4.h>
13 static int do_unlz4(struct cmd_tbl
*cmdtp
, int flag
, int argc
,
16 unsigned long src
, dst
;
17 size_t src_len
= ~0UL, dst_len
= ~0UL;
22 src
= hextoul(argv
[1], NULL
);
23 dst
= hextoul(argv
[2], NULL
);
24 dst_len
= hextoul(argv
[3], NULL
);
30 ret
= ulz4fn(map_sysmem(src
, 0), src_len
, map_sysmem(dst
, dst_len
),
33 printf("Uncompressed err :%d\n", ret
);
37 printf("Uncompressed size: %zd = 0x%zX\n", dst_len
, dst_len
);
38 env_set_hex("filesize", dst_len
);
43 U_BOOT_CMD(unlz4
, 4, 1, do_unlz4
,
44 "lz4 uncompress a memory region",
45 "srcaddr dstaddr dstsize\n"
46 "NOTE: Specify the destination size that is sufficiently larger\n"
47 " than the source size.\n"