aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-armadillo800eva.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-04-06 04:30:09 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-12 16:33:04 -0400
commitdad29d1c29b7a8699403e45822065d979309f756 (patch)
tree4e461d96020fc1e81524c33e746716e06ab188bf /arch/arm/mach-shmobile/board-armadillo800eva.c
parentedc4910171f332466fa8f164de3d2395d80163db (diff)
ARM: mach-shmobile: armadillo800eva: add support LCDC0
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Simon Horman <horms@verge.net.au> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile/board-armadillo800eva.c')
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 28bc259c50df..5cc17a89f600 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -24,6 +24,7 @@
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/videodev2.h>
27#include <mach/common.h> 28#include <mach/common.h>
28#include <mach/irqs.h> 29#include <mach/irqs.h>
29#include <asm/page.h> 30#include <asm/page.h>
@@ -33,6 +34,7 @@
33#include <asm/mach/time.h> 34#include <asm/mach/time.h>
34#include <asm/hardware/cache-l2x0.h> 35#include <asm/hardware/cache-l2x0.h>
35#include <mach/r8a7740.h> 36#include <mach/r8a7740.h>
37#include <video/sh_mobile_lcdc.h>
36 38
37/* 39/*
38 * CON1 Camera Module 40 * CON1 Camera Module
@@ -92,10 +94,66 @@
92 *-----------+---------------+---------------------------- 94 *-----------+---------------+----------------------------
93 */ 95 */
94 96
97/* LCDC */
98static struct fb_videomode lcdc0_mode = {
99 .name = "AMPIER/AM-800480",
100 .xres = 800,
101 .yres = 480,
102 .left_margin = 88,
103 .right_margin = 40,
104 .hsync_len = 128,
105 .upper_margin = 20,
106 .lower_margin = 5,
107 .vsync_len = 5,
108 .sync = 0,
109};
110
111static struct sh_mobile_lcdc_info lcdc0_info = {
112 .clock_source = LCDC_CLK_BUS,
113 .ch[0] = {
114 .chan = LCDC_CHAN_MAINLCD,
115 .fourcc = V4L2_PIX_FMT_RGB565,
116 .interface_type = RGB24,
117 .clock_divider = 5,
118 .flags = 0,
119 .lcd_modes = &lcdc0_mode,
120 .num_modes = 1,
121 .panel_cfg = {
122 .width = 111,
123 .height = 68,
124 },
125 },
126};
127
128static struct resource lcdc0_resources[] = {
129 [0] = {
130 .name = "LCD0",
131 .start = 0xfe940000,
132 .end = 0xfe943fff,
133 .flags = IORESOURCE_MEM,
134 },
135 [1] = {
136 .start = intcs_evt2irq(0x580),
137 .flags = IORESOURCE_IRQ,
138 },
139};
140
141static struct platform_device lcdc0_device = {
142 .name = "sh_mobile_lcdc_fb",
143 .num_resources = ARRAY_SIZE(lcdc0_resources),
144 .resource = lcdc0_resources,
145 .id = 0,
146 .dev = {
147 .platform_data = &lcdc0_info,
148 .coherent_dma_mask = ~0,
149 },
150};
151
95/* 152/*
96 * board devices 153 * board devices
97 */ 154 */
98static struct platform_device *eva_devices[] __initdata = { 155static struct platform_device *eva_devices[] __initdata = {
156 &lcdc0_device,
99}; 157};
100 158
101/* 159/*
@@ -109,6 +167,53 @@ static void __init eva_init(void)
109 gpio_request(GPIO_FN_SCIFA1_RXD, NULL); 167 gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
110 gpio_request(GPIO_FN_SCIFA1_TXD, NULL); 168 gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
111 169
170 /* LCDC0 */
171 gpio_request(GPIO_FN_LCDC0_SELECT, NULL);
172 gpio_request(GPIO_FN_LCD0_D0, NULL);
173 gpio_request(GPIO_FN_LCD0_D1, NULL);
174 gpio_request(GPIO_FN_LCD0_D2, NULL);
175 gpio_request(GPIO_FN_LCD0_D3, NULL);
176 gpio_request(GPIO_FN_LCD0_D4, NULL);
177 gpio_request(GPIO_FN_LCD0_D5, NULL);
178 gpio_request(GPIO_FN_LCD0_D6, NULL);
179 gpio_request(GPIO_FN_LCD0_D7, NULL);
180 gpio_request(GPIO_FN_LCD0_D8, NULL);
181 gpio_request(GPIO_FN_LCD0_D9, NULL);
182 gpio_request(GPIO_FN_LCD0_D10, NULL);
183 gpio_request(GPIO_FN_LCD0_D11, NULL);
184 gpio_request(GPIO_FN_LCD0_D12, NULL);
185 gpio_request(GPIO_FN_LCD0_D13, NULL);
186 gpio_request(GPIO_FN_LCD0_D14, NULL);
187 gpio_request(GPIO_FN_LCD0_D15, NULL);
188 gpio_request(GPIO_FN_LCD0_D16, NULL);
189 gpio_request(GPIO_FN_LCD0_D17, NULL);
190 gpio_request(GPIO_FN_LCD0_D18_PORT40, NULL);
191 gpio_request(GPIO_FN_LCD0_D19_PORT4, NULL);
192 gpio_request(GPIO_FN_LCD0_D20_PORT3, NULL);
193 gpio_request(GPIO_FN_LCD0_D21_PORT2, NULL);
194 gpio_request(GPIO_FN_LCD0_D22_PORT0, NULL);
195 gpio_request(GPIO_FN_LCD0_D23_PORT1, NULL);
196 gpio_request(GPIO_FN_LCD0_DCK, NULL);
197 gpio_request(GPIO_FN_LCD0_VSYN, NULL);
198 gpio_request(GPIO_FN_LCD0_HSYN, NULL);
199 gpio_request(GPIO_FN_LCD0_DISP, NULL);
200 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
201
202 gpio_request(GPIO_PORT61, NULL); /* LCDDON */
203 gpio_direction_output(GPIO_PORT61, 1);
204
205 gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
206 gpio_direction_output(GPIO_PORT202, 0);
207
208 /*
209 * CAUTION
210 *
211 * DBGMD/LCDC0/FSIA MUX
212 * DBGMD_SELECT_B should be set after setting PFC Function.
213 */
214 gpio_request(GPIO_PORT176, NULL);
215 gpio_direction_output(GPIO_PORT176, 1);
216
112#ifdef CONFIG_CACHE_L2X0 217#ifdef CONFIG_CACHE_L2X0
113 /* Early BRESP enable, Shared attribute override enable, 32K*8way */ 218 /* Early BRESP enable, Shared attribute override enable, 32K*8way */
114 l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff); 219 l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);