mirror of
				https://source.denx.de/u-boot/u-boot.git
				synced 2025-11-04 02:11:25 +01:00 
			
		
		
		
	Activate the command poweroff by default for STM32MP1: - with PCSI from TF-A for trusted boot - with PMIC sysreset request for basic boot (SYSRESET_POWER) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			457 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			457 B
		
	
	
	
		
			C
		
	
	
	
	
	
// 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;
 | 
						|
}
 |