]> Git Repo - linux.git/blob - arch/arm/mach-imx/mach-mx31moboard.c
enetc: Migrate to PHYLINK and PCS_LYNX
[linux.git] / arch / arm / mach-imx / mach-mx31moboard.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  *  Copyright (C) 2008 Valentin Longchamp, EPFL Mobots group
4  */
5
6 #include <linux/delay.h>
7 #include <linux/dma-mapping.h>
8 #include <linux/gfp.h>
9 #include <linux/gpio.h>
10 #include <linux/init.h>
11 #include <linux/interrupt.h>
12 #include <linux/moduleparam.h>
13 #include <linux/leds.h>
14 #include <linux/memory.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/mtd/partitions.h>
17 #include <linux/platform_device.h>
18 #include <linux/regulator/machine.h>
19 #include <linux/mfd/mc13783.h>
20 #include <linux/spi/spi.h>
21 #include <linux/types.h>
22 #include <linux/memblock.h>
23 #include <linux/clk.h>
24 #include <linux/io.h>
25 #include <linux/err.h>
26 #include <linux/input.h>
27
28 #include <linux/usb/otg.h>
29 #include <linux/usb/ulpi.h>
30
31 #include <asm/mach-types.h>
32 #include <asm/mach/arch.h>
33 #include <asm/mach/time.h>
34 #include <asm/mach/map.h>
35 #include <asm/memblock.h>
36 #include <linux/platform_data/asoc-imx-ssi.h>
37
38 #include "board-mx31moboard.h"
39 #include "common.h"
40 #include "devices-imx31.h"
41 #include "ehci.h"
42 #include "hardware.h"
43 #include "iomux-mx3.h"
44 #include "ulpi.h"
45
46 static unsigned int moboard_pins[] = {
47         /* UART0 */
48         MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
49         MX31_PIN_CTS1__GPIO2_7,
50         /* UART4 */
51         MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
52         MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
53         /* I2C0 */
54         MX31_PIN_I2C_DAT__I2C1_SDA, MX31_PIN_I2C_CLK__I2C1_SCL,
55         /* I2C1 */
56         MX31_PIN_DCD_DTE1__I2C2_SDA, MX31_PIN_RI_DTE1__I2C2_SCL,
57         /* SDHC1 */
58         MX31_PIN_SD1_DATA3__SD1_DATA3, MX31_PIN_SD1_DATA2__SD1_DATA2,
59         MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0,
60         MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD,
61         MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27,
62         /* USB reset */
63         MX31_PIN_GPIO1_0__GPIO1_0,
64         /* USB OTG */
65         MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
66         MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
67         MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
68         MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
69         MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
70         MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
71         MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
72         MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
73         MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
74         MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
75         MX31_PIN_USB_OC__GPIO1_30,
76         /* USB H2 */
77         MX31_PIN_USBH2_DATA0__USBH2_DATA0,
78         MX31_PIN_USBH2_DATA1__USBH2_DATA1,
79         MX31_PIN_STXD3__USBH2_DATA2, MX31_PIN_SRXD3__USBH2_DATA3,
80         MX31_PIN_SCK3__USBH2_DATA4, MX31_PIN_SFS3__USBH2_DATA5,
81         MX31_PIN_STXD6__USBH2_DATA6, MX31_PIN_SRXD6__USBH2_DATA7,
82         MX31_PIN_USBH2_CLK__USBH2_CLK, MX31_PIN_USBH2_DIR__USBH2_DIR,
83         MX31_PIN_USBH2_NXT__USBH2_NXT, MX31_PIN_USBH2_STP__USBH2_STP,
84         MX31_PIN_SCK6__GPIO1_25,
85         /* LEDs */
86         MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1,
87         MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3,
88         /* SPI1 */
89         MX31_PIN_CSPI2_MOSI__MOSI, MX31_PIN_CSPI2_MISO__MISO,
90         MX31_PIN_CSPI2_SCLK__SCLK, MX31_PIN_CSPI2_SPI_RDY__SPI_RDY,
91         MX31_PIN_CSPI2_SS0__SS0, MX31_PIN_CSPI2_SS2__SS2,
92         /* Atlas IRQ */
93         MX31_PIN_GPIO1_3__GPIO1_3,
94         /* SPI2 */
95         MX31_PIN_CSPI3_MOSI__MOSI, MX31_PIN_CSPI3_MISO__MISO,
96         MX31_PIN_CSPI3_SCLK__SCLK, MX31_PIN_CSPI3_SPI_RDY__SPI_RDY,
97         MX31_PIN_CSPI2_SS1__CSPI3_SS1,
98         /* SSI */
99         MX31_PIN_STXD4__STXD4, MX31_PIN_SRXD4__SRXD4,
100         MX31_PIN_SCK4__SCK4, MX31_PIN_SFS4__SFS4,
101 };
102
103 static struct physmap_flash_data mx31moboard_flash_data = {
104         .width  = 2,
105 };
106
107 static struct resource mx31moboard_flash_resource = {
108         .start  = 0xa0000000,
109         .end    = 0xa1ffffff,
110         .flags  = IORESOURCE_MEM,
111 };
112
113 static struct platform_device mx31moboard_flash = {
114         .name   = "physmap-flash",
115         .id     = 0,
116         .dev    = {
117                 .platform_data  = &mx31moboard_flash_data,
118         },
119         .resource = &mx31moboard_flash_resource,
120         .num_resources = 1,
121 };
122
123 static void __init moboard_uart0_init(void)
124 {
125         if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack")) {
126                 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0);
127                 gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1));
128         }
129 }
130
131 static const struct imxuart_platform_data uart0_pdata __initconst = {
132 };
133
134 static const struct imxuart_platform_data uart4_pdata __initconst = {
135         .flags = IMXUART_HAVE_RTSCTS,
136 };
137
138 static const struct imxi2c_platform_data moboard_i2c0_data __initconst = {
139         .bitrate = 400000,
140 };
141
142 static const struct imxi2c_platform_data moboard_i2c1_data __initconst = {
143         .bitrate = 100000,
144 };
145
146 static struct regulator_consumer_supply sdhc_consumers[] = {
147         {
148                 .dev_name = "imx31-mmc.0",
149                 .supply = "sdhc0_vcc",
150         },
151         {
152                 .dev_name = "imx31-mmc.1",
153                 .supply = "sdhc1_vcc",
154         },
155 };
156
157 static struct regulator_init_data sdhc_vreg_data = {
158         .constraints = {
159                 .min_uV = 2700000,
160                 .max_uV = 3000000,
161                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
162                         REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
163                 .valid_modes_mask = REGULATOR_MODE_NORMAL |
164                         REGULATOR_MODE_FAST,
165                 .always_on = 0,
166                 .boot_on = 1,
167         },
168         .num_consumer_supplies = ARRAY_SIZE(sdhc_consumers),
169         .consumer_supplies = sdhc_consumers,
170 };
171
172 static struct regulator_consumer_supply cam_consumers[] = {
173         {
174                 .dev_name = "mx3_camera.0",
175                 .supply = "cam_vcc",
176         },
177 };
178
179 static struct regulator_init_data cam_vreg_data = {
180         .constraints = {
181                 .min_uV = 2700000,
182                 .max_uV = 3000000,
183                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
184                         REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
185                 .valid_modes_mask = REGULATOR_MODE_NORMAL |
186                         REGULATOR_MODE_FAST,
187                 .always_on = 0,
188                 .boot_on = 1,
189         },
190         .num_consumer_supplies = ARRAY_SIZE(cam_consumers),
191         .consumer_supplies = cam_consumers,
192 };
193
194 static struct mc13xxx_regulator_init_data moboard_regulators[] = {
195         {
196                 .id = MC13783_REG_VMMC1,
197                 .init_data = &sdhc_vreg_data,
198         },
199         {
200                 .id = MC13783_REG_VCAM,
201                 .init_data = &cam_vreg_data,
202         },
203 };
204
205 static struct mc13xxx_led_platform_data moboard_led[] = {
206         {
207                 .id = MC13783_LED_R1,
208                 .name = "coreboard-led-4:red",
209         },
210         {
211                 .id = MC13783_LED_G1,
212                 .name = "coreboard-led-4:green",
213         },
214         {
215                 .id = MC13783_LED_B1,
216                 .name = "coreboard-led-4:blue",
217         },
218         {
219                 .id = MC13783_LED_R2,
220                 .name = "coreboard-led-5:red",
221         },
222         {
223                 .id = MC13783_LED_G2,
224                 .name = "coreboard-led-5:green",
225         },
226         {
227                 .id = MC13783_LED_B2,
228                 .name = "coreboard-led-5:blue",
229         },
230 };
231
232 static struct mc13xxx_leds_platform_data moboard_leds = {
233         .num_leds = ARRAY_SIZE(moboard_led),
234         .led = moboard_led,
235         .led_control[0] = MC13783_LED_C0_ENABLE | MC13783_LED_C0_ABMODE(0),
236         .led_control[1] = MC13783_LED_C1_SLEWLIM,
237         .led_control[2] = MC13783_LED_C2_SLEWLIM,
238         .led_control[3] = MC13783_LED_C3_PERIOD(0) |
239                           MC13783_LED_C3_CURRENT_R1(2) |
240                           MC13783_LED_C3_CURRENT_G1(2) |
241                           MC13783_LED_C3_CURRENT_B1(2),
242         .led_control[4] = MC13783_LED_C4_PERIOD(0) |
243                           MC13783_LED_C4_CURRENT_R2(3) |
244                           MC13783_LED_C4_CURRENT_G2(3) |
245                           MC13783_LED_C4_CURRENT_B2(3),
246 };
247
248 static struct mc13xxx_buttons_platform_data moboard_buttons = {
249         .b1on_flags = MC13783_BUTTON_DBNC_750MS | MC13783_BUTTON_ENABLE |
250                         MC13783_BUTTON_POL_INVERT,
251         .b1on_key = KEY_POWER,
252 };
253
254 static struct mc13xxx_codec_platform_data moboard_codec = {
255         .dac_ssi_port = MC13783_SSI1_PORT,
256         .adc_ssi_port = MC13783_SSI1_PORT,
257 };
258
259 static struct mc13xxx_platform_data moboard_pmic = {
260         .regulators = {
261                 .regulators = moboard_regulators,
262                 .num_regulators = ARRAY_SIZE(moboard_regulators),
263         },
264         .leds = &moboard_leds,
265         .buttons = &moboard_buttons,
266         .codec = &moboard_codec,
267         .flags = MC13XXX_USE_RTC | MC13XXX_USE_ADC | MC13XXX_USE_CODEC,
268 };
269
270 static struct imx_ssi_platform_data moboard_ssi_pdata = {
271         .flags = IMX_SSI_DMA | IMX_SSI_NET,
272 };
273
274 static struct spi_board_info moboard_spi_board_info[] __initdata = {
275         {
276                 .modalias = "mc13783",
277                 /* irq number is run-time assigned */
278                 .max_speed_hz = 300000,
279                 .bus_num = 1,
280                 .chip_select = 0,
281                 .platform_data = &moboard_pmic,
282                 .mode = SPI_CS_HIGH,
283         },
284 };
285
286 #define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0)
287 #define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1)
288
289 static int moboard_sdhc1_get_ro(struct device *dev)
290 {
291         return !gpio_get_value(SDHC1_WP);
292 }
293
294 static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
295                 void *data)
296 {
297         int ret;
298
299         ret = gpio_request(SDHC1_CD, "sdhc-detect");
300         if (ret)
301                 return ret;
302
303         gpio_direction_input(SDHC1_CD);
304
305         ret = gpio_request(SDHC1_WP, "sdhc-wp");
306         if (ret)
307                 goto err_gpio_free;
308         gpio_direction_input(SDHC1_WP);
309
310         ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq,
311                 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
312                 "sdhc1-card-detect", data);
313         if (ret)
314                 goto err_gpio_free_2;
315
316         return 0;
317
318 err_gpio_free_2:
319         gpio_free(SDHC1_WP);
320 err_gpio_free:
321         gpio_free(SDHC1_CD);
322
323         return ret;
324 }
325
326 static void moboard_sdhc1_exit(struct device *dev, void *data)
327 {
328         free_irq(gpio_to_irq(SDHC1_CD), data);
329         gpio_free(SDHC1_WP);
330         gpio_free(SDHC1_CD);
331 }
332
333 static const struct imxmmc_platform_data sdhc1_pdata __initconst = {
334         .get_ro = moboard_sdhc1_get_ro,
335         .init   = moboard_sdhc1_init,
336         .exit   = moboard_sdhc1_exit,
337 };
338
339 /*
340  * this pin is dedicated for all mx31moboard systems, so we do it here
341  */
342 #define USB_RESET_B     IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)
343 #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
344                       PAD_CTL_ODE_CMOS)
345
346 #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
347 #define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6)
348
349 static void usb_xcvr_reset(void)
350 {
351         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG | PAD_CTL_100K_PD);
352         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG | PAD_CTL_100K_PD);
353         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG | PAD_CTL_100K_PD);
354         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG | PAD_CTL_100K_PD);
355         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG | PAD_CTL_100K_PD);
356         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG | PAD_CTL_100K_PD);
357         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG | PAD_CTL_100K_PD);
358         mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG | PAD_CTL_100K_PD);
359         mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG | PAD_CTL_100K_PU);
360         mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG | PAD_CTL_100K_PU);
361         mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG | PAD_CTL_100K_PU);
362         mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG | PAD_CTL_100K_PU);
363
364         mxc_iomux_set_gpr(MUX_PGP_UH2, true);
365         mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG | PAD_CTL_100K_PU);
366         mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG | PAD_CTL_100K_PU);
367         mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG | PAD_CTL_100K_PU);
368         mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG | PAD_CTL_100K_PU);
369         mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG | PAD_CTL_100K_PD);
370         mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG | PAD_CTL_100K_PD);
371         mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG | PAD_CTL_100K_PD);
372         mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG | PAD_CTL_100K_PD);
373         mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG | PAD_CTL_100K_PD);
374         mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG | PAD_CTL_100K_PD);
375         mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG | PAD_CTL_100K_PD);
376         mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG | PAD_CTL_100K_PD);
377
378         gpio_request(OTG_EN_B, "usb-udc-en");
379         gpio_direction_output(OTG_EN_B, 0);
380         gpio_request(USBH2_EN_B, "usbh2-en");
381         gpio_direction_output(USBH2_EN_B, 0);
382
383         gpio_request(USB_RESET_B, "usb-reset");
384         gpio_direction_output(USB_RESET_B, 0);
385         mdelay(1);
386         gpio_set_value(USB_RESET_B, 1);
387         mdelay(1);
388 }
389
390 static int moboard_usbh2_init_hw(struct platform_device *pdev)
391 {
392         return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
393 }
394
395 static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
396         .init   = moboard_usbh2_init_hw,
397         .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
398 };
399
400 static int __init moboard_usbh2_init(void)
401 {
402         struct platform_device *pdev;
403
404         usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
405                         ULPI_OTG_DRVVBUS_EXT);
406         if (!usbh2_pdata.otg)
407                 return -ENODEV;
408
409         pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
410
411         return PTR_ERR_OR_ZERO(pdev);
412 }
413
414 static const struct gpio_led mx31moboard_leds[] __initconst = {
415         {
416                 .name   = "coreboard-led-0:red:running",
417                 .default_trigger = "heartbeat",
418                 .gpio   = IOMUX_TO_GPIO(MX31_PIN_SVEN0),
419         }, {
420                 .name   = "coreboard-led-1:red",
421                 .gpio   = IOMUX_TO_GPIO(MX31_PIN_STX0),
422         }, {
423                 .name   = "coreboard-led-2:red",
424                 .gpio   = IOMUX_TO_GPIO(MX31_PIN_SRX0),
425         }, {
426                 .name   = "coreboard-led-3:red",
427                 .gpio   = IOMUX_TO_GPIO(MX31_PIN_SIMPD0),
428         },
429 };
430
431 static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = {
432         .num_leds       = ARRAY_SIZE(mx31moboard_leds),
433         .leds           = mx31moboard_leds,
434 };
435
436 static struct platform_device *devices[] __initdata = {
437         &mx31moboard_flash,
438 };
439
440 static struct mx3_camera_pdata camera_pdata __initdata = {
441         .flags          = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
442         .mclk_10khz     = 4800,
443 };
444
445 static phys_addr_t mx3_camera_base __initdata;
446 #define MX3_CAMERA_BUF_SIZE SZ_4M
447
448 static int __init mx31moboard_init_cam(void)
449 {
450         int ret;
451         struct platform_device *pdev;
452
453         imx31_add_ipu_core();
454
455         pdev = imx31_alloc_mx3_camera(&camera_pdata);
456         if (IS_ERR(pdev))
457                 return PTR_ERR(pdev);
458
459         ret = dma_declare_coherent_memory(&pdev->dev,
460                                           mx3_camera_base, mx3_camera_base,
461                                           MX3_CAMERA_BUF_SIZE);
462         if (ret)
463                 goto err;
464
465         ret = platform_device_add(pdev);
466         if (ret)
467 err:
468                 platform_device_put(pdev);
469
470         return ret;
471
472 }
473
474 static void mx31moboard_poweroff(void)
475 {
476         struct clk *clk = clk_get_sys("imx2-wdt.0", NULL);
477
478         if (!IS_ERR(clk))
479                 clk_prepare_enable(clk);
480
481         mxc_iomux_mode(MX31_PIN_WATCHDOG_RST__WATCHDOG_RST);
482
483         imx_writew(1 << 6 | 1 << 2, MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
484 }
485
486 static int mx31moboard_baseboard;
487 core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
488
489 /*
490  * Board specific initialization.
491  */
492 static void __init mx31moboard_init(void)
493 {
494         imx31_soc_init();
495
496         mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins),
497                 "moboard");
498
499         platform_add_devices(devices, ARRAY_SIZE(devices));
500
501         imx31_add_imx2_wdt();
502
503         imx31_add_imx_uart0(&uart0_pdata);
504         imx31_add_imx_uart4(&uart4_pdata);
505
506         imx31_add_imx_i2c0(&moboard_i2c0_data);
507         imx31_add_imx_i2c1(&moboard_i2c1_data);
508
509         imx31_add_spi_imx1(NULL);
510         imx31_add_spi_imx2(NULL);
511
512         mx31moboard_init_cam();
513
514         imx31_add_imx_ssi(0, &moboard_ssi_pdata);
515
516         pm_power_off = mx31moboard_poweroff;
517 }
518
519 static void __init mx31moboard_late(void)
520 {
521         gpio_led_register_device(-1, &mx31moboard_led_pdata);
522
523         moboard_uart0_init();
524
525         gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq");
526         gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
527         moboard_spi_board_info[0].irq =
528                         gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
529         spi_register_board_info(moboard_spi_board_info,
530                 ARRAY_SIZE(moboard_spi_board_info));
531
532         imx31_add_mxc_mmc(0, &sdhc1_pdata);
533
534         usb_xcvr_reset();
535         moboard_usbh2_init();
536
537         imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
538
539         switch (mx31moboard_baseboard) {
540         case MX31NOBOARD:
541                 break;
542         case MX31DEVBOARD:
543                 mx31moboard_devboard_init();
544                 break;
545         case MX31MARXBOT:
546                 mx31moboard_marxbot_init();
547                 break;
548         case MX31SMARTBOT:
549         case MX31EYEBOT:
550                 mx31moboard_smartbot_init(mx31moboard_baseboard);
551                 break;
552         default:
553                 printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n",
554                         mx31moboard_baseboard);
555         }
556 }
557
558 static void __init mx31moboard_timer_init(void)
559 {
560         mx31_clocks_init(26000000);
561 }
562
563 static void __init mx31moboard_reserve(void)
564 {
565         /* reserve 4 MiB for mx3-camera */
566         mx3_camera_base = arm_memblock_steal(MX3_CAMERA_BUF_SIZE,
567                         MX3_CAMERA_BUF_SIZE);
568 }
569
570 MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
571         /* Maintainer: Philippe Retornaz, EPFL Mobots group */
572         .atag_offset = 0x100,
573         .reserve = mx31moboard_reserve,
574         .map_io = mx31_map_io,
575         .init_early = imx31_init_early,
576         .init_irq = mx31_init_irq,
577         .init_time      = mx31moboard_timer_init,
578         .init_machine = mx31moboard_init,
579         .init_late      = mx31moboard_late,
580         .restart        = mxc_restart,
581 MACHINE_END
This page took 0.064982 seconds and 4 git commands to generate.