reset.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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) 1997 Ralf Baechle
  7. */
  8. #include <linux/kernel.h>
  9. #include <asm/cacheflush.h>
  10. #include <asm/mipsregs.h>
  11. void wrppmc_machine_restart(char *command)
  12. {
  13. /*
  14. * Ouch, we're still alive ... This time we take the silver bullet ...
  15. * ... and find that we leave the hardware in a state in which the
  16. * kernel in the flush locks up somewhen during of after the PCI
  17. * detection stuff.
  18. */
  19. local_irq_disable();
  20. set_c0_status(ST0_BEV | ST0_ERL);
  21. change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
  22. flush_cache_all();
  23. write_c0_wired(0);
  24. __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
  25. }
  26. void wrppmc_machine_halt(void)
  27. {
  28. local_irq_disable();
  29. printk(KERN_NOTICE "You can safely turn off the power\n");
  30. while (1) {
  31. __asm__(
  32. ".set\tmips3\n\t"
  33. "wait\n\t"
  34. ".set\tmips0"
  35. );
  36. }
  37. }
  38. void wrppmc_machine_power_off(void)
  39. {
  40. wrppmc_machine_halt();
  41. }