Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | */ |
| 4 | |
| 5 | /* |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | |
| 11 | #ifndef __ASM_ARCH_MXC_COMMON_H__ |
| 12 | #define __ASM_ARCH_MXC_COMMON_H__ |
| 13 | |
Sascha Hauer | 282b13d | 2008-09-09 10:19:40 +0200 | [diff] [blame] | 14 | struct platform_device; |
Sascha Hauer | 30c730f | 2009-02-16 14:36:49 +0100 | [diff] [blame] | 15 | struct clk; |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 16 | enum mxc_cpu_pwr_mode; |
Sascha Hauer | 282b13d | 2008-09-09 10:19:40 +0200 | [diff] [blame] | 17 | |
Sascha Hauer | cd4a05f | 2009-04-02 22:32:10 +0200 | [diff] [blame] | 18 | extern void mx1_map_io(void); |
| 19 | extern void mx21_map_io(void); |
Sascha Hauer | 8c25c36 | 2009-06-04 11:32:12 +0200 | [diff] [blame] | 20 | extern void mx25_map_io(void); |
Sascha Hauer | cd4a05f | 2009-04-02 22:32:10 +0200 | [diff] [blame] | 21 | extern void mx27_map_io(void); |
| 22 | extern void mx31_map_io(void); |
| 23 | extern void mx35_map_io(void); |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 24 | extern void mx51_map_io(void); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 25 | extern void mx53_map_io(void); |
Uwe Kleine-König | 3dac219 | 2011-02-07 16:35:19 +0100 | [diff] [blame] | 26 | extern void imx1_init_early(void); |
| 27 | extern void imx21_init_early(void); |
| 28 | extern void imx25_init_early(void); |
| 29 | extern void imx27_init_early(void); |
Uwe Kleine-König | 97976e2 | 2011-02-07 16:35:20 +0100 | [diff] [blame] | 30 | extern void imx31_init_early(void); |
| 31 | extern void imx35_init_early(void); |
Uwe Kleine-König | ab130421 | 2011-02-07 16:35:21 +0100 | [diff] [blame] | 32 | extern void imx51_init_early(void); |
| 33 | extern void imx53_init_early(void); |
Sascha Hauer | c5aa0ad | 2009-05-25 17:36:19 +0200 | [diff] [blame] | 34 | extern void mxc_init_irq(void __iomem *); |
Amit Kucheria | a003708 | 2009-12-03 22:36:41 +0200 | [diff] [blame] | 35 | extern void tzic_init_irq(void __iomem *); |
Sascha Hauer | c5aa0ad | 2009-05-25 17:36:19 +0200 | [diff] [blame] | 36 | extern void mx1_init_irq(void); |
| 37 | extern void mx21_init_irq(void); |
Sascha Hauer | 8c25c36 | 2009-06-04 11:32:12 +0200 | [diff] [blame] | 38 | extern void mx25_init_irq(void); |
Sascha Hauer | c5aa0ad | 2009-05-25 17:36:19 +0200 | [diff] [blame] | 39 | extern void mx27_init_irq(void); |
| 40 | extern void mx31_init_irq(void); |
| 41 | extern void mx35_init_irq(void); |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 42 | extern void mx51_init_irq(void); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 43 | extern void mx53_init_irq(void); |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 44 | extern void imx1_soc_init(void); |
| 45 | extern void imx21_soc_init(void); |
| 46 | extern void imx25_soc_init(void); |
| 47 | extern void imx27_soc_init(void); |
| 48 | extern void imx31_soc_init(void); |
| 49 | extern void imx35_soc_init(void); |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 50 | extern void imx51_soc_init(void); |
Shawn Guo | 8321b75 | 2012-04-26 11:42:34 +0800 | [diff] [blame] | 51 | extern void imx51_init_late(void); |
Robert Lee | aa96a18 | 2012-05-21 17:50:27 -0500 | [diff] [blame] | 52 | extern void imx53_init_late(void); |
Sascha Hauer | 2cfb451 | 2012-05-16 12:29:53 +0200 | [diff] [blame] | 53 | extern void epit_timer_init(void __iomem *base, int irq); |
| 54 | extern void mxc_timer_init(void __iomem *, int); |
Sascha Hauer | 30c730f | 2009-02-16 14:36:49 +0100 | [diff] [blame] | 55 | extern int mx1_clocks_init(unsigned long fref); |
Holger Schurig | aa3b0a6 | 2009-01-26 16:34:54 +0100 | [diff] [blame] | 56 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); |
Baruch Siach | fadc095 | 2010-01-25 12:58:19 +0200 | [diff] [blame] | 57 | extern int mx25_clocks_init(void); |
Sascha Hauer | 30c730f | 2009-02-16 14:36:49 +0100 | [diff] [blame] | 58 | extern int mx27_clocks_init(unsigned long fref); |
| 59 | extern int mx31_clocks_init(unsigned long fref); |
Sascha Hauer | 2cb536d | 2009-02-06 17:48:59 +0100 | [diff] [blame] | 60 | extern int mx35_clocks_init(void); |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 61 | extern int mx51_clocks_init(unsigned long ckil, unsigned long osc, |
| 62 | unsigned long ckih1, unsigned long ckih2); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 63 | extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, |
| 64 | unsigned long ckih1, unsigned long ckih2); |
Sascha Hauer | ef4bac5 | 2012-09-20 14:59:36 +0200 | [diff] [blame] | 65 | extern int mx25_clocks_init_dt(void); |
Sascha Hauer | 9f0749e | 2012-02-28 21:57:50 +0100 | [diff] [blame] | 66 | extern int mx27_clocks_init_dt(void); |
Denis 'GNUtoo' Carikli | d2a37b3 | 2012-07-09 21:39:12 +0200 | [diff] [blame] | 67 | extern int mx31_clocks_init_dt(void); |
Shawn Guo | 9daaf31 | 2011-10-17 08:42:17 +0800 | [diff] [blame] | 68 | extern int mx51_clocks_init_dt(void); |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 69 | extern int mx53_clocks_init_dt(void); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 70 | extern int mx6q_clocks_init(void); |
Shawn Guo | e7fc6ae | 2011-07-07 00:37:41 +0800 | [diff] [blame] | 71 | extern struct platform_device *mxc_register_gpio(char *name, int id, |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 72 | resource_size_t iobase, resource_size_t iosize, int irq, int irq_high); |
Sascha Hauer | 198016e | 2009-02-06 15:38:22 +0100 | [diff] [blame] | 73 | extern void mxc_set_cpu_type(unsigned int type); |
Russell King | 65ea788 | 2011-11-06 17:12:08 +0000 | [diff] [blame] | 74 | extern void mxc_restart(char, const char *); |
Sascha Hauer | be124c9 | 2009-06-04 12:19:02 +0200 | [diff] [blame] | 75 | extern void mxc_arch_reset_init(void __iomem *); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 76 | extern int mx53_revision(void); |
Fabio Estevam | 2d95378 | 2011-03-25 12:52:47 -0300 | [diff] [blame] | 77 | extern int mx53_display_revision(void); |
Fabio Estevam | bb07d75 | 2012-02-29 10:28:08 -0300 | [diff] [blame] | 78 | extern void imx_set_aips(void __iomem *); |
Shawn Guo | 69ac71d | 2012-09-20 14:21:16 +0800 | [diff] [blame] | 79 | extern int mxc_device_init(void); |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 80 | |
Shawn Guo | 41e7daf | 2011-09-28 17:16:06 +0800 | [diff] [blame] | 81 | enum mxc_cpu_pwr_mode { |
| 82 | WAIT_CLOCKED, /* wfi only */ |
| 83 | WAIT_UNCLOCKED, /* WAIT */ |
| 84 | WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */ |
| 85 | STOP_POWER_ON, /* just STOP */ |
| 86 | STOP_POWER_OFF, /* STOP + SRPG */ |
| 87 | }; |
| 88 | |
Fabio Estevam | 3ac804e | 2012-02-02 20:02:32 -0200 | [diff] [blame] | 89 | enum mx3_cpu_pwr_mode { |
| 90 | MX3_RUN, |
| 91 | MX3_WAIT, |
| 92 | MX3_DOZE, |
| 93 | MX3_SLEEP, |
| 94 | }; |
| 95 | |
| 96 | extern void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode); |
Fabio Estevam | 059e58f | 2011-08-26 13:35:18 +0800 | [diff] [blame] | 97 | extern void imx_print_silicon_rev(const char *cpu, int srev); |
Sascha Hauer | b6de943 | 2011-09-20 14:28:17 +0200 | [diff] [blame] | 98 | |
| 99 | void avic_handle_irq(struct pt_regs *); |
Sascha Hauer | 58a9260 | 2011-09-20 14:28:39 +0200 | [diff] [blame] | 100 | void tzic_handle_irq(struct pt_regs *); |
Sascha Hauer | b6de943 | 2011-09-20 14:28:17 +0200 | [diff] [blame] | 101 | |
| 102 | #define imx1_handle_irq avic_handle_irq |
| 103 | #define imx21_handle_irq avic_handle_irq |
| 104 | #define imx25_handle_irq avic_handle_irq |
| 105 | #define imx27_handle_irq avic_handle_irq |
| 106 | #define imx31_handle_irq avic_handle_irq |
| 107 | #define imx35_handle_irq avic_handle_irq |
Sascha Hauer | 58a9260 | 2011-09-20 14:28:39 +0200 | [diff] [blame] | 108 | #define imx51_handle_irq tzic_handle_irq |
| 109 | #define imx53_handle_irq tzic_handle_irq |
Marc Zyngier | fea9fe8 | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 110 | #define imx6q_handle_irq gic_handle_irq |
Sascha Hauer | b6de943 | 2011-09-20 14:28:17 +0200 | [diff] [blame] | 111 | |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 112 | extern void imx_enable_cpu(int cpu, bool enable); |
| 113 | extern void imx_set_cpu_jump(int cpu, void *jump_addr); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 114 | extern void v7_cpu_resume(void); |
| 115 | extern u32 *pl310_get_save_ptr(void); |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 116 | #ifdef CONFIG_SMP |
| 117 | extern void v7_secondary_startup(void); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 118 | extern void imx_scu_map_io(void); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 119 | extern void imx_smp_prepare(void); |
Shawn Guo | e5f9dec | 2012-12-04 22:55:15 +0800 | [diff] [blame^] | 120 | extern void imx_scu_standby_enable(void); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 121 | #else |
| 122 | static inline void imx_scu_map_io(void) {} |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 123 | static inline void imx_smp_prepare(void) {} |
Shawn Guo | e5f9dec | 2012-12-04 22:55:15 +0800 | [diff] [blame^] | 124 | static inline void imx_scu_standby_enable(void) {} |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 125 | #endif |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 126 | extern void imx_enable_cpu(int cpu, bool enable); |
| 127 | extern void imx_set_cpu_jump(int cpu, void *jump_addr); |
| 128 | extern void imx_src_init(void); |
Shawn Guo | 0575fb7 | 2011-12-09 00:51:26 +0100 | [diff] [blame] | 129 | extern void imx_src_prepare_restart(void); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 130 | extern void imx_gpc_init(void); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 131 | extern void imx_gpc_pre_suspend(void); |
| 132 | extern void imx_gpc_post_resume(void); |
| 133 | extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); |
Shawn Guo | e5f9dec | 2012-12-04 22:55:15 +0800 | [diff] [blame^] | 134 | extern void imx6q_set_chicken_bit(void); |
Eric Miao | 46ec1b2 | 2011-12-21 22:38:23 +0800 | [diff] [blame] | 135 | |
Marc Zyngier | e4f2d97 | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 136 | extern void imx_cpu_die(unsigned int cpu); |
| 137 | |
Eric Miao | 46ec1b2 | 2011-12-21 22:38:23 +0800 | [diff] [blame] | 138 | #ifdef CONFIG_PM |
| 139 | extern void imx6q_pm_init(void); |
Robert Lee | 565fa91 | 2012-05-21 17:50:26 -0500 | [diff] [blame] | 140 | extern void imx51_pm_init(void); |
Robert Lee | aa96a18 | 2012-05-21 17:50:27 -0500 | [diff] [blame] | 141 | extern void imx53_pm_init(void); |
Eric Miao | 46ec1b2 | 2011-12-21 22:38:23 +0800 | [diff] [blame] | 142 | #else |
| 143 | static inline void imx6q_pm_init(void) {} |
Robert Lee | 565fa91 | 2012-05-21 17:50:26 -0500 | [diff] [blame] | 144 | static inline void imx51_pm_init(void) {} |
Robert Lee | aa96a18 | 2012-05-21 17:50:27 -0500 | [diff] [blame] | 145 | static inline void imx53_pm_init(void) {} |
Eric Miao | 46ec1b2 | 2011-12-21 22:38:23 +0800 | [diff] [blame] | 146 | #endif |
| 147 | |
Shawn Guo | 8321b75 | 2012-04-26 11:42:34 +0800 | [diff] [blame] | 148 | #ifdef CONFIG_NEON |
| 149 | extern int mx51_neon_fixup(void); |
| 150 | #else |
| 151 | static inline int mx51_neon_fixup(void) { return 0; } |
| 152 | #endif |
| 153 | |
Marc Zyngier | e4f2d97 | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 154 | extern struct smp_operations imx_smp_ops; |
| 155 | |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 156 | #endif |