summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/cmd_poweroff.c
blob: f54dd1daf230d636be366b178d08197a2c5689aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
 * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
 */

#include <common.h>
#include <command.h>
#include <sysreset.h>

int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int ret;

	puts("poweroff ...\n");
	mdelay(100);

	ret = sysreset_walk(SYSRESET_POWER);

	if (ret == -EINPROGRESS)
		mdelay(1000);

	/*NOTREACHED when power off*/
	return CMD_RET_FAILURE;
}