Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mach-mx50_rdp.c
Go to the documentation of this file.
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 
27 #include <mach/common.h>
28 #include <mach/hardware.h>
29 #include <mach/iomux-mx50.h>
30 
31 #include <asm/irq.h>
32 #include <asm/setup.h>
33 #include <asm/mach-types.h>
34 #include <asm/mach/arch.h>
35 #include <asm/mach/time.h>
36 
37 #include "devices-imx50.h"
38 
39 #define FEC_EN IMX_GPIO_NR(6, 23)
40 #define FEC_RESET_B IMX_GPIO_NR(4, 12)
41 
42 static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
43  /* SD1 */
47 
53 
54  /* SD2 */
67 
68  /* SD3 */
79 
80  /* PWR_INT */
82 
83  /* UART pad setting */
91 
96 
98  /* Need to comment below line if
99  * one needs to debug owire.
100  */
102  /* using gpio to control otg pwr */
105 
118 
123 
124  /* SGTL500_OSC_EN */
126 
127  /* SGTL_AMP_SHDN */
129 
130  /* Keypad */
147  /*EIM pads */
165 };
166 
167 /* Serial ports */
168 static const struct imxuart_platform_data uart_pdata __initconst = {
169  .flags = IMXUART_HAVE_RTSCTS,
170 };
171 
172 static const struct fec_platform_data fec_data __initconst = {
174 };
175 
176 static inline void mx50_rdp_fec_reset(void)
177 {
178  gpio_request(FEC_EN, "fec-en");
180  gpio_request(FEC_RESET_B, "fec-reset_b");
182  msleep(1);
184 }
185 
186 static const struct imxi2c_platform_data i2c_data __initconst = {
187  .bitrate = 100000,
188 };
189 
190 /*
191  * Board specific initialization.
192  */
193 static void __init mx50_rdp_board_init(void)
194 {
195  imx50_soc_init();
196 
197  mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads,
198  ARRAY_SIZE(mx50_rdp_pads));
199 
200  imx50_add_imx_uart(0, &uart_pdata);
201  imx50_add_imx_uart(1, &uart_pdata);
202  mx50_rdp_fec_reset();
203  imx50_add_fec(&fec_data);
207 }
208 
209 static void __init mx50_rdp_timer_init(void)
210 {
211  mx50_clocks_init(32768, 24000000, 22579200);
212 }
213 
214 static struct sys_timer mx50_rdp_timer = {
215  .init = mx50_rdp_timer_init,
216 };
217 
218 MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
219  .map_io = mx50_map_io,
220  .init_early = imx50_init_early,
221  .init_irq = mx50_init_irq,
222  .handle_irq = imx50_handle_irq,
223  .timer = &mx50_rdp_timer,
224  .init_machine = mx50_rdp_board_init,
225  .restart = mxc_restart,