diff options
-rw-r--r-- | arch/arm/mach-s3c2412/mach-jive.c | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index 7cfab868cce3..b528ed93773c 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/arch/regs-gpio.h> | 34 | #include <asm/arch/regs-gpio.h> |
35 | #include <asm/arch/regs-mem.h> | 35 | #include <asm/arch/regs-mem.h> |
36 | #include <asm/arch/regs-lcd.h> | 36 | #include <asm/arch/regs-lcd.h> |
37 | #include <asm/arch/fb.h> | ||
37 | 38 | ||
38 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
39 | 40 | ||
@@ -256,11 +257,101 @@ static int __init jive_mtdset(char *options) | |||
256 | /* parse the mtdset= option given to the kernel command line */ | 257 | /* parse the mtdset= option given to the kernel command line */ |
257 | __setup("mtdset=", jive_mtdset); | 258 | __setup("mtdset=", jive_mtdset); |
258 | 259 | ||
260 | /* LCD timing and setup */ | ||
261 | |||
262 | #define LCD_XRES (240) | ||
263 | #define LCD_YRES (320) | ||
264 | #define LCD_LEFT_MARGIN (12) | ||
265 | #define LCD_RIGHT_MARGIN (12) | ||
266 | #define LCD_LOWER_MARGIN (12) | ||
267 | #define LCD_UPPER_MARGIN (12) | ||
268 | #define LCD_VSYNC (2) | ||
269 | #define LCD_HSYNC (2) | ||
270 | |||
271 | #define LCD_REFRESH (60) | ||
272 | |||
273 | #define LCD_HTOT (LCD_HSYNC + LCD_LEFT_MARGIN + LCD_XRES + LCD_RIGHT_MARGIN) | ||
274 | #define LCD_VTOT (LCD_VSYNC + LCD_LOWER_MARGIN + LCD_YRES + LCD_UPPER_MARGIN) | ||
275 | |||
276 | struct s3c2410fb_display jive_vgg2432a4_display[] = { | ||
277 | [0] = { | ||
278 | .width = LCD_XRES, | ||
279 | .height = LCD_YRES, | ||
280 | .xres = LCD_XRES, | ||
281 | .yres = LCD_YRES, | ||
282 | .left_margin = LCD_LEFT_MARGIN, | ||
283 | .right_margin = LCD_RIGHT_MARGIN, | ||
284 | .upper_margin = LCD_UPPER_MARGIN, | ||
285 | .lower_margin = LCD_LOWER_MARGIN, | ||
286 | .hsync_len = LCD_HSYNC, | ||
287 | .vsync_len = LCD_VSYNC, | ||
288 | |||
289 | .pixclock = (1000000000000LL / | ||
290 | (LCD_REFRESH * LCD_HTOT * LCD_VTOT)), | ||
291 | |||
292 | .bpp = 16, | ||
293 | .type = (S3C2410_LCDCON1_TFT16BPP | | ||
294 | S3C2410_LCDCON1_TFT), | ||
295 | |||
296 | .lcdcon5 = (S3C2410_LCDCON5_FRM565 | | ||
297 | S3C2410_LCDCON5_INVVLINE | | ||
298 | S3C2410_LCDCON5_INVVFRAME | | ||
299 | S3C2410_LCDCON5_INVVDEN | | ||
300 | S3C2410_LCDCON5_PWREN), | ||
301 | }, | ||
302 | }; | ||
303 | |||
304 | /* todo - put into gpio header */ | ||
305 | |||
306 | #define S3C2410_GPCCON_MASK(x) (3 << ((x) * 2)) | ||
307 | #define S3C2410_GPDCON_MASK(x) (3 << ((x) * 2)) | ||
308 | |||
309 | struct s3c2410fb_mach_info jive_lcd_config = { | ||
310 | .displays = jive_vgg2432a4_display, | ||
311 | .num_displays = ARRAY_SIZE(jive_vgg2432a4_display), | ||
312 | .default_display = 0, | ||
313 | |||
314 | /* Enable VD[2..7], VD[10..15], VD[18..23] and VCLK, syncs, VDEN | ||
315 | * and disable the pull down resistors on pins we are using for LCD | ||
316 | * data. */ | ||
317 | |||
318 | .gpcup = (0xf << 1) | (0x3f << 10), | ||
319 | |||
320 | .gpccon = (S3C2410_GPC1_VCLK | S3C2410_GPC2_VLINE | | ||
321 | S3C2410_GPC3_VFRAME | S3C2410_GPC4_VM | | ||
322 | S3C2410_GPC10_VD2 | S3C2410_GPC11_VD3 | | ||
323 | S3C2410_GPC12_VD4 | S3C2410_GPC13_VD5 | | ||
324 | S3C2410_GPC14_VD6 | S3C2410_GPC15_VD7), | ||
325 | |||
326 | .gpccon_mask = (S3C2410_GPCCON_MASK(1) | S3C2410_GPCCON_MASK(2) | | ||
327 | S3C2410_GPCCON_MASK(3) | S3C2410_GPCCON_MASK(4) | | ||
328 | S3C2410_GPCCON_MASK(10) | S3C2410_GPCCON_MASK(11) | | ||
329 | S3C2410_GPCCON_MASK(12) | S3C2410_GPCCON_MASK(13) | | ||
330 | S3C2410_GPCCON_MASK(14) | S3C2410_GPCCON_MASK(15)), | ||
331 | |||
332 | .gpdup = (0x3f << 2) | (0x3f << 10), | ||
333 | |||
334 | .gpdcon = (S3C2410_GPD2_VD10 | S3C2410_GPD3_VD11 | | ||
335 | S3C2410_GPD4_VD12 | S3C2410_GPD5_VD13 | | ||
336 | S3C2410_GPD6_VD14 | S3C2410_GPD7_VD15 | | ||
337 | S3C2410_GPD10_VD18 | S3C2410_GPD11_VD19 | | ||
338 | S3C2410_GPD12_VD20 | S3C2410_GPD13_VD21 | | ||
339 | S3C2410_GPD14_VD22 | S3C2410_GPD15_VD23), | ||
340 | |||
341 | .gpdcon_mask = (S3C2410_GPDCON_MASK(2) | S3C2410_GPDCON_MASK(3) | | ||
342 | S3C2410_GPDCON_MASK(4) | S3C2410_GPDCON_MASK(5) | | ||
343 | S3C2410_GPDCON_MASK(6) | S3C2410_GPDCON_MASK(7) | | ||
344 | S3C2410_GPDCON_MASK(10) | S3C2410_GPDCON_MASK(11)| | ||
345 | S3C2410_GPDCON_MASK(12) | S3C2410_GPDCON_MASK(13)| | ||
346 | S3C2410_GPDCON_MASK(14) | S3C2410_GPDCON_MASK(15)), | ||
347 | }; | ||
348 | |||
259 | static struct platform_device *jive_devices[] __initdata = { | 349 | static struct platform_device *jive_devices[] __initdata = { |
260 | &s3c_device_usb, | 350 | &s3c_device_usb, |
261 | &s3c_device_rtc, | 351 | &s3c_device_rtc, |
262 | &s3c_device_wdt, | 352 | &s3c_device_wdt, |
263 | &s3c_device_i2c, | 353 | &s3c_device_i2c, |
354 | &s3c_device_lcd, | ||
264 | &s3c_device_nand, | 355 | &s3c_device_nand, |
265 | &s3c_device_usbgadget, | 356 | &s3c_device_usbgadget, |
266 | }; | 357 | }; |
@@ -419,6 +510,7 @@ static void __init jive_machine_init(void) | |||
419 | S3C2410_MISCCR_USBSUSPND1, 0x0); | 510 | S3C2410_MISCCR_USBSUSPND1, 0x0); |
420 | 511 | ||
421 | s3c24xx_udc_set_platdata(&jive_udc_cfg); | 512 | s3c24xx_udc_set_platdata(&jive_udc_cfg); |
513 | s3c24xx_fb_set_platdata(&jive_lcd_config); | ||
422 | 514 | ||
423 | platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices)); | 515 | platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices)); |
424 | } | 516 | } |