reset.c 747 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * reset.c -- common ColdFire SoC reset support
  3. *
  4. * (C) Copyright 2012, Greg Ungerer <gerg@uclinux.org>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/io.h>
  13. #include <asm/machdep.h>
  14. #include <asm/coldfire.h>
  15. #include <asm/mcfsim.h>
  16. void mcf_cpu_reset(void)
  17. {
  18. local_irq_disable();
  19. /* Set watchdog to soft reset, and enabled */
  20. __raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR);
  21. for (;;)
  22. /* wait for watchdog to timeout */;
  23. }
  24. static int __init mcf_setup_reset(void)
  25. {
  26. mach_reset = mcf_cpu_reset;
  27. return 0;
  28. }
  29. arch_initcall(mcf_setup_reset);