1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright 2024 Google LLC
16 #include <dm/uclass-internal.h>
18 static int do_bootstd_images(struct cmd_tbl *cmdtp, int flag, int argc,
21 const struct bootflow *bflow;
22 struct bootstd_priv *std;
25 ret = bootstd_get_priv(&std);
27 printf("Cannot get bootstd (err=%d)\n", ret);
28 return CMD_RET_FAILURE;
31 printf("Seq Bootflow Type At Size Filename\n");
32 printf("--- ------------------- -------------- -------- -------- ----------------\n");
35 * Use the ordering if we have one, so long as we are not trying to list
39 alist_for_each(bflow, &std->bootflows) {
40 const struct bootflow_img *img;
42 alist_for_each(img, &bflow->images) {
43 printf("%3d %-20.20s %-15.15s ",
44 bootflow_get_seq(bflow), bflow->name,
45 bootflow_img_type_name(img->type));
47 printf("%8lx", img->addr);
50 printf(" %8lx %s\n", img->size, img->fname);
55 printf("--- ------------------- -------------- -------- -------- ----------------\n");
56 printf("(%d image%s)\n", i, i != 1 ? "s" : "");
61 U_BOOT_LONGHELP(bootstd,
62 "images - list loaded images");
64 U_BOOT_CMD_WITH_SUBCMDS(bootstd, "Standard-boot operation", bootstd_help_text,
65 U_BOOT_SUBCMD_MKENT(images, 1, 1, do_bootstd_images));