diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2010-12-30 06:25:06 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-03 03:39:30 -0500 |
commit | d3d4b60b12369eded0ea0c5dffee0888ec4d80cd (patch) | |
tree | eac1cd971098d37d11766238ba0526323a6370e0 /arch/arm/mach-mx5/board-mx50_rdp.c | |
parent | 3d5a44be308203a9a192a77037fb613c2f82ed85 (diff) |
arm: mx50: add mx50 reference design board support
Add basic function and uart device support.
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5/board-mx50_rdp.c')
-rw-r--r-- | arch/arm/mach-mx5/board-mx50_rdp.c | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c new file mode 100644 index 000000000000..fd32e4c450e8 --- /dev/null +++ b/arch/arm/mach-mx5/board-mx50_rdp.c | |||
@@ -0,0 +1,197 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 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 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 along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/init.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/delay.h> | ||
25 | #include <linux/io.h> | ||
26 | #include <linux/fsl_devices.h> | ||
27 | |||
28 | #include <mach/common.h> | ||
29 | #include <mach/hardware.h> | ||
30 | #include <mach/iomux-mx50.h> | ||
31 | |||
32 | #include <asm/irq.h> | ||
33 | #include <asm/setup.h> | ||
34 | #include <asm/mach-types.h> | ||
35 | #include <asm/mach/arch.h> | ||
36 | #include <asm/mach/time.h> | ||
37 | |||
38 | #include "devices-mx50.h" | ||
39 | |||
40 | static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = { | ||
41 | /* SD1 */ | ||
42 | MX50_PAD_ECSPI2_SS0__GPIO_4_19, | ||
43 | MX50_PAD_EIM_CRE__GPIO_1_27, | ||
44 | MX50_PAD_SD1_CMD__SD1_CMD, | ||
45 | |||
46 | MX50_PAD_SD1_CLK__SD1_CLK, | ||
47 | MX50_PAD_SD1_D0__SD1_D0, | ||
48 | MX50_PAD_SD1_D1__SD1_D1, | ||
49 | MX50_PAD_SD1_D2__SD1_D2, | ||
50 | MX50_PAD_SD1_D3__SD1_D3, | ||
51 | |||
52 | /* SD2 */ | ||
53 | MX50_PAD_SD2_CD__GPIO_5_17, | ||
54 | MX50_PAD_SD2_WP__GPIO_5_16, | ||
55 | MX50_PAD_SD2_CMD__SD2_CMD, | ||
56 | MX50_PAD_SD2_CLK__SD2_CLK, | ||
57 | MX50_PAD_SD2_D0__SD2_D0, | ||
58 | MX50_PAD_SD2_D1__SD2_D1, | ||
59 | MX50_PAD_SD2_D2__SD2_D2, | ||
60 | MX50_PAD_SD2_D3__SD2_D3, | ||
61 | MX50_PAD_SD2_D4__SD2_D4, | ||
62 | MX50_PAD_SD2_D5__SD2_D5, | ||
63 | MX50_PAD_SD2_D6__SD2_D6, | ||
64 | MX50_PAD_SD2_D7__SD2_D7, | ||
65 | |||
66 | /* SD3 */ | ||
67 | MX50_PAD_SD3_CMD__SD3_CMD, | ||
68 | MX50_PAD_SD3_CLK__SD3_CLK, | ||
69 | MX50_PAD_SD3_D0__SD3_D0, | ||
70 | MX50_PAD_SD3_D1__SD3_D1, | ||
71 | MX50_PAD_SD3_D2__SD3_D2, | ||
72 | MX50_PAD_SD3_D3__SD3_D3, | ||
73 | MX50_PAD_SD3_D4__SD3_D4, | ||
74 | MX50_PAD_SD3_D5__SD3_D5, | ||
75 | MX50_PAD_SD3_D6__SD3_D6, | ||
76 | MX50_PAD_SD3_D7__SD3_D7, | ||
77 | |||
78 | /* PWR_INT */ | ||
79 | MX50_PAD_ECSPI2_MISO__GPIO_4_18, | ||
80 | |||
81 | /* UART pad setting */ | ||
82 | MX50_PAD_UART1_TXD__UART1_TXD, | ||
83 | MX50_PAD_UART1_RXD__UART1_RXD, | ||
84 | MX50_PAD_UART1_RTS__UART1_RTS, | ||
85 | MX50_PAD_UART2_TXD__UART2_TXD, | ||
86 | MX50_PAD_UART2_RXD__UART2_RXD, | ||
87 | MX50_PAD_UART2_CTS__UART2_CTS, | ||
88 | MX50_PAD_UART2_RTS__UART2_RTS, | ||
89 | |||
90 | MX50_PAD_I2C1_SCL__I2C1_SCL, | ||
91 | MX50_PAD_I2C1_SDA__I2C1_SDA, | ||
92 | MX50_PAD_I2C2_SCL__I2C2_SCL, | ||
93 | MX50_PAD_I2C2_SDA__I2C2_SDA, | ||
94 | |||
95 | MX50_PAD_EPITO__USBH1_PWR, | ||
96 | /* Need to comment below line if | ||
97 | * one needs to debug owire. | ||
98 | */ | ||
99 | MX50_PAD_OWIRE__USBH1_OC, | ||
100 | /* using gpio to control otg pwr */ | ||
101 | MX50_PAD_PWM2__GPIO_6_25, | ||
102 | MX50_PAD_I2C3_SCL__USBOTG_OC, | ||
103 | |||
104 | MX50_PAD_SSI_RXC__FEC_MDIO, | ||
105 | MX50_PAD_SSI_RXC__FEC_MDIO, | ||
106 | MX50_PAD_DISP_D0__FEC_TXCLK, | ||
107 | MX50_PAD_DISP_D1__FEC_RX_ER, | ||
108 | MX50_PAD_DISP_D2__FEC_RX_DV, | ||
109 | MX50_PAD_DISP_D3__FEC_RXD1, | ||
110 | MX50_PAD_DISP_D4__FEC_RXD0, | ||
111 | MX50_PAD_DISP_D5__FEC_TX_EN, | ||
112 | MX50_PAD_DISP_D6__FEC_TXD1, | ||
113 | MX50_PAD_DISP_D7__FEC_TXD0, | ||
114 | MX50_PAD_SSI_RXFS__FEC_MDC, | ||
115 | MX50_PAD_I2C3_SDA__GPIO_6_23, | ||
116 | MX50_PAD_ECSPI1_SCLK__GPIO_4_12, | ||
117 | |||
118 | MX50_PAD_CSPI_SS0__CSPI_SS0, | ||
119 | MX50_PAD_ECSPI1_MOSI__CSPI_SS1, | ||
120 | MX50_PAD_CSPI_MOSI__CSPI_MOSI, | ||
121 | MX50_PAD_CSPI_MISO__CSPI_MISO, | ||
122 | |||
123 | /* SGTL500_OSC_EN */ | ||
124 | MX50_PAD_UART1_CTS__GPIO_6_8, | ||
125 | |||
126 | /* SGTL_AMP_SHDN */ | ||
127 | MX50_PAD_UART3_RXD__GPIO_6_15, | ||
128 | |||
129 | /* Keypad */ | ||
130 | MX50_PAD_KEY_COL0__KEY_COL0, | ||
131 | MX50_PAD_KEY_ROW0__KEY_ROW0, | ||
132 | MX50_PAD_KEY_COL1__KEY_COL1, | ||
133 | MX50_PAD_KEY_ROW1__KEY_ROW1, | ||
134 | MX50_PAD_KEY_COL2__KEY_COL2, | ||
135 | MX50_PAD_KEY_ROW2__KEY_ROW2, | ||
136 | MX50_PAD_KEY_COL3__KEY_COL3, | ||
137 | MX50_PAD_KEY_ROW3__KEY_ROW3, | ||
138 | MX50_PAD_EIM_DA0__KEY_COL4, | ||
139 | MX50_PAD_EIM_DA1__KEY_ROW4, | ||
140 | MX50_PAD_EIM_DA2__KEY_COL5, | ||
141 | MX50_PAD_EIM_DA3__KEY_ROW5, | ||
142 | MX50_PAD_EIM_DA4__KEY_COL6, | ||
143 | MX50_PAD_EIM_DA5__KEY_ROW6, | ||
144 | MX50_PAD_EIM_DA6__KEY_COL7, | ||
145 | MX50_PAD_EIM_DA7__KEY_ROW7, | ||
146 | /*EIM pads */ | ||
147 | MX50_PAD_EIM_DA8__GPIO_1_8, | ||
148 | MX50_PAD_EIM_DA9__GPIO_1_9, | ||
149 | MX50_PAD_EIM_DA10__GPIO_1_10, | ||
150 | MX50_PAD_EIM_DA11__GPIO_1_11, | ||
151 | MX50_PAD_EIM_DA12__GPIO_1_12, | ||
152 | MX50_PAD_EIM_DA13__GPIO_1_13, | ||
153 | MX50_PAD_EIM_DA14__GPIO_1_14, | ||
154 | MX50_PAD_EIM_DA15__GPIO_1_15, | ||
155 | MX50_PAD_EIM_CS2__GPIO_1_16, | ||
156 | MX50_PAD_EIM_CS1__GPIO_1_17, | ||
157 | MX50_PAD_EIM_CS0__GPIO_1_18, | ||
158 | MX50_PAD_EIM_EB0__GPIO_1_19, | ||
159 | MX50_PAD_EIM_EB1__GPIO_1_20, | ||
160 | MX50_PAD_EIM_WAIT__GPIO_1_21, | ||
161 | MX50_PAD_EIM_BCLK__GPIO_1_22, | ||
162 | MX50_PAD_EIM_RDY__GPIO_1_23, | ||
163 | MX50_PAD_EIM_OE__GPIO_1_24, | ||
164 | }; | ||
165 | |||
166 | /* Serial ports */ | ||
167 | static const struct imxuart_platform_data uart_pdata __initconst = { | ||
168 | .flags = IMXUART_HAVE_RTSCTS, | ||
169 | }; | ||
170 | |||
171 | /* | ||
172 | * Board specific initialization. | ||
173 | */ | ||
174 | static void __init mx50_rdp_board_init(void) | ||
175 | { | ||
176 | mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads, | ||
177 | ARRAY_SIZE(mx50_rdp_pads)); | ||
178 | |||
179 | imx50_add_imx_uart(0, &uart_pdata); | ||
180 | imx50_add_imx_uart(1, &uart_pdata); | ||
181 | } | ||
182 | |||
183 | static void __init mx50_rdp_timer_init(void) | ||
184 | { | ||
185 | mx50_clocks_init(32768, 24000000, 22579200); | ||
186 | } | ||
187 | |||
188 | static struct sys_timer mx50_rdp_timer = { | ||
189 | .init = mx50_rdp_timer_init, | ||
190 | }; | ||
191 | |||
192 | MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform") | ||
193 | .map_io = mx50_map_io, | ||
194 | .init_irq = mx50_init_irq, | ||
195 | .init_machine = mx50_rdp_board_init, | ||
196 | .timer = &mx50_rdp_timer, | ||
197 | MACHINE_END | ||