Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tom Rini | 534bc70 | 2016-03-16 09:19:43 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Keystone EVM : Power off |
| 4 | * |
| 5 | * (C) Copyright 2014 |
| 6 | * Texas Instruments Incorporated, <www.ti.com> |
Tom Rini | 534bc70 | 2016-03-16 09:19:43 -0400 | [diff] [blame] | 7 | */ |
| 8 | |
Tom Rini | 534bc70 | 2016-03-16 09:19:43 -0400 | [diff] [blame] | 9 | #include <command.h> |
| 10 | #include <asm/arch/mon.h> |
| 11 | #include <asm/arch/psc_defs.h> |
| 12 | #include <asm/arch/hardware.h> |
| 13 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 14 | int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Tom Rini | 534bc70 | 2016-03-16 09:19:43 -0400 | [diff] [blame] | 15 | { |
| 16 | mon_power_off(0); |
| 17 | |
| 18 | psc_disable_module(KS2_LPSC_TETRIS); |
| 19 | psc_disable_domain(KS2_TETRIS_PWR_DOMAIN); |
| 20 | |
| 21 | asm volatile ("isb\n" |
| 22 | "dsb\n" |
| 23 | "wfi\n"); |
| 24 | |
| 25 | return 0; |
| 26 | } |