Simon Glass | b936a97 | 2020-09-19 18:49:26 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Command-line access to bloblist features |
| 4 | * |
| 5 | * Copyright 2020 Google LLC |
| 6 | * Written by Simon Glass <sjg@chromium.org> |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <bloblist.h> |
| 11 | #include <command.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 12 | #include <asm/global_data.h> |
Simon Glass | b936a97 | 2020-09-19 18:49:26 -0600 | [diff] [blame] | 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
| 16 | static int do_bloblist_info(struct cmd_tbl *cmdtp, int flag, int argc, |
| 17 | char *const argv[]) |
| 18 | { |
| 19 | bloblist_show_stats(); |
| 20 | |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | static int do_bloblist_list(struct cmd_tbl *cmdtp, int flag, int argc, |
| 25 | char *const argv[]) |
| 26 | { |
| 27 | bloblist_show_list(); |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |
Simon Glass | ac8d9d5 | 2021-03-15 18:00:25 +1300 | [diff] [blame] | 32 | #ifdef CONFIG_SYS_LONGHELP |
Simon Glass | b936a97 | 2020-09-19 18:49:26 -0600 | [diff] [blame] | 33 | static char bloblist_help_text[] = |
| 34 | "info - show information about the bloblist\n" |
| 35 | "bloblist list - list blobs in the bloblist"; |
Simon Glass | ac8d9d5 | 2021-03-15 18:00:25 +1300 | [diff] [blame] | 36 | #endif |
Simon Glass | b936a97 | 2020-09-19 18:49:26 -0600 | [diff] [blame] | 37 | |
| 38 | U_BOOT_CMD_WITH_SUBCMDS(bloblist, "Bloblists", bloblist_help_text, |
| 39 | U_BOOT_SUBCMD_MKENT(info, 1, 1, do_bloblist_info), |
| 40 | U_BOOT_SUBCMD_MKENT(list, 1, 1, do_bloblist_list)); |