system.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (C) 2005 Sigmatel Inc
  3. *
  4. * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
  5. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  6. */
  7. /*
  8. * The code contained herein is licensed under the GNU General Public
  9. * License. You may obtain a copy of the GNU General Public License
  10. * Version 2 or later at the following locations:
  11. *
  12. * http://www.opensource.org/licenses/gpl-license.html
  13. * http://www.gnu.org/copyleft/gpl.html
  14. */
  15. #ifndef __ASM_ARCH_SYSTEM_H
  16. #define __ASM_ARCH_SYSTEM_H
  17. #include <asm/proc-fns.h>
  18. #include <mach/platform.h>
  19. #include <mach/regs-clkctrl.h>
  20. #include <mach/regs-power.h>
  21. static inline void arch_idle(void)
  22. {
  23. /*
  24. * This should do all the clock switching
  25. * and wait for interrupt tricks
  26. */
  27. cpu_do_idle();
  28. }
  29. static inline void arch_reset(char mode, const char *cmd)
  30. {
  31. /* Set BATTCHRG to default value */
  32. __raw_writel(0x00010000, REGS_POWER_BASE + HW_POWER_CHARGE);
  33. /* Set MINPWR to default value */
  34. __raw_writel(0, REGS_POWER_BASE + HW_POWER_MINPWR);
  35. /* Reset digital side of chip (but not power or RTC) */
  36. __raw_writel(BM_CLKCTRL_RESET_DIG,
  37. REGS_CLKCTRL_BASE + HW_CLKCTRL_RESET);
  38. /* Should not return */
  39. }
  40. #endif