]> git.karo-electronics.de Git - mv-sheeva.git/blob - arch/sh/boards/mach-ecovec24/setup.c
sh: mach-ecovec24: deassert usb irq on boot.
[mv-sheeva.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/mtd/physmap.h>
15 #include <linux/gpio.h>
16 #include <linux/interrupt.h>
17 #include <linux/io.h>
18 #include <linux/delay.h>
19 #include <linux/usb/r8a66597.h>
20 #include <linux/i2c.h>
21 #include <linux/input.h>
22 #include <video/sh_mobile_lcdc.h>
23 #include <media/sh_mobile_ceu.h>
24 #include <asm/heartbeat.h>
25 #include <asm/sh_eth.h>
26 #include <asm/sh_keysc.h>
27 #include <cpu/sh7724.h>
28
29 /*
30  *  Address      Interface        BusWidth
31  *-----------------------------------------
32  *  0x0000_0000  uboot            16bit
33  *  0x0004_0000  Linux romImage   16bit
34  *  0x0014_0000  MTD for Linux    16bit
35  *  0x0400_0000  Internal I/O     16/32bit
36  *  0x0800_0000  DRAM             32bit
37  *  0x1800_0000  MFI              16bit
38  */
39
40 /* Heartbeat */
41 static unsigned char led_pos[] = { 0, 1, 2, 3 };
42 static struct heartbeat_data heartbeat_data = {
43         .regsize = 8,
44         .nr_bits = 4,
45         .bit_pos = led_pos,
46 };
47
48 static struct resource heartbeat_resources[] = {
49         [0] = {
50                 .start  = 0xA405012C, /* PTG */
51                 .end    = 0xA405012E - 1,
52                 .flags  = IORESOURCE_MEM,
53         },
54 };
55
56 static struct platform_device heartbeat_device = {
57         .name           = "heartbeat",
58         .id             = -1,
59         .dev = {
60                 .platform_data = &heartbeat_data,
61         },
62         .num_resources  = ARRAY_SIZE(heartbeat_resources),
63         .resource       = heartbeat_resources,
64 };
65
66 /* MTD */
67 static struct mtd_partition nor_flash_partitions[] = {
68         {
69                 .name = "boot loader",
70                 .offset = 0,
71                 .size = (5 * 1024 * 1024),
72                 .mask_flags = MTD_CAP_ROM,
73         }, {
74                 .name = "free-area",
75                 .offset = MTDPART_OFS_APPEND,
76                 .size = MTDPART_SIZ_FULL,
77         },
78 };
79
80 static struct physmap_flash_data nor_flash_data = {
81         .width          = 2,
82         .parts          = nor_flash_partitions,
83         .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
84 };
85
86 static struct resource nor_flash_resources[] = {
87         [0] = {
88                 .name   = "NOR Flash",
89                 .start  = 0x00000000,
90                 .end    = 0x03ffffff,
91                 .flags  = IORESOURCE_MEM,
92         }
93 };
94
95 static struct platform_device nor_flash_device = {
96         .name           = "physmap-flash",
97         .resource       = nor_flash_resources,
98         .num_resources  = ARRAY_SIZE(nor_flash_resources),
99         .dev            = {
100                 .platform_data = &nor_flash_data,
101         },
102 };
103
104 /* SH Eth */
105 #define SH_ETH_ADDR     (0xA4600000)
106 #define SH_ETH_MAHR     (SH_ETH_ADDR + 0x1C0)
107 #define SH_ETH_MALR     (SH_ETH_ADDR + 0x1C8)
108 static struct resource sh_eth_resources[] = {
109         [0] = {
110                 .start = SH_ETH_ADDR,
111                 .end   = SH_ETH_ADDR + 0x1FC,
112                 .flags = IORESOURCE_MEM,
113         },
114         [1] = {
115                 .start = 91,
116                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
117         },
118 };
119
120 struct sh_eth_plat_data sh_eth_plat = {
121         .phy = 0x1f, /* SMSC LAN8700 */
122         .edmac_endian = EDMAC_LITTLE_ENDIAN,
123 };
124
125 static struct platform_device sh_eth_device = {
126         .name = "sh-eth",
127         .id     = 0,
128         .dev = {
129                 .platform_data = &sh_eth_plat,
130         },
131         .num_resources = ARRAY_SIZE(sh_eth_resources),
132         .resource = sh_eth_resources,
133 };
134
135 /* USB0 host */
136 void usb0_port_power(int port, int power)
137 {
138         gpio_set_value(GPIO_PTB4, power);
139 }
140
141 static struct r8a66597_platdata usb0_host_data = {
142         .on_chip = 1,
143         .port_power = usb0_port_power,
144 };
145
146 static struct resource usb0_host_resources[] = {
147         [0] = {
148                 .start  = 0xa4d80000,
149                 .end    = 0xa4d80124 - 1,
150                 .flags  = IORESOURCE_MEM,
151         },
152         [1] = {
153                 .start  = 65,
154                 .end    = 65,
155                 .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
156         },
157 };
158
159 static struct platform_device usb0_host_device = {
160         .name           = "r8a66597_hcd",
161         .id             = 0,
162         .dev = {
163                 .dma_mask               = NULL,         /*  not use dma */
164                 .coherent_dma_mask      = 0xffffffff,
165                 .platform_data          = &usb0_host_data,
166         },
167         .num_resources  = ARRAY_SIZE(usb0_host_resources),
168         .resource       = usb0_host_resources,
169 };
170
171 /*
172  * USB1
173  *
174  * CN5 can use both host/function,
175  * and we can determine it by checking PTB[3]
176  *
177  * This time only USB1 host is supported.
178  */
179 void usb1_port_power(int port, int power)
180 {
181         if (!gpio_get_value(GPIO_PTB3)) {
182                 printk(KERN_ERR "USB1 function is not supported\n");
183                 return;
184         }
185
186         gpio_set_value(GPIO_PTB5, power);
187 }
188
189 static struct r8a66597_platdata usb1_host_data = {
190         .on_chip = 1,
191         .port_power = usb1_port_power,
192 };
193
194 static struct resource usb1_host_resources[] = {
195         [0] = {
196                 .start  = 0xa4d90000,
197                 .end    = 0xa4d90124 - 1,
198                 .flags  = IORESOURCE_MEM,
199         },
200         [1] = {
201                 .start  = 66,
202                 .end    = 66,
203                 .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
204         },
205 };
206
207 static struct platform_device usb1_host_device = {
208         .name           = "r8a66597_hcd",
209         .id             = 1,
210         .dev = {
211                 .dma_mask               = NULL,         /*  not use dma */
212                 .coherent_dma_mask      = 0xffffffff,
213                 .platform_data          = &usb1_host_data,
214         },
215         .num_resources  = ARRAY_SIZE(usb1_host_resources),
216         .resource       = usb1_host_resources,
217 };
218
219 /* LCDC */
220 static struct sh_mobile_lcdc_info lcdc_info = {
221         .ch[0] = {
222                 .interface_type = RGB18,
223                 .chan = LCDC_CHAN_MAINLCD,
224                 .bpp = 16,
225                 .lcd_cfg = {
226                         .sync = 0, /* hsync and vsync are active low */
227                 },
228                 .lcd_size_cfg = { /* 7.0 inch */
229                         .width = 152,
230                         .height = 91,
231                 },
232                 .board_cfg = {
233                 },
234         }
235 };
236
237 static struct resource lcdc_resources[] = {
238         [0] = {
239                 .name   = "LCDC",
240                 .start  = 0xfe940000,
241                 .end    = 0xfe941fff,
242                 .flags  = IORESOURCE_MEM,
243         },
244         [1] = {
245                 .start  = 106,
246                 .flags  = IORESOURCE_IRQ,
247         },
248 };
249
250 static struct platform_device lcdc_device = {
251         .name           = "sh_mobile_lcdc_fb",
252         .num_resources  = ARRAY_SIZE(lcdc_resources),
253         .resource       = lcdc_resources,
254         .dev            = {
255                 .platform_data  = &lcdc_info,
256         },
257         .archdata = {
258                 .hwblk_id = HWBLK_LCDC,
259         },
260 };
261
262 /* CEU0 */
263 static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
264         .flags = SH_CEU_FLAG_USE_8BIT_BUS,
265 };
266
267 static struct resource ceu0_resources[] = {
268         [0] = {
269                 .name   = "CEU0",
270                 .start  = 0xfe910000,
271                 .end    = 0xfe91009f,
272                 .flags  = IORESOURCE_MEM,
273         },
274         [1] = {
275                 .start  = 52,
276                 .flags  = IORESOURCE_IRQ,
277         },
278         [2] = {
279                 /* place holder for contiguous memory */
280         },
281 };
282
283 static struct platform_device ceu0_device = {
284         .name           = "sh_mobile_ceu",
285         .id             = 0, /* "ceu0" clock */
286         .num_resources  = ARRAY_SIZE(ceu0_resources),
287         .resource       = ceu0_resources,
288         .dev    = {
289                 .platform_data  = &sh_mobile_ceu0_info,
290         },
291         .archdata = {
292                 .hwblk_id = HWBLK_CEU0,
293         },
294 };
295
296 /* CEU1 */
297 static struct sh_mobile_ceu_info sh_mobile_ceu1_info = {
298         .flags = SH_CEU_FLAG_USE_8BIT_BUS,
299 };
300
301 static struct resource ceu1_resources[] = {
302         [0] = {
303                 .name   = "CEU1",
304                 .start  = 0xfe914000,
305                 .end    = 0xfe91409f,
306                 .flags  = IORESOURCE_MEM,
307         },
308         [1] = {
309                 .start  = 63,
310                 .flags  = IORESOURCE_IRQ,
311         },
312         [2] = {
313                 /* place holder for contiguous memory */
314         },
315 };
316
317 static struct platform_device ceu1_device = {
318         .name           = "sh_mobile_ceu",
319         .id             = 1, /* "ceu1" clock */
320         .num_resources  = ARRAY_SIZE(ceu1_resources),
321         .resource       = ceu1_resources,
322         .dev    = {
323                 .platform_data  = &sh_mobile_ceu1_info,
324         },
325         .archdata = {
326                 .hwblk_id = HWBLK_CEU1,
327         },
328 };
329
330 /* I2C device */
331 static struct i2c_board_info i2c1_devices[] = {
332         {
333                 I2C_BOARD_INFO("r2025sd", 0x32),
334         },
335 };
336
337 /* KEYSC */
338 static struct sh_keysc_info keysc_info = {
339         .mode           = SH_KEYSC_MODE_1,
340         .scan_timing    = 3,
341         .delay          = 50,
342         .kycr2_delay    = 100,
343         .keycodes       = { KEY_1, 0, 0, 0, 0,
344                             KEY_2, 0, 0, 0, 0,
345                             KEY_3, 0, 0, 0, 0,
346                             KEY_4, 0, 0, 0, 0,
347                             KEY_5, 0, 0, 0, 0,
348                             KEY_6, 0, 0, 0, 0, },
349 };
350
351 static struct resource keysc_resources[] = {
352         [0] = {
353                 .name   = "KEYSC",
354                 .start  = 0x044b0000,
355                 .end    = 0x044b000f,
356                 .flags  = IORESOURCE_MEM,
357         },
358         [1] = {
359                 .start  = 79,
360                 .flags  = IORESOURCE_IRQ,
361         },
362 };
363
364 static struct platform_device keysc_device = {
365         .name           = "sh_keysc",
366         .id             = 0, /* keysc0 clock */
367         .num_resources  = ARRAY_SIZE(keysc_resources),
368         .resource       = keysc_resources,
369         .dev    = {
370                 .platform_data  = &keysc_info,
371         },
372         .archdata = {
373                 .hwblk_id = HWBLK_KEYSC,
374         },
375 };
376
377 static struct platform_device *ecovec_devices[] __initdata = {
378         &heartbeat_device,
379         &nor_flash_device,
380         &sh_eth_device,
381         &usb0_host_device,
382         &usb1_host_device, /* USB1 host support */
383         &lcdc_device,
384         &ceu0_device,
385         &ceu1_device,
386         &keysc_device,
387 };
388
389 #define EEPROM_ADDR 0x50
390 static u8 mac_read(struct i2c_adapter *a, u8 command)
391 {
392         struct i2c_msg msg[2];
393         u8 buf;
394         int ret;
395
396         msg[0].addr  = EEPROM_ADDR;
397         msg[0].flags = 0;
398         msg[0].len   = 1;
399         msg[0].buf   = &command;
400
401         msg[1].addr  = EEPROM_ADDR;
402         msg[1].flags = I2C_M_RD;
403         msg[1].len   = 1;
404         msg[1].buf   = &buf;
405
406         ret = i2c_transfer(a, msg, 2);
407         if (ret < 0) {
408                 printk(KERN_ERR "error %d\n", ret);
409                 buf = 0xff;
410         }
411
412         return buf;
413 }
414
415 #define MAC_LEN 6
416 static void __init sh_eth_init(void)
417 {
418         struct i2c_adapter *a = i2c_get_adapter(1);
419         struct clk *eth_clk;
420         u8 mac[MAC_LEN];
421         int i;
422
423         if (!a) {
424                 pr_err("can not get I2C 1\n");
425                 return;
426         }
427
428         eth_clk = clk_get(NULL, "eth0");
429         if (!eth_clk) {
430                 pr_err("can not get eth0 clk\n");
431                 return;
432         }
433
434         /* read MAC address frome EEPROM */
435         for (i = 0; i < MAC_LEN; i++) {
436                 mac[i] = mac_read(a, 0x10 + i);
437                 msleep(10);
438         }
439
440         /* clock enable */
441         clk_enable(eth_clk);
442
443         /* reset sh-eth */
444         ctrl_outl(0x1, SH_ETH_ADDR + 0x0);
445
446         /* set MAC addr */
447         ctrl_outl((mac[0] << 24) |
448                   (mac[1] << 16) |
449                   (mac[2] <<  8) |
450                   (mac[3] <<  0), SH_ETH_MAHR);
451         ctrl_outl((mac[4] <<  8) |
452                   (mac[5] <<  0), SH_ETH_MALR);
453
454         clk_put(eth_clk);
455 }
456
457 #define PORT_HIZA 0xA4050158
458 #define IODRIVEA  0xA405018A
459 static int __init arch_setup(void)
460 {
461         /* enable SCIFA0 */
462         gpio_request(GPIO_FN_SCIF0_TXD, NULL);
463         gpio_request(GPIO_FN_SCIF0_RXD, NULL);
464
465         /* enable debug LED */
466         gpio_request(GPIO_PTG0, NULL);
467         gpio_request(GPIO_PTG1, NULL);
468         gpio_request(GPIO_PTG2, NULL);
469         gpio_request(GPIO_PTG3, NULL);
470         gpio_direction_output(GPIO_PTG0, 0);
471         gpio_direction_output(GPIO_PTG1, 0);
472         gpio_direction_output(GPIO_PTG2, 0);
473         gpio_direction_output(GPIO_PTG3, 0);
474         ctrl_outw((ctrl_inw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA);
475
476         /* enable SH-Eth */
477         gpio_request(GPIO_PTA1, NULL);
478         gpio_direction_output(GPIO_PTA1, 1);
479         mdelay(20);
480
481         gpio_request(GPIO_FN_RMII_RXD0,    NULL);
482         gpio_request(GPIO_FN_RMII_RXD1,    NULL);
483         gpio_request(GPIO_FN_RMII_TXD0,    NULL);
484         gpio_request(GPIO_FN_RMII_TXD1,    NULL);
485         gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
486         gpio_request(GPIO_FN_RMII_TX_EN,   NULL);
487         gpio_request(GPIO_FN_RMII_RX_ER,   NULL);
488         gpio_request(GPIO_FN_RMII_CRS_DV,  NULL);
489         gpio_request(GPIO_FN_MDIO,         NULL);
490         gpio_request(GPIO_FN_MDC,          NULL);
491         gpio_request(GPIO_FN_LNKSTA,       NULL);
492
493         /* enable USB */
494         ctrl_outw(0x0000, 0xA4D80000);
495         ctrl_outw(0x0000, 0xA4D90000);
496         gpio_request(GPIO_PTB3,  NULL);
497         gpio_request(GPIO_PTB4,  NULL);
498         gpio_request(GPIO_PTB5,  NULL);
499         gpio_direction_input(GPIO_PTB3);
500         gpio_direction_output(GPIO_PTB4, 0);
501         gpio_direction_output(GPIO_PTB5, 0);
502         ctrl_outw(0x0600, 0xa40501d4);
503         ctrl_outw(0x0600, 0xa4050192);
504
505         /* enable LCDC */
506         gpio_request(GPIO_FN_LCDD23,   NULL);
507         gpio_request(GPIO_FN_LCDD22,   NULL);
508         gpio_request(GPIO_FN_LCDD21,   NULL);
509         gpio_request(GPIO_FN_LCDD20,   NULL);
510         gpio_request(GPIO_FN_LCDD19,   NULL);
511         gpio_request(GPIO_FN_LCDD18,   NULL);
512         gpio_request(GPIO_FN_LCDD17,   NULL);
513         gpio_request(GPIO_FN_LCDD16,   NULL);
514         gpio_request(GPIO_FN_LCDD15,   NULL);
515         gpio_request(GPIO_FN_LCDD14,   NULL);
516         gpio_request(GPIO_FN_LCDD13,   NULL);
517         gpio_request(GPIO_FN_LCDD12,   NULL);
518         gpio_request(GPIO_FN_LCDD11,   NULL);
519         gpio_request(GPIO_FN_LCDD10,   NULL);
520         gpio_request(GPIO_FN_LCDD9,    NULL);
521         gpio_request(GPIO_FN_LCDD8,    NULL);
522         gpio_request(GPIO_FN_LCDD7,    NULL);
523         gpio_request(GPIO_FN_LCDD6,    NULL);
524         gpio_request(GPIO_FN_LCDD5,    NULL);
525         gpio_request(GPIO_FN_LCDD4,    NULL);
526         gpio_request(GPIO_FN_LCDD3,    NULL);
527         gpio_request(GPIO_FN_LCDD2,    NULL);
528         gpio_request(GPIO_FN_LCDD1,    NULL);
529         gpio_request(GPIO_FN_LCDD0,    NULL);
530         gpio_request(GPIO_FN_LCDDISP,  NULL);
531         gpio_request(GPIO_FN_LCDHSYN,  NULL);
532         gpio_request(GPIO_FN_LCDDCK,   NULL);
533         gpio_request(GPIO_FN_LCDVSYN,  NULL);
534         gpio_request(GPIO_FN_LCDDON,   NULL);
535         gpio_request(GPIO_FN_LCDLCLK,  NULL);
536         ctrl_outw((ctrl_inw(PORT_HIZA) & ~0x0001), PORT_HIZA);
537
538         gpio_request(GPIO_PTE6, NULL);
539         gpio_request(GPIO_PTU1, NULL);
540         gpio_request(GPIO_PTR1, NULL);
541         gpio_request(GPIO_PTA2, NULL);
542         gpio_direction_input(GPIO_PTE6);
543         gpio_direction_output(GPIO_PTU1, 0);
544         gpio_direction_output(GPIO_PTR1, 0);
545         gpio_direction_output(GPIO_PTA2, 0);
546
547         /* I/O buffer drive ability is low */
548         ctrl_outw((ctrl_inw(IODRIVEA) & ~0x00c0) | 0x0040 , IODRIVEA);
549
550         if (gpio_get_value(GPIO_PTE6)) {
551                 /* DVI */
552                 lcdc_info.clock_source                  = LCDC_CLK_EXTERNAL;
553                 lcdc_info.ch[0].clock_divider           = 1,
554                 lcdc_info.ch[0].lcd_cfg.name            = "DVI";
555                 lcdc_info.ch[0].lcd_cfg.xres            = 1280;
556                 lcdc_info.ch[0].lcd_cfg.yres            = 720;
557                 lcdc_info.ch[0].lcd_cfg.left_margin     = 220;
558                 lcdc_info.ch[0].lcd_cfg.right_margin    = 110;
559                 lcdc_info.ch[0].lcd_cfg.hsync_len       = 40;
560                 lcdc_info.ch[0].lcd_cfg.upper_margin    = 20;
561                 lcdc_info.ch[0].lcd_cfg.lower_margin    = 5;
562                 lcdc_info.ch[0].lcd_cfg.vsync_len       = 5;
563
564                 gpio_set_value(GPIO_PTA2, 1);
565                 gpio_set_value(GPIO_PTU1, 1);
566         } else {
567                 /* Panel */
568
569                 lcdc_info.clock_source                  = LCDC_CLK_PERIPHERAL;
570                 lcdc_info.ch[0].clock_divider           = 2,
571                 lcdc_info.ch[0].lcd_cfg.name            = "Panel";
572                 lcdc_info.ch[0].lcd_cfg.xres            = 800;
573                 lcdc_info.ch[0].lcd_cfg.yres            = 480;
574                 lcdc_info.ch[0].lcd_cfg.left_margin     = 220;
575                 lcdc_info.ch[0].lcd_cfg.right_margin    = 110;
576                 lcdc_info.ch[0].lcd_cfg.hsync_len       = 70;
577                 lcdc_info.ch[0].lcd_cfg.upper_margin    = 20;
578                 lcdc_info.ch[0].lcd_cfg.lower_margin    = 5;
579                 lcdc_info.ch[0].lcd_cfg.vsync_len       = 5;
580
581                 gpio_set_value(GPIO_PTR1, 1);
582
583                 /* FIXME
584                  *
585                  * LCDDON control is needed for Panel,
586                  * but current sh_mobile_lcdc driver doesn't control it.
587                  * It is temporary correspondence
588                  */
589                 gpio_request(GPIO_PTF4, NULL);
590                 gpio_direction_output(GPIO_PTF4, 1);
591         }
592
593         /* enable CEU0 */
594         gpio_request(GPIO_FN_VIO0_D15, NULL);
595         gpio_request(GPIO_FN_VIO0_D14, NULL);
596         gpio_request(GPIO_FN_VIO0_D13, NULL);
597         gpio_request(GPIO_FN_VIO0_D12, NULL);
598         gpio_request(GPIO_FN_VIO0_D11, NULL);
599         gpio_request(GPIO_FN_VIO0_D10, NULL);
600         gpio_request(GPIO_FN_VIO0_D9,  NULL);
601         gpio_request(GPIO_FN_VIO0_D8,  NULL);
602         gpio_request(GPIO_FN_VIO0_D7,  NULL);
603         gpio_request(GPIO_FN_VIO0_D6,  NULL);
604         gpio_request(GPIO_FN_VIO0_D5,  NULL);
605         gpio_request(GPIO_FN_VIO0_D4,  NULL);
606         gpio_request(GPIO_FN_VIO0_D3,  NULL);
607         gpio_request(GPIO_FN_VIO0_D2,  NULL);
608         gpio_request(GPIO_FN_VIO0_D1,  NULL);
609         gpio_request(GPIO_FN_VIO0_D0,  NULL);
610         gpio_request(GPIO_FN_VIO0_VD,  NULL);
611         gpio_request(GPIO_FN_VIO0_CLK, NULL);
612         gpio_request(GPIO_FN_VIO0_FLD, NULL);
613         gpio_request(GPIO_FN_VIO0_HD,  NULL);
614         platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
615
616         /* enable CEU1 */
617         gpio_request(GPIO_FN_VIO1_D7,  NULL);
618         gpio_request(GPIO_FN_VIO1_D6,  NULL);
619         gpio_request(GPIO_FN_VIO1_D5,  NULL);
620         gpio_request(GPIO_FN_VIO1_D4,  NULL);
621         gpio_request(GPIO_FN_VIO1_D3,  NULL);
622         gpio_request(GPIO_FN_VIO1_D2,  NULL);
623         gpio_request(GPIO_FN_VIO1_D1,  NULL);
624         gpio_request(GPIO_FN_VIO1_D0,  NULL);
625         gpio_request(GPIO_FN_VIO1_FLD, NULL);
626         gpio_request(GPIO_FN_VIO1_HD,  NULL);
627         gpio_request(GPIO_FN_VIO1_VD,  NULL);
628         gpio_request(GPIO_FN_VIO1_CLK, NULL);
629         platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
630
631         /* enable KEYSC */
632         gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
633         gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
634         gpio_request(GPIO_FN_KEYOUT3,     NULL);
635         gpio_request(GPIO_FN_KEYOUT2,     NULL);
636         gpio_request(GPIO_FN_KEYOUT1,     NULL);
637         gpio_request(GPIO_FN_KEYOUT0,     NULL);
638         gpio_request(GPIO_FN_KEYIN0,      NULL);
639
640         /* enable I2C device */
641         i2c_register_board_info(1, i2c1_devices,
642                                 ARRAY_SIZE(i2c1_devices));
643
644         return platform_add_devices(ecovec_devices,
645                                     ARRAY_SIZE(ecovec_devices));
646 }
647 arch_initcall(arch_setup);
648
649 static int __init devices_setup(void)
650 {
651         sh_eth_init();
652         return 0;
653 }
654 device_initcall(devices_setup);
655
656
657 static struct sh_machine_vector mv_ecovec __initmv = {
658         .mv_name        = "R0P7724 (EcoVec)",
659 };