Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[sfrench/cifs-2.6.git] / arch / sh / boards / mach-ecovec24 / setup.c
1 /*
2  * Copyright (C) 2009 Renesas Solutions Corp.
3  *
4  * Kuninori Morimoto <morimoto.kuninori@renesas.com>
5  *
6  * This file is subject to the terms and conditions of the GNU General Public
7  * License.  See the file "COPYING" in the main directory of this archive
8  * for more details.
9  */
10
11 #include <linux/init.h>
12 #include <linux/device.h>
13 #include <linux/platform_device.h>
14 #include <linux/mfd/sh_mobile_sdhi.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/gpio.h>
17 #include <linux/interrupt.h>
18 #include <linux/io.h>
19 #include <linux/delay.h>
20 #include <linux/usb/r8a66597.h>
21 #include <linux/i2c.h>
22 #include <linux/i2c/tsc2007.h>
23 #include <linux/spi/spi.h>
24 #include <linux/spi/sh_msiof.h>
25 #include <linux/spi/mmc_spi.h>
26 #include <linux/mmc/host.h>
27 #include <linux/input.h>
28 #include <linux/input/sh_keysc.h>
29 #include <linux/mfd/sh_mobile_sdhi.h>
30 #include <video/sh_mobile_lcdc.h>
31 #include <sound/sh_fsi.h>
32 #include <media/sh_mobile_ceu.h>
33 #include <media/tw9910.h>
34 #include <media/mt9t112.h>
35 #include <asm/heartbeat.h>
36 #include <asm/sh_eth.h>
37 #include <asm/clock.h>
38 #include <asm/suspend.h>
39 #include <cpu/sh7724.h>
40
41 /*
42  *  Address      Interface        BusWidth
43  *-----------------------------------------
44  *  0x0000_0000  uboot            16bit
45  *  0x0004_0000  Linux romImage   16bit
46  *  0x0014_0000  MTD for Linux    16bit
47  *  0x0400_0000  Internal I/O     16/32bit
48  *  0x0800_0000  DRAM             32bit
49  *  0x1800_0000  MFI              16bit
50  */
51
52 /* SWITCH
53  *------------------------------
54  * DS2[1] = FlashROM write protect  ON     : write protect
55  *                                  OFF    : No write protect
56  * DS2[2] = RMII / TS, SCIF         ON     : RMII
57  *                                  OFF    : TS, SCIF3
58  * DS2[3] = Camera / Video          ON     : Camera
59  *                                  OFF    : NTSC/PAL (IN)
60  * DS2[5] = NTSC_OUT Clock          ON     : On board OSC
61  *                                  OFF    : SH7724 DV_CLK
62  * DS2[6-7] = MMC / SD              ON-OFF : SD
63  *                                  OFF-ON : MMC
64  */
65
66 /* Heartbeat */
67 static unsigned char led_pos[] = { 0, 1, 2, 3 };
68
69 static struct heartbeat_data heartbeat_data = {
70         .nr_bits = 4,
71         .bit_pos = led_pos,
72 };
73
74 static struct resource heartbeat_resource = {
75         .start  = 0xA405012C, /* PTG */
76         .end    = 0xA405012E - 1,
77         .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
78 };
79
80 static struct platform_device heartbeat_device = {
81         .name           = "heartbeat",
82         .id             = -1,
83         .dev = {
84                 .platform_data = &heartbeat_data,
85         },
86         .num_resources  = 1,
87         .resource       = &heartbeat_resource,
88 };
89
90 /* MTD */
91 static struct mtd_partition nor_flash_partitions[] = {
92         {
93                 .name = "boot loader",
94                 .offset = 0,
95                 .size = (5 * 1024 * 1024),
96                 .mask_flags = MTD_WRITEABLE,  /* force read-only */
97         }, {
98                 .name = "free-area",
99                 .offset = MTDPART_OFS_APPEND,
100                 .size = MTDPART_SIZ_FULL,
101         },
102 };
103
104 static struct physmap_flash_data nor_flash_data = {
105         .width          = 2,
106         .parts          = nor_flash_partitions,
107         .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
108 };
109
110 static struct resource nor_flash_resources[] = {
111         [0] = {
112                 .name   = "NOR Flash",
113                 .start  = 0x00000000,
114                 .end    = 0x03ffffff,
115                 .flags  = IORESOURCE_MEM,
116         }
117 };
118
119 static struct platform_device nor_flash_device = {
120         .name           = "physmap-flash",
121         .resource       = nor_flash_resources,
122         .num_resources  = ARRAY_SIZE(nor_flash_resources),
123         .dev            = {
124                 .platform_data = &nor_flash_data,
125         },
126 };
127
128 /* SH Eth */
129 #define SH_ETH_ADDR     (0xA4600000)
130 static struct resource sh_eth_resources[] = {
131         [0] = {
132                 .start = SH_ETH_ADDR,
133                 .end   = SH_ETH_ADDR + 0x1FC,
134                 .flags = IORESOURCE_MEM,
135         },
136         [1] = {
137                 .start = 91,
138                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
139         },
140 };
141
142 struct sh_eth_plat_data sh_eth_plat = {
143         .phy = 0x1f, /* SMSC LAN8700 */
144         .edmac_endian = EDMAC_LITTLE_ENDIAN,
145         .ether_link_active_low = 1
146 };
147
148 static struct platform_device sh_eth_device = {
149         .name = "sh-eth",
150         .id     = 0,
151         .dev = {
152                 .platform_data = &sh_eth_plat,
153         },
154         .num_resources = ARRAY_SIZE(sh_eth_resources),
155         .resource = sh_eth_resources,
156         .archdata = {
157                 .hwblk_id = HWBLK_ETHER,
158         },
159 };
160
161 /* USB0 host */
162 void usb0_port_power(int port, int power)
163 {
164         gpio_set_value(GPIO_PTB4, power);
165 }
166
167 static struct r8a66597_platdata usb0_host_data = {
168         .on_chip = 1,
169         .port_power = usb0_port_power,
170 };
171
172 static struct resource usb0_host_resources[] = {
173         [0] = {
174                 .start  = 0xa4d80000,
175                 .end    = 0xa4d80124 - 1,
176                 .flags  = IORESOURCE_MEM,
177         },
178         [1] = {
179                 .start  = 65,
180                 .end    = 65,
181                 .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
182         },
183 };
184
185 static struct platform_device usb0_host_device = {
186         .name           = "r8a66597_hcd",
187         .id             = 0,
188         .dev = {
189                 .dma_mask               = NULL,         /*  not use dma */
190                 .coherent_dma_mask      = 0xffffffff,
191                 .platform_data          = &usb0_host_data,
192         },
193         .num_resources  = ARRAY_SIZE(usb0_host_resources),
194         .resource       = usb0_host_resources,
195 };
196
197 /* USB1 host/function */
198 void usb1_port_power(int port, int power)
199 {
200         gpio_set_value(GPIO_PTB5, power);
201 }
202
203 static struct r8a66597_platdata usb1_common_data = {
204         .on_chip = 1,
205         .port_power = usb1_port_power,
206 };
207
208 static struct resource usb1_common_resources[] = {
209         [0] = {
210                 .start  = 0xa4d90000,
211                 .end    = 0xa4d90124 - 1,
212                 .flags  = IORESOURCE_MEM,
213         },
214         [1] = {
215                 .start  = 66,
216                 .end    = 66,
217                 .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
218         },
219 };
220
221 static struct platform_device usb1_common_device = {
222         /* .name will be added in arch_setup */
223         .id             = 1,
224         .dev = {
225                 .dma_mask               = NULL,         /*  not use dma */
226                 .coherent_dma_mask      = 0xffffffff,
227                 .platform_data          = &usb1_common_data,
228         },
229         .num_resources  = ARRAY_SIZE(usb1_common_resources),
230         .resource       = usb1_common_resources,
231 };
232
233 /* LCDC */
234 static struct sh_mobile_lcdc_info lcdc_info = {
235         .ch[0] = {
236                 .interface_type = RGB18,
237                 .chan = LCDC_CHAN_MAINLCD,
238                 .bpp = 16,
239                 .lcd_cfg = {
240                         .sync = 0, /* hsync and vsync are active low */
241                 },
242                 .lcd_size_cfg = { /* 7.0 inch */
243                         .width = 152,
244                         .height = 91,
245                 },
246                 .board_cfg = {
247                 },
248         }
249 };
250
251 static struct resource lcdc_resources[] = {
252         [0] = {
253                 .name   = "LCDC",
254                 .start  = 0xfe940000,
255                 .end    = 0xfe942fff,
256                 .flags  = IORESOURCE_MEM,
257         },
258         [1] = {
259                 .start  = 106,
260                 .flags  = IORESOURCE_IRQ,
261         },
262 };
263
264 static struct platform_device lcdc_device = {
265         .name           = "sh_mobile_lcdc_fb",
266         .num_resources  = ARRAY_SIZE(lcdc_resources),
267         .resource       = lcdc_resources,
268         .dev            = {
269                 .platform_data  = &lcdc_info,
270         },
271         .archdata = {
272                 .hwblk_id = HWBLK_LCDC,
273         },
274 };
275
276 /* CEU0 */
277 static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
278         .flags = SH_CEU_FLAG_USE_8BIT_BUS,
279 };
280
281 static struct resource ceu0_resources[] = {
282         [0] = {
283                 .name   = "CEU0",
284                 .start  = 0xfe910000,
285                 .end    = 0xfe91009f,
286                 .flags  = IORESOURCE_MEM,
287         },
288         [1] = {
289                 .start  = 52,
290                 .flags  = IORESOURCE_IRQ,
291         },
292         [2] = {
293                 /* place holder for contiguous memory */
294         },
295 };
296
297 static struct platform_device ceu0_device = {
298         .name           = "sh_mobile_ceu",
299         .id             = 0, /* "ceu0" clock */
300         .num_resources  = ARRAY_SIZE(ceu0_resources),
301         .resource       = ceu0_resources,
302         .dev    = {
303                 .platform_data  = &sh_mobile_ceu0_info,
304         },
305         .archdata = {
306                 .hwblk_id = HWBLK_CEU0,
307         },
308 };
309
310 /* CEU1 */
311 static struct sh_mobile_ceu_info sh_mobile_ceu1_info = {
312         .flags = SH_CEU_FLAG_USE_8BIT_BUS,
313 };
314
315 static struct resource ceu1_resources[] = {
316         [0] = {
317                 .name   = "CEU1",
318                 .start  = 0xfe914000,
319                 .end    = 0xfe91409f,
320                 .flags  = IORESOURCE_MEM,
321         },
322         [1] = {
323                 .start  = 63,
324                 .flags  = IORESOURCE_IRQ,
325         },
326         [2] = {
327                 /* place holder for contiguous memory */
328         },
329 };
330
331 static struct platform_device ceu1_device = {
332         .name           = "sh_mobile_ceu",
333         .id             = 1, /* "ceu1" clock */
334         .num_resources  = ARRAY_SIZE(ceu1_resources),
335         .resource       = ceu1_resources,
336         .dev    = {
337                 .platform_data  = &sh_mobile_ceu1_info,
338         },
339         .archdata = {
340                 .hwblk_id = HWBLK_CEU1,
341         },
342 };
343
344 /* I2C device */
345 static struct i2c_board_info i2c0_devices[] = {
346         {
347                 I2C_BOARD_INFO("da7210", 0x1a),
348         },
349 };
350
351 static struct i2c_board_info i2c1_devices[] = {
352         {
353                 I2C_BOARD_INFO("r2025sd", 0x32),
354         },
355         {
356                 I2C_BOARD_INFO("lis3lv02d", 0x1c),
357                 .irq = 33,
358         }
359 };
360
361 /* KEYSC */
362 static struct sh_keysc_info keysc_info = {
363         .mode           = SH_KEYSC_MODE_1,
364         .scan_timing    = 3,
365         .delay          = 50,
366         .kycr2_delay    = 100,
367         .keycodes       = { KEY_1, 0, 0, 0, 0,
368                             KEY_2, 0, 0, 0, 0,
369                             KEY_3, 0, 0, 0, 0,
370                             KEY_4, 0, 0, 0, 0,
371                             KEY_5, 0, 0, 0, 0,
372                             KEY_6, 0, 0, 0, 0, },
373 };
374
375 static struct resource keysc_resources[] = {
376         [0] = {
377                 .name   = "KEYSC",
378                 .start  = 0x044b0000,
379                 .end    = 0x044b000f,
380                 .flags  = IORESOURCE_MEM,
381         },
382         [1] = {
383                 .start  = 79,
384                 .flags  = IORESOURCE_IRQ,
385         },
386 };
387
388 static struct platform_device keysc_device = {
389         .name           = "sh_keysc",
390         .id             = 0, /* keysc0 clock */
391         .num_resources  = ARRAY_SIZE(keysc_resources),
392         .resource       = keysc_resources,
393         .dev    = {
394                 .platform_data  = &keysc_info,
395         },
396         .archdata = {
397                 .hwblk_id = HWBLK_KEYSC,
398         },
399 };
400
401 /* TouchScreen */
402 #define IRQ0 32
403 static int ts_get_pendown_state(void)
404 {
405         int val = 0;
406         gpio_free(GPIO_FN_INTC_IRQ0);
407         gpio_request(GPIO_PTZ0, NULL);
408         gpio_direction_input(GPIO_PTZ0);
409
410         val = gpio_get_value(GPIO_PTZ0);
411
412         gpio_free(GPIO_PTZ0);
413         gpio_request(GPIO_FN_INTC_IRQ0, NULL);
414
415         return val ? 0 : 1;
416 }
417
418 static int ts_init(void)
419 {
420         gpio_request(GPIO_FN_INTC_IRQ0, NULL);
421         return 0;
422 }
423
424 struct tsc2007_platform_data tsc2007_info = {
425         .model                  = 2007,
426         .x_plate_ohms           = 180,
427         .get_pendown_state      = ts_get_pendown_state,
428         .init_platform_hw       = ts_init,
429 };
430
431 static struct i2c_board_info ts_i2c_clients = {
432         I2C_BOARD_INFO("tsc2007", 0x48),
433         .type           = "tsc2007",
434         .platform_data  = &tsc2007_info,
435         .irq            = IRQ0,
436 };
437
438 #ifdef CONFIG_MFD_SH_MOBILE_SDHI
439 /* SHDI0 */
440 static void sdhi0_set_pwr(struct platform_device *pdev, int state)
441 {
442         gpio_set_value(GPIO_PTB6, state);
443 }
444
445 static struct sh_mobile_sdhi_info sdhi0_info = {
446         .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
447         .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
448         .set_pwr        = sdhi0_set_pwr,
449 };
450
451 static struct resource sdhi0_resources[] = {
452         [0] = {
453                 .name   = "SDHI0",
454                 .start  = 0x04ce0000,
455                 .end    = 0x04ce01ff,
456                 .flags  = IORESOURCE_MEM,
457         },
458         [1] = {
459                 .start  = 100,
460                 .flags  = IORESOURCE_IRQ,
461         },
462 };
463
464 static struct platform_device sdhi0_device = {
465         .name           = "sh_mobile_sdhi",
466         .num_resources  = ARRAY_SIZE(sdhi0_resources),
467         .resource       = sdhi0_resources,
468         .id             = 0,
469         .dev    = {
470                 .platform_data  = &sdhi0_info,
471         },
472         .archdata = {
473                 .hwblk_id = HWBLK_SDHI0,
474         },
475 };
476
477 /* SHDI1 */
478 static void sdhi1_set_pwr(struct platform_device *pdev, int state)
479 {
480         gpio_set_value(GPIO_PTB7, state);
481 }
482
483 static struct sh_mobile_sdhi_info sdhi1_info = {
484         .dma_slave_tx   = SHDMA_SLAVE_SDHI1_TX,
485         .dma_slave_rx   = SHDMA_SLAVE_SDHI1_RX,
486         .set_pwr        = sdhi1_set_pwr,
487 };
488
489 static struct resource sdhi1_resources[] = {
490         [0] = {
491                 .name   = "SDHI1",
492                 .start  = 0x04cf0000,
493                 .end    = 0x04cf01ff,
494                 .flags  = IORESOURCE_MEM,
495         },
496         [1] = {
497                 .start  = 23,
498                 .flags  = IORESOURCE_IRQ,
499         },
500 };
501
502 static struct platform_device sdhi1_device = {
503         .name           = "sh_mobile_sdhi",
504         .num_resources  = ARRAY_SIZE(sdhi1_resources),
505         .resource       = sdhi1_resources,
506         .id             = 1,
507         .dev    = {
508                 .platform_data  = &sdhi1_info,
509         },
510         .archdata = {
511                 .hwblk_id = HWBLK_SDHI1,
512         },
513 };
514
515 #else
516
517 /* MMC SPI */
518 static int mmc_spi_get_ro(struct device *dev)
519 {
520         return gpio_get_value(GPIO_PTY6);
521 }
522
523 static int mmc_spi_get_cd(struct device *dev)
524 {
525         return !gpio_get_value(GPIO_PTY7);
526 }
527
528 static void mmc_spi_setpower(struct device *dev, unsigned int maskval)
529 {
530         gpio_set_value(GPIO_PTB6, maskval ? 1 : 0);
531 }
532
533 static struct mmc_spi_platform_data mmc_spi_info = {
534         .get_ro = mmc_spi_get_ro,
535         .get_cd = mmc_spi_get_cd,
536         .caps = MMC_CAP_NEEDS_POLL,
537         .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */
538         .setpower = mmc_spi_setpower,
539 };
540
541 static struct spi_board_info spi_bus[] = {
542         {
543                 .modalias       = "mmc_spi",
544                 .platform_data  = &mmc_spi_info,
545                 .max_speed_hz   = 5000000,
546                 .mode           = SPI_MODE_0,
547                 .controller_data = (void *) GPIO_PTM4,
548         },
549 };
550
551 /* MSIOF0 */
552 static struct sh_msiof_spi_info msiof0_data = {
553         .num_chipselect = 1,
554 };
555
556 static struct resource msiof0_resources[] = {
557         [0] = {
558                 .name   = "MSIOF0",
559                 .start  = 0xa4c40000,
560                 .end    = 0xa4c40063,
561                 .flags  = IORESOURCE_MEM,
562         },
563         [1] = {
564                 .start  = 84,
565                 .flags  = IORESOURCE_IRQ,
566         },
567 };
568
569 static struct platform_device msiof0_device = {
570         .name           = "spi_sh_msiof",
571         .id             = 0, /* MSIOF0 */
572         .dev = {
573                 .platform_data = &msiof0_data,
574         },
575         .num_resources  = ARRAY_SIZE(msiof0_resources),
576         .resource       = msiof0_resources,
577         .archdata = {
578                 .hwblk_id = HWBLK_MSIOF0,
579         },
580 };
581
582 #endif
583
584 /* I2C Video/Camera */
585 static struct i2c_board_info i2c_camera[] = {
586         {
587                 I2C_BOARD_INFO("tw9910", 0x45),
588         },
589         {
590                 /* 1st camera */
591                 I2C_BOARD_INFO("mt9t112", 0x3c),
592         },
593         {
594                 /* 2nd camera */
595                 I2C_BOARD_INFO("mt9t112", 0x3c),
596         },
597 };
598
599 /* tw9910 */
600 static int tw9910_power(struct device *dev, int mode)
601 {
602         int val = mode ? 0 : 1;
603
604         gpio_set_value(GPIO_PTU2, val);
605         if (mode)
606                 mdelay(100);
607
608         return 0;
609 }
610
611 static struct tw9910_video_info tw9910_info = {
612         .buswidth       = SOCAM_DATAWIDTH_8,
613         .mpout          = TW9910_MPO_FIELD,
614 };
615
616 static struct soc_camera_link tw9910_link = {
617         .i2c_adapter_id = 0,
618         .bus_id         = 1,
619         .power          = tw9910_power,
620         .board_info     = &i2c_camera[0],
621         .module_name    = "tw9910",
622         .priv           = &tw9910_info,
623 };
624
625 /* mt9t112 */
626 static int mt9t112_power1(struct device *dev, int mode)
627 {
628         gpio_set_value(GPIO_PTA3, mode);
629         if (mode)
630                 mdelay(100);
631
632         return 0;
633 }
634
635 static struct mt9t112_camera_info mt9t112_info1 = {
636         .flags = MT9T112_FLAG_PCLK_RISING_EDGE | MT9T112_FLAG_DATAWIDTH_8,
637         .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */
638 };
639
640 static struct soc_camera_link mt9t112_link1 = {
641         .i2c_adapter_id = 0,
642         .power          = mt9t112_power1,
643         .bus_id         = 0,
644         .board_info     = &i2c_camera[1],
645         .module_name    = "mt9t112",
646         .priv           = &mt9t112_info1,
647 };
648
649 static int mt9t112_power2(struct device *dev, int mode)
650 {
651         gpio_set_value(GPIO_PTA4, mode);
652         if (mode)
653                 mdelay(100);
654
655         return 0;
656 }
657
658 static struct mt9t112_camera_info mt9t112_info2 = {
659         .flags = MT9T112_FLAG_PCLK_RISING_EDGE | MT9T112_FLAG_DATAWIDTH_8,
660         .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */
661 };
662
663 static struct soc_camera_link mt9t112_link2 = {
664         .i2c_adapter_id = 1,
665         .power          = mt9t112_power2,
666         .bus_id         = 1,
667         .board_info     = &i2c_camera[2],
668         .module_name    = "mt9t112",
669         .priv           = &mt9t112_info2,
670 };
671
672 static struct platform_device camera_devices[] = {
673         {
674                 .name   = "soc-camera-pdrv",
675                 .id     = 0,
676                 .dev    = {
677                         .platform_data = &tw9910_link,
678                 },
679         },
680         {
681                 .name   = "soc-camera-pdrv",
682                 .id     = 1,
683                 .dev    = {
684                         .platform_data = &mt9t112_link1,
685                 },
686         },
687         {
688                 .name   = "soc-camera-pdrv",
689                 .id     = 2,
690                 .dev    = {
691                         .platform_data = &mt9t112_link2,
692                 },
693         },
694 };
695
696 /* FSI */
697 /*
698  * FSI-B use external clock which came from da7210.
699  * So, we should change parent of fsi
700  */
701 #define FCLKBCR         0xa415000c
702 static void fsimck_init(struct clk *clk)
703 {
704         u32 status = __raw_readl(clk->enable_reg);
705
706         /* use external clock */
707         status &= ~0x000000ff;
708         status |= 0x00000080;
709
710         __raw_writel(status, clk->enable_reg);
711 }
712
713 static struct clk_ops fsimck_clk_ops = {
714         .init = fsimck_init,
715 };
716
717 static struct clk fsimckb_clk = {
718         .ops            = &fsimck_clk_ops,
719         .enable_reg     = (void __iomem *)FCLKBCR,
720         .rate           = 0, /* unknown */
721 };
722
723 struct sh_fsi_platform_info fsi_info = {
724         .portb_flags = SH_FSI_BRS_INV |
725                        SH_FSI_OUT_SLAVE_MODE |
726                        SH_FSI_IN_SLAVE_MODE |
727                        SH_FSI_OFMT(I2S) |
728                        SH_FSI_IFMT(I2S),
729 };
730
731 static struct resource fsi_resources[] = {
732         [0] = {
733                 .name   = "FSI",
734                 .start  = 0xFE3C0000,
735                 .end    = 0xFE3C021d,
736                 .flags  = IORESOURCE_MEM,
737         },
738         [1] = {
739                 .start  = 108,
740                 .flags  = IORESOURCE_IRQ,
741         },
742 };
743
744 static struct platform_device fsi_device = {
745         .name           = "sh_fsi",
746         .id             = 0,
747         .num_resources  = ARRAY_SIZE(fsi_resources),
748         .resource       = fsi_resources,
749         .dev    = {
750                 .platform_data  = &fsi_info,
751         },
752         .archdata = {
753                 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
754         },
755 };
756
757 /* IrDA */
758 static struct resource irda_resources[] = {
759         [0] = {
760                 .name   = "IrDA",
761                 .start  = 0xA45D0000,
762                 .end    = 0xA45D0049,
763                 .flags  = IORESOURCE_MEM,
764         },
765         [1] = {
766                 .start  = 20,
767                 .flags  = IORESOURCE_IRQ,
768         },
769 };
770
771 static struct platform_device irda_device = {
772         .name           = "sh_sir",
773         .num_resources  = ARRAY_SIZE(irda_resources),
774         .resource       = irda_resources,
775 };
776
777 #include <media/ak881x.h>
778 #include <media/sh_vou.h>
779
780 struct ak881x_pdata ak881x_pdata = {
781         .flags = AK881X_IF_MODE_SLAVE,
782 };
783
784 static struct i2c_board_info ak8813 = {
785         I2C_BOARD_INFO("ak8813", 0x20),
786         .platform_data = &ak881x_pdata,
787 };
788
789 struct sh_vou_pdata sh_vou_pdata = {
790         .bus_fmt        = SH_VOU_BUS_8BIT,
791         .flags          = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
792         .board_info     = &ak8813,
793         .i2c_adap       = 0,
794         .module_name    = "ak881x",
795 };
796
797 static struct resource sh_vou_resources[] = {
798         [0] = {
799                 .start  = 0xfe960000,
800                 .end    = 0xfe962043,
801                 .flags  = IORESOURCE_MEM,
802         },
803         [1] = {
804                 .start  = 55,
805                 .flags  = IORESOURCE_IRQ,
806         },
807 };
808
809 static struct platform_device vou_device = {
810         .name           = "sh-vou",
811         .id             = -1,
812         .num_resources  = ARRAY_SIZE(sh_vou_resources),
813         .resource       = sh_vou_resources,
814         .dev            = {
815                 .platform_data  = &sh_vou_pdata,
816         },
817         .archdata       = {
818                 .hwblk_id       = HWBLK_VOU,
819         },
820 };
821
822 static struct platform_device *ecovec_devices[] __initdata = {
823         &heartbeat_device,
824         &nor_flash_device,
825         &sh_eth_device,
826         &usb0_host_device,
827         &usb1_common_device,
828         &lcdc_device,
829         &ceu0_device,
830         &ceu1_device,
831         &keysc_device,
832 #ifdef CONFIG_MFD_SH_MOBILE_SDHI
833         &sdhi0_device,
834         &sdhi1_device,
835 #else
836         &msiof0_device,
837 #endif
838         &camera_devices[0],
839         &camera_devices[1],
840         &camera_devices[2],
841         &fsi_device,
842         &irda_device,
843         &vou_device,
844 };
845
846 #ifdef CONFIG_I2C
847 #define EEPROM_ADDR 0x50
848 static u8 mac_read(struct i2c_adapter *a, u8 command)
849 {
850         struct i2c_msg msg[2];
851         u8 buf;
852         int ret;
853
854         msg[0].addr  = EEPROM_ADDR;
855         msg[0].flags = 0;
856         msg[0].len   = 1;
857         msg[0].buf   = &command;
858
859         msg[1].addr  = EEPROM_ADDR;
860         msg[1].flags = I2C_M_RD;
861         msg[1].len   = 1;
862         msg[1].buf   = &buf;
863
864         ret = i2c_transfer(a, msg, 2);
865         if (ret < 0) {
866                 printk(KERN_ERR "error %d\n", ret);
867                 buf = 0xff;
868         }
869
870         return buf;
871 }
872
873 static void __init sh_eth_init(struct sh_eth_plat_data *pd)
874 {
875         struct i2c_adapter *a = i2c_get_adapter(1);
876         int i;
877
878         if (!a) {
879                 pr_err("can not get I2C 1\n");
880                 return;
881         }
882
883         /* read MAC address frome EEPROM */
884         for (i = 0; i < sizeof(pd->mac_addr); i++) {
885                 pd->mac_addr[i] = mac_read(a, 0x10 + i);
886                 msleep(10);
887         }
888
889         i2c_put_adapter(a);
890 }
891 #else
892 static void __init sh_eth_init(struct sh_eth_plat_data *pd)
893 {
894         pr_err("unable to read sh_eth MAC address\n");
895 }
896 #endif
897
898 #define PORT_HIZA 0xA4050158
899 #define IODRIVEA  0xA405018A
900
901 extern char ecovec24_sdram_enter_start;
902 extern char ecovec24_sdram_enter_end;
903 extern char ecovec24_sdram_leave_start;
904 extern char ecovec24_sdram_leave_end;
905
906 static int __init arch_setup(void)
907 {
908         struct clk *clk;
909
910         /* register board specific self-refresh code */
911         sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
912                                         SUSP_SH_RSTANDBY,
913                                         &ecovec24_sdram_enter_start,
914                                         &ecovec24_sdram_enter_end,
915                                         &ecovec24_sdram_leave_start,
916                                         &ecovec24_sdram_leave_end);
917
918         /* enable STATUS0, STATUS2 and PDSTATUS */
919         gpio_request(GPIO_FN_STATUS0, NULL);
920         gpio_request(GPIO_FN_STATUS2, NULL);
921         gpio_request(GPIO_FN_PDSTATUS, NULL);
922
923         /* enable SCIFA0 */
924         gpio_request(GPIO_FN_SCIF0_TXD, NULL);
925         gpio_request(GPIO_FN_SCIF0_RXD, NULL);
926
927         /* enable debug LED */
928         gpio_request(GPIO_PTG0, NULL);
929         gpio_request(GPIO_PTG1, NULL);
930         gpio_request(GPIO_PTG2, NULL);
931         gpio_request(GPIO_PTG3, NULL);
932         gpio_direction_output(GPIO_PTG0, 0);
933         gpio_direction_output(GPIO_PTG1, 0);
934         gpio_direction_output(GPIO_PTG2, 0);
935         gpio_direction_output(GPIO_PTG3, 0);
936         __raw_writew((__raw_readw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA);
937
938         /* enable SH-Eth */
939         gpio_request(GPIO_PTA1, NULL);
940         gpio_direction_output(GPIO_PTA1, 1);
941         mdelay(20);
942
943         gpio_request(GPIO_FN_RMII_RXD0,    NULL);
944         gpio_request(GPIO_FN_RMII_RXD1,    NULL);
945         gpio_request(GPIO_FN_RMII_TXD0,    NULL);
946         gpio_request(GPIO_FN_RMII_TXD1,    NULL);
947         gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
948         gpio_request(GPIO_FN_RMII_TX_EN,   NULL);
949         gpio_request(GPIO_FN_RMII_RX_ER,   NULL);
950         gpio_request(GPIO_FN_RMII_CRS_DV,  NULL);
951         gpio_request(GPIO_FN_MDIO,         NULL);
952         gpio_request(GPIO_FN_MDC,          NULL);
953         gpio_request(GPIO_FN_LNKSTA,       NULL);
954
955         /* enable USB */
956         __raw_writew(0x0000, 0xA4D80000);
957         __raw_writew(0x0000, 0xA4D90000);
958         gpio_request(GPIO_PTB3,  NULL);
959         gpio_request(GPIO_PTB4,  NULL);
960         gpio_request(GPIO_PTB5,  NULL);
961         gpio_direction_input(GPIO_PTB3);
962         gpio_direction_output(GPIO_PTB4, 0);
963         gpio_direction_output(GPIO_PTB5, 0);
964         __raw_writew(0x0600, 0xa40501d4);
965         __raw_writew(0x0600, 0xa4050192);
966
967         if (gpio_get_value(GPIO_PTB3)) {
968                 printk(KERN_INFO "USB1 function is selected\n");
969                 usb1_common_device.name = "r8a66597_udc";
970         } else {
971                 printk(KERN_INFO "USB1 host is selected\n");
972                 usb1_common_device.name = "r8a66597_hcd";
973         }
974
975         /* enable LCDC */
976         gpio_request(GPIO_FN_LCDD23,   NULL);
977         gpio_request(GPIO_FN_LCDD22,   NULL);
978         gpio_request(GPIO_FN_LCDD21,   NULL);
979         gpio_request(GPIO_FN_LCDD20,   NULL);
980         gpio_request(GPIO_FN_LCDD19,   NULL);
981         gpio_request(GPIO_FN_LCDD18,   NULL);
982         gpio_request(GPIO_FN_LCDD17,   NULL);
983         gpio_request(GPIO_FN_LCDD16,   NULL);
984         gpio_request(GPIO_FN_LCDD15,   NULL);
985         gpio_request(GPIO_FN_LCDD14,   NULL);
986         gpio_request(GPIO_FN_LCDD13,   NULL);
987         gpio_request(GPIO_FN_LCDD12,   NULL);
988         gpio_request(GPIO_FN_LCDD11,   NULL);
989         gpio_request(GPIO_FN_LCDD10,   NULL);
990         gpio_request(GPIO_FN_LCDD9,    NULL);
991         gpio_request(GPIO_FN_LCDD8,    NULL);
992         gpio_request(GPIO_FN_LCDD7,    NULL);
993         gpio_request(GPIO_FN_LCDD6,    NULL);
994         gpio_request(GPIO_FN_LCDD5,    NULL);
995         gpio_request(GPIO_FN_LCDD4,    NULL);
996         gpio_request(GPIO_FN_LCDD3,    NULL);
997         gpio_request(GPIO_FN_LCDD2,    NULL);
998         gpio_request(GPIO_FN_LCDD1,    NULL);
999         gpio_request(GPIO_FN_LCDD0,    NULL);
1000         gpio_request(GPIO_FN_LCDDISP,  NULL);
1001         gpio_request(GPIO_FN_LCDHSYN,  NULL);
1002         gpio_request(GPIO_FN_LCDDCK,   NULL);
1003         gpio_request(GPIO_FN_LCDVSYN,  NULL);
1004         gpio_request(GPIO_FN_LCDDON,   NULL);
1005         gpio_request(GPIO_FN_LCDLCLK,  NULL);
1006         __raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA);
1007
1008         gpio_request(GPIO_PTE6, NULL);
1009         gpio_request(GPIO_PTU1, NULL);
1010         gpio_request(GPIO_PTR1, NULL);
1011         gpio_request(GPIO_PTA2, NULL);
1012         gpio_direction_input(GPIO_PTE6);
1013         gpio_direction_output(GPIO_PTU1, 0);
1014         gpio_direction_output(GPIO_PTR1, 0);
1015         gpio_direction_output(GPIO_PTA2, 0);
1016
1017         /* I/O buffer drive ability is high */
1018         __raw_writew((__raw_readw(IODRIVEA) & ~0x00c0) | 0x0080 , IODRIVEA);
1019
1020         if (gpio_get_value(GPIO_PTE6)) {
1021                 /* DVI */
1022                 lcdc_info.clock_source                  = LCDC_CLK_EXTERNAL;
1023                 lcdc_info.ch[0].clock_divider           = 1,
1024                 lcdc_info.ch[0].lcd_cfg.name            = "DVI";
1025                 lcdc_info.ch[0].lcd_cfg.xres            = 1280;
1026                 lcdc_info.ch[0].lcd_cfg.yres            = 720;
1027                 lcdc_info.ch[0].lcd_cfg.left_margin     = 220;
1028                 lcdc_info.ch[0].lcd_cfg.right_margin    = 110;
1029                 lcdc_info.ch[0].lcd_cfg.hsync_len       = 40;
1030                 lcdc_info.ch[0].lcd_cfg.upper_margin    = 20;
1031                 lcdc_info.ch[0].lcd_cfg.lower_margin    = 5;
1032                 lcdc_info.ch[0].lcd_cfg.vsync_len       = 5;
1033
1034                 gpio_set_value(GPIO_PTA2, 1);
1035                 gpio_set_value(GPIO_PTU1, 1);
1036         } else {
1037                 /* Panel */
1038
1039                 lcdc_info.clock_source                  = LCDC_CLK_PERIPHERAL;
1040                 lcdc_info.ch[0].clock_divider           = 2,
1041                 lcdc_info.ch[0].lcd_cfg.name            = "Panel";
1042                 lcdc_info.ch[0].lcd_cfg.xres            = 800;
1043                 lcdc_info.ch[0].lcd_cfg.yres            = 480;
1044                 lcdc_info.ch[0].lcd_cfg.left_margin     = 220;
1045                 lcdc_info.ch[0].lcd_cfg.right_margin    = 110;
1046                 lcdc_info.ch[0].lcd_cfg.hsync_len       = 70;
1047                 lcdc_info.ch[0].lcd_cfg.upper_margin    = 20;
1048                 lcdc_info.ch[0].lcd_cfg.lower_margin    = 5;
1049                 lcdc_info.ch[0].lcd_cfg.vsync_len       = 5;
1050
1051                 gpio_set_value(GPIO_PTR1, 1);
1052
1053                 /* FIXME
1054                  *
1055                  * LCDDON control is needed for Panel,
1056                  * but current sh_mobile_lcdc driver doesn't control it.
1057                  * It is temporary correspondence
1058                  */
1059                 gpio_request(GPIO_PTF4, NULL);
1060                 gpio_direction_output(GPIO_PTF4, 1);
1061
1062                 /* enable TouchScreen */
1063                 i2c_register_board_info(0, &ts_i2c_clients, 1);
1064                 set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
1065         }
1066
1067         /* enable CEU0 */
1068         gpio_request(GPIO_FN_VIO0_D15, NULL);
1069         gpio_request(GPIO_FN_VIO0_D14, NULL);
1070         gpio_request(GPIO_FN_VIO0_D13, NULL);
1071         gpio_request(GPIO_FN_VIO0_D12, NULL);
1072         gpio_request(GPIO_FN_VIO0_D11, NULL);
1073         gpio_request(GPIO_FN_VIO0_D10, NULL);
1074         gpio_request(GPIO_FN_VIO0_D9,  NULL);
1075         gpio_request(GPIO_FN_VIO0_D8,  NULL);
1076         gpio_request(GPIO_FN_VIO0_D7,  NULL);
1077         gpio_request(GPIO_FN_VIO0_D6,  NULL);
1078         gpio_request(GPIO_FN_VIO0_D5,  NULL);
1079         gpio_request(GPIO_FN_VIO0_D4,  NULL);
1080         gpio_request(GPIO_FN_VIO0_D3,  NULL);
1081         gpio_request(GPIO_FN_VIO0_D2,  NULL);
1082         gpio_request(GPIO_FN_VIO0_D1,  NULL);
1083         gpio_request(GPIO_FN_VIO0_D0,  NULL);
1084         gpio_request(GPIO_FN_VIO0_VD,  NULL);
1085         gpio_request(GPIO_FN_VIO0_CLK, NULL);
1086         gpio_request(GPIO_FN_VIO0_FLD, NULL);
1087         gpio_request(GPIO_FN_VIO0_HD,  NULL);
1088         platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
1089
1090         /* enable CEU1 */
1091         gpio_request(GPIO_FN_VIO1_D7,  NULL);
1092         gpio_request(GPIO_FN_VIO1_D6,  NULL);
1093         gpio_request(GPIO_FN_VIO1_D5,  NULL);
1094         gpio_request(GPIO_FN_VIO1_D4,  NULL);
1095         gpio_request(GPIO_FN_VIO1_D3,  NULL);
1096         gpio_request(GPIO_FN_VIO1_D2,  NULL);
1097         gpio_request(GPIO_FN_VIO1_D1,  NULL);
1098         gpio_request(GPIO_FN_VIO1_D0,  NULL);
1099         gpio_request(GPIO_FN_VIO1_FLD, NULL);
1100         gpio_request(GPIO_FN_VIO1_HD,  NULL);
1101         gpio_request(GPIO_FN_VIO1_VD,  NULL);
1102         gpio_request(GPIO_FN_VIO1_CLK, NULL);
1103         platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
1104
1105         /* enable KEYSC */
1106         gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
1107         gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
1108         gpio_request(GPIO_FN_KEYOUT3,     NULL);
1109         gpio_request(GPIO_FN_KEYOUT2,     NULL);
1110         gpio_request(GPIO_FN_KEYOUT1,     NULL);
1111         gpio_request(GPIO_FN_KEYOUT0,     NULL);
1112         gpio_request(GPIO_FN_KEYIN0,      NULL);
1113
1114         /* enable user debug switch */
1115         gpio_request(GPIO_PTR0, NULL);
1116         gpio_request(GPIO_PTR4, NULL);
1117         gpio_request(GPIO_PTR5, NULL);
1118         gpio_request(GPIO_PTR6, NULL);
1119         gpio_direction_input(GPIO_PTR0);
1120         gpio_direction_input(GPIO_PTR4);
1121         gpio_direction_input(GPIO_PTR5);
1122         gpio_direction_input(GPIO_PTR6);
1123
1124 #ifdef CONFIG_MFD_SH_MOBILE_SDHI
1125         /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
1126         gpio_request(GPIO_FN_SDHI0CD,  NULL);
1127         gpio_request(GPIO_FN_SDHI0WP,  NULL);
1128         gpio_request(GPIO_FN_SDHI0CMD, NULL);
1129         gpio_request(GPIO_FN_SDHI0CLK, NULL);
1130         gpio_request(GPIO_FN_SDHI0D3,  NULL);
1131         gpio_request(GPIO_FN_SDHI0D2,  NULL);
1132         gpio_request(GPIO_FN_SDHI0D1,  NULL);
1133         gpio_request(GPIO_FN_SDHI0D0,  NULL);
1134         gpio_request(GPIO_PTB6, NULL);
1135         gpio_direction_output(GPIO_PTB6, 0);
1136
1137         /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
1138         gpio_request(GPIO_FN_SDHI1CD,  NULL);
1139         gpio_request(GPIO_FN_SDHI1WP,  NULL);
1140         gpio_request(GPIO_FN_SDHI1CMD, NULL);
1141         gpio_request(GPIO_FN_SDHI1CLK, NULL);
1142         gpio_request(GPIO_FN_SDHI1D3,  NULL);
1143         gpio_request(GPIO_FN_SDHI1D2,  NULL);
1144         gpio_request(GPIO_FN_SDHI1D1,  NULL);
1145         gpio_request(GPIO_FN_SDHI1D0,  NULL);
1146         gpio_request(GPIO_PTB7, NULL);
1147         gpio_direction_output(GPIO_PTB7, 0);
1148
1149         /* I/O buffer drive ability is high for SDHI1 */
1150         __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1151 #else
1152         /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */
1153         gpio_request(GPIO_FN_MSIOF0_TXD, NULL);
1154         gpio_request(GPIO_FN_MSIOF0_RXD, NULL);
1155         gpio_request(GPIO_FN_MSIOF0_TSCK, NULL);
1156         gpio_request(GPIO_PTM4, NULL); /* software CS control of TSYNC pin */
1157         gpio_direction_output(GPIO_PTM4, 1); /* active low CS */
1158         gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */
1159         gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
1160         gpio_request(GPIO_PTY6, NULL); /* write protect */
1161         gpio_direction_input(GPIO_PTY6);
1162         gpio_request(GPIO_PTY7, NULL); /* card detect */
1163         gpio_direction_input(GPIO_PTY7);
1164
1165         spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
1166 #endif
1167
1168         /* enable Video */
1169         gpio_request(GPIO_PTU2, NULL);
1170         gpio_direction_output(GPIO_PTU2, 1);
1171
1172         /* enable Camera */
1173         gpio_request(GPIO_PTA3, NULL);
1174         gpio_request(GPIO_PTA4, NULL);
1175         gpio_direction_output(GPIO_PTA3, 0);
1176         gpio_direction_output(GPIO_PTA4, 0);
1177
1178         /* enable FSI */
1179         gpio_request(GPIO_FN_FSIMCKB,    NULL);
1180         gpio_request(GPIO_FN_FSIIBSD,    NULL);
1181         gpio_request(GPIO_FN_FSIOBSD,    NULL);
1182         gpio_request(GPIO_FN_FSIIBBCK,   NULL);
1183         gpio_request(GPIO_FN_FSIIBLRCK,  NULL);
1184         gpio_request(GPIO_FN_FSIOBBCK,   NULL);
1185         gpio_request(GPIO_FN_FSIOBLRCK,  NULL);
1186         gpio_request(GPIO_FN_CLKAUDIOBO, NULL);
1187
1188         /* set SPU2 clock to 83.4 MHz */
1189         clk = clk_get(NULL, "spu_clk");
1190         if (clk) {
1191                 clk_set_rate(clk, clk_round_rate(clk, 83333333));
1192                 clk_put(clk);
1193         }
1194
1195         /* change parent of FSI B */
1196         clk = clk_get(NULL, "fsib_clk");
1197         if (clk) {
1198                 clk_register(&fsimckb_clk);
1199                 clk_set_parent(clk, &fsimckb_clk);
1200                 clk_set_rate(clk, 11000);
1201                 clk_set_rate(&fsimckb_clk, 11000);
1202                 clk_put(clk);
1203         }
1204
1205         gpio_request(GPIO_PTU0, NULL);
1206         gpio_direction_output(GPIO_PTU0, 0);
1207         mdelay(20);
1208
1209         /* enable motion sensor */
1210         gpio_request(GPIO_FN_INTC_IRQ1, NULL);
1211         gpio_direction_input(GPIO_FN_INTC_IRQ1);
1212
1213         /* set VPU clock to 166 MHz */
1214         clk = clk_get(NULL, "vpu_clk");
1215         if (clk) {
1216                 clk_set_rate(clk, clk_round_rate(clk, 166000000));
1217                 clk_put(clk);
1218         }
1219
1220         /* enable IrDA */
1221         gpio_request(GPIO_FN_IRDA_OUT, NULL);
1222         gpio_request(GPIO_FN_IRDA_IN,  NULL);
1223         gpio_request(GPIO_PTU5, NULL);
1224         gpio_direction_output(GPIO_PTU5, 0);
1225
1226         /* enable I2C device */
1227         i2c_register_board_info(0, i2c0_devices,
1228                                 ARRAY_SIZE(i2c0_devices));
1229
1230         i2c_register_board_info(1, i2c1_devices,
1231                                 ARRAY_SIZE(i2c1_devices));
1232
1233         /* VOU */
1234         gpio_request(GPIO_FN_DV_D15, NULL);
1235         gpio_request(GPIO_FN_DV_D14, NULL);
1236         gpio_request(GPIO_FN_DV_D13, NULL);
1237         gpio_request(GPIO_FN_DV_D12, NULL);
1238         gpio_request(GPIO_FN_DV_D11, NULL);
1239         gpio_request(GPIO_FN_DV_D10, NULL);
1240         gpio_request(GPIO_FN_DV_D9, NULL);
1241         gpio_request(GPIO_FN_DV_D8, NULL);
1242         gpio_request(GPIO_FN_DV_CLKI, NULL);
1243         gpio_request(GPIO_FN_DV_CLK, NULL);
1244         gpio_request(GPIO_FN_DV_VSYNC, NULL);
1245         gpio_request(GPIO_FN_DV_HSYNC, NULL);
1246
1247         /* AK8813 power / reset sequence */
1248         gpio_request(GPIO_PTG4, NULL);
1249         gpio_request(GPIO_PTU3, NULL);
1250         /* Reset */
1251         gpio_direction_output(GPIO_PTG4, 0);
1252         /* Power down */
1253         gpio_direction_output(GPIO_PTU3, 1);
1254
1255         udelay(10);
1256
1257         /* Power up, reset */
1258         gpio_set_value(GPIO_PTU3, 0);
1259
1260         udelay(10);
1261
1262         /* Remove reset */
1263         gpio_set_value(GPIO_PTG4, 1);
1264
1265         return platform_add_devices(ecovec_devices,
1266                                     ARRAY_SIZE(ecovec_devices));
1267 }
1268 arch_initcall(arch_setup);
1269
1270 static int __init devices_setup(void)
1271 {
1272         sh_eth_init(&sh_eth_plat);
1273         return 0;
1274 }
1275 device_initcall(devices_setup);
1276
1277 static struct sh_machine_vector mv_ecovec __initmv = {
1278         .mv_name        = "R0P7724 (EcoVec)",
1279 };