blob: c75f254abd857c07e6f8133716b51d5925f17581 [file] [log] [blame]
Quinn Jensen52c543f2007-07-09 22:06:53 +01001/*
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 Hauer282b13d2008-09-09 10:19:40 +020014struct platform_device;
Sascha Hauer30c730f2009-02-16 14:36:49 +010015struct clk;
Shawn Guoa1f1c7e2011-09-06 15:08:40 +080016enum mxc_cpu_pwr_mode;
Sascha Hauer282b13d2008-09-09 10:19:40 +020017
Sascha Hauercd4a05f2009-04-02 22:32:10 +020018extern void mx1_map_io(void);
19extern void mx21_map_io(void);
Sascha Hauer8c25c362009-06-04 11:32:12 +020020extern void mx25_map_io(void);
Sascha Hauercd4a05f2009-04-02 22:32:10 +020021extern void mx27_map_io(void);
22extern void mx31_map_io(void);
23extern void mx35_map_io(void);
Richard Zhao3d5a44b2010-12-30 19:25:05 +080024extern void mx50_map_io(void);
Amit Kucheriaa329b482010-02-04 12:21:53 -080025extern void mx51_map_io(void);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060026extern void mx53_map_io(void);
Uwe Kleine-König3dac2192011-02-07 16:35:19 +010027extern void imx1_init_early(void);
28extern void imx21_init_early(void);
29extern void imx25_init_early(void);
30extern void imx27_init_early(void);
Uwe Kleine-König97976e22011-02-07 16:35:20 +010031extern void imx31_init_early(void);
32extern void imx35_init_early(void);
33extern void imx50_init_early(void);
Uwe Kleine-Königab1304212011-02-07 16:35:21 +010034extern void imx51_init_early(void);
35extern void imx53_init_early(void);
Sascha Hauerc5aa0ad2009-05-25 17:36:19 +020036extern void mxc_init_irq(void __iomem *);
Amit Kucheriaa0037082009-12-03 22:36:41 +020037extern void tzic_init_irq(void __iomem *);
Sascha Hauerc5aa0ad2009-05-25 17:36:19 +020038extern void mx1_init_irq(void);
39extern void mx21_init_irq(void);
Sascha Hauer8c25c362009-06-04 11:32:12 +020040extern void mx25_init_irq(void);
Sascha Hauerc5aa0ad2009-05-25 17:36:19 +020041extern void mx27_init_irq(void);
42extern void mx31_init_irq(void);
43extern void mx35_init_irq(void);
Richard Zhao3d5a44b2010-12-30 19:25:05 +080044extern void mx50_init_irq(void);
Amit Kucheriaa329b482010-02-04 12:21:53 -080045extern void mx51_init_irq(void);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060046extern void mx53_init_irq(void);
Shawn Guob78d8e52011-06-06 00:07:55 +080047extern void imx1_soc_init(void);
48extern void imx21_soc_init(void);
49extern void imx25_soc_init(void);
50extern void imx27_soc_init(void);
51extern void imx31_soc_init(void);
52extern void imx35_soc_init(void);
53extern void imx50_soc_init(void);
54extern void imx51_soc_init(void);
55extern void imx53_soc_init(void);
Sascha Hauerf2b89012010-08-19 14:08:04 +020056extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq);
Sascha Hauer8db5d1a2009-05-25 12:21:38 +020057extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int);
Sascha Hauer30c730f2009-02-16 14:36:49 +010058extern int mx1_clocks_init(unsigned long fref);
Holger Schurigaa3b0a62009-01-26 16:34:54 +010059extern int mx21_clocks_init(unsigned long lref, unsigned long fref);
Baruch Siachfadc0952010-01-25 12:58:19 +020060extern int mx25_clocks_init(void);
Sascha Hauer30c730f2009-02-16 14:36:49 +010061extern int mx27_clocks_init(unsigned long fref);
62extern int mx31_clocks_init(unsigned long fref);
Sascha Hauer2cb536d2009-02-06 17:48:59 +010063extern int mx35_clocks_init(void);
Amit Kucheriaa329b482010-02-04 12:21:53 -080064extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
65 unsigned long ckih1, unsigned long ckih2);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060066extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
67 unsigned long ckih1, unsigned long ckih2);
Shawn Guo9daaf312011-10-17 08:42:17 +080068extern int mx51_clocks_init_dt(void);
Shawn Guo73d2b4c2011-10-17 08:42:16 +080069extern int mx53_clocks_init_dt(void);
Shawn Guo13eed982011-09-06 15:05:25 +080070extern int mx6q_clocks_init(void);
Shawn Guoe7fc6ae2011-07-07 00:37:41 +080071extern struct platform_device *mxc_register_gpio(char *name, int id,
Shawn Guob78d8e52011-06-06 00:07:55 +080072 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
Sascha Hauer198016e2009-02-06 15:38:22 +010073extern void mxc_set_cpu_type(unsigned int type);
Sascha Hauerbe124c92009-06-04 12:19:02 +020074extern void mxc_arch_reset_init(void __iomem *);
Arnaud Patard (Rtp)c2932bf2010-10-27 14:40:55 +020075extern void mx51_efikamx_reset(void);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060076extern int mx53_revision(void);
Fabio Estevam2d953782011-03-25 12:52:47 -030077extern int mx53_display_revision(void);
Shawn Guo73d2b4c2011-10-17 08:42:16 +080078
Shawn Guo41e7daf2011-09-28 17:16:06 +080079enum 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
87extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode);
Fabio Estevam059e58f2011-08-26 13:35:18 +080088extern void imx_print_silicon_rev(const char *cpu, int srev);
Sascha Hauerb6de9432011-09-20 14:28:17 +020089
90void avic_handle_irq(struct pt_regs *);
Sascha Hauer58a92602011-09-20 14:28:39 +020091void tzic_handle_irq(struct pt_regs *);
Shawn Guo11036432011-09-24 00:43:06 +080092void gic_handle_irq(struct pt_regs *);
Sascha Hauerb6de9432011-09-20 14:28:17 +020093
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 Hauer58a92602011-09-20 14:28:39 +0200100#define imx50_handle_irq tzic_handle_irq
101#define imx51_handle_irq tzic_handle_irq
102#define imx53_handle_irq tzic_handle_irq
Shawn Guo11036432011-09-24 00:43:06 +0800103#define imx6q_handle_irq gic_handle_irq
Sascha Hauerb6de9432011-09-20 14:28:17 +0200104
Shawn Guo69c31b72011-09-06 14:59:40 +0800105extern void imx_enable_cpu(int cpu, bool enable);
106extern void imx_set_cpu_jump(int cpu, void *jump_addr);
Shawn Guo13eed982011-09-06 15:05:25 +0800107#ifdef CONFIG_DEBUG_LL
108extern void imx_lluart_map_io(void);
109#else
110static inline void imx_lluart_map_io(void) {}
111#endif
Shawn Guoa1f1c7e2011-09-06 15:08:40 +0800112extern void v7_cpu_resume(void);
113extern u32 *pl310_get_save_ptr(void);
Shawn Guo69c31b72011-09-06 14:59:40 +0800114#ifdef CONFIG_SMP
115extern void v7_secondary_startup(void);
Shawn Guo13eed982011-09-06 15:05:25 +0800116extern void imx_scu_map_io(void);
Shawn Guoa1f1c7e2011-09-06 15:08:40 +0800117extern void imx_smp_prepare(void);
Shawn Guo13eed982011-09-06 15:05:25 +0800118#else
119static inline void imx_scu_map_io(void) {}
Shawn Guoa1f1c7e2011-09-06 15:08:40 +0800120static inline void imx_smp_prepare(void) {}
Shawn Guo69c31b72011-09-06 14:59:40 +0800121#endif
Shawn Guo13eed982011-09-06 15:05:25 +0800122extern void imx_enable_cpu(int cpu, bool enable);
123extern void imx_set_cpu_jump(int cpu, void *jump_addr);
124extern void imx_src_init(void);
125extern void imx_gpc_init(void);
Shawn Guoa1f1c7e2011-09-06 15:08:40 +0800126extern void imx_gpc_pre_suspend(void);
127extern void imx_gpc_post_resume(void);
Shawn Guo9daaf312011-10-17 08:42:17 +0800128extern void imx51_babbage_common_init(void);
Shawn Guo73d2b4c2011-10-17 08:42:16 +0800129extern void imx53_ard_common_init(void);
130extern void imx53_evk_common_init(void);
131extern void imx53_qsb_common_init(void);
132extern void imx53_smd_common_init(void);
Shawn Guoa1f1c7e2011-09-06 15:08:40 +0800133extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
134extern void imx6q_pm_init(void);
Richard Zhaof4750582011-11-17 18:54:29 +0800135extern void imx6q_clock_map_io(void);
Quinn Jensen52c543f2007-07-09 22:06:53 +0100136#endif