ti81xx-restart.c 1001 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License version 2 as
  4. * published by the Free Software Foundation.
  5. */
  6. #include <linux/kernel.h>
  7. #include <linux/init.h>
  8. #include <linux/reboot.h>
  9. #include "iomap.h"
  10. #include "common.h"
  11. #include "control.h"
  12. #include "prm3xxx.h"
  13. #define TI81XX_PRM_DEVICE_RSTCTRL 0x00a0
  14. #define TI81XX_GLOBAL_RST_COLD BIT(1)
  15. /**
  16. * ti81xx_restart - trigger a software restart of the SoC
  17. * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
  18. * @cmd: passed from the userspace program rebooting the system (if provided)
  19. *
  20. * Resets the SoC. For @cmd, see the 'reboot' syscall in
  21. * kernel/sys.c. No return value.
  22. *
  23. * NOTE: Warm reset does not seem to work, may require resetting
  24. * clocks to bypass mode.
  25. */
  26. void ti81xx_restart(enum reboot_mode mode, const char *cmd)
  27. {
  28. omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
  29. TI81XX_PRM_DEVICE_RSTCTRL);
  30. while (1);
  31. }