ip27-reset.c
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  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.  * Reset an IP27.
  7.  *
  8.  * Copyright (C) 1997, 1998, 1999, 2000 by Ralf Baechle
  9.  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  10.  */
  11. #include <linux/config.h>
  12. #include <linux/kernel.h>
  13. #include <linux/sched.h>
  14. #include <linux/timer.h>
  15. #include <linux/smp.h>
  16. #include <linux/mmzone.h>
  17. #include <asm/io.h>
  18. #include <asm/irq.h>
  19. #include <asm/system.h>
  20. #include <asm/sgialib.h>
  21. #include <asm/sn/addrs.h>
  22. #include <asm/sn/arch.h>
  23. #include <asm/sn/gda.h>
  24. #include <asm/sn/sn0/hub.h>
  25. void machine_restart(char *command) __attribute__((noreturn));
  26. void machine_halt(void) __attribute__((noreturn));
  27. void machine_power_off(void) __attribute__((noreturn));
  28. #define noreturn while(1); /* Silence gcc.  */
  29. /* XXX How to pass the reboot command to the firmware??? */
  30. void machine_restart(char *command)
  31. {
  32. #if 0
  33. int i;
  34. #endif
  35. printk("Reboot started from CPU %dn", smp_processor_id());
  36. #ifdef CONFIG_SMP
  37. smp_send_stop();
  38. #endif
  39. #if 0
  40. for (i = 0; i < numnodes; i++)
  41. REMOTE_HUB_S(COMPACT_TO_NASID_NODEID(i), PROMOP_REG, 
  42. PROMOP_REBOOT);
  43. #else
  44. LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
  45. #endif
  46. noreturn;
  47. }
  48. void machine_halt(void)
  49. {
  50. int i;
  51. #ifdef CONFIG_SMP
  52. smp_send_stop();
  53. #endif
  54. for (i = 0; i < numnodes; i++)
  55. REMOTE_HUB_S(COMPACT_TO_NASID_NODEID(i), PROMOP_REG, 
  56. PROMOP_RESTART);
  57. LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
  58. noreturn;
  59. }
  60. void machine_power_off(void)
  61. {
  62. /* To do ...  */
  63. noreturn;
  64. }
  65. void ip27_reboot_setup(void)
  66. {
  67. /* Nothing to do on IP27.  */
  68. }