reset.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Thomas Horsten <thh@lasat.com>
  3. * Copyright (C) 2000 LASAT Networks A/S.
  4. *
  5. * This program is free software; you can distribute it and/or modify it
  6. * under the terms of the GNU General Public License (Version 2) as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. * for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  17. *
  18. * Reset the LASAT board.
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/pm.h>
  22. #include <asm/reboot.h>
  23. #include <asm/lasat/lasat.h>
  24. #include "picvue.h"
  25. #include "prom.h"
  26. static void lasat_machine_restart(char *command);
  27. static void lasat_machine_halt(void);
  28. /* Used to set machine to boot in service mode via /proc interface */
  29. int lasat_boot_to_service;
  30. static void lasat_machine_restart(char *command)
  31. {
  32. local_irq_disable();
  33. if (lasat_boot_to_service) {
  34. *(volatile unsigned int *)0xa0000024 = 0xdeadbeef;
  35. *(volatile unsigned int *)0xa00000fc = 0xfedeabba;
  36. }
  37. *lasat_misc->reset_reg = 0xbedead;
  38. for (;;) ;
  39. }
  40. static void lasat_machine_halt(void)
  41. {
  42. local_irq_disable();
  43. prom_monitor();
  44. for (;;) ;
  45. }
  46. void lasat_reboot_setup(void)
  47. {
  48. _machine_restart = lasat_machine_restart;
  49. _machine_halt = lasat_machine_halt;
  50. pm_power_off = lasat_machine_halt;
  51. }