diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-02 00:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-02 00:02:35 -0400 |
commit | 367069f16e32e188d4687fe2c3e30f2ca583836f (patch) | |
tree | 977f87038b75e53af9d132cba2f7a2aecb2fa005 /arch/arm/mach-mx5 | |
parent | 81a3c10ce8a7fd5bf9a06bfc38bd417512911831 (diff) | |
parent | c72dbae971400e466ad9ff16c920cd6d9d8c55a1 (diff) |
Merge branch 'next/dt' of git://git.linaro.org/people/arnd/arm-soc
* 'next/dt' of git://git.linaro.org/people/arnd/arm-soc:
ARM: gic: use module.h instead of export.h
ARM: gic: fix irq_alloc_descs handling for sparse irq
ARM: gic: add OF based initialization
ARM: gic: add irq_domain support
irq: support domains with non-zero hwirq base
of/irq: introduce of_irq_init
ARM: at91: add at91sam9g20 and Calao USB A9G20 DT support
ARM: at91: dt: at91sam9g45 family and board device tree files
arm/mx5: add device tree support for imx51 babbage
arm/mx5: add device tree support for imx53 boards
ARM: msm: Add devicetree support for msm8660-surf
msm_serial: Add devicetree support
msm_serial: Use relative resources for iomem
Fix up conflicts in arch/arm/mach-at91/{at91sam9260.c,at91sam9g45.c}
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r-- | arch/arm/mach-mx5/Kconfig | 21 | ||||
-rw-r--r-- | arch/arm/mach-mx5/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_babbage.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx53_ard.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx53_evk.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx53_loco.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx53_smd.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx5/clock-mx51-mx53.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-mx5/imx51-dt.c | 116 | ||||
-rw-r--r-- | arch/arm/mach-mx5/imx53-dt.c | 126 |
10 files changed, 341 insertions, 12 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 3d4c31306ca7..af0c212e3c7b 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig | |||
@@ -56,6 +56,15 @@ config MACH_MX50_RDP | |||
56 | 56 | ||
57 | comment "i.MX51 machines:" | 57 | comment "i.MX51 machines:" |
58 | 58 | ||
59 | config MACH_IMX51_DT | ||
60 | bool "Support i.MX51 platforms from device tree" | ||
61 | select SOC_IMX51 | ||
62 | select USE_OF | ||
63 | select MACH_MX51_BABBAGE | ||
64 | help | ||
65 | Include support for Freescale i.MX51 based platforms | ||
66 | using the device tree for discovery | ||
67 | |||
59 | config MACH_MX51_BABBAGE | 68 | config MACH_MX51_BABBAGE |
60 | bool "Support MX51 BABBAGE platforms" | 69 | bool "Support MX51 BABBAGE platforms" |
61 | select SOC_IMX51 | 70 | select SOC_IMX51 |
@@ -171,6 +180,18 @@ config MACH_MX51_EFIKASB | |||
171 | 180 | ||
172 | comment "i.MX53 machines:" | 181 | comment "i.MX53 machines:" |
173 | 182 | ||
183 | config MACH_IMX53_DT | ||
184 | bool "Support i.MX53 platforms from device tree" | ||
185 | select SOC_IMX53 | ||
186 | select USE_OF | ||
187 | select MACH_MX53_ARD | ||
188 | select MACH_MX53_EVK | ||
189 | select MACH_MX53_LOCO | ||
190 | select MACH_MX53_SMD | ||
191 | help | ||
192 | Include support for Freescale i.MX53 based platforms | ||
193 | using the device tree for discovery | ||
194 | |||
174 | config MACH_MX53_EVK | 195 | config MACH_MX53_EVK |
175 | bool "Support MX53 EVK platforms" | 196 | bool "Support MX53 EVK platforms" |
176 | select SOC_IMX53 | 197 | select SOC_IMX53 |
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile index 9565304b7282..0fc60807fa2b 100644 --- a/arch/arm/mach-mx5/Makefile +++ b/arch/arm/mach-mx5/Makefile | |||
@@ -21,3 +21,6 @@ obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o | |||
21 | obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o | 21 | obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o |
22 | obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o | 22 | obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o |
23 | obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o | 23 | obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o |
24 | |||
25 | obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o | ||
26 | obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o | ||
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 5993208a8f00..5c837603ff0f 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -349,6 +349,12 @@ static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = { | |||
349 | .wp_type = ESDHC_WP_GPIO, | 349 | .wp_type = ESDHC_WP_GPIO, |
350 | }; | 350 | }; |
351 | 351 | ||
352 | void __init imx51_babbage_common_init(void) | ||
353 | { | ||
354 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, | ||
355 | ARRAY_SIZE(mx51babbage_pads)); | ||
356 | } | ||
357 | |||
352 | /* | 358 | /* |
353 | * Board specific initialization. | 359 | * Board specific initialization. |
354 | */ | 360 | */ |
@@ -363,8 +369,7 @@ static void __init mx51_babbage_init(void) | |||
363 | #if defined(CONFIG_CPU_FREQ_IMX) | 369 | #if defined(CONFIG_CPU_FREQ_IMX) |
364 | get_cpu_op = mx51_get_cpu_op; | 370 | get_cpu_op = mx51_get_cpu_op; |
365 | #endif | 371 | #endif |
366 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, | 372 | imx51_babbage_common_init(); |
367 | ARRAY_SIZE(mx51babbage_pads)); | ||
368 | 373 | ||
369 | imx51_add_imx_uart(0, &uart_pdata); | 374 | imx51_add_imx_uart(0, &uart_pdata); |
370 | imx51_add_imx_uart(1, NULL); | 375 | imx51_add_imx_uart(1, NULL); |
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c index 614edcb0aa7e..0d7f0fffb23a 100644 --- a/arch/arm/mach-mx5/board-mx53_ard.c +++ b/arch/arm/mach-mx5/board-mx53_ard.c | |||
@@ -171,9 +171,6 @@ static struct imxi2c_platform_data mx53_ard_i2c3_data = { | |||
171 | 171 | ||
172 | static void __init mx53_ard_io_init(void) | 172 | static void __init mx53_ard_io_init(void) |
173 | { | 173 | { |
174 | mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads, | ||
175 | ARRAY_SIZE(mx53_ard_pads)); | ||
176 | |||
177 | gpio_request(ARD_ETHERNET_INT_B, "eth-int-b"); | 174 | gpio_request(ARD_ETHERNET_INT_B, "eth-int-b"); |
178 | gpio_direction_input(ARD_ETHERNET_INT_B); | 175 | gpio_direction_input(ARD_ETHERNET_INT_B); |
179 | 176 | ||
@@ -216,6 +213,13 @@ static int weim_cs_config(void) | |||
216 | return 0; | 213 | return 0; |
217 | } | 214 | } |
218 | 215 | ||
216 | void __init imx53_ard_common_init(void) | ||
217 | { | ||
218 | mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads, | ||
219 | ARRAY_SIZE(mx53_ard_pads)); | ||
220 | weim_cs_config(); | ||
221 | } | ||
222 | |||
219 | static struct platform_device *devices[] __initdata = { | 223 | static struct platform_device *devices[] __initdata = { |
220 | &ard_smsc_lan9220_device, | 224 | &ard_smsc_lan9220_device, |
221 | }; | 225 | }; |
@@ -225,8 +229,8 @@ static void __init mx53_ard_board_init(void) | |||
225 | imx53_soc_init(); | 229 | imx53_soc_init(); |
226 | imx53_add_imx_uart(0, NULL); | 230 | imx53_add_imx_uart(0, NULL); |
227 | 231 | ||
232 | imx53_ard_common_init(); | ||
228 | mx53_ard_io_init(); | 233 | mx53_ard_io_init(); |
229 | weim_cs_config(); | ||
230 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 234 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
231 | 235 | ||
232 | imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); | 236 | imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); |
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c index 6a3e6168e322..6bea31ab8f85 100644 --- a/arch/arm/mach-mx5/board-mx53_evk.c +++ b/arch/arm/mach-mx5/board-mx53_evk.c | |||
@@ -131,12 +131,17 @@ static const struct spi_imx_master mx53_evk_spi_data __initconst = { | |||
131 | .num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs), | 131 | .num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs), |
132 | }; | 132 | }; |
133 | 133 | ||
134 | void __init imx53_evk_common_init(void) | ||
135 | { | ||
136 | mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, | ||
137 | ARRAY_SIZE(mx53_evk_pads)); | ||
138 | } | ||
139 | |||
134 | static void __init mx53_evk_board_init(void) | 140 | static void __init mx53_evk_board_init(void) |
135 | { | 141 | { |
136 | imx53_soc_init(); | 142 | imx53_soc_init(); |
143 | imx53_evk_common_init(); | ||
137 | 144 | ||
138 | mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, | ||
139 | ARRAY_SIZE(mx53_evk_pads)); | ||
140 | mx53_evk_init_uart(); | 145 | mx53_evk_init_uart(); |
141 | mx53_evk_fec_reset(); | 146 | mx53_evk_fec_reset(); |
142 | imx53_add_fec(&mx53_evk_fec_pdata); | 147 | imx53_add_fec(&mx53_evk_fec_pdata); |
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c index 0af2766f8610..7678f7734db6 100644 --- a/arch/arm/mach-mx5/board-mx53_loco.c +++ b/arch/arm/mach-mx5/board-mx53_loco.c | |||
@@ -263,6 +263,12 @@ static const struct gpio_led_platform_data mx53loco_leds_data __initconst = { | |||
263 | .num_leds = ARRAY_SIZE(mx53loco_leds), | 263 | .num_leds = ARRAY_SIZE(mx53loco_leds), |
264 | }; | 264 | }; |
265 | 265 | ||
266 | void __init imx53_qsb_common_init(void) | ||
267 | { | ||
268 | mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads, | ||
269 | ARRAY_SIZE(mx53_loco_pads)); | ||
270 | } | ||
271 | |||
266 | static struct i2c_board_info mx53loco_i2c_devices[] = { | 272 | static struct i2c_board_info mx53loco_i2c_devices[] = { |
267 | { | 273 | { |
268 | I2C_BOARD_INFO("mma8450", 0x1C), | 274 | I2C_BOARD_INFO("mma8450", 0x1C), |
@@ -273,9 +279,8 @@ static void __init mx53_loco_board_init(void) | |||
273 | { | 279 | { |
274 | int ret; | 280 | int ret; |
275 | imx53_soc_init(); | 281 | imx53_soc_init(); |
282 | imx53_qsb_common_init(); | ||
276 | 283 | ||
277 | mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads, | ||
278 | ARRAY_SIZE(mx53_loco_pads)); | ||
279 | imx53_add_imx_uart(0, NULL); | 284 | imx53_add_imx_uart(0, NULL); |
280 | mx53_loco_fec_reset(); | 285 | mx53_loco_fec_reset(); |
281 | imx53_add_fec(&mx53_loco_fec_data); | 286 | imx53_add_fec(&mx53_loco_fec_data); |
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c index d12fd3043ba6..59c0845eb4a6 100644 --- a/arch/arm/mach-mx5/board-mx53_smd.c +++ b/arch/arm/mach-mx5/board-mx53_smd.c | |||
@@ -125,12 +125,17 @@ static inline void mx53_smd_ahci_pwr_on(void) | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | void __init imx53_smd_common_init(void) | ||
129 | { | ||
130 | mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads, | ||
131 | ARRAY_SIZE(mx53_smd_pads)); | ||
132 | } | ||
133 | |||
128 | static void __init mx53_smd_board_init(void) | 134 | static void __init mx53_smd_board_init(void) |
129 | { | 135 | { |
130 | imx53_soc_init(); | 136 | imx53_soc_init(); |
137 | imx53_smd_common_init(); | ||
131 | 138 | ||
132 | mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads, | ||
133 | ARRAY_SIZE(mx53_smd_pads)); | ||
134 | mx53_smd_init_uart(); | 139 | mx53_smd_init_uart(); |
135 | mx53_smd_fec_reset(); | 140 | mx53_smd_fec_reset(); |
136 | imx53_add_fec(&mx53_smd_fec_data); | 141 | imx53_add_fec(&mx53_smd_fec_data); |
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c index b94879e8679f..2aacf41c48e7 100644 --- a/arch/arm/mach-mx5/clock-mx51-mx53.c +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/clkdev.h> | 17 | #include <linux/clkdev.h> |
18 | #include <linux/of.h> | ||
18 | 19 | ||
19 | #include <asm/div64.h> | 20 | #include <asm/div64.h> |
20 | 21 | ||
@@ -1632,3 +1633,41 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc, | |||
1632 | MX53_INT_GPT); | 1633 | MX53_INT_GPT); |
1633 | return 0; | 1634 | return 0; |
1634 | } | 1635 | } |
1636 | |||
1637 | static void __init clk_get_freq_dt(unsigned long *ckil, unsigned long *osc, | ||
1638 | unsigned long *ckih1, unsigned long *ckih2) | ||
1639 | { | ||
1640 | struct device_node *np; | ||
1641 | |||
1642 | /* retrieve the freqency of fixed clocks from device tree */ | ||
1643 | for_each_compatible_node(np, NULL, "fixed-clock") { | ||
1644 | u32 rate; | ||
1645 | if (of_property_read_u32(np, "clock-frequency", &rate)) | ||
1646 | continue; | ||
1647 | |||
1648 | if (of_device_is_compatible(np, "fsl,imx-ckil")) | ||
1649 | *ckil = rate; | ||
1650 | else if (of_device_is_compatible(np, "fsl,imx-osc")) | ||
1651 | *osc = rate; | ||
1652 | else if (of_device_is_compatible(np, "fsl,imx-ckih1")) | ||
1653 | *ckih1 = rate; | ||
1654 | else if (of_device_is_compatible(np, "fsl,imx-ckih2")) | ||
1655 | *ckih2 = rate; | ||
1656 | } | ||
1657 | } | ||
1658 | |||
1659 | int __init mx51_clocks_init_dt(void) | ||
1660 | { | ||
1661 | unsigned long ckil, osc, ckih1, ckih2; | ||
1662 | |||
1663 | clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2); | ||
1664 | return mx51_clocks_init(ckil, osc, ckih1, ckih2); | ||
1665 | } | ||
1666 | |||
1667 | int __init mx53_clocks_init_dt(void) | ||
1668 | { | ||
1669 | unsigned long ckil, osc, ckih1, ckih2; | ||
1670 | |||
1671 | clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2); | ||
1672 | return mx53_clocks_init(ckil, osc, ckih1, ckih2); | ||
1673 | } | ||
diff --git a/arch/arm/mach-mx5/imx51-dt.c b/arch/arm/mach-mx5/imx51-dt.c new file mode 100644 index 000000000000..ccc61585659b --- /dev/null +++ b/arch/arm/mach-mx5/imx51-dt.c | |||
@@ -0,0 +1,116 @@ | |||
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/irq.h> | ||
14 | #include <linux/irqdomain.h> | ||
15 | #include <linux/of_irq.h> | ||
16 | #include <linux/of_platform.h> | ||
17 | #include <asm/mach/arch.h> | ||
18 | #include <asm/mach/time.h> | ||
19 | #include <mach/common.h> | ||
20 | #include <mach/mx51.h> | ||
21 | |||
22 | /* | ||
23 | * Lookup table for attaching a specific name and platform_data pointer to | ||
24 | * devices as they get created by of_platform_populate(). Ideally this table | ||
25 | * would not exist, but the current clock implementation depends on some devices | ||
26 | * having a specific name. | ||
27 | */ | ||
28 | static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = { | ||
29 | OF_DEV_AUXDATA("fsl,imx51-uart", MX51_UART1_BASE_ADDR, "imx21-uart.0", NULL), | ||
30 | OF_DEV_AUXDATA("fsl,imx51-uart", MX51_UART2_BASE_ADDR, "imx21-uart.1", NULL), | ||
31 | OF_DEV_AUXDATA("fsl,imx51-uart", MX51_UART3_BASE_ADDR, "imx21-uart.2", NULL), | ||
32 | OF_DEV_AUXDATA("fsl,imx51-fec", MX51_FEC_BASE_ADDR, "imx27-fec.0", NULL), | ||
33 | OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC1_BASE_ADDR, "sdhci-esdhc-imx51.0", NULL), | ||
34 | OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC2_BASE_ADDR, "sdhci-esdhc-imx51.1", NULL), | ||
35 | OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC3_BASE_ADDR, "sdhci-esdhc-imx51.2", NULL), | ||
36 | OF_DEV_AUXDATA("fsl,imx51-esdhc", MX51_ESDHC4_BASE_ADDR, "sdhci-esdhc-imx51.3", NULL), | ||
37 | OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL), | ||
38 | OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL), | ||
39 | OF_DEV_AUXDATA("fsl,imx51-cspi", MX51_CSPI_BASE_ADDR, "imx35-cspi.0", NULL), | ||
40 | OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C1_BASE_ADDR, "imx-i2c.0", NULL), | ||
41 | OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C2_BASE_ADDR, "imx-i2c.1", NULL), | ||
42 | OF_DEV_AUXDATA("fsl,imx51-sdma", MX51_SDMA_BASE_ADDR, "imx35-sdma", NULL), | ||
43 | OF_DEV_AUXDATA("fsl,imx51-wdt", MX51_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL), | ||
44 | { /* sentinel */ } | ||
45 | }; | ||
46 | |||
47 | static void __init imx51_tzic_add_irq_domain(struct device_node *np, | ||
48 | struct device_node *interrupt_parent) | ||
49 | { | ||
50 | irq_domain_add_simple(np, 0); | ||
51 | } | ||
52 | |||
53 | static void __init imx51_gpio_add_irq_domain(struct device_node *np, | ||
54 | struct device_node *interrupt_parent) | ||
55 | { | ||
56 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | ||
57 | 32 * 4; /* imx51 gets 4 gpio ports */ | ||
58 | |||
59 | irq_domain_add_simple(np, gpio_irq_base); | ||
60 | gpio_irq_base += 32; | ||
61 | } | ||
62 | |||
63 | static const struct of_device_id imx51_irq_match[] __initconst = { | ||
64 | { .compatible = "fsl,imx51-tzic", .data = imx51_tzic_add_irq_domain, }, | ||
65 | { .compatible = "fsl,imx51-gpio", .data = imx51_gpio_add_irq_domain, }, | ||
66 | { /* sentinel */ } | ||
67 | }; | ||
68 | |||
69 | static const struct of_device_id imx51_iomuxc_of_match[] __initconst = { | ||
70 | { .compatible = "fsl,imx51-iomuxc-babbage", .data = imx51_babbage_common_init, }, | ||
71 | { /* sentinel */ } | ||
72 | }; | ||
73 | |||
74 | static void __init imx51_dt_init(void) | ||
75 | { | ||
76 | struct device_node *node; | ||
77 | const struct of_device_id *of_id; | ||
78 | void (*func)(void); | ||
79 | |||
80 | of_irq_init(imx51_irq_match); | ||
81 | |||
82 | node = of_find_matching_node(NULL, imx51_iomuxc_of_match); | ||
83 | if (node) { | ||
84 | of_id = of_match_node(imx51_iomuxc_of_match, node); | ||
85 | func = of_id->data; | ||
86 | func(); | ||
87 | of_node_put(node); | ||
88 | } | ||
89 | |||
90 | of_platform_populate(NULL, of_default_bus_match_table, | ||
91 | imx51_auxdata_lookup, NULL); | ||
92 | } | ||
93 | |||
94 | static void __init imx51_timer_init(void) | ||
95 | { | ||
96 | mx51_clocks_init_dt(); | ||
97 | } | ||
98 | |||
99 | static struct sys_timer imx51_timer = { | ||
100 | .init = imx51_timer_init, | ||
101 | }; | ||
102 | |||
103 | static const char *imx51_dt_board_compat[] __initdata = { | ||
104 | "fsl,imx51-babbage", | ||
105 | NULL | ||
106 | }; | ||
107 | |||
108 | DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)") | ||
109 | .map_io = mx51_map_io, | ||
110 | .init_early = imx51_init_early, | ||
111 | .init_irq = mx51_init_irq, | ||
112 | .handle_irq = imx51_handle_irq, | ||
113 | .timer = &imx51_timer, | ||
114 | .init_machine = imx51_dt_init, | ||
115 | .dt_compat = imx51_dt_board_compat, | ||
116 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx5/imx53-dt.c b/arch/arm/mach-mx5/imx53-dt.c new file mode 100644 index 000000000000..ccaa0b81b768 --- /dev/null +++ b/arch/arm/mach-mx5/imx53-dt.c | |||
@@ -0,0 +1,126 @@ | |||
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 | */ | ||
29 | static 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 | |||
51 | static void __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 | } | ||
56 | |||
57 | static void __init imx53_gpio_add_irq_domain(struct device_node *np, | ||
58 | struct device_node *interrupt_parent) | ||
59 | { | ||
60 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | ||
61 | 32 * 7; /* imx53 gets 7 gpio ports */ | ||
62 | |||
63 | irq_domain_add_simple(np, gpio_irq_base); | ||
64 | gpio_irq_base += 32; | ||
65 | } | ||
66 | |||
67 | static const struct of_device_id imx53_irq_match[] __initconst = { | ||
68 | { .compatible = "fsl,imx53-tzic", .data = imx53_tzic_add_irq_domain, }, | ||
69 | { .compatible = "fsl,imx53-gpio", .data = imx53_gpio_add_irq_domain, }, | ||
70 | { /* sentinel */ } | ||
71 | }; | ||
72 | |||
73 | static const struct of_device_id imx53_iomuxc_of_match[] __initconst = { | ||
74 | { .compatible = "fsl,imx53-iomuxc-ard", .data = imx53_ard_common_init, }, | ||
75 | { .compatible = "fsl,imx53-iomuxc-evk", .data = imx53_evk_common_init, }, | ||
76 | { .compatible = "fsl,imx53-iomuxc-qsb", .data = imx53_qsb_common_init, }, | ||
77 | { .compatible = "fsl,imx53-iomuxc-smd", .data = imx53_smd_common_init, }, | ||
78 | { /* sentinel */ } | ||
79 | }; | ||
80 | |||
81 | static void __init imx53_dt_init(void) | ||
82 | { | ||
83 | struct device_node *node; | ||
84 | const struct of_device_id *of_id; | ||
85 | void (*func)(void); | ||
86 | |||
87 | of_irq_init(imx53_irq_match); | ||
88 | |||
89 | node = of_find_matching_node(NULL, imx53_iomuxc_of_match); | ||
90 | if (node) { | ||
91 | of_id = of_match_node(imx53_iomuxc_of_match, node); | ||
92 | func = of_id->data; | ||
93 | func(); | ||
94 | of_node_put(node); | ||
95 | } | ||
96 | |||
97 | of_platform_populate(NULL, of_default_bus_match_table, | ||
98 | imx53_auxdata_lookup, NULL); | ||
99 | } | ||
100 | |||
101 | static void __init imx53_timer_init(void) | ||
102 | { | ||
103 | mx53_clocks_init_dt(); | ||
104 | } | ||
105 | |||
106 | static struct sys_timer imx53_timer = { | ||
107 | .init = imx53_timer_init, | ||
108 | }; | ||
109 | |||
110 | static const char *imx53_dt_board_compat[] __initdata = { | ||
111 | "fsl,imx53-ard", | ||
112 | "fsl,imx53-evk", | ||
113 | "fsl,imx53-qsb", | ||
114 | "fsl,imx53-smd", | ||
115 | NULL | ||
116 | }; | ||
117 | |||
118 | DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)") | ||
119 | .map_io = mx53_map_io, | ||
120 | .init_early = imx53_init_early, | ||
121 | .init_irq = mx53_init_irq, | ||
122 | .handle_irq = imx53_handle_irq, | ||
123 | .timer = &imx53_timer, | ||
124 | .init_machine = imx53_dt_init, | ||
125 | .dt_compat = imx53_dt_board_compat, | ||
126 | MACHINE_END | ||