malta-reset.c 961 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. * Carsten Langgaard, carstenl@mips.com
  7. * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
  8. */
  9. #include <linux/io.h>
  10. #include <linux/pm.h>
  11. #include <asm/reboot.h>
  12. #define SOFTRES_REG 0x1f000500
  13. #define GORESET 0x42
  14. static void mips_machine_restart(char *command)
  15. {
  16. unsigned int __iomem *softres_reg =
  17. ioremap(SOFTRES_REG, sizeof(unsigned int));
  18. __raw_writel(GORESET, softres_reg);
  19. }
  20. static void mips_machine_halt(void)
  21. {
  22. unsigned int __iomem *softres_reg =
  23. ioremap(SOFTRES_REG, sizeof(unsigned int));
  24. __raw_writel(GORESET, softres_reg);
  25. }
  26. static int __init mips_reboot_setup(void)
  27. {
  28. _machine_restart = mips_machine_restart;
  29. _machine_halt = mips_machine_halt;
  30. pm_power_off = mips_machine_halt;
  31. return 0;
  32. }
  33. arch_initcall(mips_reboot_setup);