system.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * arch/arm/mach-s3c2410/include/mach/system.h
  3. *
  4. * Copyright (C) 2006 Simtec Electronics
  5. * Ben Dooks <ben@simtec.co.uk>
  6. *
  7. * KS8695 - System function defines and includes
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef __ASM_ARCH_SYSTEM_H
  14. #define __ASM_ARCH_SYSTEM_H
  15. #include <linux/io.h>
  16. #include <mach/regs-timer.h>
  17. static void arch_idle(void)
  18. {
  19. /*
  20. * This should do all the clock switching
  21. * and wait for interrupt tricks,
  22. */
  23. cpu_do_idle();
  24. }
  25. static void arch_reset(char mode, const char *cmd)
  26. {
  27. unsigned int reg;
  28. if (mode == 's')
  29. cpu_reset(0);
  30. /* disable timer0 */
  31. reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
  32. __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
  33. /* enable watchdog mode */
  34. __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
  35. /* re-enable timer0 */
  36. __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
  37. }
  38. #endif