Skip to content

Commit 42c9dee

Browse files
committed
OMAP: DSS2: Remove FB_OMAP_BOOTLOADER_INIT support
FB_OMAP_BOOTLOADER_INIT does not work, and it was only partially implemented for SDI. This patch removes support for FB_OMAP_BOOTLOADER_INIT to clean up the code and to remove any assumptions that FB_OMAP_BOOTLOADER_INIT would work. Proper implementation is much more complex, requiring early boot time register and clock handling to keep the DSS running. Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent 1bb4783 commit 42c9dee

File tree

4 files changed

+28
-65
lines changed

4 files changed

+28
-65
lines changed

drivers/video/omap2/dss/core.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ static inline void dss_uninitialize_debugfs(void)
166166
static int omap_dss_probe(struct platform_device *pdev)
167167
{
168168
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
169-
int skip_init = 0;
170169
int r;
171170
int i;
172171

@@ -210,13 +209,8 @@ static int omap_dss_probe(struct platform_device *pdev)
210209
goto err_venc;
211210
}
212211

213-
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
214-
/* DISPC_CONTROL */
215-
if (omap_readl(0x48050440) & 1) /* LCD enabled? */
216-
skip_init = 1;
217-
#endif
218212
if (cpu_is_omap34xx()) {
219-
r = sdi_init(skip_init);
213+
r = sdi_init();
220214
if (r) {
221215
DSSERR("Failed to initialize SDI\n");
222216
goto err_sdi;

drivers/video/omap2/dss/dss.c

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
559559
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */
560560
}
561561

562-
static int dss_init(bool skip_init)
562+
static int dss_init(void)
563563
{
564564
int r;
565565
u32 rev;
@@ -578,22 +578,20 @@ static int dss_init(bool skip_init)
578578
goto fail0;
579579
}
580580

581-
if (!skip_init) {
582-
/* disable LCD and DIGIT output. This seems to fix the synclost
583-
* problem that we get, if the bootloader starts the DSS and
584-
* the kernel resets it */
585-
omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
586-
587-
/* We need to wait here a bit, otherwise we sometimes start to
588-
* get synclost errors, and after that only power cycle will
589-
* restore DSS functionality. I have no idea why this happens.
590-
* And we have to wait _before_ resetting the DSS, but after
591-
* enabling clocks.
592-
*/
593-
msleep(50);
594-
595-
_omap_dss_reset();
596-
}
581+
/* disable LCD and DIGIT output. This seems to fix the synclost
582+
* problem that we get, if the bootloader starts the DSS and
583+
* the kernel resets it */
584+
omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
585+
586+
/* We need to wait here a bit, otherwise we sometimes start to
587+
* get synclost errors, and after that only power cycle will
588+
* restore DSS functionality. I have no idea why this happens.
589+
* And we have to wait _before_ resetting the DSS, but after
590+
* enabling clocks.
591+
*/
592+
msleep(50);
593+
594+
_omap_dss_reset();
597595

598596
/* autoidle */
599597
REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
@@ -954,7 +952,6 @@ void dss_debug_dump_clocks(struct seq_file *s)
954952
static int omap_dsshw_probe(struct platform_device *pdev)
955953
{
956954
int r;
957-
int skip_init = 0;
958955

959956
dss.pdev = pdev;
960957

@@ -967,13 +964,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
967964
dss.ctx_id = dss_get_ctx_id();
968965
DSSDBG("initial ctx id %u\n", dss.ctx_id);
969966

970-
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
971-
/* DISPC_CONTROL */
972-
if (omap_readl(0x48050440) & 1) /* LCD enabled? */
973-
skip_init = 1;
974-
#endif
975-
976-
r = dss_init(skip_init);
967+
r = dss_init();
977968
if (r) {
978969
DSSERR("Failed to initialize DSS\n");
979970
goto err_dss;

drivers/video/omap2/dss/dss.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
251251

252252
/* SDI */
253253
#ifdef CONFIG_OMAP2_DSS_SDI
254-
int sdi_init(bool skip_init);
254+
int sdi_init(void);
255255
void sdi_exit(void);
256256
int sdi_init_display(struct omap_dss_device *display);
257257
#else
258-
static inline int sdi_init(bool skip_init)
258+
static inline int sdi_init(void)
259259
{
260260
return 0;
261261
}

drivers/video/omap2/dss/sdi.c

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "dss.h"
3131

3232
static struct {
33-
bool skip_init;
3433
bool update_enabled;
3534
struct regulator *vdds_sdi_reg;
3635
} sdi;
@@ -68,9 +67,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
6867
if (r)
6968
goto err1;
7069

71-
/* In case of skip_init sdi_init has already enabled the clocks */
72-
if (!sdi.skip_init)
73-
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
70+
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
7471

7572
sdi_basic_init(dssdev);
7673

@@ -80,14 +77,8 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
8077
dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
8178
dssdev->panel.acbi, dssdev->panel.acb);
8279

83-
if (!sdi.skip_init) {
84-
r = dss_calc_clock_div(1, t->pixel_clock * 1000,
85-
&dss_cinfo, &dispc_cinfo);
86-
} else {
87-
r = dss_get_clock_div(&dss_cinfo);
88-
r = dispc_get_clock_div(dssdev->manager->id, &dispc_cinfo);
89-
}
90-
80+
r = dss_calc_clock_div(1, t->pixel_clock * 1000,
81+
&dss_cinfo, &dispc_cinfo);
9182
if (r)
9283
goto err2;
9384

@@ -116,18 +107,14 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
116107
if (r)
117108
goto err2;
118109

119-
if (!sdi.skip_init) {
120-
dss_sdi_init(dssdev->phy.sdi.datapairs);
121-
r = dss_sdi_enable();
122-
if (r)
123-
goto err1;
124-
mdelay(2);
125-
}
110+
dss_sdi_init(dssdev->phy.sdi.datapairs);
111+
r = dss_sdi_enable();
112+
if (r)
113+
goto err1;
114+
mdelay(2);
126115

127116
dssdev->manager->enable(dssdev->manager);
128117

129-
sdi.skip_init = 0;
130-
131118
return 0;
132119
err2:
133120
dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
@@ -173,17 +160,8 @@ int sdi_init_display(struct omap_dss_device *dssdev)
173160
return 0;
174161
}
175162

176-
int sdi_init(bool skip_init)
163+
int sdi_init(void)
177164
{
178-
/* we store this for first display enable, then clear it */
179-
sdi.skip_init = skip_init;
180-
181-
/*
182-
* Enable clocks already here, otherwise there would be a toggle
183-
* of them until sdi_display_enable is called.
184-
*/
185-
if (skip_init)
186-
dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
187165
return 0;
188166
}
189167

0 commit comments

Comments
 (0)