common.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 mx1_map_io(void);
  20. void mx21_map_io(void);
  21. void mx27_map_io(void);
  22. void mx31_map_io(void);
  23. void mx35_map_io(void);
  24. void imx1_init_early(void);
  25. void imx21_init_early(void);
  26. void imx27_init_early(void);
  27. void imx31_init_early(void);
  28. void imx35_init_early(void);
  29. void mxc_init_irq(void __iomem *);
  30. void tzic_init_irq(void);
  31. void mx1_init_irq(void);
  32. void mx21_init_irq(void);
  33. void mx27_init_irq(void);
  34. void mx31_init_irq(void);
  35. void mx35_init_irq(void);
  36. void imx1_soc_init(void);
  37. void imx21_soc_init(void);
  38. void imx27_soc_init(void);
  39. void imx31_soc_init(void);
  40. void imx35_soc_init(void);
  41. void epit_timer_init(void __iomem *base, int irq);
  42. void mxc_timer_init(unsigned long, int);
  43. int mx1_clocks_init(unsigned long fref);
  44. int mx21_clocks_init(unsigned long lref, unsigned long fref);
  45. int mx27_clocks_init(unsigned long fref);
  46. int mx31_clocks_init(unsigned long fref);
  47. int mx35_clocks_init(void);
  48. int mx31_clocks_init_dt(void);
  49. struct platform_device *mxc_register_gpio(char *name, int id,
  50. resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
  51. void mxc_set_cpu_type(unsigned int type);
  52. void mxc_restart(enum reboot_mode, const char *);
  53. void mxc_arch_reset_init(void __iomem *);
  54. void imx_set_aips(void __iomem *);
  55. void imx_aips_allow_unprivileged_access(const char *compat);
  56. int mxc_device_init(void);
  57. void imx_set_soc_revision(unsigned int rev);
  58. void imx_init_revision_from_anatop(void);
  59. struct device *imx_soc_device_init(void);
  60. void imx6_enable_rbc(bool enable);
  61. void imx_gpc_check_dt(void);
  62. void imx_gpc_set_arm_power_in_lpm(bool power_off);
  63. void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
  64. void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
  65. enum mxc_cpu_pwr_mode {
  66. WAIT_CLOCKED, /* wfi only */
  67. WAIT_UNCLOCKED, /* WAIT */
  68. WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */
  69. STOP_POWER_ON, /* just STOP */
  70. STOP_POWER_OFF, /* STOP + SRPG */
  71. };
  72. enum mx3_cpu_pwr_mode {
  73. MX3_RUN,
  74. MX3_WAIT,
  75. MX3_DOZE,
  76. MX3_SLEEP,
  77. };
  78. void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode);
  79. void imx_enable_cpu(int cpu, bool enable);
  80. void imx_set_cpu_jump(int cpu, void *jump_addr);
  81. u32 imx_get_cpu_arg(int cpu);
  82. void imx_set_cpu_arg(int cpu, u32 arg);
  83. #ifdef CONFIG_SMP
  84. void v7_secondary_startup(void);
  85. void imx_scu_map_io(void);
  86. void imx_smp_prepare(void);
  87. #else
  88. static inline void imx_scu_map_io(void) {}
  89. static inline void imx_smp_prepare(void) {}
  90. #endif
  91. void imx_src_init(void);
  92. void imx_gpc_pre_suspend(bool arm_power_off);
  93. void imx_gpc_post_resume(void);
  94. void imx_gpc_mask_all(void);
  95. void imx_gpc_restore_all(void);
  96. void imx_gpc_hwirq_mask(unsigned int hwirq);
  97. void imx_gpc_hwirq_unmask(unsigned int hwirq);
  98. void imx_anatop_init(void);
  99. void imx_anatop_pre_suspend(void);
  100. void imx_anatop_post_resume(void);
  101. int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
  102. void imx6q_set_int_mem_clk_lpm(bool enable);
  103. void imx6sl_set_wait_clk(bool enter);
  104. int imx_mmdc_get_ddr_type(void);
  105. void imx_cpu_die(unsigned int cpu);
  106. int imx_cpu_kill(unsigned int cpu);
  107. #ifdef CONFIG_SUSPEND
  108. void v7_cpu_resume(void);
  109. void imx6_suspend(void __iomem *ocram_vbase);
  110. #else
  111. static inline void v7_cpu_resume(void) {}
  112. static inline void imx6_suspend(void __iomem *ocram_vbase) {}
  113. #endif
  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 imx6q_pm_set_ccm_base(void __iomem *base);
  119. #ifdef CONFIG_PM
  120. void imx51_pm_init(void);
  121. void imx53_pm_init(void);
  122. void imx5_pm_set_ccm_base(void __iomem *base);
  123. #else
  124. static inline void imx51_pm_init(void) {}
  125. static inline void imx53_pm_init(void) {}
  126. static inline void imx5_pm_set_ccm_base(void __iomem *base) {}
  127. #endif
  128. #ifdef CONFIG_NEON
  129. int mx51_neon_fixup(void);
  130. #else
  131. static inline int mx51_neon_fixup(void) { return 0; }
  132. #endif
  133. #ifdef CONFIG_CACHE_L2X0
  134. void imx_init_l2cache(void);
  135. #else
  136. static inline void imx_init_l2cache(void) {}
  137. #endif
  138. extern struct smp_operations imx_smp_ops;
  139. extern struct smp_operations ls1021a_smp_ops;
  140. #endif