diff --git a/cmd/Makefile b/cmd/Makefile index 006075a048..7008dd42dc 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -8,6 +8,7 @@ ifndef CONFIG_SPL_BUILD obj-y += boot.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-y += help.o +obj-y += panic.o obj-y += version.o # command diff --git a/cmd/panic.c b/cmd/panic.c new file mode 100644 index 0000000000..f13b3f094f --- /dev/null +++ b/cmd/panic.c @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH + */ + +#include +#include + +static int do_panic(struct cmd_tbl *cmdtp, int flag, int argc, + char * const argv[]) +{ + char *text = (argc < 2) ? "" : argv[1]; + + panic(text); + + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD( + panic, 2, 1, do_panic, + "Panic with optional message", + "[message]" +);