common.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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(void __iomem *, 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. int mx51_revision(void);
  55. int mx53_revision(void);
  56. void imx_set_aips(void __iomem *);
  57. void imx_aips_allow_unprivileged_access(const char *compat);
  58. int mxc_device_init(void);
  59. void imx_set_soc_revision(unsigned int rev);
  60. unsigned int imx_get_soc_revision(void);
  61. void imx_init_revision_from_anatop(void);
  62. struct device *imx_soc_device_init(void);
  63. void imx6_enable_rbc(bool enable);
  64. void imx_gpc_check_dt(void);
  65. void imx_gpc_set_arm_power_in_lpm(bool power_off);
  66. void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
  67. void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
  68. enum mxc_cpu_pwr_mode {
  69. WAIT_CLOCKED, /* wfi only */
  70. WAIT_UNCLOCKED, /* WAIT */
  71. WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */
  72. STOP_POWER_ON, /* just STOP */
  73. STOP_POWER_OFF, /* STOP + SRPG */
  74. };
  75. enum mx3_cpu_pwr_mode {
  76. MX3_RUN,
  77. MX3_WAIT,
  78. MX3_DOZE,
  79. MX3_SLEEP,
  80. };
  81. void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode);
  82. void imx_print_silicon_rev(const char *cpu, int srev);
  83. void imx_enable_cpu(int cpu, bool enable);
  84. void imx_set_cpu_jump(int cpu, void *jump_addr);
  85. u32 imx_get_cpu_arg(int cpu);
  86. void imx_set_cpu_arg(int cpu, u32 arg);
  87. #ifdef CONFIG_SMP
  88. void v7_secondary_startup(void);
  89. void imx_scu_map_io(void);
  90. void imx_smp_prepare(void);
  91. #else
  92. static inline void imx_scu_map_io(void) {}
  93. static inline void imx_smp_prepare(void) {}
  94. #endif
  95. void imx_src_init(void);
  96. void imx_gpc_pre_suspend(bool arm_power_off);
  97. void imx_gpc_post_resume(void);
  98. void imx_gpc_mask_all(void);
  99. void imx_gpc_restore_all(void);
  100. void imx_gpc_hwirq_mask(unsigned int hwirq);
  101. void imx_gpc_hwirq_unmask(unsigned int hwirq);
  102. void imx_anatop_init(void);
  103. void imx_anatop_pre_suspend(void);
  104. void imx_anatop_post_resume(void);
  105. int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
  106. void imx6q_set_int_mem_clk_lpm(bool enable);
  107. void imx6sl_set_wait_clk(bool enter);
  108. int imx_mmdc_get_ddr_type(void);
  109. void imx_cpu_die(unsigned int cpu);
  110. int imx_cpu_kill(unsigned int cpu);
  111. #ifdef CONFIG_SUSPEND
  112. void v7_cpu_resume(void);
  113. void imx6_suspend(void __iomem *ocram_vbase);
  114. #else
  115. static inline void v7_cpu_resume(void) {}
  116. static inline void imx6_suspend(void __iomem *ocram_vbase) {}
  117. #endif
  118. void imx6q_pm_init(void);
  119. void imx6dl_pm_init(void);
  120. void imx6sl_pm_init(void);
  121. void imx6sx_pm_init(void);
  122. void imx6q_pm_set_ccm_base(void __iomem *base);
  123. #ifdef CONFIG_PM
  124. void imx51_pm_init(void);
  125. void imx53_pm_init(void);
  126. void imx5_pm_set_ccm_base(void __iomem *base);
  127. #else
  128. static inline void imx51_pm_init(void) {}
  129. static inline void imx53_pm_init(void) {}
  130. static inline void imx5_pm_set_ccm_base(void __iomem *base) {}
  131. #endif
  132. #ifdef CONFIG_NEON
  133. int mx51_neon_fixup(void);
  134. #else
  135. static inline int mx51_neon_fixup(void) { return 0; }
  136. #endif
  137. #ifdef CONFIG_CACHE_L2X0
  138. void imx_init_l2cache(void);
  139. #else
  140. static inline void imx_init_l2cache(void) {}
  141. #endif
  142. extern struct smp_operations imx_smp_ops;
  143. extern struct smp_operations ls1021a_smp_ops;
  144. #endif