reset.c 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it
  3. * under the terms of the GNU General Public License as published by the
  4. * Free Software Foundation; either version 2 of the License, or (at your
  5. * option) any later version.
  6. *
  7. * Copyright (C) 1997, 2001 Ralf Baechle
  8. * Copyright 2001 MontaVista Software Inc.
  9. * Author: jsun@mvista.com or jsun@junsun.net
  10. */
  11. #include <linux/sched.h>
  12. #include <linux/mm.h>
  13. #include <asm/io.h>
  14. #include <asm/cacheflush.h>
  15. #include <asm/processor.h>
  16. #include <asm/reboot.h>
  17. #include <asm/system.h>
  18. void nec_osprey_restart(char *command)
  19. {
  20. set_c0_status(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 nec_osprey_halt(void)
  27. {
  28. printk(KERN_NOTICE "\n** You can safely turn off the power\n");
  29. while (1)
  30. __asm__(".set\tmips3\n\t"
  31. "wait\n\t"
  32. ".set\tmips0");
  33. }
  34. void nec_osprey_power_off(void)
  35. {
  36. nec_osprey_halt();
  37. }