xref: /openbmc/u-boot/arch/arm/mach-keystone/cmd_poweroff.c (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
2534bc70eSTom Rini /*
3534bc70eSTom Rini  * Keystone EVM : Power off
4534bc70eSTom Rini  *
5534bc70eSTom Rini  * (C) Copyright 2014
6534bc70eSTom Rini  *     Texas Instruments Incorporated, <www.ti.com>
7534bc70eSTom Rini  */
8534bc70eSTom Rini 
9534bc70eSTom Rini #include <common.h>
10534bc70eSTom Rini #include <command.h>
11534bc70eSTom Rini #include <asm/arch/mon.h>
12534bc70eSTom Rini #include <asm/arch/psc_defs.h>
13534bc70eSTom Rini #include <asm/arch/hardware.h>
14534bc70eSTom Rini 
do_poweroff(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])15534bc70eSTom Rini int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
16534bc70eSTom Rini {
17534bc70eSTom Rini 	mon_power_off(0);
18534bc70eSTom Rini 
19534bc70eSTom Rini 	psc_disable_module(KS2_LPSC_TETRIS);
20534bc70eSTom Rini 	psc_disable_domain(KS2_TETRIS_PWR_DOMAIN);
21534bc70eSTom Rini 
22534bc70eSTom Rini 	asm volatile ("isb\n"
23534bc70eSTom Rini 		      "dsb\n"
24534bc70eSTom Rini 		      "wfi\n");
25534bc70eSTom Rini 
26534bc70eSTom Rini 	return 0;
27534bc70eSTom Rini }
28