blob: 36a4ca3a90008eb33c99dde97608424506f3e2a8 [file] [log] [blame]
Kuninori Morimoto287c1292009-05-26 07:04:52 +00001/*
2 * linux/arch/sh/boards/se/7724/setup.c
3 *
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 *
6 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/device.h>
15#include <linux/interrupt.h>
16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h>
18#include <linux/delay.h>
19#include <linux/smc91x.h>
20#include <linux/gpio.h>
21#include <linux/input.h>
Magnus Damm9731f4a2009-07-03 09:40:03 +000022#include <linux/usb/r8a66597.h>
Kuninori Morimoto287c1292009-05-26 07:04:52 +000023#include <video/sh_mobile_lcdc.h>
24#include <media/sh_mobile_ceu.h>
25#include <asm/io.h>
26#include <asm/heartbeat.h>
Kuninori Morimotoa80cad92009-06-26 07:05:39 +000027#include <asm/sh_eth.h>
28#include <asm/clock.h>
Kuninori Morimoto287c1292009-05-26 07:04:52 +000029#include <asm/sh_keysc.h>
30#include <cpu/sh7724.h>
31#include <mach-se/mach/se7724.h>
32
33/*
34 * SWx 1234 5678
35 * ------------------------------------
36 * SW31 : 1001 1100 : default
37 * SW32 : 0111 1111 : use on board flash
38 *
39 * SW41 : abxx xxxx -> a = 0 : Analog monitor
40 * 1 : Digital monitor
41 * b = 0 : VGA
Kuninori Morimoto4f324312009-08-03 04:52:03 +000042 * 1 : 720p
43 */
44
45/*
46 * about 720p
47 *
48 * When you use 1280 x 720 lcdc output,
49 * you should change OSC6 lcdc clock from 25.175MHz to 74.25MHz,
50 * and change SW41 to use 720p
Kuninori Morimoto287c1292009-05-26 07:04:52 +000051 */
52
53/* Heartbeat */
54static struct heartbeat_data heartbeat_data = {
55 .regsize = 16,
56};
57
58static struct resource heartbeat_resources[] = {
59 [0] = {
60 .start = PA_LED,
61 .end = PA_LED,
62 .flags = IORESOURCE_MEM,
63 },
64};
65
66static struct platform_device heartbeat_device = {
67 .name = "heartbeat",
68 .id = -1,
69 .dev = {
70 .platform_data = &heartbeat_data,
71 },
72 .num_resources = ARRAY_SIZE(heartbeat_resources),
73 .resource = heartbeat_resources,
74};
75
76/* LAN91C111 */
77static struct smc91x_platdata smc91x_info = {
78 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
79};
80
81static struct resource smc91x_eth_resources[] = {
82 [0] = {
83 .name = "SMC91C111" ,
84 .start = 0x1a300300,
85 .end = 0x1a30030f,
86 .flags = IORESOURCE_MEM,
87 },
88 [1] = {
89 .start = IRQ0_SMC,
90 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
91 },
92};
93
94static struct platform_device smc91x_eth_device = {
95 .name = "smc91x",
96 .num_resources = ARRAY_SIZE(smc91x_eth_resources),
97 .resource = smc91x_eth_resources,
98 .dev = {
99 .platform_data = &smc91x_info,
100 },
101};
102
103/* MTD */
104static struct mtd_partition nor_flash_partitions[] = {
105 {
106 .name = "uboot",
107 .offset = 0,
108 .size = (1 * 1024 * 1024),
109 .mask_flags = MTD_WRITEABLE, /* Read-only */
110 }, {
111 .name = "kernel",
112 .offset = MTDPART_OFS_APPEND,
113 .size = (2 * 1024 * 1024),
114 }, {
115 .name = "free-area",
116 .offset = MTDPART_OFS_APPEND,
117 .size = MTDPART_SIZ_FULL,
118 },
119};
120
121static struct physmap_flash_data nor_flash_data = {
122 .width = 2,
123 .parts = nor_flash_partitions,
124 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
125};
126
127static struct resource nor_flash_resources[] = {
128 [0] = {
129 .name = "NOR Flash",
130 .start = 0x00000000,
131 .end = 0x01ffffff,
132 .flags = IORESOURCE_MEM,
133 }
134};
135
136static struct platform_device nor_flash_device = {
137 .name = "physmap-flash",
138 .resource = nor_flash_resources,
139 .num_resources = ARRAY_SIZE(nor_flash_resources),
140 .dev = {
141 .platform_data = &nor_flash_data,
142 },
143};
144
145/* LCDC */
146static struct sh_mobile_lcdc_info lcdc_info = {
147 .clock_source = LCDC_CLK_EXTERNAL,
148 .ch[0] = {
149 .chan = LCDC_CHAN_MAINLCD,
150 .bpp = 16,
151 .clock_divider = 1,
152 .lcd_cfg = {
153 .name = "LB070WV1",
154 .sync = 0, /* hsync and vsync are active low */
155 },
156 .lcd_size_cfg = { /* 7.0 inch */
157 .width = 152,
158 .height = 91,
159 },
160 .board_cfg = {
161 },
162 }
163};
164
165static struct resource lcdc_resources[] = {
166 [0] = {
167 .name = "LCDC",
168 .start = 0xfe940000,
169 .end = 0xfe941fff,
170 .flags = IORESOURCE_MEM,
171 },
172 [1] = {
173 .start = 106,
174 .flags = IORESOURCE_IRQ,
175 },
176};
177
178static struct platform_device lcdc_device = {
179 .name = "sh_mobile_lcdc_fb",
180 .num_resources = ARRAY_SIZE(lcdc_resources),
181 .resource = lcdc_resources,
182 .dev = {
183 .platform_data = &lcdc_info,
184 },
185};
186
187/* CEU0 */
188static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
189 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
190};
191
192static struct resource ceu0_resources[] = {
193 [0] = {
194 .name = "CEU0",
195 .start = 0xfe910000,
196 .end = 0xfe91009f,
197 .flags = IORESOURCE_MEM,
198 },
199 [1] = {
200 .start = 52,
201 .flags = IORESOURCE_IRQ,
202 },
203 [2] = {
204 /* place holder for contiguous memory */
205 },
206};
207
208static struct platform_device ceu0_device = {
209 .name = "sh_mobile_ceu",
210 .id = 0, /* "ceu0" clock */
211 .num_resources = ARRAY_SIZE(ceu0_resources),
212 .resource = ceu0_resources,
213 .dev = {
214 .platform_data = &sh_mobile_ceu0_info,
215 },
216};
217
218/* CEU1 */
219static struct sh_mobile_ceu_info sh_mobile_ceu1_info = {
220 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
221};
222
223static struct resource ceu1_resources[] = {
224 [0] = {
225 .name = "CEU1",
226 .start = 0xfe914000,
227 .end = 0xfe91409f,
228 .flags = IORESOURCE_MEM,
229 },
230 [1] = {
231 .start = 63,
232 .flags = IORESOURCE_IRQ,
233 },
234 [2] = {
235 /* place holder for contiguous memory */
236 },
237};
238
239static struct platform_device ceu1_device = {
240 .name = "sh_mobile_ceu",
241 .id = 1, /* "ceu1" clock */
242 .num_resources = ARRAY_SIZE(ceu1_resources),
243 .resource = ceu1_resources,
244 .dev = {
245 .platform_data = &sh_mobile_ceu1_info,
246 },
247};
248
249/* KEYSC */
250static struct sh_keysc_info keysc_info = {
251 .mode = SH_KEYSC_MODE_1,
252 .scan_timing = 10,
253 .delay = 50,
254 .keycodes = {
255 KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
256 KEY_6, KEY_7, KEY_8, KEY_9, KEY_A,
257 KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,
258 KEY_G, KEY_H, KEY_I, KEY_K, KEY_L,
259 KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q,
260 KEY_R, KEY_S, KEY_T, KEY_U, KEY_V,
261 },
262};
263
264static struct resource keysc_resources[] = {
265 [0] = {
266 .start = 0x1a204000,
267 .end = 0x1a20400f,
268 .flags = IORESOURCE_MEM,
269 },
270 [1] = {
271 .start = IRQ0_KEY,
272 .flags = IORESOURCE_IRQ,
273 },
274};
275
276static struct platform_device keysc_device = {
277 .name = "sh_keysc",
278 .id = 0, /* "keysc0" clock */
279 .num_resources = ARRAY_SIZE(keysc_resources),
280 .resource = keysc_resources,
281 .dev = {
282 .platform_data = &keysc_info,
283 },
284};
285
Kuninori Morimotoa80cad92009-06-26 07:05:39 +0000286/* SH Eth */
287static struct resource sh_eth_resources[] = {
288 [0] = {
289 .start = SH_ETH_ADDR,
290 .end = SH_ETH_ADDR + 0x1FC,
291 .flags = IORESOURCE_MEM,
292 },
293 [1] = {
294 .start = 91,
295 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
296 },
297};
298
299struct sh_eth_plat_data sh_eth_plat = {
300 .phy = 0x1f, /* SMSC LAN8187 */
301 .edmac_endian = EDMAC_LITTLE_ENDIAN,
302};
303
304static struct platform_device sh_eth_device = {
305 .name = "sh-eth",
306 .id = 0,
307 .dev = {
308 .platform_data = &sh_eth_plat,
309 },
310 .num_resources = ARRAY_SIZE(sh_eth_resources),
311 .resource = sh_eth_resources,
312};
313
Magnus Damm9731f4a2009-07-03 09:40:03 +0000314static struct r8a66597_platdata sh7724_usb0_host_data = {
Magnus Damm719a72b2009-07-17 14:59:55 +0000315 .on_chip = 1,
Magnus Damm9731f4a2009-07-03 09:40:03 +0000316};
317
318static struct resource sh7724_usb0_host_resources[] = {
319 [0] = {
320 .start = 0xa4d80000,
321 .end = 0xa4d800ff,
322 .flags = IORESOURCE_MEM,
323 },
324 [1] = {
325 .start = 65,
326 .end = 65,
327 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
328 },
329};
330
331static struct platform_device sh7724_usb0_host_device = {
332 .name = "r8a66597_hcd",
333 .id = 0,
334 .dev = {
335 .dma_mask = NULL, /* not use dma */
336 .coherent_dma_mask = 0xffffffff,
337 .platform_data = &sh7724_usb0_host_data,
338 },
339 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
340 .resource = sh7724_usb0_host_resources,
341};
342
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000343static struct platform_device *ms7724se_devices[] __initdata = {
344 &heartbeat_device,
345 &smc91x_eth_device,
346 &lcdc_device,
347 &nor_flash_device,
348 &ceu0_device,
349 &ceu1_device,
350 &keysc_device,
Kuninori Morimotoa80cad92009-06-26 07:05:39 +0000351 &sh_eth_device,
Magnus Damm9731f4a2009-07-03 09:40:03 +0000352 &sh7724_usb0_host_device,
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000353};
354
Kuninori Morimotoa80cad92009-06-26 07:05:39 +0000355#define EEPROM_OP 0xBA206000
356#define EEPROM_ADR 0xBA206004
357#define EEPROM_DATA 0xBA20600C
358#define EEPROM_STAT 0xBA206010
359#define EEPROM_STRT 0xBA206014
360static int __init sh_eth_is_eeprom_ready(void)
361{
362 int t = 10000;
363
364 while (t--) {
365 if (!ctrl_inw(EEPROM_STAT))
366 return 1;
367 cpu_relax();
368 }
369
370 printk(KERN_ERR "ms7724se can not access to eeprom\n");
371 return 0;
372}
373
374static void __init sh_eth_init(void)
375{
376 int i;
377 u16 mac[3];
378
379 /* check EEPROM status */
380 if (!sh_eth_is_eeprom_ready())
381 return;
382
383 /* read MAC addr from EEPROM */
384 for (i = 0 ; i < 3 ; i++) {
385 ctrl_outw(0x0, EEPROM_OP); /* read */
386 ctrl_outw(i*2, EEPROM_ADR);
387 ctrl_outw(0x1, EEPROM_STRT);
388 if (!sh_eth_is_eeprom_ready())
389 return;
390
391 mac[i] = ctrl_inw(EEPROM_DATA);
392 mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */
393 }
394
395 /* reset sh-eth */
396 ctrl_outl(0x1, SH_ETH_ADDR + 0x0);
397
398 /* set MAC addr */
399 ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR);
400 ctrl_outl((mac[2]), SH_ETH_MALR);
401}
402
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000403#define SW4140 0xBA201000
404#define FPGA_OUT 0xBA200400
405#define PORT_HIZA 0xA4050158
Magnus Damm9731f4a2009-07-03 09:40:03 +0000406#define PORT_MSELCRB 0xA4050182
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000407
408#define SW41_A 0x0100
409#define SW41_B 0x0200
410#define SW41_C 0x0400
411#define SW41_D 0x0800
412#define SW41_E 0x1000
413#define SW41_F 0x2000
414#define SW41_G 0x4000
415#define SW41_H 0x8000
Magnus Damm9731f4a2009-07-03 09:40:03 +0000416
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000417static int __init devices_setup(void)
418{
419 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */
420
421 /* Reset Release */
422 ctrl_outw(ctrl_inw(FPGA_OUT) &
423 ~((1 << 1) | /* LAN */
424 (1 << 6) | /* VIDEO DAC */
Kuninori Morimotoa80cad92009-06-26 07:05:39 +0000425 (1 << 12) | /* USB0 */
426 (1 << 14)), /* RMII */
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000427 FPGA_OUT);
428
Magnus Damm9731f4a2009-07-03 09:40:03 +0000429 /* turn on USB clocks, use external clock */
430 ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
431
Magnus Damm7766e162009-08-06 15:03:43 +0000432#ifdef CONFIG_PM
433 /* Let LED9 show STATUS2 */
434 gpio_request(GPIO_FN_STATUS2, NULL);
435
436 /* Lit LED10 show STATUS0 */
437 gpio_request(GPIO_FN_STATUS0, NULL);
438
439 /* Lit LED11 show PDSTATUS */
440 gpio_request(GPIO_FN_PDSTATUS, NULL);
441#else
442 /* Lit LED9 */
443 gpio_request(GPIO_PTJ6, NULL);
444 gpio_direction_output(GPIO_PTJ6, 1);
445 gpio_export(GPIO_PTJ6, 0);
446
447 /* Lit LED10 */
448 gpio_request(GPIO_PTJ5, NULL);
449 gpio_direction_output(GPIO_PTJ5, 1);
450 gpio_export(GPIO_PTJ5, 0);
451
452 /* Lit LED11 */
453 gpio_request(GPIO_PTJ7, NULL);
454 gpio_direction_output(GPIO_PTJ7, 1);
455 gpio_export(GPIO_PTJ7, 0);
456#endif
457
Magnus Damm9731f4a2009-07-03 09:40:03 +0000458 /* enable USB0 port */
459 ctrl_outw(0x0600, 0xa40501d4);
460
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000461 /* enable IRQ 0,1,2 */
462 gpio_request(GPIO_FN_INTC_IRQ0, NULL);
463 gpio_request(GPIO_FN_INTC_IRQ1, NULL);
464 gpio_request(GPIO_FN_INTC_IRQ2, NULL);
465
466 /* enable SCIFA3 */
467 gpio_request(GPIO_FN_SCIF3_I_SCK, NULL);
468 gpio_request(GPIO_FN_SCIF3_I_RXD, NULL);
469 gpio_request(GPIO_FN_SCIF3_I_TXD, NULL);
470 gpio_request(GPIO_FN_SCIF3_I_CTS, NULL);
471 gpio_request(GPIO_FN_SCIF3_I_RTS, NULL);
472
473 /* enable LCDC */
474 gpio_request(GPIO_FN_LCDD23, NULL);
475 gpio_request(GPIO_FN_LCDD22, NULL);
476 gpio_request(GPIO_FN_LCDD21, NULL);
477 gpio_request(GPIO_FN_LCDD20, NULL);
478 gpio_request(GPIO_FN_LCDD19, NULL);
479 gpio_request(GPIO_FN_LCDD18, NULL);
480 gpio_request(GPIO_FN_LCDD17, NULL);
481 gpio_request(GPIO_FN_LCDD16, NULL);
482 gpio_request(GPIO_FN_LCDD15, NULL);
483 gpio_request(GPIO_FN_LCDD14, NULL);
484 gpio_request(GPIO_FN_LCDD13, NULL);
485 gpio_request(GPIO_FN_LCDD12, NULL);
486 gpio_request(GPIO_FN_LCDD11, NULL);
487 gpio_request(GPIO_FN_LCDD10, NULL);
488 gpio_request(GPIO_FN_LCDD9, NULL);
489 gpio_request(GPIO_FN_LCDD8, NULL);
490 gpio_request(GPIO_FN_LCDD7, NULL);
491 gpio_request(GPIO_FN_LCDD6, NULL);
492 gpio_request(GPIO_FN_LCDD5, NULL);
493 gpio_request(GPIO_FN_LCDD4, NULL);
494 gpio_request(GPIO_FN_LCDD3, NULL);
495 gpio_request(GPIO_FN_LCDD2, NULL);
496 gpio_request(GPIO_FN_LCDD1, NULL);
497 gpio_request(GPIO_FN_LCDD0, NULL);
498 gpio_request(GPIO_FN_LCDDISP, NULL);
499 gpio_request(GPIO_FN_LCDHSYN, NULL);
500 gpio_request(GPIO_FN_LCDDCK, NULL);
501 gpio_request(GPIO_FN_LCDVSYN, NULL);
502 gpio_request(GPIO_FN_LCDDON, NULL);
503 gpio_request(GPIO_FN_LCDVEPWC, NULL);
504 gpio_request(GPIO_FN_LCDVCPWC, NULL);
505 gpio_request(GPIO_FN_LCDRD, NULL);
506 gpio_request(GPIO_FN_LCDLCLK, NULL);
507 ctrl_outw((ctrl_inw(PORT_HIZA) & ~0x0001), PORT_HIZA);
508
509 /* enable CEU0 */
510 gpio_request(GPIO_FN_VIO0_D15, NULL);
511 gpio_request(GPIO_FN_VIO0_D14, NULL);
512 gpio_request(GPIO_FN_VIO0_D13, NULL);
513 gpio_request(GPIO_FN_VIO0_D12, NULL);
514 gpio_request(GPIO_FN_VIO0_D11, NULL);
515 gpio_request(GPIO_FN_VIO0_D10, NULL);
516 gpio_request(GPIO_FN_VIO0_D9, NULL);
517 gpio_request(GPIO_FN_VIO0_D8, NULL);
518 gpio_request(GPIO_FN_VIO0_D7, NULL);
519 gpio_request(GPIO_FN_VIO0_D6, NULL);
520 gpio_request(GPIO_FN_VIO0_D5, NULL);
521 gpio_request(GPIO_FN_VIO0_D4, NULL);
522 gpio_request(GPIO_FN_VIO0_D3, NULL);
523 gpio_request(GPIO_FN_VIO0_D2, NULL);
524 gpio_request(GPIO_FN_VIO0_D1, NULL);
525 gpio_request(GPIO_FN_VIO0_D0, NULL);
526 gpio_request(GPIO_FN_VIO0_VD, NULL);
527 gpio_request(GPIO_FN_VIO0_CLK, NULL);
528 gpio_request(GPIO_FN_VIO0_FLD, NULL);
529 gpio_request(GPIO_FN_VIO0_HD, NULL);
Magnus Damm84f75972009-07-01 04:55:35 +0000530 platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000531
532 /* enable CEU1 */
533 gpio_request(GPIO_FN_VIO1_D7, NULL);
534 gpio_request(GPIO_FN_VIO1_D6, NULL);
535 gpio_request(GPIO_FN_VIO1_D5, NULL);
536 gpio_request(GPIO_FN_VIO1_D4, NULL);
537 gpio_request(GPIO_FN_VIO1_D3, NULL);
538 gpio_request(GPIO_FN_VIO1_D2, NULL);
539 gpio_request(GPIO_FN_VIO1_D1, NULL);
540 gpio_request(GPIO_FN_VIO1_D0, NULL);
541 gpio_request(GPIO_FN_VIO1_FLD, NULL);
542 gpio_request(GPIO_FN_VIO1_HD, NULL);
543 gpio_request(GPIO_FN_VIO1_VD, NULL);
544 gpio_request(GPIO_FN_VIO1_CLK, NULL);
Magnus Damm84f75972009-07-01 04:55:35 +0000545 platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000546
547 /* KEYSC */
548 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
549 gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
550 gpio_request(GPIO_FN_KEYIN4, NULL);
551 gpio_request(GPIO_FN_KEYIN3, NULL);
552 gpio_request(GPIO_FN_KEYIN2, NULL);
553 gpio_request(GPIO_FN_KEYIN1, NULL);
554 gpio_request(GPIO_FN_KEYIN0, NULL);
555 gpio_request(GPIO_FN_KEYOUT3, NULL);
556 gpio_request(GPIO_FN_KEYOUT2, NULL);
557 gpio_request(GPIO_FN_KEYOUT1, NULL);
558 gpio_request(GPIO_FN_KEYOUT0, NULL);
559
Kuninori Morimotoa80cad92009-06-26 07:05:39 +0000560 /*
561 * enable SH-Eth
562 *
563 * please remove J33 pin from your board !!
564 *
565 * ms7724 board should not use GPIO_FN_LNKSTA pin
566 * So, This time PTX5 is set to input pin
567 */
568 gpio_request(GPIO_FN_RMII_RXD0, NULL);
569 gpio_request(GPIO_FN_RMII_RXD1, NULL);
570 gpio_request(GPIO_FN_RMII_TXD0, NULL);
571 gpio_request(GPIO_FN_RMII_TXD1, NULL);
572 gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
573 gpio_request(GPIO_FN_RMII_TX_EN, NULL);
574 gpio_request(GPIO_FN_RMII_RX_ER, NULL);
575 gpio_request(GPIO_FN_RMII_CRS_DV, NULL);
576 gpio_request(GPIO_FN_MDIO, NULL);
577 gpio_request(GPIO_FN_MDC, NULL);
578 gpio_request(GPIO_PTX5, NULL);
579 gpio_direction_input(GPIO_PTX5);
580 sh_eth_init();
581
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000582 if (sw & SW41_B) {
Kuninori Morimoto4f324312009-08-03 04:52:03 +0000583 /* 720p */
584 lcdc_info.ch[0].lcd_cfg.xres = 1280;
585 lcdc_info.ch[0].lcd_cfg.yres = 720;
586 lcdc_info.ch[0].lcd_cfg.left_margin = 220;
587 lcdc_info.ch[0].lcd_cfg.right_margin = 110;
588 lcdc_info.ch[0].lcd_cfg.hsync_len = 40;
589 lcdc_info.ch[0].lcd_cfg.upper_margin = 20;
590 lcdc_info.ch[0].lcd_cfg.lower_margin = 5;
591 lcdc_info.ch[0].lcd_cfg.vsync_len = 5;
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000592 } else {
593 /* VGA */
594 lcdc_info.ch[0].lcd_cfg.xres = 640;
595 lcdc_info.ch[0].lcd_cfg.yres = 480;
596 lcdc_info.ch[0].lcd_cfg.left_margin = 105;
597 lcdc_info.ch[0].lcd_cfg.right_margin = 50;
598 lcdc_info.ch[0].lcd_cfg.hsync_len = 96;
599 lcdc_info.ch[0].lcd_cfg.upper_margin = 33;
600 lcdc_info.ch[0].lcd_cfg.lower_margin = 10;
601 lcdc_info.ch[0].lcd_cfg.vsync_len = 2;
602 }
603
604 if (sw & SW41_A) {
605 /* Digital monitor */
606 lcdc_info.ch[0].interface_type = RGB18;
607 lcdc_info.ch[0].flags = 0;
608 } else {
609 /* Analog monitor */
610 lcdc_info.ch[0].interface_type = RGB24;
611 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
612 }
613
614 return platform_add_devices(ms7724se_devices,
Kuninori Morimotoa80cad92009-06-26 07:05:39 +0000615 ARRAY_SIZE(ms7724se_devices));
Kuninori Morimoto287c1292009-05-26 07:04:52 +0000616}
617device_initcall(devices_setup);
618
619static struct sh_machine_vector mv_ms7724se __initmv = {
620 .mv_name = "ms7724se",
621 .mv_init_irq = init_se7724_IRQ,
622 .mv_nr_irqs = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR,
623};