aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/imx53-dt.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-10 14:12:55 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-10 14:13:53 -0500
commit7483948fdd31a8642ef0288aab6f368b98d53c29 (patch)
tree031020a5553701d2aae8dddb0fa509aa65854eb1 /arch/arm/mach-imx/imx53-dt.c
parent22a416c4e0f2179b57028e084ac0ed2c110333bd (diff)
parentfe250923bbbbcbccc9aa7b84d05ee7a060450534 (diff)
Merge tag 'usb-3.3-rc3' into usb-next
This is done to resolve a merge conflict with: drivers/usb/class/cdc-wdm.c and to better handle future patches for this driver as it is under active development at the moment. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/mach-imx/imx53-dt.c')
-rw-r--r--arch/arm/mach-imx/imx53-dt.c129
1 files changed, 129 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx53-dt.c b/arch/arm/mach-imx/imx53-dt.c
new file mode 100644
index 000000000000..05ebb3e68679
--- /dev/null
+++ b/arch/arm/mach-imx/imx53-dt.c
@@ -0,0 +1,129 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/io.h>
14#include <linux/irq.h>
15#include <linux/irqdomain.h>
16#include <linux/of_irq.h>
17#include <linux/of_platform.h>
18#include <asm/mach/arch.h>
19#include <asm/mach/time.h>
20#include <mach/common.h>
21#include <mach/mx53.h>
22
23/*
24 * Lookup table for attaching a specific name and platform_data pointer to
25 * devices as they get created by of_platform_populate(). Ideally this table
26 * would not exist, but the current clock implementation depends on some devices
27 * having a specific name.
28 */
29static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
30 OF_DEV_AUXDATA("fsl,imx53-uart", MX53_UART1_BASE_ADDR, "imx21-uart.0", NULL),
31 OF_DEV_AUXDATA("fsl,imx53-uart", MX53_UART2_BASE_ADDR, "imx21-uart.1", NULL),
32 OF_DEV_AUXDATA("fsl,imx53-uart", MX53_UART3_BASE_ADDR, "imx21-uart.2", NULL),
33 OF_DEV_AUXDATA("fsl,imx53-uart", MX53_UART4_BASE_ADDR, "imx21-uart.3", NULL),
34 OF_DEV_AUXDATA("fsl,imx53-uart", MX53_UART5_BASE_ADDR, "imx21-uart.4", NULL),
35 OF_DEV_AUXDATA("fsl,imx53-fec", MX53_FEC_BASE_ADDR, "imx25-fec.0", NULL),
36 OF_DEV_AUXDATA("fsl,imx53-esdhc", MX53_ESDHC1_BASE_ADDR, "sdhci-esdhc-imx53.0", NULL),
37 OF_DEV_AUXDATA("fsl,imx53-esdhc", MX53_ESDHC2_BASE_ADDR, "sdhci-esdhc-imx53.1", NULL),
38 OF_DEV_AUXDATA("fsl,imx53-esdhc", MX53_ESDHC3_BASE_ADDR, "sdhci-esdhc-imx53.2", NULL),
39 OF_DEV_AUXDATA("fsl,imx53-esdhc", MX53_ESDHC4_BASE_ADDR, "sdhci-esdhc-imx53.3", NULL),
40 OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL),
41 OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL),
42 OF_DEV_AUXDATA("fsl,imx53-cspi", MX53_CSPI_BASE_ADDR, "imx35-cspi.0", NULL),
43 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C1_BASE_ADDR, "imx-i2c.0", NULL),
44 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C2_BASE_ADDR, "imx-i2c.1", NULL),
45 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C3_BASE_ADDR, "imx-i2c.2", NULL),
46 OF_DEV_AUXDATA("fsl,imx53-sdma", MX53_SDMA_BASE_ADDR, "imx35-sdma", NULL),
47 OF_DEV_AUXDATA("fsl,imx53-wdt", MX53_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL),
48 { /* sentinel */ }
49};
50
51static int __init imx53_tzic_add_irq_domain(struct device_node *np,
52 struct device_node *interrupt_parent)
53{
54 irq_domain_add_simple(np, 0);
55 return 0;
56}
57
58static int __init imx53_gpio_add_irq_domain(struct device_node *np,
59 struct device_node *interrupt_parent)
60{
61 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
62
63 gpio_irq_base -= 32;
64 irq_domain_add_simple(np, gpio_irq_base);
65
66 return 0;
67}
68
69static const struct of_device_id imx53_irq_match[] __initconst = {
70 { .compatible = "fsl,imx53-tzic", .data = imx53_tzic_add_irq_domain, },
71 { .compatible = "fsl,imx53-gpio", .data = imx53_gpio_add_irq_domain, },
72 { /* sentinel */ }
73};
74
75static const struct of_device_id imx53_iomuxc_of_match[] __initconst = {
76 { .compatible = "fsl,imx53-iomuxc-ard", .data = imx53_ard_common_init, },
77 { .compatible = "fsl,imx53-iomuxc-evk", .data = imx53_evk_common_init, },
78 { .compatible = "fsl,imx53-iomuxc-qsb", .data = imx53_qsb_common_init, },
79 { .compatible = "fsl,imx53-iomuxc-smd", .data = imx53_smd_common_init, },
80 { /* sentinel */ }
81};
82
83static void __init imx53_dt_init(void)
84{
85 struct device_node *node;
86 const struct of_device_id *of_id;
87 void (*func)(void);
88
89 of_irq_init(imx53_irq_match);
90
91 node = of_find_matching_node(NULL, imx53_iomuxc_of_match);
92 if (node) {
93 of_id = of_match_node(imx53_iomuxc_of_match, node);
94 func = of_id->data;
95 func();
96 of_node_put(node);
97 }
98
99 of_platform_populate(NULL, of_default_bus_match_table,
100 imx53_auxdata_lookup, NULL);
101}
102
103static void __init imx53_timer_init(void)
104{
105 mx53_clocks_init_dt();
106}
107
108static struct sys_timer imx53_timer = {
109 .init = imx53_timer_init,
110};
111
112static const char *imx53_dt_board_compat[] __initdata = {
113 "fsl,imx53-ard",
114 "fsl,imx53-evk",
115 "fsl,imx53-qsb",
116 "fsl,imx53-smd",
117 NULL
118};
119
120DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
121 .map_io = mx53_map_io,
122 .init_early = imx53_init_early,
123 .init_irq = mx53_init_irq,
124 .handle_irq = imx53_handle_irq,
125 .timer = &imx53_timer,
126 .init_machine = imx53_dt_init,
127 .dt_compat = imx53_dt_board_compat,
128 .restart = mxc_restart,
129MACHINE_END