ip30-power.c 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * ip30-power.c: Software powerdown and reset handling for IP30 architecture.
  4. *
  5. * Copyright (C) 2004-2007 Stanislaw Skowronek <[email protected]>
  6. * 2014 Joshua Kinard <[email protected]>
  7. * 2009 Johannes Dickgreber <[email protected]>
  8. */
  9. #include <linux/init.h>
  10. #include <linux/kernel.h>
  11. #include <linux/module.h>
  12. #include <linux/sched.h>
  13. #include <linux/notifier.h>
  14. #include <linux/delay.h>
  15. #include <linux/rtc/ds1685.h>
  16. #include <linux/interrupt.h>
  17. #include <linux/pm.h>
  18. #include <asm/reboot.h>
  19. #include <asm/sgi/heart.h>
  20. static void __noreturn ip30_machine_restart(char *cmd)
  21. {
  22. /*
  23. * Execute HEART cold reset
  24. * Yes, it's cold-HEARTed!
  25. */
  26. heart_write((heart_read(&heart_regs->mode) | HM_COLD_RST),
  27. &heart_regs->mode);
  28. unreachable();
  29. }
  30. static int __init ip30_reboot_setup(void)
  31. {
  32. _machine_restart = ip30_machine_restart;
  33. return 0;
  34. }
  35. subsys_initcall(ip30_reboot_setup);