sead3-reset.c 900 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
  7. */
  8. #include <linux/io.h>
  9. #include <linux/pm.h>
  10. #include <asm/reboot.h>
  11. #include <asm/mips-boards/generic.h>
  12. static void mips_machine_restart(char *command)
  13. {
  14. unsigned int __iomem *softres_reg =
  15. ioremap(SOFTRES_REG, sizeof(unsigned int));
  16. __raw_writel(GORESET, softres_reg);
  17. }
  18. static void mips_machine_halt(void)
  19. {
  20. unsigned int __iomem *softres_reg =
  21. ioremap(SOFTRES_REG, sizeof(unsigned int));
  22. __raw_writel(GORESET, softres_reg);
  23. }
  24. static int __init mips_reboot_setup(void)
  25. {
  26. _machine_restart = mips_machine_restart;
  27. _machine_halt = mips_machine_halt;
  28. pm_power_off = mips_machine_halt;
  29. return 0;
  30. }
  31. arch_initcall(mips_reboot_setup);