1 /*
2  * Keystone EVM : Power off
3  *
4  * (C) Copyright 2014
5  *     Texas Instruments Incorporated, <www.ti.com>
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9 
10 #include <common.h>
11 #include <command.h>
12 #include <asm/arch/mon.h>
13 #include <asm/arch/psc_defs.h>
14 #include <asm/arch/hardware.h>
15 
16 int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
17 {
18 	mon_power_off(0);
19 
20 	psc_disable_module(KS2_LPSC_TETRIS);
21 	psc_disable_domain(KS2_TETRIS_PWR_DOMAIN);
22 
23 	asm volatile ("isb\n"
24 		      "dsb\n"
25 		      "wfi\n");
26 
27 	return 0;
28 }
29