blob: 1c33a6ce326c6f497d873375938008225d679390 [file] [log] [blame]
Fabio Estevamaefa1c62009-06-02 17:24:16 -07001/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
Marc Kleine-Budded17e1c12010-08-18 18:20:24 +02003 * Copyright (C) 2009 Marc Kleine-Budde, Pengutronix
Fabio Estevamaefa1c62009-06-02 17:24:16 -07004 *
5 * Author: Fabio Estevam <fabio.estevam@freescale.com>
6 *
Alex Gershgorin25af2d92012-03-13 17:05:29 +02007 * Copyright (C) 2011 Meprolight, Ltd.
8 * Alex Gershgorin <alexg@meprolight.com>
9 *
10 * Modified from i.MX31 3-Stack Development System
11 *
Fabio Estevamaefa1c62009-06-02 17:24:16 -070012 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
Fabio Estevamaefa1c62009-06-02 17:24:16 -070021 */
22
Uwe Kleine-König767c38b2010-03-04 16:39:53 +010023/*
24 * This machine is known as:
25 * - i.MX35 3-Stack Development System
26 * - i.MX35 Platform Development Kit (i.MX35 PDK)
27 */
28
Fabio Estevamaefa1c62009-06-02 17:24:16 -070029#include <linux/types.h>
30#include <linux/init.h>
31#include <linux/platform_device.h>
32#include <linux/memory.h>
33#include <linux/gpio.h>
Fabio Estevam130a0dd2010-12-22 12:25:30 -020034#include <linux/usb/otg.h>
Fabio Estevamaefa1c62009-06-02 17:24:16 -070035
Marc Kleine-Budded17e1c12010-08-18 18:20:24 +020036#include <linux/mtd/physmap.h>
Alex Gershgorinc8349fb2012-03-29 10:12:45 +020037#include <linux/mfd/mc13892.h>
38#include <linux/regulator/machine.h>
Marc Kleine-Budded17e1c12010-08-18 18:20:24 +020039
Fabio Estevamaefa1c62009-06-02 17:24:16 -070040#include <asm/mach-types.h>
41#include <asm/mach/arch.h>
42#include <asm/mach/time.h>
43#include <asm/mach/map.h>
44
wu guoxing881e09f2012-03-14 10:10:54 +080045#include <video/platform_lcd.h>
Fabio Estevamaefa1c62009-06-02 17:24:16 -070046
Shawn Guo3ed0bcb2012-09-13 09:37:49 +080047#include "3ds_debugboard.h"
Shawn Guoe3372472012-09-13 21:01:00 +080048#include "common.h"
Uwe Kleine-König6eafde52010-06-23 11:49:34 +020049#include "devices-imx35.h"
Shawn Guo641dfe82014-05-19 20:41:52 +080050#include "ehci.h"
Shawn Guo50f2de62012-09-14 14:14:45 +080051#include "hardware.h"
Shawn Guo267dd342012-09-13 13:26:00 +080052#include "iomux-mx35.h"
Fabio Estevamaefa1c62009-06-02 17:24:16 -070053
wu guoxing881e09f2012-03-14 10:10:54 +080054#define GPIO_MC9S08DZ60_GPS_ENABLE 0
55#define GPIO_MC9S08DZ60_HDD_ENABLE 4
56#define GPIO_MC9S08DZ60_WIFI_ENABLE 5
57#define GPIO_MC9S08DZ60_LCD_ENABLE 6
58#define GPIO_MC9S08DZ60_SPEAKER_ENABLE 8
59
60static const struct fb_videomode fb_modedb[] = {
61 {
62 /* 800x480 @ 55 Hz */
63 .name = "Ceramate-CLAA070VC01",
64 .refresh = 55,
65 .xres = 800,
66 .yres = 480,
67 .pixclock = 40000,
68 .left_margin = 40,
69 .right_margin = 40,
70 .upper_margin = 5,
71 .lower_margin = 5,
72 .hsync_len = 20,
73 .vsync_len = 10,
74 .sync = FB_SYNC_OE_ACT_HIGH,
75 .vmode = FB_VMODE_NONINTERLACED,
76 .flag = 0,
77 },
78};
79
wu guoxing881e09f2012-03-14 10:10:54 +080080static struct mx3fb_platform_data mx3fb_pdata __initdata = {
81 .name = "Ceramate-CLAA070VC01",
82 .mode = fb_modedb,
83 .num_modes = ARRAY_SIZE(fb_modedb),
84};
85
86static struct i2c_board_info __initdata i2c_devices_3ds[] = {
87 {
88 I2C_BOARD_INFO("mc9s08dz60", 0x69),
89 },
90};
91
92static int lcd_power_gpio = -ENXIO;
93
Grant Likely3d0f7cf2012-05-17 13:54:40 -060094static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip, void *data)
wu guoxing881e09f2012-03-14 10:10:54 +080095{
96 return !strcmp(chip->label, data);
97}
98
99static void mx35_3ds_lcd_set_power(
100 struct plat_lcd_data *pd, unsigned int power)
101{
102 struct gpio_chip *chip;
103
104 if (!gpio_is_valid(lcd_power_gpio)) {
105 chip = gpiochip_find(
106 "mc9s08dz60", mc9s08dz60_gpiochip_match);
107 if (chip) {
108 lcd_power_gpio =
109 chip->base + GPIO_MC9S08DZ60_LCD_ENABLE;
110 if (gpio_request(lcd_power_gpio, "lcd_power") < 0) {
111 pr_err("error: gpio already requested!\n");
112 lcd_power_gpio = -ENXIO;
113 }
114 } else {
115 pr_err("error: didn't find mc9s08dz60 gpio chip\n");
116 }
117 }
118
119 if (gpio_is_valid(lcd_power_gpio))
120 gpio_set_value_cansleep(lcd_power_gpio, power);
121}
122
123static struct plat_lcd_data mx35_3ds_lcd_data = {
124 .set_power = mx35_3ds_lcd_set_power,
125};
126
127static struct platform_device mx35_3ds_lcd = {
128 .name = "platform-lcd",
129 .dev.platform_data = &mx35_3ds_lcd_data,
130};
131
Uwe Kleine-König6eafde52010-06-23 11:49:34 +0200132static const struct imxuart_platform_data uart_pdata __initconst = {
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700133 .flags = IMXUART_HAVE_RTSCTS,
134};
135
Marc Kleine-Budded17e1c12010-08-18 18:20:24 +0200136static struct physmap_flash_data mx35pdk_flash_data = {
137 .width = 2,
138};
139
140static struct resource mx35pdk_flash_resource = {
141 .start = MX35_CS0_BASE_ADDR,
142 .end = MX35_CS0_BASE_ADDR + SZ_64M - 1,
143 .flags = IORESOURCE_MEM,
144};
145
146static struct platform_device mx35pdk_flash = {
147 .name = "physmap-flash",
148 .id = 0,
149 .dev = {
150 .platform_data = &mx35pdk_flash_data,
151 },
152 .resource = &mx35pdk_flash_resource,
153 .num_resources = 1,
154};
155
Marc Kleine-Budde81aa1722010-08-18 18:22:59 +0200156static const struct mxc_nand_platform_data mx35pdk_nand_board_info __initconst = {
157 .width = 1,
158 .hw_ecc = 1,
159 .flash_bbt = 1,
160};
161
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700162static struct platform_device *devices[] __initdata = {
Marc Kleine-Budded17e1c12010-08-18 18:20:24 +0200163 &mx35pdk_flash,
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700164};
165
Uwe Kleine-König9fece9b2015-02-21 16:08:21 +0100166static const iomux_v3_cfg_t mx35pdk_pads[] __initconst = {
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700167 /* UART1 */
168 MX35_PAD_CTS1__UART1_CTS,
169 MX35_PAD_RTS1__UART1_RTS,
170 MX35_PAD_TXD1__UART1_TXD_MUX,
171 MX35_PAD_RXD1__UART1_RXD_MUX,
172 /* FEC */
173 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
174 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
175 MX35_PAD_FEC_RX_DV__FEC_RX_DV,
176 MX35_PAD_FEC_COL__FEC_COL,
177 MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
178 MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
179 MX35_PAD_FEC_TX_EN__FEC_TX_EN,
180 MX35_PAD_FEC_MDC__FEC_MDC,
181 MX35_PAD_FEC_MDIO__FEC_MDIO,
182 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
183 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
184 MX35_PAD_FEC_CRS__FEC_CRS,
185 MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
186 MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
187 MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
188 MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
189 MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
190 MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
Harro Haan9c2daf12009-11-27 11:44:36 +0100191 /* USBOTG */
192 MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR,
193 MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC,
Marc Kleine-Buddeab3d8b52010-08-18 18:26:42 +0200194 /* USBH1 */
195 MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR,
196 MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC,
Shawn Guo6207c832010-10-22 00:23:44 +0800197 /* SDCARD */
198 MX35_PAD_SD1_CMD__ESDHC1_CMD,
199 MX35_PAD_SD1_CLK__ESDHC1_CLK,
200 MX35_PAD_SD1_DATA0__ESDHC1_DAT0,
201 MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
202 MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
203 MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
Fabio Estevam352cd9a2011-03-01 16:59:44 -0300204 /* I2C1 */
205 MX35_PAD_I2C1_CLK__I2C1_SCL,
206 MX35_PAD_I2C1_DAT__I2C1_SDA,
wu guoxing881e09f2012-03-14 10:10:54 +0800207 /* Display */
208 MX35_PAD_LD0__IPU_DISPB_DAT_0,
209 MX35_PAD_LD1__IPU_DISPB_DAT_1,
210 MX35_PAD_LD2__IPU_DISPB_DAT_2,
211 MX35_PAD_LD3__IPU_DISPB_DAT_3,
212 MX35_PAD_LD4__IPU_DISPB_DAT_4,
213 MX35_PAD_LD5__IPU_DISPB_DAT_5,
214 MX35_PAD_LD6__IPU_DISPB_DAT_6,
215 MX35_PAD_LD7__IPU_DISPB_DAT_7,
216 MX35_PAD_LD8__IPU_DISPB_DAT_8,
217 MX35_PAD_LD9__IPU_DISPB_DAT_9,
218 MX35_PAD_LD10__IPU_DISPB_DAT_10,
219 MX35_PAD_LD11__IPU_DISPB_DAT_11,
220 MX35_PAD_LD12__IPU_DISPB_DAT_12,
221 MX35_PAD_LD13__IPU_DISPB_DAT_13,
222 MX35_PAD_LD14__IPU_DISPB_DAT_14,
223 MX35_PAD_LD15__IPU_DISPB_DAT_15,
224 MX35_PAD_LD16__IPU_DISPB_DAT_16,
225 MX35_PAD_LD17__IPU_DISPB_DAT_17,
226 MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC,
227 MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
228 MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
229 MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
230 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
231 MX35_PAD_D3_REV__IPU_DISPB_D3_REV,
232 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200233 /*PMIC IRQ*/
234 MX35_PAD_GPIO2_0__GPIO2_0,
Alex Gershgorin25af2d92012-03-13 17:05:29 +0200235};
236
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200237static struct regulator_consumer_supply sw1_consumers[] = {
238 {
239 .supply = "cpu_vcc",
240 }
241};
242
243static struct regulator_consumer_supply vcam_consumers[] = {
244 /* sgtl5000 */
245 REGULATOR_SUPPLY("VDDA", "0-000a"),
246};
247
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200248static struct regulator_init_data sw1_init = {
249 .constraints = {
250 .name = "SW1",
251 .min_uV = 600000,
252 .max_uV = 1375000,
253 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
254 .valid_modes_mask = 0,
255 .always_on = 1,
256 .boot_on = 1,
257 },
258 .num_consumer_supplies = ARRAY_SIZE(sw1_consumers),
259 .consumer_supplies = sw1_consumers,
260};
261
262static struct regulator_init_data sw2_init = {
263 .constraints = {
264 .name = "SW2",
265 .always_on = 1,
266 .boot_on = 1,
267 }
268};
269
270static struct regulator_init_data sw3_init = {
271 .constraints = {
272 .name = "SW3",
273 .always_on = 1,
274 .boot_on = 1,
275 }
276};
277
278static struct regulator_init_data sw4_init = {
279 .constraints = {
280 .name = "SW4",
281 .always_on = 1,
282 .boot_on = 1,
283 }
284};
285
286static struct regulator_init_data viohi_init = {
287 .constraints = {
288 .name = "VIOHI",
289 .boot_on = 1,
290 }
291};
292
293static struct regulator_init_data vusb_init = {
294 .constraints = {
295 .name = "VUSB",
296 .boot_on = 1,
297 }
298};
299
300static struct regulator_init_data vdig_init = {
301 .constraints = {
302 .name = "VDIG",
303 .boot_on = 1,
304 }
305};
306
307static struct regulator_init_data vpll_init = {
308 .constraints = {
309 .name = "VPLL",
310 .boot_on = 1,
311 }
312};
313
314static struct regulator_init_data vusb2_init = {
315 .constraints = {
316 .name = "VUSB2",
317 .boot_on = 1,
318 }
319};
320
321static struct regulator_init_data vvideo_init = {
322 .constraints = {
323 .name = "VVIDEO",
324 .boot_on = 1
325 }
326};
327
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200328static struct regulator_init_data vcam_init = {
329 .constraints = {
330 .name = "VCAM",
331 .min_uV = 2500000,
332 .max_uV = 3000000,
333 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
334 REGULATOR_CHANGE_MODE,
335 .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL,
336 .boot_on = 1
337 },
338 .num_consumer_supplies = ARRAY_SIZE(vcam_consumers),
339 .consumer_supplies = vcam_consumers,
340};
341
342static struct regulator_init_data vgen1_init = {
343 .constraints = {
344 .name = "VGEN1",
345 }
346};
347
348static struct regulator_init_data vgen2_init = {
349 .constraints = {
350 .name = "VGEN2",
351 .boot_on = 1,
352 }
353};
354
355static struct regulator_init_data vgen3_init = {
356 .constraints = {
357 .name = "VGEN3",
358 }
359};
360
361static struct mc13xxx_regulator_init_data mx35_3ds_regulators[] = {
362 { .id = MC13892_SW1, .init_data = &sw1_init },
363 { .id = MC13892_SW2, .init_data = &sw2_init },
364 { .id = MC13892_SW3, .init_data = &sw3_init },
365 { .id = MC13892_SW4, .init_data = &sw4_init },
366 { .id = MC13892_VIOHI, .init_data = &viohi_init },
367 { .id = MC13892_VPLL, .init_data = &vpll_init },
368 { .id = MC13892_VDIG, .init_data = &vdig_init },
369 { .id = MC13892_VUSB2, .init_data = &vusb2_init },
370 { .id = MC13892_VVIDEO, .init_data = &vvideo_init },
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200371 { .id = MC13892_VCAM, .init_data = &vcam_init },
372 { .id = MC13892_VGEN1, .init_data = &vgen1_init },
373 { .id = MC13892_VGEN2, .init_data = &vgen2_init },
374 { .id = MC13892_VGEN3, .init_data = &vgen3_init },
375 { .id = MC13892_VUSB, .init_data = &vusb_init },
376};
377
378static struct mc13xxx_platform_data mx35_3ds_mc13892_data = {
379 .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN,
380 .regulators = {
381 .num_regulators = ARRAY_SIZE(mx35_3ds_regulators),
382 .regulators = mx35_3ds_regulators,
383 },
384};
385
386#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
387
388static struct i2c_board_info mx35_3ds_i2c_mc13892 = {
389
390 I2C_BOARD_INFO("mc13892", 0x08),
391 .platform_data = &mx35_3ds_mc13892_data,
Shawn Guo84715dd2011-12-02 15:31:11 +0800392 /* irq number is run-time assigned */
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200393};
394
395static void __init imx35_3ds_init_mc13892(void)
396{
397 int ret = gpio_request_one(GPIO_PMIC_INT, GPIOF_DIR_IN, "pmic irq");
398
399 if (ret) {
400 pr_err("failed to get pmic irq: %d\n", ret);
401 return;
402 }
403
Shawn Guo84715dd2011-12-02 15:31:11 +0800404 mx35_3ds_i2c_mc13892.irq = gpio_to_irq(GPIO_PMIC_INT);
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200405 i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1);
406}
407
Sascha Hauer4bd597b2011-01-03 11:30:28 +0100408static int mx35_3ds_otg_init(struct platform_device *pdev)
409{
410 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
411}
412
Harro Haan9c2daf12009-11-27 11:44:36 +0100413/* OTG config */
Uwe Kleine-König9e1dde32010-11-12 16:40:06 +0100414static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = {
Harro Haan9c2daf12009-11-27 11:44:36 +0100415 .operating_mode = FSL_USB2_DR_DEVICE,
416 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
Fabio Estevam1a46cce82011-03-02 11:26:49 -0300417 .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
418/*
419 * ENGCM09152 also requires a hardware change.
420 * Please check the MX35 Chip Errata document for details.
421 */
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700422};
423
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200424static struct mxc_usbh_platform_data otg_pdata __initdata = {
Sascha Hauer4bd597b2011-01-03 11:30:28 +0100425 .init = mx35_3ds_otg_init,
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200426 .portsc = MXC_EHCI_MODE_UTMI,
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200427};
428
Sascha Hauer4bd597b2011-01-03 11:30:28 +0100429static int mx35_3ds_usbh_init(struct platform_device *pdev)
430{
431 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
432 MXC_EHCI_INTERNAL_PHY);
433}
434
Marc Kleine-Buddeab3d8b52010-08-18 18:26:42 +0200435/* USB HOST config */
Uwe Kleine-König2d58de22010-11-15 11:57:49 +0100436static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
Sascha Hauer4bd597b2011-01-03 11:30:28 +0100437 .init = mx35_3ds_usbh_init,
Marc Kleine-Buddeab3d8b52010-08-18 18:26:42 +0200438 .portsc = MXC_EHCI_MODE_SERIAL,
Marc Kleine-Buddeab3d8b52010-08-18 18:26:42 +0200439};
440
Benoît Thébaudeau33a264d2012-06-12 19:46:43 +0200441static bool otg_mode_host __initdata;
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200442
443static int __init mx35_3ds_otg_mode(char *options)
444{
445 if (!strcmp(options, "host"))
Benoît Thébaudeau33a264d2012-06-12 19:46:43 +0200446 otg_mode_host = true;
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200447 else if (!strcmp(options, "device"))
Benoît Thébaudeau33a264d2012-06-12 19:46:43 +0200448 otg_mode_host = false;
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200449 else
450 pr_info("otg_mode neither \"host\" nor \"device\". "
451 "Defaulting to device\n");
Benoît Thébaudeau33a264d2012-06-12 19:46:43 +0200452 return 1;
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200453}
454__setup("otg_mode=", mx35_3ds_otg_mode);
455
Fabio Estevam352cd9a2011-03-01 16:59:44 -0300456static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = {
457 .bitrate = 100000,
458};
459
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700460/*
461 * Board specific initialization.
462 */
Uwe Kleine-Könige134fb22011-02-11 10:23:19 +0100463static void __init mx35_3ds_init(void)
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700464{
Shawn Guob78d8e52011-06-06 00:07:55 +0800465 imx35_soc_init();
466
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700467 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
468
Uwe Kleine-König6bd96f32010-10-06 12:00:18 +0200469 imx35_add_fec(NULL);
Benoît Thébaudeaubec31a82012-07-04 16:35:54 +0200470 imx35_add_imx2_wdt();
Benoît Thébaudeauc6fd6d12012-07-04 16:36:28 +0200471 imx35_add_mxc_rtc();
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700472 platform_add_devices(devices, ARRAY_SIZE(devices));
473
Uwe Kleine-König6eafde52010-06-23 11:49:34 +0200474 imx35_add_imx_uart0(&uart_pdata);
Harro Haan9c2daf12009-11-27 11:44:36 +0100475
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200476 if (otg_mode_host)
477 imx35_add_mxc_ehci_otg(&otg_pdata);
Marc Kleine-Budde81aa1722010-08-18 18:22:59 +0200478
Uwe Kleine-König2d58de22010-11-15 11:57:49 +0100479 imx35_add_mxc_ehci_hs(&usb_host_pdata);
Marc Kleine-Buddeab3d8b52010-08-18 18:26:42 +0200480
Fabio Estevam130a0dd2010-12-22 12:25:30 -0200481 if (!otg_mode_host)
482 imx35_add_fsl_usb2_udc(&usb_otg_pdata);
483
Marc Kleine-Budde81aa1722010-08-18 18:22:59 +0200484 imx35_add_mxc_nand(&mx35pdk_nand_board_info);
Uwe Kleine-König124bf942010-11-19 21:03:33 +0100485 imx35_add_sdhci_esdhc_imx(0, NULL);
Xiao Jiang2c6605d2010-10-21 16:15:50 +0800486
Fabio Estevam352cd9a2011-03-01 16:59:44 -0300487 imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);
wu guoxing881e09f2012-03-14 10:10:54 +0800488
489 i2c_register_board_info(
490 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds));
491
Shawn Guo88289c82012-06-13 14:07:31 +0800492 imx35_add_ipu_core();
Vladimir Zapolskiyc2171472016-09-19 04:37:25 +0300493}
494
495static void __init mx35_3ds_late_init(void)
496{
497 struct platform_device *imx35_fb_pdev;
498
499 if (mxc_expio_init(MX35_CS5_BASE_ADDR, IMX_GPIO_NR(1, 1)))
500 pr_warn("Init of the debugboard failed, all "
501 "devices on the debugboard are unusable.\n");
Alex Gershgorin25af2d92012-03-13 17:05:29 +0200502
wu guoxing881e09f2012-03-14 10:10:54 +0800503 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata);
504 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev;
505 platform_device_register(&mx35_3ds_lcd);
Alex Gershgorinc8349fb2012-03-29 10:12:45 +0200506
507 imx35_3ds_init_mc13892();
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700508}
509
510static void __init mx35pdk_timer_init(void)
511{
512 mx35_clocks_init();
513}
514
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700515MACHINE_START(MX35_3DS, "Freescale MX35PDK")
516 /* Maintainer: Freescale Semiconductor, Inc */
Nicolas Pitredc8f1902011-07-05 22:38:12 -0400517 .atag_offset = 0x100,
Uwe Kleine-König97976e22011-02-07 16:35:20 +0100518 .map_io = mx35_map_io,
519 .init_early = imx35_init_early,
520 .init_irq = mx35_init_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700521 .init_time = mx35pdk_timer_init,
Uwe Kleine-Könige134fb22011-02-11 10:23:19 +0100522 .init_machine = mx35_3ds_init,
Vladimir Zapolskiyc2171472016-09-19 04:37:25 +0300523 .init_late = mx35_3ds_late_init,
Russell King65ea7882011-11-06 17:12:08 +0000524 .restart = mxc_restart,
Fabio Estevamaefa1c62009-06-02 17:24:16 -0700525MACHINE_END