1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2018, Google Inc.
4 * Written by Simon Glass <sjg@chromium.org>
11 #include <asm/global_data.h>
12 #include <asm/state.h>
14 static int do_sb_handoff(struct cmd_tbl *cmdtp, int flag, int argc,
17 #if CONFIG_IS_ENABLED(HANDOFF)
19 printf("SPL handoff magic %lx\n", gd->spl_handoff->arch.magic);
21 printf("SPL handoff info not received\n");
25 printf("Command not supported\n");
31 static int do_sb_state(struct cmd_tbl *cmdtp, int flag, int argc,
34 struct sandbox_state *state;
36 state = state_get_current();
42 static struct cmd_tbl cmd_sb_sub[] = {
43 U_BOOT_CMD_MKENT(handoff, 1, 0, do_sb_handoff, "", ""),
44 U_BOOT_CMD_MKENT(state, 1, 0, do_sb_state, "", ""),
47 static int do_sb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
55 c = find_cmd_tbl(argv[0], cmd_sb_sub, ARRAY_SIZE(cmd_sb_sub));
57 return c->cmd(cmdtp, flag, argc, argv);
64 "Sandbox status commands",
65 "handoff - Show handoff data received from SPL\n"
66 "sb state - Show sandbox state"