restart.c 857 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * arch/arm/plat-spear/restart.c
  4. *
  5. * SPEAr platform specific restart functions
  6. *
  7. * Copyright (C) 2009 ST Microelectronics
  8. * Viresh Kumar <[email protected]>
  9. */
  10. #include <linux/io.h>
  11. #include <linux/amba/sp810.h>
  12. #include <linux/reboot.h>
  13. #include <asm/system_misc.h>
  14. #include "spear.h"
  15. #include "generic.h"
  16. #define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204)
  17. void spear_restart(enum reboot_mode mode, const char *cmd)
  18. {
  19. if (mode == REBOOT_SOFT) {
  20. /* software reset, Jump into ROM at address 0 */
  21. soft_restart(0);
  22. } else {
  23. /* hardware reset, Use on-chip reset capability */
  24. #ifdef CONFIG_ARCH_SPEAR13XX
  25. writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES);
  26. #endif
  27. #if defined(CONFIG_ARCH_SPEAR3XX) || defined(CONFIG_ARCH_SPEAR6XX)
  28. sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
  29. #endif
  30. }
  31. }