aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-08-26 07:04:34 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-26 22:36:10 -0400
commitfa3ba51bcf2351da9869924c8765d7d485226c31 (patch)
tree3d4fab98452eab911e91b4f6682edffb386e9c1f
parent907050a33d3b6a9f37e2ceca764b60f8e3922466 (diff)
sh: Add support LCDC for EcoVec24
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c109
1 files changed, 109 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 7850818bb4e8..a575b38016a4 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -17,6 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/usb/r8a66597.h> 19#include <linux/usb/r8a66597.h>
20#include <video/sh_mobile_lcdc.h>
20#include <asm/heartbeat.h> 21#include <asm/heartbeat.h>
21#include <asm/sh_eth.h> 22#include <asm/sh_eth.h>
22#include <cpu/sh7724.h> 23#include <cpu/sh7724.h>
@@ -211,14 +212,60 @@ static struct platform_device usb1_host_device = {
211 .resource = usb1_host_resources, 212 .resource = usb1_host_resources,
212}; 213};
213 214
215/* LCDC */
216static struct sh_mobile_lcdc_info lcdc_info = {
217 .ch[0] = {
218 .interface_type = RGB18,
219 .chan = LCDC_CHAN_MAINLCD,
220 .bpp = 16,
221 .clock_divider = 1,
222 .lcd_cfg = {
223 .sync = 0, /* hsync and vsync are active low */
224 },
225 .lcd_size_cfg = { /* 7.0 inch */
226 .width = 152,
227 .height = 91,
228 },
229 .board_cfg = {
230 },
231 }
232};
233
234static struct resource lcdc_resources[] = {
235 [0] = {
236 .name = "LCDC",
237 .start = 0xfe940000,
238 .end = 0xfe941fff,
239 .flags = IORESOURCE_MEM,
240 },
241 [1] = {
242 .start = 106,
243 .flags = IORESOURCE_IRQ,
244 },
245};
246
247static struct platform_device lcdc_device = {
248 .name = "sh_mobile_lcdc_fb",
249 .num_resources = ARRAY_SIZE(lcdc_resources),
250 .resource = lcdc_resources,
251 .dev = {
252 .platform_data = &lcdc_info,
253 },
254 .archdata = {
255 .hwblk_id = HWBLK_LCDC,
256 },
257};
258
214static struct platform_device *ecovec_devices[] __initdata = { 259static struct platform_device *ecovec_devices[] __initdata = {
215 &heartbeat_device, 260 &heartbeat_device,
216 &nor_flash_device, 261 &nor_flash_device,
217 &sh_eth_device, 262 &sh_eth_device,
218 &usb0_host_device, 263 &usb0_host_device,
219 &usb1_host_device, /* USB1 host support */ 264 &usb1_host_device, /* USB1 host support */
265 &lcdc_device,
220}; 266};
221 267
268#define PORT_HIZA 0xA4050158
222static int __init devices_setup(void) 269static int __init devices_setup(void)
223{ 270{
224 /* enable SCIFA0 */ 271 /* enable SCIFA0 */
@@ -262,6 +309,68 @@ static int __init devices_setup(void)
262 ctrl_outw(0x0600, 0xa40501d4); 309 ctrl_outw(0x0600, 0xa40501d4);
263 ctrl_outw(0x0600, 0xa4050192); 310 ctrl_outw(0x0600, 0xa4050192);
264 311
312 /* enable LCDC */
313 gpio_request(GPIO_FN_LCDD23, NULL);
314 gpio_request(GPIO_FN_LCDD22, NULL);
315 gpio_request(GPIO_FN_LCDD21, NULL);
316 gpio_request(GPIO_FN_LCDD20, NULL);
317 gpio_request(GPIO_FN_LCDD19, NULL);
318 gpio_request(GPIO_FN_LCDD18, NULL);
319 gpio_request(GPIO_FN_LCDD17, NULL);
320 gpio_request(GPIO_FN_LCDD16, NULL);
321 gpio_request(GPIO_FN_LCDD15, NULL);
322 gpio_request(GPIO_FN_LCDD14, NULL);
323 gpio_request(GPIO_FN_LCDD13, NULL);
324 gpio_request(GPIO_FN_LCDD12, NULL);
325 gpio_request(GPIO_FN_LCDD11, NULL);
326 gpio_request(GPIO_FN_LCDD10, NULL);
327 gpio_request(GPIO_FN_LCDD9, NULL);
328 gpio_request(GPIO_FN_LCDD8, NULL);
329 gpio_request(GPIO_FN_LCDD7, NULL);
330 gpio_request(GPIO_FN_LCDD6, NULL);
331 gpio_request(GPIO_FN_LCDD5, NULL);
332 gpio_request(GPIO_FN_LCDD4, NULL);
333 gpio_request(GPIO_FN_LCDD3, NULL);
334 gpio_request(GPIO_FN_LCDD2, NULL);
335 gpio_request(GPIO_FN_LCDD1, NULL);
336 gpio_request(GPIO_FN_LCDD0, NULL);
337 gpio_request(GPIO_FN_LCDDISP, NULL);
338 gpio_request(GPIO_FN_LCDHSYN, NULL);
339 gpio_request(GPIO_FN_LCDDCK, NULL);
340 gpio_request(GPIO_FN_LCDVSYN, NULL);
341 gpio_request(GPIO_FN_LCDDON, NULL);
342 gpio_request(GPIO_FN_LCDLCLK, NULL);
343 ctrl_outw((ctrl_inw(PORT_HIZA) & ~0x0001), PORT_HIZA);
344
345 gpio_request(GPIO_PTE6, NULL);
346 gpio_request(GPIO_PTU1, NULL);
347 gpio_request(GPIO_PTR1, NULL);
348 gpio_request(GPIO_PTA2, NULL);
349 gpio_direction_input(GPIO_PTE6);
350 gpio_direction_output(GPIO_PTU1, 0);
351 gpio_direction_output(GPIO_PTR1, 0);
352 gpio_direction_output(GPIO_PTA2, 0);
353
354 if (gpio_get_value(GPIO_PTE6)) {
355 /* DVI */
356 lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
357 lcdc_info.ch[0].lcd_cfg.name = "DVI";
358 lcdc_info.ch[0].lcd_cfg.xres = 1280;
359 lcdc_info.ch[0].lcd_cfg.yres = 720;
360 lcdc_info.ch[0].lcd_cfg.left_margin = 220;
361 lcdc_info.ch[0].lcd_cfg.right_margin = 110;
362 lcdc_info.ch[0].lcd_cfg.hsync_len = 40;
363 lcdc_info.ch[0].lcd_cfg.upper_margin = 20;
364 lcdc_info.ch[0].lcd_cfg.lower_margin = 5;
365 lcdc_info.ch[0].lcd_cfg.vsync_len = 5;
366
367 gpio_set_value(GPIO_PTA2, 1);
368 gpio_set_value(GPIO_PTU1, 1);
369 } else {
370 /* Panel */
371 /* not supported */
372 }
373
265 return platform_add_devices(ecovec_devices, 374 return platform_add_devices(ecovec_devices,
266 ARRAY_SIZE(ecovec_devices)); 375 ARRAY_SIZE(ecovec_devices));
267} 376}