blob: 6340df2284d7785d4370f65ebdf878e6ed756dd2 [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;
Sascha Hauer282b13d2008-09-09 10:19:40 +020016
Sascha Hauercd4a05f2009-04-02 22:32:10 +020017extern void mx1_map_io(void);
18extern void mx21_map_io(void);
Sascha Hauer8c25c362009-06-04 11:32:12 +020019extern void mx25_map_io(void);
Sascha Hauercd4a05f2009-04-02 22:32:10 +020020extern void mx27_map_io(void);
21extern void mx31_map_io(void);
22extern void mx35_map_io(void);
Richard Zhao3d5a44b2010-12-30 19:25:05 +080023extern void mx50_map_io(void);
Amit Kucheriaa329b482010-02-04 12:21:53 -080024extern void mx51_map_io(void);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060025extern void mx53_map_io(void);
Uwe Kleine-König3dac2192011-02-07 16:35:19 +010026extern void imx1_init_early(void);
27extern void imx21_init_early(void);
28extern void imx25_init_early(void);
29extern void imx27_init_early(void);
Uwe Kleine-König97976e22011-02-07 16:35:20 +010030extern void imx31_init_early(void);
31extern void imx35_init_early(void);
32extern void imx50_init_early(void);
Uwe Kleine-Königab1304212011-02-07 16:35:21 +010033extern void imx51_init_early(void);
34extern void imx53_init_early(void);
Sascha Hauerc5aa0ad2009-05-25 17:36:19 +020035extern void mxc_init_irq(void __iomem *);
Amit Kucheriaa0037082009-12-03 22:36:41 +020036extern void tzic_init_irq(void __iomem *);
Sascha Hauerc5aa0ad2009-05-25 17:36:19 +020037extern void mx1_init_irq(void);
38extern void mx21_init_irq(void);
Sascha Hauer8c25c362009-06-04 11:32:12 +020039extern void mx25_init_irq(void);
Sascha Hauerc5aa0ad2009-05-25 17:36:19 +020040extern void mx27_init_irq(void);
41extern void mx31_init_irq(void);
42extern void mx35_init_irq(void);
Richard Zhao3d5a44b2010-12-30 19:25:05 +080043extern void mx50_init_irq(void);
Amit Kucheriaa329b482010-02-04 12:21:53 -080044extern void mx51_init_irq(void);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060045extern void mx53_init_irq(void);
Shawn Guob78d8e52011-06-06 00:07:55 +080046extern void imx1_soc_init(void);
47extern void imx21_soc_init(void);
48extern void imx25_soc_init(void);
49extern void imx27_soc_init(void);
50extern void imx31_soc_init(void);
51extern void imx35_soc_init(void);
52extern void imx50_soc_init(void);
53extern void imx51_soc_init(void);
54extern void imx53_soc_init(void);
Sascha Hauerf2b89012010-08-19 14:08:04 +020055extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq);
Sascha Hauer8db5d1a2009-05-25 12:21:38 +020056extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int);
Sascha Hauer30c730f2009-02-16 14:36:49 +010057extern int mx1_clocks_init(unsigned long fref);
Holger Schurigaa3b0a62009-01-26 16:34:54 +010058extern int mx21_clocks_init(unsigned long lref, unsigned long fref);
Baruch Siachfadc0952010-01-25 12:58:19 +020059extern int mx25_clocks_init(void);
Sascha Hauer30c730f2009-02-16 14:36:49 +010060extern int mx27_clocks_init(unsigned long fref);
61extern int mx31_clocks_init(unsigned long fref);
Sascha Hauer2cb536d2009-02-06 17:48:59 +010062extern int mx35_clocks_init(void);
Amit Kucheriaa329b482010-02-04 12:21:53 -080063extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
64 unsigned long ckih1, unsigned long ckih2);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060065extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
66 unsigned long ckih1, unsigned long ckih2);
Shawn Guoe7fc6ae2011-07-07 00:37:41 +080067extern struct platform_device *mxc_register_gpio(char *name, int id,
Shawn Guob78d8e52011-06-06 00:07:55 +080068 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
Sascha Hauer198016e2009-02-06 15:38:22 +010069extern void mxc_set_cpu_type(unsigned int type);
Sascha Hauerbe124c92009-06-04 12:19:02 +020070extern void mxc_arch_reset_init(void __iomem *);
Arnaud Patard (Rtp)c2932bf2010-10-27 14:40:55 +020071extern void mx51_efikamx_reset(void);
Dinh Nguyenc0abefd2010-11-15 11:29:59 -060072extern int mx53_revision(void);
Fabio Estevam2d953782011-03-25 12:52:47 -030073extern int mx53_display_revision(void);
Shawn Guo41e7daf2011-09-28 17:16:06 +080074
75enum mxc_cpu_pwr_mode {
76 WAIT_CLOCKED, /* wfi only */
77 WAIT_UNCLOCKED, /* WAIT */
78 WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */
79 STOP_POWER_ON, /* just STOP */
80 STOP_POWER_OFF, /* STOP + SRPG */
81};
82
83extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode);
84extern void (*imx_idle)(void);
Fabio Estevam059e58f2011-08-26 13:35:18 +080085extern void imx_print_silicon_rev(const char *cpu, int srev);
Sascha Hauerb6de9432011-09-20 14:28:17 +020086
87void avic_handle_irq(struct pt_regs *);
Sascha Hauer58a92602011-09-20 14:28:39 +020088void tzic_handle_irq(struct pt_regs *);
Shawn Guo11036432011-09-24 00:43:06 +080089void gic_handle_irq(struct pt_regs *);
Sascha Hauerb6de9432011-09-20 14:28:17 +020090
91#define imx1_handle_irq avic_handle_irq
92#define imx21_handle_irq avic_handle_irq
93#define imx25_handle_irq avic_handle_irq
94#define imx27_handle_irq avic_handle_irq
95#define imx31_handle_irq avic_handle_irq
96#define imx35_handle_irq avic_handle_irq
Sascha Hauer58a92602011-09-20 14:28:39 +020097#define imx50_handle_irq tzic_handle_irq
98#define imx51_handle_irq tzic_handle_irq
99#define imx53_handle_irq tzic_handle_irq
Shawn Guo11036432011-09-24 00:43:06 +0800100#define imx6q_handle_irq gic_handle_irq
Sascha Hauerb6de9432011-09-20 14:28:17 +0200101
Shawn Guo69c31b72011-09-06 14:59:40 +0800102extern void imx_enable_cpu(int cpu, bool enable);
103extern void imx_set_cpu_jump(int cpu, void *jump_addr);
104#ifdef CONFIG_SMP
105extern void v7_secondary_startup(void);
106#endif
Quinn Jensen52c543f2007-07-09 22:06:53 +0100107#endif