blob: f54dd1daf230d636be366b178d08197a2c5689aa [file] [log] [blame]
Patrick Delaunayc16cc4f2019-04-12 11:55:46 +02001// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2/*
3 * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
4 */
5
6#include <common.h>
7#include <command.h>
8#include <sysreset.h>
9
10int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
11{
12 int ret;
13
14 puts("poweroff ...\n");
15 mdelay(100);
16
17 ret = sysreset_walk(SYSRESET_POWER);
18
19 if (ret == -EINPROGRESS)
20 mdelay(1000);
21
22 /*NOTREACHED when power off*/
23 return CMD_RET_FAILURE;
24}