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); |
Richard Zhao | 3d5a44b | 2010-12-30 19:25:05 +0800 | [diff] [blame] | 24 | extern void mx50_map_io(void); |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 25 | extern void mx51_map_io(void); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 26 | extern void mx53_map_io(void); |
Uwe Kleine-König | 3dac219 | 2011-02-07 16:35:19 +0100 | [diff] [blame] | 27 | extern void imx1_init_early(void); |
| 28 | extern void imx21_init_early(void); |
| 29 | extern void imx25_init_early(void); |
| 30 | extern void imx27_init_early(void); |
Uwe Kleine-König | 97976e2 | 2011-02-07 16:35:20 +0100 | [diff] [blame] | 31 | extern void imx31_init_early(void); |
| 32 | extern void imx35_init_early(void); |
| 33 | extern void imx50_init_early(void); |
Uwe Kleine-König | ab130421 | 2011-02-07 16:35:21 +0100 | [diff] [blame] | 34 | extern void imx51_init_early(void); |
| 35 | extern void imx53_init_early(void); |
Sascha Hauer | c5aa0ad | 2009-05-25 17:36:19 +0200 | [diff] [blame] | 36 | extern void mxc_init_irq(void __iomem *); |
Amit Kucheria | a003708 | 2009-12-03 22:36:41 +0200 | [diff] [blame] | 37 | extern void tzic_init_irq(void __iomem *); |
Sascha Hauer | c5aa0ad | 2009-05-25 17:36:19 +0200 | [diff] [blame] | 38 | extern void mx1_init_irq(void); |
| 39 | extern void mx21_init_irq(void); |
Sascha Hauer | 8c25c36 | 2009-06-04 11:32:12 +0200 | [diff] [blame] | 40 | extern void mx25_init_irq(void); |
Sascha Hauer | c5aa0ad | 2009-05-25 17:36:19 +0200 | [diff] [blame] | 41 | extern void mx27_init_irq(void); |
| 42 | extern void mx31_init_irq(void); |
| 43 | extern void mx35_init_irq(void); |
Richard Zhao | 3d5a44b | 2010-12-30 19:25:05 +0800 | [diff] [blame] | 44 | extern void mx50_init_irq(void); |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 45 | extern void mx51_init_irq(void); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 46 | extern void mx53_init_irq(void); |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 47 | extern void imx1_soc_init(void); |
| 48 | extern void imx21_soc_init(void); |
| 49 | extern void imx25_soc_init(void); |
| 50 | extern void imx27_soc_init(void); |
| 51 | extern void imx31_soc_init(void); |
| 52 | extern void imx35_soc_init(void); |
| 53 | extern void imx50_soc_init(void); |
| 54 | extern void imx51_soc_init(void); |
| 55 | extern void imx53_soc_init(void); |
Sascha Hauer | f2b8901 | 2010-08-19 14:08:04 +0200 | [diff] [blame] | 56 | extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq); |
Sascha Hauer | 8db5d1a | 2009-05-25 12:21:38 +0200 | [diff] [blame] | 57 | extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); |
Sascha Hauer | 30c730f | 2009-02-16 14:36:49 +0100 | [diff] [blame] | 58 | extern int mx1_clocks_init(unsigned long fref); |
Holger Schurig | aa3b0a6 | 2009-01-26 16:34:54 +0100 | [diff] [blame] | 59 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); |
Baruch Siach | fadc095 | 2010-01-25 12:58:19 +0200 | [diff] [blame] | 60 | extern int mx25_clocks_init(void); |
Sascha Hauer | 30c730f | 2009-02-16 14:36:49 +0100 | [diff] [blame] | 61 | extern int mx27_clocks_init(unsigned long fref); |
| 62 | extern int mx31_clocks_init(unsigned long fref); |
Sascha Hauer | 2cb536d | 2009-02-06 17:48:59 +0100 | [diff] [blame] | 63 | extern int mx35_clocks_init(void); |
Amit Kucheria | a329b48 | 2010-02-04 12:21:53 -0800 | [diff] [blame] | 64 | extern int mx51_clocks_init(unsigned long ckil, unsigned long osc, |
| 65 | unsigned long ckih1, unsigned long ckih2); |
Dinh Nguyen | c0abefd | 2010-11-15 11:29:59 -0600 | [diff] [blame] | 66 | extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, |
| 67 | unsigned long ckih1, unsigned long ckih2); |
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); |
Sascha Hauer | be124c9 | 2009-06-04 12:19:02 +0200 | [diff] [blame] | 74 | extern void mxc_arch_reset_init(void __iomem *); |
Arnaud Patard (Rtp) | c2932bf | 2010-10-27 14:40:55 +0200 | [diff] [blame] | 75 | extern void mx51_efikamx_reset(void); |
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); |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 78 | |
Shawn Guo | 41e7daf | 2011-09-28 17:16:06 +0800 | [diff] [blame] | 79 | enum mxc_cpu_pwr_mode { |
| 80 | WAIT_CLOCKED, /* wfi only */ |
| 81 | WAIT_UNCLOCKED, /* WAIT */ |
| 82 | WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */ |
| 83 | STOP_POWER_ON, /* just STOP */ |
| 84 | STOP_POWER_OFF, /* STOP + SRPG */ |
| 85 | }; |
| 86 | |
| 87 | extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode); |
Fabio Estevam | 059e58f | 2011-08-26 13:35:18 +0800 | [diff] [blame] | 88 | extern void imx_print_silicon_rev(const char *cpu, int srev); |
Sascha Hauer | b6de943 | 2011-09-20 14:28:17 +0200 | [diff] [blame] | 89 | |
| 90 | void avic_handle_irq(struct pt_regs *); |
Sascha Hauer | 58a9260 | 2011-09-20 14:28:39 +0200 | [diff] [blame] | 91 | void tzic_handle_irq(struct pt_regs *); |
Shawn Guo | 1103643 | 2011-09-24 00:43:06 +0800 | [diff] [blame] | 92 | void gic_handle_irq(struct pt_regs *); |
Sascha Hauer | b6de943 | 2011-09-20 14:28:17 +0200 | [diff] [blame] | 93 | |
| 94 | #define imx1_handle_irq avic_handle_irq |
| 95 | #define imx21_handle_irq avic_handle_irq |
| 96 | #define imx25_handle_irq avic_handle_irq |
| 97 | #define imx27_handle_irq avic_handle_irq |
| 98 | #define imx31_handle_irq avic_handle_irq |
| 99 | #define imx35_handle_irq avic_handle_irq |
Sascha Hauer | 58a9260 | 2011-09-20 14:28:39 +0200 | [diff] [blame] | 100 | #define imx50_handle_irq tzic_handle_irq |
| 101 | #define imx51_handle_irq tzic_handle_irq |
| 102 | #define imx53_handle_irq tzic_handle_irq |
Shawn Guo | 1103643 | 2011-09-24 00:43:06 +0800 | [diff] [blame] | 103 | #define imx6q_handle_irq gic_handle_irq |
Sascha Hauer | b6de943 | 2011-09-20 14:28:17 +0200 | [diff] [blame] | 104 | |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 105 | extern void imx_enable_cpu(int cpu, bool enable); |
| 106 | extern void imx_set_cpu_jump(int cpu, void *jump_addr); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 107 | #ifdef CONFIG_DEBUG_LL |
| 108 | extern void imx_lluart_map_io(void); |
| 109 | #else |
| 110 | static inline void imx_lluart_map_io(void) {} |
| 111 | #endif |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 112 | extern void v7_cpu_resume(void); |
| 113 | extern u32 *pl310_get_save_ptr(void); |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 114 | #ifdef CONFIG_SMP |
| 115 | extern void v7_secondary_startup(void); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 116 | extern void imx_scu_map_io(void); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 117 | extern void imx_smp_prepare(void); |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 118 | #else |
| 119 | static inline void imx_scu_map_io(void) {} |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 120 | static inline void imx_smp_prepare(void) {} |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 121 | #endif |
Shawn Guo | 13eed98 | 2011-09-06 15:05:25 +0800 | [diff] [blame] | 122 | extern void imx_enable_cpu(int cpu, bool enable); |
| 123 | extern void imx_set_cpu_jump(int cpu, void *jump_addr); |
| 124 | extern void imx_src_init(void); |
| 125 | extern void imx_gpc_init(void); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 126 | extern void imx_gpc_pre_suspend(void); |
| 127 | extern void imx_gpc_post_resume(void); |
Shawn Guo | 9daaf31 | 2011-10-17 08:42:17 +0800 | [diff] [blame] | 128 | extern void imx51_babbage_common_init(void); |
Shawn Guo | 73d2b4c | 2011-10-17 08:42:16 +0800 | [diff] [blame] | 129 | extern void imx53_ard_common_init(void); |
| 130 | extern void imx53_evk_common_init(void); |
| 131 | extern void imx53_qsb_common_init(void); |
| 132 | extern void imx53_smd_common_init(void); |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 133 | extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); |
| 134 | extern void imx6q_pm_init(void); |
Richard Zhao | f475058 | 2011-11-17 18:54:29 +0800 | [diff] [blame] | 135 | extern void imx6q_clock_map_io(void); |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 136 | #endif |