aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-03-06 01:53:41 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-03-06 06:57:14 -0500
commit5c44778eb0b8928aabfe039ba6f11ca88be6d650 (patch)
tree861bb2bab929e96787cf300beecb4d82b30f9d63
parent23f1365677a84f775d374a1d8ca0360257685894 (diff)
video: s3c-fb: Add support EXYNOS5 FIMD
This patch adds s3c_fb_driverdata s3c_fb_data_exynos5 for EXYNOS5 and adds extended timing control setting. EXYNOS5 FIMD needs extended setting for video timing control. Additional bits are added to VIDTCON2, VIDWxxADD2, VIDOSDxA and VIDOSDxB registers in order to set timing value for lager resolution. Also, address offset of VIDTCONx registers is changed from 0x0 to 0x20000, thus variable type should be changed to int type to handle the address offset of VIDTCONx registers for EXYNOS5 FIMD. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb.h24
-rw-r--r--drivers/video/s3c-fb.c52
2 files changed, 63 insertions, 13 deletions
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
index bbb16e0aa1f6..9a78012d6f43 100644
--- a/arch/arm/plat-samsung/include/plat/regs-fb.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
@@ -167,15 +167,17 @@
167#define VIDTCON1_HSPW(_x) ((_x) << 0) 167#define VIDTCON1_HSPW(_x) ((_x) << 0)
168 168
169#define VIDTCON2 (0x18) 169#define VIDTCON2 (0x18)
170#define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23)
170#define VIDTCON2_LINEVAL_MASK (0x7ff << 11) 171#define VIDTCON2_LINEVAL_MASK (0x7ff << 11)
171#define VIDTCON2_LINEVAL_SHIFT (11) 172#define VIDTCON2_LINEVAL_SHIFT (11)
172#define VIDTCON2_LINEVAL_LIMIT (0x7ff) 173#define VIDTCON2_LINEVAL_LIMIT (0x7ff)
173#define VIDTCON2_LINEVAL(_x) ((_x) << 11) 174#define VIDTCON2_LINEVAL(_x) (((_x) & 0x7ff) << 11)
174 175
176#define VIDTCON2_HOZVAL_E(_x) ((((_x) & 0x800) >> 11) << 22)
175#define VIDTCON2_HOZVAL_MASK (0x7ff << 0) 177#define VIDTCON2_HOZVAL_MASK (0x7ff << 0)
176#define VIDTCON2_HOZVAL_SHIFT (0) 178#define VIDTCON2_HOZVAL_SHIFT (0)
177#define VIDTCON2_HOZVAL_LIMIT (0x7ff) 179#define VIDTCON2_HOZVAL_LIMIT (0x7ff)
178#define VIDTCON2_HOZVAL(_x) ((_x) << 0) 180#define VIDTCON2_HOZVAL(_x) (((_x) & 0x7ff) << 0)
179 181
180/* WINCONx */ 182/* WINCONx */
181 183
@@ -231,25 +233,29 @@
231/* Local input channels (windows 0-2) */ 233/* Local input channels (windows 0-2) */
232#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win))) 234#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win)))
233 235
236#define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
234#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) 237#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11)
235#define VIDOSDxA_TOPLEFT_X_SHIFT (11) 238#define VIDOSDxA_TOPLEFT_X_SHIFT (11)
236#define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff) 239#define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff)
237#define VIDOSDxA_TOPLEFT_X(_x) ((_x) << 11) 240#define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x7ff) << 11)
238 241
242#define VIDOSDxA_TOPLEFT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
239#define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0) 243#define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0)
240#define VIDOSDxA_TOPLEFT_Y_SHIFT (0) 244#define VIDOSDxA_TOPLEFT_Y_SHIFT (0)
241#define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff) 245#define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff)
242#define VIDOSDxA_TOPLEFT_Y(_x) ((_x) << 0) 246#define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x7ff) << 0)
243 247
248#define VIDOSDxB_BOTRIGHT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
244#define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11) 249#define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11)
245#define VIDOSDxB_BOTRIGHT_X_SHIFT (11) 250#define VIDOSDxB_BOTRIGHT_X_SHIFT (11)
246#define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff) 251#define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff)
247#define VIDOSDxB_BOTRIGHT_X(_x) ((_x) << 11) 252#define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x7ff) << 11)
248 253
254#define VIDOSDxB_BOTRIGHT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
249#define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0) 255#define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0)
250#define VIDOSDxB_BOTRIGHT_Y_SHIFT (0) 256#define VIDOSDxB_BOTRIGHT_Y_SHIFT (0)
251#define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff) 257#define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff)
252#define VIDOSDxB_BOTRIGHT_Y(_x) ((_x) << 0) 258#define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x7ff) << 0)
253 259
254/* For VIDOSD[1..4]C */ 260/* For VIDOSD[1..4]C */
255#define VIDISD14C_ALPHA0_R(_x) ((_x) << 20) 261#define VIDISD14C_ALPHA0_R(_x) ((_x) << 20)
@@ -281,15 +287,17 @@
281#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8)) 287#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8))
282#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4)) 288#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4))
283 289
290#define VIDW_BUF_SIZE_OFFSET_E(_x) ((((_x) & 0x2000) >> 13) << 27)
284#define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13) 291#define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13)
285#define VIDW_BUF_SIZE_OFFSET_SHIFT (13) 292#define VIDW_BUF_SIZE_OFFSET_SHIFT (13)
286#define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff) 293#define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff)
287#define VIDW_BUF_SIZE_OFFSET(_x) ((_x) << 13) 294#define VIDW_BUF_SIZE_OFFSET(_x) (((_x) & 0x1fff) << 13)
288 295
296#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x) ((((_x) & 0x2000) >> 13) << 26)
289#define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0) 297#define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0)
290#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0) 298#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0)
291#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff) 299#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff)
292#define VIDW_BUF_SIZE_PAGEWIDTH(_x) ((_x) << 0) 300#define VIDW_BUF_SIZE_PAGEWIDTH(_x) (((_x) & 0x1fff) << 0)
293 301
294/* Interrupt controls and status */ 302/* Interrupt controls and status */
295 303
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 1fb7ddf8fb5f..f3105160bf98 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -89,7 +89,7 @@ struct s3c_fb;
89struct s3c_fb_variant { 89struct s3c_fb_variant {
90 unsigned int is_2443:1; 90 unsigned int is_2443:1;
91 unsigned short nr_windows; 91 unsigned short nr_windows;
92 unsigned short vidtcon; 92 unsigned int vidtcon;
93 unsigned short wincon; 93 unsigned short wincon;
94 unsigned short winmap; 94 unsigned short winmap;
95 unsigned short keycon; 95 unsigned short keycon;
@@ -568,7 +568,9 @@ static int s3c_fb_set_par(struct fb_info *info)
568 writel(data, regs + sfb->variant.vidtcon + 4); 568 writel(data, regs + sfb->variant.vidtcon + 4);
569 569
570 data = VIDTCON2_LINEVAL(var->yres - 1) | 570 data = VIDTCON2_LINEVAL(var->yres - 1) |
571 VIDTCON2_HOZVAL(var->xres - 1); 571 VIDTCON2_HOZVAL(var->xres - 1) |
572 VIDTCON2_LINEVAL_E(var->yres - 1) |
573 VIDTCON2_HOZVAL_E(var->xres - 1);
572 writel(data, regs + sfb->variant.vidtcon + 8); 574 writel(data, regs + sfb->variant.vidtcon + 8);
573 } 575 }
574 576
@@ -584,17 +586,23 @@ static int s3c_fb_set_par(struct fb_info *info)
584 586
585 pagewidth = (var->xres * var->bits_per_pixel) >> 3; 587 pagewidth = (var->xres * var->bits_per_pixel) >> 3;
586 data = VIDW_BUF_SIZE_OFFSET(info->fix.line_length - pagewidth) | 588 data = VIDW_BUF_SIZE_OFFSET(info->fix.line_length - pagewidth) |
587 VIDW_BUF_SIZE_PAGEWIDTH(pagewidth); 589 VIDW_BUF_SIZE_PAGEWIDTH(pagewidth) |
590 VIDW_BUF_SIZE_OFFSET_E(info->fix.line_length - pagewidth) |
591 VIDW_BUF_SIZE_PAGEWIDTH_E(pagewidth);
588 writel(data, regs + sfb->variant.buf_size + (win_no * 4)); 592 writel(data, regs + sfb->variant.buf_size + (win_no * 4));
589 593
590 /* write 'OSD' registers to control position of framebuffer */ 594 /* write 'OSD' registers to control position of framebuffer */
591 595
592 data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0); 596 data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0) |
597 VIDOSDxA_TOPLEFT_X_E(0) | VIDOSDxA_TOPLEFT_Y_E(0);
593 writel(data, regs + VIDOSD_A(win_no, sfb->variant)); 598 writel(data, regs + VIDOSD_A(win_no, sfb->variant));
594 599
595 data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel, 600 data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
596 var->xres - 1)) | 601 var->xres - 1)) |
597 VIDOSDxB_BOTRIGHT_Y(var->yres - 1); 602 VIDOSDxB_BOTRIGHT_Y(var->yres - 1) |
603 VIDOSDxB_BOTRIGHT_X_E(s3c_fb_align_word(var->bits_per_pixel,
604 var->xres - 1)) |
605 VIDOSDxB_BOTRIGHT_Y_E(var->yres - 1);
598 606
599 writel(data, regs + VIDOSD_B(win_no, sfb->variant)); 607 writel(data, regs + VIDOSD_B(win_no, sfb->variant));
600 608
@@ -1903,6 +1911,37 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
1903 .win[4] = &s3c_fb_data_s5p_wins[4], 1911 .win[4] = &s3c_fb_data_s5p_wins[4],
1904}; 1912};
1905 1913
1914static struct s3c_fb_driverdata s3c_fb_data_exynos5 = {
1915 .variant = {
1916 .nr_windows = 5,
1917 .vidtcon = VIDTCON0,
1918 .wincon = WINCON(0),
1919 .winmap = WINxMAP(0),
1920 .keycon = WKEYCON,
1921 .osd = VIDOSD_BASE,
1922 .osd_stride = 16,
1923 .buf_start = VIDW_BUF_START(0),
1924 .buf_size = VIDW_BUF_SIZE(0),
1925 .buf_end = VIDW_BUF_END(0),
1926
1927 .palette = {
1928 [0] = 0x2400,
1929 [1] = 0x2800,
1930 [2] = 0x2c00,
1931 [3] = 0x3000,
1932 [4] = 0x3400,
1933 },
1934 .has_shadowcon = 1,
1935 .has_blendcon = 1,
1936 .has_fixvclk = 1,
1937 },
1938 .win[0] = &s3c_fb_data_s5p_wins[0],
1939 .win[1] = &s3c_fb_data_s5p_wins[1],
1940 .win[2] = &s3c_fb_data_s5p_wins[2],
1941 .win[3] = &s3c_fb_data_s5p_wins[3],
1942 .win[4] = &s3c_fb_data_s5p_wins[4],
1943};
1944
1906/* S3C2443/S3C2416 style hardware */ 1945/* S3C2443/S3C2416 style hardware */
1907static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = { 1946static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
1908 .variant = { 1947 .variant = {
@@ -1981,6 +2020,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
1981 .name = "exynos4-fb", 2020 .name = "exynos4-fb",
1982 .driver_data = (unsigned long)&s3c_fb_data_exynos4, 2021 .driver_data = (unsigned long)&s3c_fb_data_exynos4,
1983 }, { 2022 }, {
2023 .name = "exynos5-fb",
2024 .driver_data = (unsigned long)&s3c_fb_data_exynos5,
2025 }, {
1984 .name = "s3c2443-fb", 2026 .name = "s3c2443-fb",
1985 .driver_data = (unsigned long)&s3c_fb_data_s3c2443, 2027 .driver_data = (unsigned long)&s3c_fb_data_s3c2443,
1986 }, { 2028 }, {