cmd_poweroff.c 538 B

12345678910111213141516171819202122232425262728
  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. #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. int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  15. {
  16. mon_power_off(0);
  17. psc_disable_module(KS2_LPSC_TETRIS);
  18. psc_disable_domain(KS2_TETRIS_PWR_DOMAIN);
  19. asm volatile ("isb\n"
  20. "dsb\n"
  21. "wfi\n");
  22. return 0;
  23. }