system.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copied from linux/include/asm-arm/arch-sa1100/system.h
  3. * Copyright (c) 1999 Nicolas Pitre <nico@cam.org>
  4. */
  5. #ifndef __ASM_ARCH_SYSTEM_H
  6. #define __ASM_ARCH_SYSTEM_H
  7. #include <linux/config.h>
  8. #include <linux/clk.h>
  9. #include <asm/mach-types.h>
  10. #include <asm/hardware.h>
  11. #include <asm/arch/prcm.h>
  12. #ifndef CONFIG_MACH_VOICEBLUE
  13. #define voiceblue_reset() do {} while (0)
  14. #endif
  15. static inline void arch_idle(void)
  16. {
  17. cpu_do_idle();
  18. }
  19. static inline void omap1_arch_reset(char mode)
  20. {
  21. /*
  22. * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
  23. * "Global Software Reset Affects Traffic Controller Frequency".
  24. */
  25. if (cpu_is_omap5912()) {
  26. omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4),
  27. DPLL_CTL);
  28. omap_writew(0x8, ARM_RSTCT1);
  29. }
  30. if (machine_is_voiceblue())
  31. voiceblue_reset();
  32. else
  33. omap_writew(1, ARM_RSTCT1);
  34. }
  35. static inline void omap2_arch_reset(char mode)
  36. {
  37. u32 rate;
  38. struct clk *vclk, *sclk;
  39. vclk = clk_get(NULL, "virt_prcm_set");
  40. sclk = clk_get(NULL, "sys_ck");
  41. rate = clk_get_rate(sclk);
  42. clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */
  43. RM_RSTCTRL_WKUP |= 2;
  44. }
  45. static inline void arch_reset(char mode)
  46. {
  47. if (!cpu_is_omap24xx())
  48. omap1_arch_reset(mode);
  49. else
  50. omap2_arch_reset(mode);
  51. }
  52. #endif