diff options
author | Eric Bénard <eric@eukrea.com> | 2010-06-10 10:07:50 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-26 08:18:19 -0400 |
commit | 21744f193d3ee520c252cd9db0bdfac8ed3cd35f (patch) | |
tree | 076efcb6cf0aad8a2fe846a151af3cfec843ad72 /arch/arm/mach-mx3 | |
parent | ac0eb0f3ca3e3fff6ac083ee3a51b98f87d67843 (diff) |
i.MX35: add cpuimx35 support and its baseboard
* cpuimx35 integrates i.MX35, RAM, NAND, Ethernet, I2C RTC, USB Host,
USB OTG and I2C touchscreen controller
* mbimxsd provides access to LCD, Audio, LED, Switch button, UART ...
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r-- | arch/arm/mach-mx3/Kconfig | 22 | ||||
-rw-r--r-- | arch/arm/mach-mx3/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | 263 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-cpuimx35.c | 226 |
4 files changed, 513 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 344753fdf25e..b09e9a94adf1 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -125,4 +125,26 @@ config MACH_KZM_ARM11_01 | |||
125 | Include support for KZM-ARM11-01. This includes specific | 125 | Include support for KZM-ARM11-01. This includes specific |
126 | configurations for the board and its peripherals. | 126 | configurations for the board and its peripherals. |
127 | 127 | ||
128 | config MACH_EUKREA_CPUIMX35 | ||
129 | bool "Support Eukrea CPUIMX35 Platform" | ||
130 | select ARCH_MX35 | ||
131 | select MXC_ULPI if USB_ULPI | ||
132 | help | ||
133 | Include support for Eukrea CPUIMX35 platform. This includes | ||
134 | specific configurations for the board and its peripherals. | ||
135 | |||
136 | choice | ||
137 | prompt "Baseboard" | ||
138 | depends on MACH_EUKREA_CPUIMX35 | ||
139 | default MACH_EUKREA_MBIMXSD_BASEBOARD | ||
140 | |||
141 | config MACH_EUKREA_MBIMXSD_BASEBOARD | ||
142 | prompt "Eukrea MBIMXSD development board" | ||
143 | bool | ||
144 | help | ||
145 | This adds board specific devices that can be found on Eukrea's | ||
146 | MBIMXSD evaluation board. | ||
147 | |||
148 | endchoice | ||
149 | |||
128 | endif | 150 | endif |
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile index 5d650fda5d5d..ef68ff55a7b6 100644 --- a/arch/arm/mach-mx3/Makefile +++ b/arch/arm/mach-mx3/Makefile | |||
@@ -24,3 +24,5 @@ obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o | |||
24 | obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o | 24 | obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o |
25 | obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35pdk.o | 25 | obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35pdk.o |
26 | obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o | 26 | obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o |
27 | obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o | ||
28 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.o | ||
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c new file mode 100644 index 000000000000..678597852443 --- /dev/null +++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | |||
@@ -0,0 +1,263 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Eric Benard - eric@eukrea.com | ||
3 | * | ||
4 | * Based on pcm970-baseboard.c which is : | ||
5 | * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version 2 | ||
10 | * of the License, or (at your option) any later version. | ||
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., 51 Franklin Street, Fifth Floor, Boston, | ||
19 | * MA 02110-1301, USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/types.h> | ||
23 | #include <linux/init.h> | ||
24 | |||
25 | #include <linux/gpio.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/leds.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/gpio_keys.h> | ||
30 | #include <linux/input.h> | ||
31 | #include <video/platform_lcd.h> | ||
32 | #include <linux/i2c.h> | ||
33 | |||
34 | #include <asm/mach-types.h> | ||
35 | #include <asm/mach/arch.h> | ||
36 | #include <asm/mach/time.h> | ||
37 | #include <asm/mach/map.h> | ||
38 | |||
39 | #include <mach/board-eukrea_cpuimx35.h> | ||
40 | #include <mach/hardware.h> | ||
41 | #include <mach/common.h> | ||
42 | #include <mach/imx-uart.h> | ||
43 | #include <mach/iomux-mx35.h> | ||
44 | #include <mach/ipu.h> | ||
45 | #include <mach/mx3fb.h> | ||
46 | #include <mach/audmux.h> | ||
47 | #include <mach/ssi.h> | ||
48 | |||
49 | #include "devices.h" | ||
50 | |||
51 | static const struct fb_videomode fb_modedb[] = { | ||
52 | { | ||
53 | .name = "CMO_QVGA", | ||
54 | .refresh = 60, | ||
55 | .xres = 320, | ||
56 | .yres = 240, | ||
57 | .pixclock = KHZ2PICOS(6500), | ||
58 | .left_margin = 68, | ||
59 | .right_margin = 20, | ||
60 | .upper_margin = 15, | ||
61 | .lower_margin = 4, | ||
62 | .hsync_len = 30, | ||
63 | .vsync_len = 3, | ||
64 | .sync = 0, | ||
65 | .vmode = FB_VMODE_NONINTERLACED, | ||
66 | .flag = 0, | ||
67 | }, | ||
68 | }; | ||
69 | |||
70 | static struct ipu_platform_data mx3_ipu_data = { | ||
71 | .irq_base = MXC_IPU_IRQ_START, | ||
72 | }; | ||
73 | |||
74 | static struct mx3fb_platform_data mx3fb_pdata = { | ||
75 | .dma_dev = &mx3_ipu.dev, | ||
76 | .name = "CMO_QVGA", | ||
77 | .mode = fb_modedb, | ||
78 | .num_modes = ARRAY_SIZE(fb_modedb), | ||
79 | }; | ||
80 | |||
81 | static struct pad_desc eukrea_mbimxsd_pads[] = { | ||
82 | /* LCD */ | ||
83 | MX35_PAD_LD0__IPU_DISPB_DAT_0, | ||
84 | MX35_PAD_LD1__IPU_DISPB_DAT_1, | ||
85 | MX35_PAD_LD2__IPU_DISPB_DAT_2, | ||
86 | MX35_PAD_LD3__IPU_DISPB_DAT_3, | ||
87 | MX35_PAD_LD4__IPU_DISPB_DAT_4, | ||
88 | MX35_PAD_LD5__IPU_DISPB_DAT_5, | ||
89 | MX35_PAD_LD6__IPU_DISPB_DAT_6, | ||
90 | MX35_PAD_LD7__IPU_DISPB_DAT_7, | ||
91 | MX35_PAD_LD8__IPU_DISPB_DAT_8, | ||
92 | MX35_PAD_LD9__IPU_DISPB_DAT_9, | ||
93 | MX35_PAD_LD10__IPU_DISPB_DAT_10, | ||
94 | MX35_PAD_LD11__IPU_DISPB_DAT_11, | ||
95 | MX35_PAD_LD12__IPU_DISPB_DAT_12, | ||
96 | MX35_PAD_LD13__IPU_DISPB_DAT_13, | ||
97 | MX35_PAD_LD14__IPU_DISPB_DAT_14, | ||
98 | MX35_PAD_LD15__IPU_DISPB_DAT_15, | ||
99 | MX35_PAD_LD16__IPU_DISPB_DAT_16, | ||
100 | MX35_PAD_LD17__IPU_DISPB_DAT_17, | ||
101 | MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC, | ||
102 | MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK, | ||
103 | MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY, | ||
104 | MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC, | ||
105 | /* Backlight */ | ||
106 | MX35_PAD_CONTRAST__IPU_DISPB_CONTR, | ||
107 | /* LCD_PWR */ | ||
108 | MX35_PAD_D3_CLS__GPIO1_4, | ||
109 | /* LED */ | ||
110 | MX35_PAD_LD23__GPIO3_29, | ||
111 | /* SWITCH */ | ||
112 | MX35_PAD_LD19__GPIO3_25, | ||
113 | /* UART2 */ | ||
114 | MX35_PAD_CTS2__UART2_CTS, | ||
115 | MX35_PAD_RTS2__UART2_RTS, | ||
116 | MX35_PAD_TXD2__UART2_TXD_MUX, | ||
117 | MX35_PAD_RXD2__UART2_RXD_MUX, | ||
118 | /* I2S */ | ||
119 | MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS, | ||
120 | MX35_PAD_STXD4__AUDMUX_AUD4_TXD, | ||
121 | MX35_PAD_SRXD4__AUDMUX_AUD4_RXD, | ||
122 | MX35_PAD_SCK4__AUDMUX_AUD4_TXC, | ||
123 | }; | ||
124 | |||
125 | #define GPIO_LED1 (2 * 32 + 29) | ||
126 | #define GPIO_SWITCH1 (2 * 32 + 25) | ||
127 | #define GPIO_LCDPWR (4) | ||
128 | |||
129 | static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, | ||
130 | unsigned int power) | ||
131 | { | ||
132 | if (power) | ||
133 | gpio_direction_output(GPIO_LCDPWR, 1); | ||
134 | else | ||
135 | gpio_direction_output(GPIO_LCDPWR, 0); | ||
136 | } | ||
137 | |||
138 | static struct plat_lcd_data eukrea_mbimxsd_lcd_power_data = { | ||
139 | .set_power = eukrea_mbimxsd_lcd_power_set, | ||
140 | }; | ||
141 | |||
142 | static struct platform_device eukrea_mbimxsd_lcd_powerdev = { | ||
143 | .name = "platform-lcd", | ||
144 | .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, | ||
145 | }; | ||
146 | |||
147 | static struct gpio_led eukrea_mbimxsd_leds[] = { | ||
148 | { | ||
149 | .name = "led1", | ||
150 | .default_trigger = "heartbeat", | ||
151 | .active_low = 1, | ||
152 | .gpio = GPIO_LED1, | ||
153 | }, | ||
154 | }; | ||
155 | |||
156 | static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { | ||
157 | .leds = eukrea_mbimxsd_leds, | ||
158 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), | ||
159 | }; | ||
160 | |||
161 | static struct platform_device eukrea_mbimxsd_leds_gpio = { | ||
162 | .name = "leds-gpio", | ||
163 | .id = -1, | ||
164 | .dev = { | ||
165 | .platform_data = &eukrea_mbimxsd_led_info, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { | ||
170 | { | ||
171 | .gpio = GPIO_SWITCH1, | ||
172 | .code = BTN_0, | ||
173 | .desc = "BP1", | ||
174 | .active_low = 1, | ||
175 | .wakeup = 1, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct gpio_keys_platform_data eukrea_mbimxsd_button_data = { | ||
180 | .buttons = eukrea_mbimxsd_gpio_buttons, | ||
181 | .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), | ||
182 | }; | ||
183 | |||
184 | static struct platform_device eukrea_mbimxsd_button_device = { | ||
185 | .name = "gpio-keys", | ||
186 | .id = -1, | ||
187 | .num_resources = 0, | ||
188 | .dev = { | ||
189 | .platform_data = &eukrea_mbimxsd_button_data, | ||
190 | } | ||
191 | }; | ||
192 | |||
193 | static struct platform_device *platform_devices[] __initdata = { | ||
194 | &eukrea_mbimxsd_leds_gpio, | ||
195 | &eukrea_mbimxsd_button_device, | ||
196 | &eukrea_mbimxsd_lcd_powerdev, | ||
197 | }; | ||
198 | |||
199 | static struct imxuart_platform_data uart_pdata = { | ||
200 | .flags = IMXUART_HAVE_RTSCTS, | ||
201 | }; | ||
202 | |||
203 | static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { | ||
204 | { | ||
205 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
206 | }, | ||
207 | }; | ||
208 | |||
209 | struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { | ||
210 | .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, | ||
211 | }; | ||
212 | |||
213 | /* | ||
214 | * system init for baseboard usage. Will be called by cpuimx35 init. | ||
215 | * | ||
216 | * Add platform devices present on this baseboard and init | ||
217 | * them from CPU side as far as required to use them later on | ||
218 | */ | ||
219 | void __init eukrea_mbimxsd_baseboard_init(void) | ||
220 | { | ||
221 | if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads, | ||
222 | ARRAY_SIZE(eukrea_mbimxsd_pads))) | ||
223 | printk(KERN_ERR "error setting mbimxsd pads !\n"); | ||
224 | |||
225 | #if defined(CONFIG_SND_SOC_EUKREA_TLV320) | ||
226 | /* SSI unit master I2S codec connected to SSI_AUD4 */ | ||
227 | mxc_audmux_v2_configure_port(0, | ||
228 | MXC_AUDMUX_V2_PTCR_SYN | | ||
229 | MXC_AUDMUX_V2_PTCR_TFSDIR | | ||
230 | MXC_AUDMUX_V2_PTCR_TFSEL(3) | | ||
231 | MXC_AUDMUX_V2_PTCR_TCLKDIR | | ||
232 | MXC_AUDMUX_V2_PTCR_TCSEL(3), | ||
233 | MXC_AUDMUX_V2_PDCR_RXDSEL(3) | ||
234 | ); | ||
235 | mxc_audmux_v2_configure_port(3, | ||
236 | MXC_AUDMUX_V2_PTCR_SYN, | ||
237 | MXC_AUDMUX_V2_PDCR_RXDSEL(0) | ||
238 | ); | ||
239 | #endif | ||
240 | |||
241 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | ||
242 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | ||
243 | mxc_register_device(&mx3_fb, &mx3fb_pdata); | ||
244 | |||
245 | mxc_register_device(&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); | ||
246 | |||
247 | gpio_request(GPIO_LED1, "LED1"); | ||
248 | gpio_direction_output(GPIO_LED1, 1); | ||
249 | gpio_free(GPIO_LED1); | ||
250 | |||
251 | gpio_request(GPIO_SWITCH1, "SWITCH1"); | ||
252 | gpio_direction_input(GPIO_SWITCH1); | ||
253 | gpio_free(GPIO_SWITCH1); | ||
254 | |||
255 | gpio_request(GPIO_LCDPWR, "LCDPWR"); | ||
256 | gpio_direction_output(GPIO_LCDPWR, 1); | ||
257 | gpio_free(GPIO_SWITCH1); | ||
258 | |||
259 | i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, | ||
260 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); | ||
261 | |||
262 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | ||
263 | } | ||
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c new file mode 100644 index 000000000000..55caa5cb8bc7 --- /dev/null +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -0,0 +1,226 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Eric Benard - eric@eukrea.com | ||
3 | * Copyright (C) 2009 Sascha Hauer, Pengutronix | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | #include <linux/init.h> | ||
22 | |||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/mtd/physmap.h> | ||
25 | #include <linux/memory.h> | ||
26 | #include <linux/gpio.h> | ||
27 | #include <linux/interrupt.h> | ||
28 | #include <linux/delay.h> | ||
29 | #include <linux/i2c.h> | ||
30 | #include <linux/i2c/tsc2007.h> | ||
31 | #include <linux/usb/otg.h> | ||
32 | #include <linux/usb/ulpi.h> | ||
33 | #include <linux/fsl_devices.h> | ||
34 | |||
35 | #include <asm/mach-types.h> | ||
36 | #include <asm/mach/arch.h> | ||
37 | #include <asm/mach/time.h> | ||
38 | #include <asm/mach/map.h> | ||
39 | |||
40 | #include <mach/board-eukrea_cpuimx35.h> | ||
41 | #include <mach/hardware.h> | ||
42 | #include <mach/common.h> | ||
43 | #include <mach/imx-uart.h> | ||
44 | #include <mach/i2c.h> | ||
45 | #include <mach/iomux-mx35.h> | ||
46 | #include <mach/mxc_nand.h> | ||
47 | #include <mach/mxc_ehci.h> | ||
48 | #include <mach/ulpi.h> | ||
49 | |||
50 | #include "devices.h" | ||
51 | |||
52 | static struct imxuart_platform_data uart_pdata = { | ||
53 | .flags = IMXUART_HAVE_RTSCTS, | ||
54 | }; | ||
55 | |||
56 | static struct imxi2c_platform_data eukrea_cpuimx35_i2c_1_data = { | ||
57 | .bitrate = 50000, | ||
58 | }; | ||
59 | |||
60 | #define TSC2007_IRQGPIO (2 * 32 + 2) | ||
61 | static int ts_get_pendown_state(void) | ||
62 | { | ||
63 | int val = 0; | ||
64 | gpio_free(TSC2007_IRQGPIO); | ||
65 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
66 | gpio_direction_input(TSC2007_IRQGPIO); | ||
67 | |||
68 | val = gpio_get_value(TSC2007_IRQGPIO); | ||
69 | |||
70 | gpio_free(TSC2007_IRQGPIO); | ||
71 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
72 | |||
73 | return val ? 0 : 1; | ||
74 | } | ||
75 | |||
76 | static int ts_init(void) | ||
77 | { | ||
78 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static struct tsc2007_platform_data tsc2007_info = { | ||
83 | .model = 2007, | ||
84 | .x_plate_ohms = 180, | ||
85 | .get_pendown_state = ts_get_pendown_state, | ||
86 | .init_platform_hw = ts_init, | ||
87 | }; | ||
88 | |||
89 | static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | ||
90 | { | ||
91 | I2C_BOARD_INFO("pcf8563", 0x51), | ||
92 | }, { | ||
93 | I2C_BOARD_INFO("tsc2007", 0x48), | ||
94 | .type = "tsc2007", | ||
95 | .platform_data = &tsc2007_info, | ||
96 | .irq = gpio_to_irq(TSC2007_IRQGPIO), | ||
97 | }, | ||
98 | }; | ||
99 | |||
100 | static struct platform_device *devices[] __initdata = { | ||
101 | &mxc_fec_device, | ||
102 | &imx_wdt_device0, | ||
103 | }; | ||
104 | |||
105 | static struct pad_desc eukrea_cpuimx35_pads[] = { | ||
106 | /* UART1 */ | ||
107 | MX35_PAD_CTS1__UART1_CTS, | ||
108 | MX35_PAD_RTS1__UART1_RTS, | ||
109 | MX35_PAD_TXD1__UART1_TXD_MUX, | ||
110 | MX35_PAD_RXD1__UART1_RXD_MUX, | ||
111 | /* FEC */ | ||
112 | MX35_PAD_FEC_TX_CLK__FEC_TX_CLK, | ||
113 | MX35_PAD_FEC_RX_CLK__FEC_RX_CLK, | ||
114 | MX35_PAD_FEC_RX_DV__FEC_RX_DV, | ||
115 | MX35_PAD_FEC_COL__FEC_COL, | ||
116 | MX35_PAD_FEC_RDATA0__FEC_RDATA_0, | ||
117 | MX35_PAD_FEC_TDATA0__FEC_TDATA_0, | ||
118 | MX35_PAD_FEC_TX_EN__FEC_TX_EN, | ||
119 | MX35_PAD_FEC_MDC__FEC_MDC, | ||
120 | MX35_PAD_FEC_MDIO__FEC_MDIO, | ||
121 | MX35_PAD_FEC_TX_ERR__FEC_TX_ERR, | ||
122 | MX35_PAD_FEC_RX_ERR__FEC_RX_ERR, | ||
123 | MX35_PAD_FEC_CRS__FEC_CRS, | ||
124 | MX35_PAD_FEC_RDATA1__FEC_RDATA_1, | ||
125 | MX35_PAD_FEC_TDATA1__FEC_TDATA_1, | ||
126 | MX35_PAD_FEC_RDATA2__FEC_RDATA_2, | ||
127 | MX35_PAD_FEC_TDATA2__FEC_TDATA_2, | ||
128 | MX35_PAD_FEC_RDATA3__FEC_RDATA_3, | ||
129 | MX35_PAD_FEC_TDATA3__FEC_TDATA_3, | ||
130 | /* I2C1 */ | ||
131 | MX35_PAD_I2C1_CLK__I2C1_SCL, | ||
132 | MX35_PAD_I2C1_DAT__I2C1_SDA, | ||
133 | /* TSC2007 IRQ */ | ||
134 | MX35_PAD_ATA_DA2__GPIO3_2, | ||
135 | }; | ||
136 | |||
137 | static struct mxc_nand_platform_data pcm037_nand_board_info = { | ||
138 | .width = 1, | ||
139 | .hw_ecc = 1, | ||
140 | .flash_bbt = 1, | ||
141 | }; | ||
142 | |||
143 | static struct mxc_usbh_platform_data otg_pdata = { | ||
144 | .portsc = MXC_EHCI_MODE_UTMI, | ||
145 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
146 | }; | ||
147 | |||
148 | static struct mxc_usbh_platform_data usbh1_pdata = { | ||
149 | .portsc = MXC_EHCI_MODE_SERIAL, | ||
150 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | ||
151 | MXC_EHCI_IPPUE_DOWN, | ||
152 | }; | ||
153 | |||
154 | static struct fsl_usb2_platform_data otg_device_pdata = { | ||
155 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
156 | .phy_mode = FSL_USB2_PHY_UTMI, | ||
157 | }; | ||
158 | |||
159 | static int otg_mode_host; | ||
160 | |||
161 | static int __init eukrea_cpuimx35_otg_mode(char *options) | ||
162 | { | ||
163 | if (!strcmp(options, "host")) | ||
164 | otg_mode_host = 1; | ||
165 | else if (!strcmp(options, "device")) | ||
166 | otg_mode_host = 0; | ||
167 | else | ||
168 | pr_info("otg_mode neither \"host\" nor \"device\". " | ||
169 | "Defaulting to device\n"); | ||
170 | return 0; | ||
171 | } | ||
172 | __setup("otg_mode=", eukrea_cpuimx35_otg_mode); | ||
173 | |||
174 | /* | ||
175 | * Board specific initialization. | ||
176 | */ | ||
177 | static void __init mxc_board_init(void) | ||
178 | { | ||
179 | mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads, | ||
180 | ARRAY_SIZE(eukrea_cpuimx35_pads)); | ||
181 | |||
182 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
183 | |||
184 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | ||
185 | mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); | ||
186 | |||
187 | i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices, | ||
188 | ARRAY_SIZE(eukrea_cpuimx35_i2c_devices)); | ||
189 | mxc_register_device(&mxc_i2c_device0, &eukrea_cpuimx35_i2c_1_data); | ||
190 | |||
191 | #if defined(CONFIG_USB_ULPI) | ||
192 | if (otg_mode_host) { | ||
193 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
194 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); | ||
195 | |||
196 | mxc_register_device(&mxc_otg_host, &otg_pdata); | ||
197 | } | ||
198 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | ||
199 | #endif | ||
200 | if (!otg_mode_host) | ||
201 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | ||
202 | |||
203 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD | ||
204 | eukrea_mbimxsd_baseboard_init(); | ||
205 | #endif | ||
206 | } | ||
207 | |||
208 | static void __init eukrea_cpuimx35_timer_init(void) | ||
209 | { | ||
210 | mx35_clocks_init(); | ||
211 | } | ||
212 | |||
213 | struct sys_timer eukrea_cpuimx35_timer = { | ||
214 | .init = eukrea_cpuimx35_timer_init, | ||
215 | }; | ||
216 | |||
217 | MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35") | ||
218 | /* Maintainer: Eukrea Electromatique */ | ||
219 | .phys_io = MX35_AIPS1_BASE_ADDR, | ||
220 | .io_pg_offst = ((MX35_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
221 | .boot_params = MX3x_PHYS_OFFSET + 0x100, | ||
222 | .map_io = mx35_map_io, | ||
223 | .init_irq = mx35_init_irq, | ||
224 | .init_machine = mxc_board_init, | ||
225 | .timer = &eukrea_cpuimx35_timer, | ||
226 | MACHINE_END | ||