cmd_poweroff.c 535 B

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