aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-04-08 07:17:01 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-24 09:50:07 -0400
commit233628328037c02cf3db6165cab5d3f43587c5f3 (patch)
treef46e2a4084f25324c7afbfa4f27a84d8e9650b47 /drivers/video
parentd66b15818c16af35ddb5da7b53905d9f6f62a45b (diff)
OMAPDSS: Add basic omap5 features to dss and dispc
Add basic omap5 features for dss and dispc. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c2
-rw-r--r--drivers/video/omap2/dss/dss.c8
-rw-r--r--drivers/video/omap2/dss/dss_features.c93
3 files changed, 103 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index d512c389741..e52c5778938 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3829,6 +3829,8 @@ static int __init dispc_init_features(struct device *dev)
3829 src = &omap34xx_rev3_0_dispc_feats; 3829 src = &omap34xx_rev3_0_dispc_feats;
3830 } else if (cpu_is_omap44xx()) { 3830 } else if (cpu_is_omap44xx()) {
3831 src = &omap44xx_dispc_feats; 3831 src = &omap44xx_dispc_feats;
3832 } else if (soc_is_omap54xx()) {
3833 src = &omap44xx_dispc_feats;
3832 } else { 3834 } else {
3833 return -ENODEV; 3835 return -ENODEV;
3834 } 3836 }
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 759dbee4834..4524c174ac5 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -123,6 +123,12 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
123 .clk_name = "dpll_per_m5x2_ck", 123 .clk_name = "dpll_per_m5x2_ck",
124}; 124};
125 125
126static const struct dss_features omap54xx_dss_feats __initconst = {
127 .fck_div_max = 64,
128 .dss_fck_multiplier = 1,
129 .clk_name = "dpll_per_h12x2_ck",
130};
131
126static inline void dss_write_reg(const struct dss_reg idx, u32 val) 132static inline void dss_write_reg(const struct dss_reg idx, u32 val)
127{ 133{
128 __raw_writel(val, dss.base + idx.idx); 134 __raw_writel(val, dss.base + idx.idx);
@@ -740,6 +746,8 @@ static int __init dss_init_features(struct device *dev)
740 src = &omap3630_dss_feats; 746 src = &omap3630_dss_feats;
741 else if (cpu_is_omap44xx()) 747 else if (cpu_is_omap44xx())
742 src = &omap44xx_dss_feats; 748 src = &omap44xx_dss_feats;
749 else if (soc_is_omap54xx())
750 src = &omap54xx_dss_feats;
743 else 751 else
744 return -ENODEV; 752 return -ENODEV;
745 753
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index c26fc1fb7db..af4775a2070 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -106,6 +106,21 @@ static const struct dss_reg_field omap4_dss_reg_fields[] = {
106 [FEAT_REG_DSIPLL_REGM_DSI] = { 30, 26 }, 106 [FEAT_REG_DSIPLL_REGM_DSI] = { 30, 26 },
107}; 107};
108 108
109static const struct dss_reg_field omap5_dss_reg_fields[] = {
110 [FEAT_REG_FIRHINC] = { 12, 0 },
111 [FEAT_REG_FIRVINC] = { 28, 16 },
112 [FEAT_REG_FIFOLOWTHRESHOLD] = { 15, 0 },
113 [FEAT_REG_FIFOHIGHTHRESHOLD] = { 31, 16 },
114 [FEAT_REG_FIFOSIZE] = { 15, 0 },
115 [FEAT_REG_HORIZONTALACCU] = { 10, 0 },
116 [FEAT_REG_VERTICALACCU] = { 26, 16 },
117 [FEAT_REG_DISPC_CLK_SWITCH] = { 9, 7 },
118 [FEAT_REG_DSIPLL_REGN] = { 8, 1 },
119 [FEAT_REG_DSIPLL_REGM] = { 20, 9 },
120 [FEAT_REG_DSIPLL_REGM_DISPC] = { 25, 21 },
121 [FEAT_REG_DSIPLL_REGM_DSI] = { 30, 26 },
122};
123
109static const enum omap_display_type omap2_dss_supported_displays[] = { 124static const enum omap_display_type omap2_dss_supported_displays[] = {
110 /* OMAP_DSS_CHANNEL_LCD */ 125 /* OMAP_DSS_CHANNEL_LCD */
111 OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI, 126 OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI,
@@ -144,6 +159,19 @@ static const enum omap_display_type omap4_dss_supported_displays[] = {
144 OMAP_DISPLAY_TYPE_DSI, 159 OMAP_DISPLAY_TYPE_DSI,
145}; 160};
146 161
162static const enum omap_display_type omap5_dss_supported_displays[] = {
163 /* OMAP_DSS_CHANNEL_LCD */
164 OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI |
165 OMAP_DISPLAY_TYPE_DSI,
166
167 /* OMAP_DSS_CHANNEL_DIGIT */
168 OMAP_DISPLAY_TYPE_HDMI | OMAP_DISPLAY_TYPE_DPI,
169
170 /* OMAP_DSS_CHANNEL_LCD2 */
171 OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI |
172 OMAP_DISPLAY_TYPE_DSI,
173};
174
147static const enum omap_color_mode omap2_dss_supported_color_modes[] = { 175static const enum omap_color_mode omap2_dss_supported_color_modes[] = {
148 /* OMAP_DSS_GFX */ 176 /* OMAP_DSS_GFX */
149 OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | 177 OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 |
@@ -298,6 +326,14 @@ static const char * const omap4_dss_clk_source_names[] = {
298 [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "PLL2_CLK2", 326 [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "PLL2_CLK2",
299}; 327};
300 328
329static const char * const omap5_dss_clk_source_names[] = {
330 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "DPLL_DSI1_A_CLK1",
331 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "DPLL_DSI1_A_CLK2",
332 [OMAP_DSS_CLK_SRC_FCK] = "DSS_CLK",
333 [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC] = "DPLL_DSI1_C_CLK1",
334 [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "DPLL_DSI1_C_CLK2",
335};
336
301static const struct dss_param_range omap2_dss_param_range[] = { 337static const struct dss_param_range omap2_dss_param_range[] = {
302 [FEAT_PARAM_DSS_FCK] = { 0, 173000000 }, 338 [FEAT_PARAM_DSS_FCK] = { 0, 173000000 },
303 [FEAT_PARAM_DSS_PCD] = { 2, 255 }, 339 [FEAT_PARAM_DSS_PCD] = { 2, 255 },
@@ -349,6 +385,22 @@ static const struct dss_param_range omap4_dss_param_range[] = {
349 [FEAT_PARAM_MGR_HEIGHT] = { 1, 2048 }, 385 [FEAT_PARAM_MGR_HEIGHT] = { 1, 2048 },
350}; 386};
351 387
388static const struct dss_param_range omap5_dss_param_range[] = {
389 [FEAT_PARAM_DSS_FCK] = { 0, 200000000 },
390 [FEAT_PARAM_DSS_PCD] = { 1, 255 },
391 [FEAT_PARAM_DSIPLL_REGN] = { 0, (1 << 8) - 1 },
392 [FEAT_PARAM_DSIPLL_REGM] = { 0, (1 << 12) - 1 },
393 [FEAT_PARAM_DSIPLL_REGM_DISPC] = { 0, (1 << 5) - 1 },
394 [FEAT_PARAM_DSIPLL_REGM_DSI] = { 0, (1 << 5) - 1 },
395 [FEAT_PARAM_DSIPLL_FINT] = { 500000, 2500000 },
396 [FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 },
397 [FEAT_PARAM_DSI_FCK] = { 0, 170000000 },
398 [FEAT_PARAM_DOWNSCALE] = { 1, 4 },
399 [FEAT_PARAM_LINEWIDTH] = { 1, 2048 },
400 [FEAT_PARAM_MGR_WIDTH] = { 1, 2048 },
401 [FEAT_PARAM_MGR_HEIGHT] = { 1, 2048 },
402};
403
352static const enum dss_feat_id omap2_dss_feat_list[] = { 404static const enum dss_feat_id omap2_dss_feat_list[] = {
353 FEAT_LCDENABLEPOL, 405 FEAT_LCDENABLEPOL,
354 FEAT_LCDENABLESIGNAL, 406 FEAT_LCDENABLESIGNAL,
@@ -450,6 +502,25 @@ static const enum dss_feat_id omap4_dss_feat_list[] = {
450 FEAT_BURST_2D, 502 FEAT_BURST_2D,
451}; 503};
452 504
505static const enum dss_feat_id omap5_dss_feat_list[] = {
506 FEAT_MGR_LCD2,
507 FEAT_CORE_CLK_DIV,
508 FEAT_LCD_CLK_SRC,
509 FEAT_DSI_DCS_CMD_CONFIG_VC,
510 FEAT_DSI_VC_OCP_WIDTH,
511 FEAT_DSI_GNQ,
512 FEAT_HDMI_CTS_SWMODE,
513 FEAT_HDMI_AUDIO_USE_MCLK,
514 FEAT_HANDLE_UV_SEPARATE,
515 FEAT_ATTR2,
516 FEAT_CPR,
517 FEAT_PRELOAD,
518 FEAT_FIR_COEF_V,
519 FEAT_ALPHA_FREE_ZORDER,
520 FEAT_FIFO_MERGE,
521 FEAT_BURST_2D,
522};
523
453/* OMAP2 DSS Features */ 524/* OMAP2 DSS Features */
454static const struct omap_dss_features omap2_dss_features = { 525static const struct omap_dss_features omap2_dss_features = {
455 .reg_fields = omap2_dss_reg_fields, 526 .reg_fields = omap2_dss_reg_fields,
@@ -570,6 +641,26 @@ static const struct omap_dss_features omap4_dss_features = {
570 .burst_size_unit = 16, 641 .burst_size_unit = 16,
571}; 642};
572 643
644/* OMAP5 DSS Features */
645static const struct omap_dss_features omap5_dss_features = {
646 .reg_fields = omap5_dss_reg_fields,
647 .num_reg_fields = ARRAY_SIZE(omap5_dss_reg_fields),
648
649 .features = omap5_dss_feat_list,
650 .num_features = ARRAY_SIZE(omap5_dss_feat_list),
651
652 .num_mgrs = 3,
653 .num_ovls = 4,
654 .supported_displays = omap5_dss_supported_displays,
655 .supported_color_modes = omap4_dss_supported_color_modes,
656 .overlay_caps = omap4_dss_overlay_caps,
657 .clksrc_names = omap5_dss_clk_source_names,
658 .dss_params = omap5_dss_param_range,
659 .supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
660 .buffer_size_unit = 16,
661 .burst_size_unit = 16,
662};
663
573#if defined(CONFIG_OMAP4_DSS_HDMI) 664#if defined(CONFIG_OMAP4_DSS_HDMI)
574/* HDMI OMAP4 Functions*/ 665/* HDMI OMAP4 Functions*/
575static const struct ti_hdmi_ip_ops omap4_hdmi_functions = { 666static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
@@ -707,6 +798,8 @@ void dss_features_init(void)
707 omap_current_dss_features = &omap4430_es2_0_1_2_dss_features; 798 omap_current_dss_features = &omap4430_es2_0_1_2_dss_features;
708 else if (cpu_is_omap44xx()) 799 else if (cpu_is_omap44xx())
709 omap_current_dss_features = &omap4_dss_features; 800 omap_current_dss_features = &omap4_dss_features;
801 else if (soc_is_omap54xx())
802 omap_current_dss_features = &omap5_dss_features;
710 else 803 else
711 DSSWARN("Unsupported OMAP version"); 804 DSSWARN("Unsupported OMAP version");
712} 805}