blob: f0ad9173b961a115ee5d2931aca61bf091d557f5 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Rini534bc702016-03-16 09:19:43 -04002/*
3 * Keystone EVM : Power off
4 *
5 * (C) Copyright 2014
6 * Texas Instruments Incorporated, <www.ti.com>
Tom Rini534bc702016-03-16 09:19:43 -04007 */
8
9#include <common.h>
10#include <command.h>
11#include <asm/arch/mon.h>
12#include <asm/arch/psc_defs.h>
13#include <asm/arch/hardware.h>
14
Simon Glass09140112020-05-10 11:40:03 -060015int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Tom Rini534bc702016-03-16 09:19:43 -040016{
17 mon_power_off(0);
18
19 psc_disable_module(KS2_LPSC_TETRIS);
20 psc_disable_domain(KS2_TETRIS_PWR_DOMAIN);
21
22 asm volatile ("isb\n"
23 "dsb\n"
24 "wfi\n");
25
26 return 0;
27}