common.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved.
  3. */
  4. /*
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #ifndef __ASM_ARCH_MXC_COMMON_H__
  10. #define __ASM_ARCH_MXC_COMMON_H__
  11. #include <linux/reboot.h>
  12. struct irq_data;
  13. struct platform_device;
  14. struct pt_regs;
  15. struct clk;
  16. struct device_node;
  17. enum mxc_cpu_pwr_mode;
  18. struct of_device_id;
  19. void mx21_map_io(void);
  20. void mx27_map_io(void);
  21. void mx31_map_io(void);
  22. void mx35_map_io(void);
  23. void imx21_init_early(void);
  24. void imx27_init_early(void);
  25. void imx31_init_early(void);
  26. void imx35_init_early(void);
  27. void mxc_init_irq(void __iomem *);
  28. void mx21_init_irq(void);
  29. void mx27_init_irq(void);
  30. void mx31_init_irq(void);
  31. void mx35_init_irq(void);
  32. void imx21_soc_init(void);
  33. void imx27_soc_init(void);
  34. void imx31_soc_init(void);
  35. void imx35_soc_init(void);
  36. void epit_timer_init(void __iomem *base, int irq);
  37. int mx21_clocks_init(unsigned long lref, unsigned long fref);
  38. int mx27_clocks_init(unsigned long fref);
  39. int mx31_clocks_init(unsigned long fref);
  40. int mx35_clocks_init(void);
  41. struct platform_device *mxc_register_gpio(char *name, int id,
  42. resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
  43. void mxc_set_cpu_type(unsigned int type);
  44. void mxc_restart(enum reboot_mode, const char *);
  45. void mxc_arch_reset_init(void __iomem *);
  46. void imx1_reset_init(void __iomem *);
  47. void imx_set_aips(void __iomem *);
  48. void imx_aips_allow_unprivileged_access(const char *compat);
  49. int mxc_device_init(void);
  50. void imx_set_soc_revision(unsigned int rev);
  51. void imx_init_revision_from_anatop(void);
  52. struct device *imx_soc_device_init(void);
  53. void imx6_enable_rbc(bool enable);
  54. void imx_gpc_check_dt(void);
  55. void imx_gpc_set_arm_power_in_lpm(bool power_off);
  56. void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
  57. void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
  58. void imx25_pm_init(void);
  59. void imx27_pm_init(void);
  60. enum mxc_cpu_pwr_mode {
  61. WAIT_CLOCKED, /* wfi only */
  62. WAIT_UNCLOCKED, /* WAIT */
  63. WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */
  64. STOP_POWER_ON, /* just STOP */
  65. STOP_POWER_OFF, /* STOP + SRPG */
  66. };
  67. enum mx3_cpu_pwr_mode {
  68. MX3_RUN,
  69. MX3_WAIT,
  70. MX3_DOZE,
  71. MX3_SLEEP,
  72. };
  73. void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode);
  74. void imx_enable_cpu(int cpu, bool enable);
  75. void imx_set_cpu_jump(int cpu, void *jump_addr);
  76. u32 imx_get_cpu_arg(int cpu);
  77. void imx_set_cpu_arg(int cpu, u32 arg);
  78. #ifdef CONFIG_SMP
  79. void v7_secondary_startup(void);
  80. void imx_scu_map_io(void);
  81. void imx_smp_prepare(void);
  82. #else
  83. static inline void imx_scu_map_io(void) {}
  84. static inline void imx_smp_prepare(void) {}
  85. #endif
  86. void imx_src_init(void);
  87. void imx_gpc_pre_suspend(bool arm_power_off);
  88. void imx_gpc_post_resume(void);
  89. void imx_gpc_mask_all(void);
  90. void imx_gpc_restore_all(void);
  91. void imx_gpc_hwirq_mask(unsigned int hwirq);
  92. void imx_gpc_hwirq_unmask(unsigned int hwirq);
  93. void imx_anatop_init(void);
  94. void imx_anatop_pre_suspend(void);
  95. void imx_anatop_post_resume(void);
  96. int imx6_set_lpm(enum mxc_cpu_pwr_mode mode);
  97. void imx6_set_int_mem_clk_lpm(bool enable);
  98. void imx6sl_set_wait_clk(bool enter);
  99. int imx_mmdc_get_ddr_type(void);
  100. void imx_cpu_die(unsigned int cpu);
  101. int imx_cpu_kill(unsigned int cpu);
  102. #ifdef CONFIG_SUSPEND
  103. void v7_cpu_resume(void);
  104. void imx53_suspend(void __iomem *ocram_vbase);
  105. extern const u32 imx53_suspend_sz;
  106. void imx6_suspend(void __iomem *ocram_vbase);
  107. #else
  108. static inline void v7_cpu_resume(void) {}
  109. static inline void imx53_suspend(void __iomem *ocram_vbase) {}
  110. static const u32 imx53_suspend_sz;
  111. static inline void imx6_suspend(void __iomem *ocram_vbase) {}
  112. #endif
  113. void imx6_pm_ccm_init(const char *ccm_compat);
  114. void imx6q_pm_init(void);
  115. void imx6dl_pm_init(void);
  116. void imx6sl_pm_init(void);
  117. void imx6sx_pm_init(void);
  118. void imx6ul_pm_init(void);
  119. #ifdef CONFIG_PM
  120. void imx51_pm_init(void);
  121. void imx53_pm_init(void);
  122. #else
  123. static inline void imx51_pm_init(void) {}
  124. static inline void imx53_pm_init(void) {}
  125. #endif
  126. #ifdef CONFIG_NEON
  127. int mx51_neon_fixup(void);
  128. #else
  129. static inline int mx51_neon_fixup(void) { return 0; }
  130. #endif
  131. #ifdef CONFIG_CACHE_L2X0
  132. void imx_init_l2cache(void);
  133. #else
  134. static inline void imx_init_l2cache(void) {}
  135. #endif
  136. extern const struct smp_operations imx_smp_ops;
  137. extern const struct smp_operations ls1021a_smp_ops;
  138. #endif