reset.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Cobalt Reset operations
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
  9. * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
  10. */
  11. #include <linux/init.h>
  12. #include <linux/io.h>
  13. #include <linux/leds.h>
  14. #include <asm/idle.h>
  15. #include <asm/processor.h>
  16. #include <cobalt.h>
  17. #define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000))
  18. #define RESET 0x0f
  19. DEFINE_LED_TRIGGER(power_off_led_trigger);
  20. static int __init ledtrig_power_off_init(void)
  21. {
  22. led_trigger_register_simple("power-off", &power_off_led_trigger);
  23. return 0;
  24. }
  25. device_initcall(ledtrig_power_off_init);
  26. void cobalt_machine_halt(void)
  27. {
  28. /*
  29. * turn on power off LED on RaQ
  30. */
  31. led_trigger_event(power_off_led_trigger, LED_FULL);
  32. local_irq_disable();
  33. while (1) {
  34. if (cpu_wait)
  35. cpu_wait();
  36. }
  37. }
  38. void cobalt_machine_restart(char *command)
  39. {
  40. writeb(RESET, RESET_PORT);
  41. /* we should never get here */
  42. cobalt_machine_halt();
  43. }