mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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 <tomi.valkeinen@ti.com>
This commit is contained in:
		
							parent
							
								
									1bb4783506
								
							
						
					
					
						commit
						42c9dee821
					
				
					 4 changed files with 26 additions and 63 deletions
				
			
		| 
						 | 
					@ -166,7 +166,6 @@ static inline void dss_uninitialize_debugfs(void)
 | 
				
			||||||
static int omap_dss_probe(struct platform_device *pdev)
 | 
					static int omap_dss_probe(struct platform_device *pdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
 | 
						struct omap_dss_board_info *pdata = pdev->dev.platform_data;
 | 
				
			||||||
	int skip_init = 0;
 | 
					 | 
				
			||||||
	int r;
 | 
						int r;
 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -210,13 +209,8 @@ static int omap_dss_probe(struct platform_device *pdev)
 | 
				
			||||||
		goto err_venc;
 | 
							goto err_venc;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
 | 
					 | 
				
			||||||
	/* DISPC_CONTROL */
 | 
					 | 
				
			||||||
	if (omap_readl(0x48050440) & 1)	/* LCD enabled? */
 | 
					 | 
				
			||||||
		skip_init = 1;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	if (cpu_is_omap34xx()) {
 | 
						if (cpu_is_omap34xx()) {
 | 
				
			||||||
		r = sdi_init(skip_init);
 | 
							r = sdi_init();
 | 
				
			||||||
		if (r) {
 | 
							if (r) {
 | 
				
			||||||
			DSSERR("Failed to initialize SDI\n");
 | 
								DSSERR("Failed to initialize SDI\n");
 | 
				
			||||||
			goto err_sdi;
 | 
								goto err_sdi;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -559,7 +559,7 @@ void dss_set_dac_pwrdn_bgz(bool enable)
 | 
				
			||||||
	REG_FLD_MOD(DSS_CONTROL, enable, 5, 5);	/* DAC Power-Down Control */
 | 
						REG_FLD_MOD(DSS_CONTROL, enable, 5, 5);	/* DAC Power-Down Control */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int dss_init(bool skip_init)
 | 
					static int dss_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int r;
 | 
						int r;
 | 
				
			||||||
	u32 rev;
 | 
						u32 rev;
 | 
				
			||||||
| 
						 | 
					@ -578,22 +578,20 @@ static int dss_init(bool skip_init)
 | 
				
			||||||
		goto fail0;
 | 
							goto fail0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!skip_init) {
 | 
						/* disable LCD and DIGIT output. This seems to fix the synclost
 | 
				
			||||||
		/* disable LCD and DIGIT output. This seems to fix the synclost
 | 
						 * problem that we get, if the bootloader starts the DSS and
 | 
				
			||||||
		 * problem that we get, if the bootloader starts the DSS and
 | 
						 * the kernel resets it */
 | 
				
			||||||
		 * the kernel resets it */
 | 
						omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
 | 
				
			||||||
		omap_writel(omap_readl(0x48050440) & ~0x3, 0x48050440);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* We need to wait here a bit, otherwise we sometimes start to
 | 
						/* We need to wait here a bit, otherwise we sometimes start to
 | 
				
			||||||
		 * get synclost errors, and after that only power cycle will
 | 
						 * get synclost errors, and after that only power cycle will
 | 
				
			||||||
		 * restore DSS functionality. I have no idea why this happens.
 | 
						 * restore DSS functionality. I have no idea why this happens.
 | 
				
			||||||
		 * And we have to wait _before_ resetting the DSS, but after
 | 
						 * And we have to wait _before_ resetting the DSS, but after
 | 
				
			||||||
		 * enabling clocks.
 | 
						 * enabling clocks.
 | 
				
			||||||
		 */
 | 
						 */
 | 
				
			||||||
		msleep(50);
 | 
						msleep(50);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		_omap_dss_reset();
 | 
						_omap_dss_reset();
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* autoidle */
 | 
						/* autoidle */
 | 
				
			||||||
	REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
 | 
						REG_FLD_MOD(DSS_SYSCONFIG, 1, 0, 0);
 | 
				
			||||||
| 
						 | 
					@ -954,7 +952,6 @@ void dss_debug_dump_clocks(struct seq_file *s)
 | 
				
			||||||
static int omap_dsshw_probe(struct platform_device *pdev)
 | 
					static int omap_dsshw_probe(struct platform_device *pdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int r;
 | 
						int r;
 | 
				
			||||||
	int skip_init = 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dss.pdev = pdev;
 | 
						dss.pdev = pdev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -967,13 +964,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
 | 
				
			||||||
	dss.ctx_id = dss_get_ctx_id();
 | 
						dss.ctx_id = dss_get_ctx_id();
 | 
				
			||||||
	DSSDBG("initial ctx id %u\n", dss.ctx_id);
 | 
						DSSDBG("initial ctx id %u\n", dss.ctx_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
 | 
						r = dss_init();
 | 
				
			||||||
	/* DISPC_CONTROL */
 | 
					 | 
				
			||||||
	if (omap_readl(0x48050440) & 1)	/* LCD enabled? */
 | 
					 | 
				
			||||||
		skip_init = 1;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	r = dss_init(skip_init);
 | 
					 | 
				
			||||||
	if (r) {
 | 
						if (r) {
 | 
				
			||||||
		DSSERR("Failed to initialize DSS\n");
 | 
							DSSERR("Failed to initialize DSS\n");
 | 
				
			||||||
		goto err_dss;
 | 
							goto err_dss;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -251,11 +251,11 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SDI */
 | 
					/* SDI */
 | 
				
			||||||
#ifdef CONFIG_OMAP2_DSS_SDI
 | 
					#ifdef CONFIG_OMAP2_DSS_SDI
 | 
				
			||||||
int sdi_init(bool skip_init);
 | 
					int sdi_init(void);
 | 
				
			||||||
void sdi_exit(void);
 | 
					void sdi_exit(void);
 | 
				
			||||||
int sdi_init_display(struct omap_dss_device *display);
 | 
					int sdi_init_display(struct omap_dss_device *display);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
static inline int sdi_init(bool skip_init)
 | 
					static inline int sdi_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,6 @@
 | 
				
			||||||
#include "dss.h"
 | 
					#include "dss.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct {
 | 
					static struct {
 | 
				
			||||||
	bool skip_init;
 | 
					 | 
				
			||||||
	bool update_enabled;
 | 
						bool update_enabled;
 | 
				
			||||||
	struct regulator *vdds_sdi_reg;
 | 
						struct regulator *vdds_sdi_reg;
 | 
				
			||||||
} sdi;
 | 
					} sdi;
 | 
				
			||||||
| 
						 | 
					@ -68,9 +67,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 | 
				
			||||||
	if (r)
 | 
						if (r)
 | 
				
			||||||
		goto err1;
 | 
							goto err1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* In case of skip_init sdi_init has already enabled the clocks */
 | 
						dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 | 
				
			||||||
	if (!sdi.skip_init)
 | 
					 | 
				
			||||||
		dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sdi_basic_init(dssdev);
 | 
						sdi_basic_init(dssdev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -80,14 +77,8 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 | 
				
			||||||
	dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
 | 
						dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
 | 
				
			||||||
			dssdev->panel.acbi, dssdev->panel.acb);
 | 
								dssdev->panel.acbi, dssdev->panel.acb);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!sdi.skip_init) {
 | 
						r = dss_calc_clock_div(1, t->pixel_clock * 1000,
 | 
				
			||||||
		r = dss_calc_clock_div(1, t->pixel_clock * 1000,
 | 
								&dss_cinfo, &dispc_cinfo);
 | 
				
			||||||
				&dss_cinfo, &dispc_cinfo);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		r = dss_get_clock_div(&dss_cinfo);
 | 
					 | 
				
			||||||
		r = dispc_get_clock_div(dssdev->manager->id, &dispc_cinfo);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (r)
 | 
						if (r)
 | 
				
			||||||
		goto err2;
 | 
							goto err2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -116,18 +107,14 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 | 
				
			||||||
	if (r)
 | 
						if (r)
 | 
				
			||||||
		goto err2;
 | 
							goto err2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!sdi.skip_init) {
 | 
						dss_sdi_init(dssdev->phy.sdi.datapairs);
 | 
				
			||||||
		dss_sdi_init(dssdev->phy.sdi.datapairs);
 | 
						r = dss_sdi_enable();
 | 
				
			||||||
		r = dss_sdi_enable();
 | 
						if (r)
 | 
				
			||||||
		if (r)
 | 
							goto err1;
 | 
				
			||||||
			goto err1;
 | 
						mdelay(2);
 | 
				
			||||||
		mdelay(2);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dssdev->manager->enable(dssdev->manager);
 | 
						dssdev->manager->enable(dssdev->manager);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sdi.skip_init = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
err2:
 | 
					err2:
 | 
				
			||||||
	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 | 
						dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK);
 | 
				
			||||||
| 
						 | 
					@ -173,17 +160,8 @@ int sdi_init_display(struct omap_dss_device *dssdev)
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int sdi_init(bool skip_init)
 | 
					int sdi_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* we store this for first display enable, then clear it */
 | 
					 | 
				
			||||||
	sdi.skip_init = skip_init;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/*
 | 
					 | 
				
			||||||
	 * Enable clocks already here, otherwise there would be a toggle
 | 
					 | 
				
			||||||
	 * of them until sdi_display_enable is called.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	if (skip_init)
 | 
					 | 
				
			||||||
		dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK);
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue