aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r--arch/arm/mach-mx2/Kconfig9
-rw-r--r--arch/arm/mach-mx2/Makefile1
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c2
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c6
-rw-r--r--arch/arm/mach-mx2/devices.c78
-rw-r--r--arch/arm/mach-mx2/devices.h3
-rw-r--r--arch/arm/mach-mx2/mxt_td60.c319
-rw-r--r--arch/arm/mach-mx2/pca100.c2
8 files changed, 414 insertions, 6 deletions
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index c8a2eac4d13c..b96c6a389363 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -6,11 +6,13 @@ choice
6 6
7config MACH_MX21 7config MACH_MX21
8 bool "i.MX21 support" 8 bool "i.MX21 support"
9 select ARCH_MXC_AUDMUX_V1
9 help 10 help
10 This enables support for Freescale's MX2 based i.MX21 processor. 11 This enables support for Freescale's MX2 based i.MX21 processor.
11 12
12config MACH_MX27 13config MACH_MX27
13 bool "i.MX27 support" 14 bool "i.MX27 support"
15 select ARCH_MXC_AUDMUX_V1
14 help 16 help
15 This enables support for Freescale's MX2 based i.MX27 processor. 17 This enables support for Freescale's MX2 based i.MX27 processor.
16 18
@@ -102,4 +104,11 @@ config MACH_PCA100
102 Include support for phyCARD-s (aka pca100) platform. This 104 Include support for phyCARD-s (aka pca100) platform. This
103 includes specific configurations for the module and its peripherals. 105 includes specific configurations for the module and its peripherals.
104 106
107config MACH_MXT_TD60
108 bool "Maxtrack i-MXT TD60"
109 depends on MACH_MX27
110 help
111 Include support for i-MXT (aka td60) platform. This
112 includes specific configurations for the module and its peripherals.
113
105endif 114endif
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index 19560f045632..52aca0aaf9b5 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -20,4 +20,5 @@ obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o
20obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27.o 20obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27.o
21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o 21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
22obj-$(CONFIG_MACH_PCA100) += pca100.o 22obj-$(CONFIG_MACH_PCA100) += pca100.o
23obj-$(CONFIG_MACH_MXT_TD60) += mxt_td60.o
23 24
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index eede79855f4a..91901b5d56c2 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -1000,7 +1000,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
1000 clk_enable(&per_clk[0]); 1000 clk_enable(&per_clk[0]);
1001 clk_enable(&gpio_clk); 1001 clk_enable(&gpio_clk);
1002 1002
1003#ifdef CONFIG_DEBUG_LL_CONSOLE 1003#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
1004 clk_enable(&uart_clk[0]); 1004 clk_enable(&uart_clk[0]);
1005#endif 1005#endif
1006 1006
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index ff5e33298914..b010bf9ceaab 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -651,8 +651,8 @@ static struct clk_lookup lookups[] = {
651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1) 651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1)
652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk) 652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk)
653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1) 653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1)
654 _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) 654 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
655 _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) 655 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
657 _REGISTER_CLOCK(NULL, "vpu", vpu_clk) 657 _REGISTER_CLOCK(NULL, "vpu", vpu_clk)
658 _REGISTER_CLOCK(NULL, "dma", dma_clk) 658 _REGISTER_CLOCK(NULL, "dma", dma_clk)
@@ -751,7 +751,7 @@ int __init mx27_clocks_init(unsigned long fref)
751 clk_enable(&emi_clk); 751 clk_enable(&emi_clk);
752 clk_enable(&iim_clk); 752 clk_enable(&iim_clk);
753 753
754#ifdef CONFIG_DEBUG_LL_CONSOLE 754#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
755 clk_enable(&uart1_clk); 755 clk_enable(&uart1_clk);
756#endif 756#endif
757 757
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 50199aff0143..3d398ce09b31 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -530,6 +530,84 @@ struct platform_device mxc_usbh2 = {
530}; 530};
531#endif 531#endif
532 532
533static struct resource imx_ssi_resources0[] = {
534 {
535 .start = SSI1_BASE_ADDR,
536 .end = SSI1_BASE_ADDR + 0x6F,
537 .flags = IORESOURCE_MEM,
538 }, {
539 .start = MXC_INT_SSI1,
540 .end = MXC_INT_SSI1,
541 .flags = IORESOURCE_IRQ,
542 }, {
543 .name = "tx0",
544 .start = DMA_REQ_SSI1_TX0,
545 .end = DMA_REQ_SSI1_TX0,
546 .flags = IORESOURCE_DMA,
547 }, {
548 .name = "rx0",
549 .start = DMA_REQ_SSI1_RX0,
550 .end = DMA_REQ_SSI1_RX0,
551 .flags = IORESOURCE_DMA,
552 }, {
553 .name = "tx1",
554 .start = DMA_REQ_SSI1_TX1,
555 .end = DMA_REQ_SSI1_TX1,
556 .flags = IORESOURCE_DMA,
557 }, {
558 .name = "rx1",
559 .start = DMA_REQ_SSI1_RX1,
560 .end = DMA_REQ_SSI1_RX1,
561 .flags = IORESOURCE_DMA,
562 },
563};
564
565static struct resource imx_ssi_resources1[] = {
566 {
567 .start = SSI2_BASE_ADDR,
568 .end = SSI2_BASE_ADDR + 0x6F,
569 .flags = IORESOURCE_MEM,
570 }, {
571 .start = MXC_INT_SSI2,
572 .end = MXC_INT_SSI2,
573 .flags = IORESOURCE_IRQ,
574 }, {
575 .name = "tx0",
576 .start = DMA_REQ_SSI2_TX0,
577 .end = DMA_REQ_SSI2_TX0,
578 .flags = IORESOURCE_DMA,
579 }, {
580 .name = "rx0",
581 .start = DMA_REQ_SSI2_RX0,
582 .end = DMA_REQ_SSI2_RX0,
583 .flags = IORESOURCE_DMA,
584 }, {
585 .name = "tx1",
586 .start = DMA_REQ_SSI2_TX1,
587 .end = DMA_REQ_SSI2_TX1,
588 .flags = IORESOURCE_DMA,
589 }, {
590 .name = "rx1",
591 .start = DMA_REQ_SSI2_RX1,
592 .end = DMA_REQ_SSI2_RX1,
593 .flags = IORESOURCE_DMA,
594 },
595};
596
597struct platform_device imx_ssi_device0 = {
598 .name = "imx-ssi",
599 .id = 0,
600 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
601 .resource = imx_ssi_resources0,
602};
603
604struct platform_device imx_ssi_device1 = {
605 .name = "imx-ssi",
606 .id = 1,
607 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
608 .resource = imx_ssi_resources1,
609};
610
533/* GPIO port description */ 611/* GPIO port description */
534static struct mxc_gpio_port imx_gpio_ports[] = { 612static struct mxc_gpio_port imx_gpio_ports[] = {
535 { 613 {
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index d315406d6725..97306aa18f1c 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -26,4 +26,5 @@ extern struct platform_device mxc_usbh2;
26extern struct platform_device mxc_spi_device0; 26extern struct platform_device mxc_spi_device0;
27extern struct platform_device mxc_spi_device1; 27extern struct platform_device mxc_spi_device1;
28extern struct platform_device mxc_spi_device2; 28extern struct platform_device mxc_spi_device2;
29 29extern struct platform_device imx_ssi_device0;
30extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/mach-mx2/mxt_td60.c b/arch/arm/mach-mx2/mxt_td60.c
new file mode 100644
index 000000000000..03dbbdc98955
--- /dev/null
+++ b/arch/arm/mach-mx2/mxt_td60.c
@@ -0,0 +1,319 @@
1/*
2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/platform_device.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/map.h>
24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h>
26#include <linux/i2c.h>
27#include <linux/irq.h>
28#include <mach/common.h>
29#include <mach/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33#include <asm/mach/map.h>
34#include <linux/gpio.h>
35#include <mach/imx-uart.h>
36#include <mach/iomux.h>
37#include <mach/mxc_nand.h>
38#include <mach/i2c.h>
39#include <linux/i2c/pca953x.h>
40#include <mach/imxfb.h>
41#include <mach/mmc.h>
42
43#include "devices.h"
44
45static unsigned int mxt_td60_pins[] __initdata = {
46 /* UART0 */
47 PE12_PF_UART1_TXD,
48 PE13_PF_UART1_RXD,
49 PE14_PF_UART1_CTS,
50 PE15_PF_UART1_RTS,
51 /* UART1 */
52 PE3_PF_UART2_CTS,
53 PE4_PF_UART2_RTS,
54 PE6_PF_UART2_TXD,
55 PE7_PF_UART2_RXD,
56 /* UART2 */
57 PE8_PF_UART3_TXD,
58 PE9_PF_UART3_RXD,
59 PE10_PF_UART3_CTS,
60 PE11_PF_UART3_RTS,
61 /* UART3 */
62 PB26_AF_UART4_RTS,
63 PB28_AF_UART4_TXD,
64 PB29_AF_UART4_CTS,
65 PB31_AF_UART4_RXD,
66 /* UART4 */
67 PB18_AF_UART5_TXD,
68 PB19_AF_UART5_RXD,
69 PB20_AF_UART5_CTS,
70 PB21_AF_UART5_RTS,
71 /* UART5 */
72 PB10_AF_UART6_TXD,
73 PB12_AF_UART6_CTS,
74 PB11_AF_UART6_RXD,
75 PB13_AF_UART6_RTS,
76 /* FEC */
77 PD0_AIN_FEC_TXD0,
78 PD1_AIN_FEC_TXD1,
79 PD2_AIN_FEC_TXD2,
80 PD3_AIN_FEC_TXD3,
81 PD4_AOUT_FEC_RX_ER,
82 PD5_AOUT_FEC_RXD1,
83 PD6_AOUT_FEC_RXD2,
84 PD7_AOUT_FEC_RXD3,
85 PD8_AF_FEC_MDIO,
86 PD9_AIN_FEC_MDC,
87 PD10_AOUT_FEC_CRS,
88 PD11_AOUT_FEC_TX_CLK,
89 PD12_AOUT_FEC_RXD0,
90 PD13_AOUT_FEC_RX_DV,
91 PD14_AOUT_FEC_RX_CLK,
92 PD15_AOUT_FEC_COL,
93 PD16_AIN_FEC_TX_ER,
94 PF23_AIN_FEC_TX_EN,
95 /* I2C1 */
96 PD17_PF_I2C_DATA,
97 PD18_PF_I2C_CLK,
98 /* I2C2 */
99 PC5_PF_I2C2_SDA,
100 PC6_PF_I2C2_SCL,
101 /* FB */
102 PA5_PF_LSCLK,
103 PA6_PF_LD0,
104 PA7_PF_LD1,
105 PA8_PF_LD2,
106 PA9_PF_LD3,
107 PA10_PF_LD4,
108 PA11_PF_LD5,
109 PA12_PF_LD6,
110 PA13_PF_LD7,
111 PA14_PF_LD8,
112 PA15_PF_LD9,
113 PA16_PF_LD10,
114 PA17_PF_LD11,
115 PA18_PF_LD12,
116 PA19_PF_LD13,
117 PA20_PF_LD14,
118 PA21_PF_LD15,
119 PA22_PF_LD16,
120 PA23_PF_LD17,
121 PA25_PF_CLS,
122 PA27_PF_SPL_SPR,
123 PA28_PF_HSYNC,
124 PA29_PF_VSYNC,
125 PA30_PF_CONTRAST,
126 PA31_PF_OE_ACD,
127 /* OWIRE */
128 PE16_AF_OWIRE,
129 /* SDHC1*/
130 PE18_PF_SD1_D0,
131 PE19_PF_SD1_D1,
132 PE20_PF_SD1_D2,
133 PE21_PF_SD1_D3,
134 PE22_PF_SD1_CMD,
135 PE23_PF_SD1_CLK,
136 PF8_AF_ATA_IORDY,
137 /* SDHC2*/
138 PB4_PF_SD2_D0,
139 PB5_PF_SD2_D1,
140 PB6_PF_SD2_D2,
141 PB7_PF_SD2_D3,
142 PB8_PF_SD2_CMD,
143 PB9_PF_SD2_CLK,
144};
145
146static struct mxc_nand_platform_data mxt_td60_nand_board_info = {
147 .width = 1,
148 .hw_ecc = 1,
149};
150
151static struct imxi2c_platform_data mxt_td60_i2c_data = {
152 .bitrate = 100000,
153};
154
155/* PCA9557 */
156static int mxt_td60_pca9557_setup(struct i2c_client *client,
157 unsigned gpio_base, unsigned ngpio,
158 void *context)
159{
160 static int mxt_td60_gpio_value[] = {
161 -1, -1, -1, -1, -1, -1, -1, 1
162 };
163 int n;
164
165 for (n = 0; n < ARRAY_SIZE(mxt_td60_gpio_value); ++n) {
166 gpio_request(gpio_base + n, "MXT_TD60 GPIO Exp");
167 if (mxt_td60_gpio_value[n] < 0)
168 gpio_direction_input(gpio_base + n);
169 else
170 gpio_direction_output(gpio_base + n,
171 mxt_td60_gpio_value[n]);
172 gpio_export(gpio_base + n, 0);
173 }
174
175 return 0;
176}
177
178static struct pca953x_platform_data mxt_td60_pca9557_pdata = {
179 .gpio_base = 240, /* place PCA9557 after all MX27 gpio pins */
180 .invert = 0, /* Do not invert */
181 .setup = mxt_td60_pca9557_setup,
182};
183
184static struct i2c_board_info mxt_td60_i2c_devices[] = {
185 {
186 I2C_BOARD_INFO("pca9557", 0x18),
187 .platform_data = &mxt_td60_pca9557_pdata,
188 },
189};
190
191static struct imxi2c_platform_data mxt_td60_i2c2_data = {
192 .bitrate = 100000,
193};
194
195static struct i2c_board_info mxt_td60_i2c2_devices[] = {
196};
197
198static struct imx_fb_videomode mxt_td60_modes[] = {
199 {
200 .mode = {
201 .name = "Chimei LW700AT9003",
202 .refresh = 60,
203 .xres = 800,
204 .yres = 480,
205 .pixclock = 30303,
206 .hsync_len = 64,
207 .left_margin = 0x67,
208 .right_margin = 0x68,
209 .vsync_len = 16,
210 .upper_margin = 0x0f,
211 .lower_margin = 0x0f,
212 },
213 .bpp = 16,
214 .pcr = 0xFA208B83,
215 },
216};
217
218static struct imx_fb_platform_data mxt_td60_fb_data = {
219 .mode = mxt_td60_modes,
220 .num_modes = ARRAY_SIZE(mxt_td60_modes),
221
222 /*
223 * - HSYNC active high
224 * - VSYNC active high
225 * - clk notenabled while idle
226 * - clock inverted
227 * - data not inverted
228 * - data enable low active
229 * - enable sharp mode
230 */
231 .pwmr = 0x00A903FF,
232 .lscr1 = 0x00120300,
233 .dmacr = 0x00020010,
234};
235
236static int mxt_td60_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
237 void *data)
238{
239 return request_irq(IRQ_GPIOF(8), detect_irq, IRQF_TRIGGER_FALLING,
240 "sdhc1-card-detect", data);
241}
242
243static void mxt_td60_sdhc1_exit(struct device *dev, void *data)
244{
245 free_irq(IRQ_GPIOF(8), data);
246}
247
248static struct imxmmc_platform_data sdhc1_pdata = {
249 .init = mxt_td60_sdhc1_init,
250 .exit = mxt_td60_sdhc1_exit,
251};
252
253static struct platform_device *platform_devices[] __initdata = {
254 &mxc_fec_device,
255};
256
257static struct imxuart_platform_data uart_pdata[] = {
258 {
259 .flags = IMXUART_HAVE_RTSCTS,
260 }, {
261 .flags = IMXUART_HAVE_RTSCTS,
262 }, {
263 .flags = IMXUART_HAVE_RTSCTS,
264 }, {
265 .flags = IMXUART_HAVE_RTSCTS,
266 }, {
267 .flags = IMXUART_HAVE_RTSCTS,
268 }, {
269 .flags = IMXUART_HAVE_RTSCTS,
270 },
271};
272
273static void __init mxt_td60_board_init(void)
274{
275 mxc_gpio_setup_multiple_pins(mxt_td60_pins, ARRAY_SIZE(mxt_td60_pins),
276 "MXT_TD60");
277
278 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
279 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
280 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
281 mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
282 mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
283 mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
284 mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info);
285
286 i2c_register_board_info(0, mxt_td60_i2c_devices,
287 ARRAY_SIZE(mxt_td60_i2c_devices));
288
289 i2c_register_board_info(1, mxt_td60_i2c2_devices,
290 ARRAY_SIZE(mxt_td60_i2c2_devices));
291
292 mxc_register_device(&mxc_i2c_device0, &mxt_td60_i2c_data);
293 mxc_register_device(&mxc_i2c_device1, &mxt_td60_i2c2_data);
294 mxc_register_device(&mxc_fb_device, &mxt_td60_fb_data);
295 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
296
297 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
298}
299
300static void __init mxt_td60_timer_init(void)
301{
302 mx27_clocks_init(26000000);
303}
304
305static struct sys_timer mxt_td60_timer = {
306 .init = mxt_td60_timer_init,
307};
308
309MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
310 /* maintainer: Maxtrack Industrial */
311 .phys_io = AIPI_BASE_ADDR,
312 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
313 .boot_params = PHYS_OFFSET + 0x100,
314 .map_io = mx27_map_io,
315 .init_irq = mx27_init_irq,
316 .init_machine = mxt_td60_board_init,
317 .timer = &mxt_td60_timer,
318MACHINE_END
319
diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c
index fe5b165b88cc..aea3d340d2e1 100644
--- a/arch/arm/mach-mx2/pca100.c
+++ b/arch/arm/mach-mx2/pca100.c
@@ -237,7 +237,7 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
238 .boot_params = PHYS_OFFSET + 0x100, 238 .boot_params = PHYS_OFFSET + 0x100,
239 .map_io = mx27_map_io, 239 .map_io = mx27_map_io,
240 .init_irq = mxc_init_irq, 240 .init_irq = mx27_init_irq,
241 .init_machine = pca100_init, 241 .init_machine = pca100_init,
242 .timer = &pca100_timer, 242 .timer = &pca100_timer,
243MACHINE_END 243MACHINE_END