Skip to contentSkip to conversation

staging: sm750fb: remove 750LE code

PATCH In review Sudip Mukherjee 3 participants 7 messages Mar 19, 2015

Subsystems (2)
lore
Share & tools
lore

Sudip Mukherjee

author maintainer
#0 lore raw

PATCH 1/2 staging: sm750fb: remove 750LE code

750LE is a special version of the hardware with Ip Core and Silicon Motion is making this hardware only for Huawei. It is not available to anyone else.
So its better to remove the codes related to SM750LE.

---

this patch will generate warning from checkpatch. but since those were already there in the file so nothing has been done about it. and I am not sure if this patch will apply or not as some patches of Lorenzo Stoakes and Ragavendra Nagraj are already pending. if those patches are already applied then this will not apply.

 drivers/staging/sm750fb/ddk750_chip.c  | 64 ++++++----------------------------
 drivers/staging/sm750fb/ddk750_mode.c  | 19 +++-------
 drivers/staging/sm750fb/ddk750_swi2c.c |  3 --
 drivers/staging/sm750fb/sm750.c        |  9 ++---
 drivers/staging/sm750fb/sm750_hw.c     | 55 ++++-------------------------
 5 files changed, 24 insertions(+), 126 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +10 -54
index 33add64..a8ebedd 100644
@@ -20,22 +20,14 @@ logical_chip_type_t getChipType(void)
 	physicalID = devId750;//either 0x718 or 0x750
 	physicalRev = revId750;
 
-    if (physicalID == 0x718)
-    {
-        chip = SM718;
-    }
-    else if (physicalID == 0x750)
-    {
-        chip = SM750;
-		/* SM750 and SM750LE are different in their revision ID only. */
-		if (physicalRev == SM750LE_REVISION_ID){
-			chip = SM750LE;
-		}
-    }
-    else
-    {
-        chip = SM_UNKNOWN;
-    }
+	if (physicalID == 0x750)
+	{
+		chip = SM750;
+	}
+	else
+	{
+		chip = SM_UNKNOWN;
+	}
 
 	return chip;
 }
@@ -94,10 +86,6 @@ unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL)
 unsigned int getChipClock(void)
 {
     pll_value_t pll;
-#if 1
-	if(getChipType() == SM750LE)
-		return MHz(130);
-#endif
 
     return getPllValue(MXCLK_PLL, &pll);
 }
@@ -112,11 +100,6 @@ void setChipClock(unsigned int frequency)
 {
     pll_value_t pll;
     unsigned int ulActualMxClk;
-#if 1
-		/* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */
-		if (getChipType() == SM750LE)
-			return;
-#endif
 
     if (frequency != 0)
     {
@@ -143,11 +126,7 @@ void setChipClock(unsigned int frequency)
 void setMemoryClock(unsigned int frequency)
 {
     unsigned int ulReg, divisor;
- #if 1
-	/* Cheok_0509: For SM750LE, the memory clock is fixed. Nothing to set. */
-	if (getChipType() == SM750LE)
-		return;
-#endif
+
     if (frequency != 0)
     {
         /* Set the frequency to the maximum frequency that the DDR Memory can take
@@ -193,11 +172,7 @@ void setMemoryClock(unsigned int frequency)
 void setMasterClock(unsigned int frequency)
 {
     unsigned int ulReg, divisor;
-  #if 1
-	/* Cheok_0509: For SM750LE, the memory clock is fixed. Nothing to set. */
-	if (getChipType() == SM750LE)
-		return;
-#endif
+
     if (frequency != 0)
     {
         /* Set the frequency to the maximum frequency that the SM750 engine can
@@ -237,10 +212,6 @@ unsigned int ddk750_getVMSize(void)
 	unsigned int reg;
 	unsigned int data;
 
-	/* sm750le only use 64 mb memory*/
-	if(getChipType() == SM750LE)
-		return MB(64);
-
 	/* for 750,always use power mode0*/
 	reg = PEEK32(MODE0_GATE);
 	reg = FIELD_SET(reg,MODE0_GATE,GPIO,ON);
@@ -291,12 +262,6 @@ int ddk750_initHw(initchip_param_t * pInitParam)
 		ulReg = FIELD_SET(ulReg,VGA_CONFIGURATION,PLL,PANEL);
 		ulReg = FIELD_SET(ulReg,VGA_CONFIGURATION,MODE,GRAPHIC);
 		POKE32(VGA_CONFIGURATION,ulReg);
-	}else{
-#if defined(__i386__) || defined( __x86_64__)
-		/* set graphic mode via IO method */
-		outb_p(0x88,0x3d4);
-		outb_p(0x06,0x3d5);
-#endif
 	}
 
 	/* Set the Main Chip Clock */
@@ -444,15 +409,6 @@ unsigned int calcPllValue(unsigned int request_orig,pll_value_t *pll)
 	unsigned int tmpClock,ret;
 	pllcalparam * xparm;
 
-#if 1
-	if (getChipType() == SM750LE)
-    {
-        /* SM750LE don't have prgrammable PLL and M/N values to work on.
-           Just return the requested clock. */
-        return request_orig;
-    }
-#endif
-
 	ret = 0;
 	miniDiff = ~0;
 	request = request_orig / 1000;
drivers/staging/sm750fb/ddk750_mode.c +5 -14
index 2e418fb..44e346a 100644
@@ -107,17 +107,13 @@ static int programModeRegisters(mode_parameter_t * pModeParam,pll_value_t * pll)
 					  FIELD_SET(0,CRT_DISPLAY_CTRL,PLANE,ENABLE);
 
 
-		if(getChipType() == SM750LE){
-			displayControlAdjust_SM750LE(pModeParam,ulTmpValue);
-		}else{
-			ulReg = PEEK32(CRT_DISPLAY_CTRL)
-					& FIELD_CLEAR(CRT_DISPLAY_CTRL,VSYNC_PHASE)
-					& FIELD_CLEAR(CRT_DISPLAY_CTRL,HSYNC_PHASE)
-					& FIELD_CLEAR(CRT_DISPLAY_CTRL,TIMING)
-					& FIELD_CLEAR(CRT_DISPLAY_CTRL,PLANE);
+		ulReg = PEEK32(CRT_DISPLAY_CTRL)
+			       & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE)
+			       & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE)
+			       & FIELD_CLEAR(CRT_DISPLAY_CTRL, TIMING)
+			       & FIELD_CLEAR(CRT_DISPLAY_CTRL, PLANE);
 
 			 POKE32(CRT_DISPLAY_CTRL,ulTmpValue|ulReg);
-		}
 
 	}
 	else if(pll->clockType == PRIMARY_PLL)
@@ -193,11 +189,6 @@ int ddk750_setModeTiming(mode_parameter_t * parm,clock_type_t clock)
 	pll.clockType = clock;
 
 	uiActualPixelClk = calcPllValue(parm->pixel_clock,&pll);
-	if(getChipType() == SM750LE){
-		/* set graphic mode via IO method */
-		outb_p(0x88,0x3d4);
-		outb_p(0x06,0x3d5);
-	}
 	programModeRegisters(parm,&pll);
 	return 0;
 }
drivers/staging/sm750fb/ddk750_swi2c.c +0 -3
index 8557cce..b162ced 100644
@@ -410,9 +410,6 @@ long swI2CInit(
     if ((i2cClkGPIO > 31) || (i2cDataGPIO > 31))
         return -1;
 
-    if (getChipType() == SM750LE)
-        return swI2CInit_SM750LE(i2cClkGPIO, i2cDataGPIO);
-
     /* Initialize the GPIO pin for the i2c Clock Register */
     g_i2cClkGPIOMuxReg = GPIO_MUX;
     g_i2cClkGPIODataReg = GPIO_DATA;
drivers/staging/sm750fb/sm750.c +2 -7
index a7b1b9c..8a6e36b 100644
@@ -701,10 +701,10 @@ static int sm750fb_set_drv(struct lynxfb_par * par)
     output->proc_setMode = hw_sm750_output_setMode;
     output->proc_checkMode = hw_sm750_output_checkMode;
 
-    output->proc_setBLANK = (share->revid == SM750LE_REVISION_ID)?hw_sm750le_setBLANK:hw_sm750_setBLANK;
+    output->proc_setBLANK = hw_sm750_setBLANK;
     output->clear = hw_sm750_output_clear;
     /* chip specific phase */
-    share->accel.de_wait = (share->revid == SM750LE_REVISION_ID)?hw_sm750le_deWait: hw_sm750_deWait;
+    share->accel.de_wait = hw_sm750_deWait;
     switch (spec_share->state.dataflow)
     {
         case sm750_simul_pri:
@@ -1059,11 +1059,6 @@ NO_PARAM:
                 else
                     spec_share->state.dataflow = sm750_simul_pri;
             }
-        }else{
-            /* SM750LE only have one crt channel */
-            spec_share->state.dataflow = sm750_simul_sec;
-            /* sm750le do not have complex attributes*/
-            spec_share->state.nocrt = 0;
         }
 }
 
drivers/staging/sm750fb/sm750_hw.c +7 -48

81 lines not on this page · raw message

Signature · 1 line
1.8.1.2
author maintainer
#1 lore raw

PATCH 2/2 staging: sm750fb: fix build warning

after removing the 750LE related codes we started getting a build warning about an unused function. Hence removing that function also.

---
 drivers/staging/sm750fb/ddk750_mode.c | 70 -----------------------------------
 1 file changed, 70 deletions(-)
drivers/staging/sm750fb/ddk750_mode.c +0 -70
index 44e346a..df4e14e 100644
@@ -4,76 +4,6 @@
 #include "ddk750_mode.h"
 #include "ddk750_chip.h"
 
-/*
-	SM750LE only:
-    This function takes care extra registers and bit fields required to set
-    up a mode in SM750LE
-
-	Explanation about Display Control register:
-    HW only supports 7 predefined pixel clocks, and clock select is
-    in bit 29:27 of	Display Control register.
-*/
-static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, unsigned long dispControl)
-{
-	unsigned long x, y;
-
-	x = pModeParam->horizontal_display_end;
-	y = pModeParam->vertical_display_end;
-
-    /* SM750LE has to set up the top-left and bottom-right
-       registers as well.
-       Note that normal SM750/SM718 only use those two register for
-       auto-centering mode.
-    */
-    POKE32(CRT_AUTO_CENTERING_TL,
-      FIELD_VALUE(0, CRT_AUTO_CENTERING_TL, TOP, 0)
-    | FIELD_VALUE(0, CRT_AUTO_CENTERING_TL, LEFT, 0));
-
-    POKE32(CRT_AUTO_CENTERING_BR,
-      FIELD_VALUE(0, CRT_AUTO_CENTERING_BR, BOTTOM, y-1)
-    | FIELD_VALUE(0, CRT_AUTO_CENTERING_BR, RIGHT, x-1));
-
-    /* Assume common fields in dispControl have been properly set before
-       calling this function.
-       This function only sets the extra fields in dispControl.
-    */
-
-	/* Clear bit 29:27 of display control register */
-    dispControl &= FIELD_CLEAR(CRT_DISPLAY_CTRL, CLK);
-
-	/* Set bit 29:27 of display control register for the right clock */
-	/* Note that SM750LE only need to supported 7 resoluitons. */
-	if ( x == 800 && y == 600 )
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41);
-	else if (x == 1024 && y == 768)
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65);
-	else if (x == 1152 && y == 864)
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL80);
-	else if (x == 1280 && y == 768)
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL80);
-	else if (x == 1280 && y == 720)
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL74);
-	else if (x == 1280 && y == 960)
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL108);
-	else if (x == 1280 && y == 1024)
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL108);
-	else /* default to VGA clock */
-    	dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL25);
-
-	/* Set bit 25:24 of display controller */
-    dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CRTSELECT, CRT);
-    dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, RGBBIT, 24BIT);
-
-    /* Set bit 14 of display controller */
-    dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLOCK_PHASE, ACTIVE_LOW);
-
-    POKE32(CRT_DISPLAY_CTRL, dispControl);
-
-	return dispControl;
-}
-
-
-
 /* only timing related registers will be  programed */
 static int programModeRegisters(mode_parameter_t * pModeParam,pll_value_t * pll)
 {
Signature · 1 line
1.8.1.2
#2 lore raw
In reply to Sudip Mukherjee
Quoted 3 lines · Sudip Mukherjee

750LE is a special version of the hardware with Ip Core and Silicon Motion is making this hardware only for Huawei. It is not available to anyone else.

And Huawei doesn't run Linux? (hint, they do...)

Why remove this if someone can use it? I don't understand.

thanks,

greg k-h

author maintainer
#3 lore raw
Quoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Sudip Mukherjee

750LE is a special version of the hardware with Ip Core and Silicon Motion is making this hardware only for Huawei. It is not available to anyone else.

And Huawei doesn't run Linux? (hint, they do...)

Why remove this if someone can use it? I don't understand.

this is part of my conversation with Teddy Wang of Silicon Motion:
"I think you can remove it . SM750LE is a special version. And it's just a IP core. No one except huawei will use it."

and moreover I donot have that 750LE hardware to test any changes. I just have the SM712 and SM750 hardware. so ....

now, whatever you decide .. I will surely like to have the code in place.

regards
sudip

Quoted 4 lines

thanks,

greg k-h

#4 lore raw
Quoted 14 lines · Sudip Mukherjee
Quoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Sudip Mukherjee

750LE is a special version of the hardware with Ip Core and Silicon Motion is making this hardware only for Huawei. It is not available to anyone else.

And Huawei doesn't run Linux? (hint, they do...)

Why remove this if someone can use it? I don't understand.

this is part of my conversation with Teddy Wang of Silicon Motion:
"I think you can remove it . SM750LE is a special version. And it's just a IP core. No one except huawei will use it."

Quoted 5 lines

and moreover I donot have that 750LE hardware to test any changes. I just have the SM712 and SM750 hardware. so ....

now, whatever you decide .. I will surely like to have the code in place.

I suggest to leave it, it's not costing anything to keep around, and I think you removed additional code with this patch anyway, which wasn't good...

thanks,

greg k-h

author maintainer
#5 lore raw
Quoted 7 lines · Greg Kroah-Hartman
Quoted 2 lines · Sudip Mukherjee

On Thu, Mar 19, 2015 at 02:22:36PM +0100, Greg Kroah-Hartman wrote:
place.

I suggest to leave it, it's not costing anything to keep around, and I think you removed additional code with this patch anyway, which wasn't good...

fine, then please discard this series.
additional code means only a chip comparison for SM718 which this driver donot have any support for.

ohh, and one request, I have some patches pending for staging/sm7xxfb and staging/panel, if you please review, and if ok, apply them then i can send the followon patches.

regards
sudip

Quoted 4 lines

thanks,

greg k-h

#6 lore raw
In reply to Sudip Mukherjee
Quoted 3 lines · Sudip Mukherjee

750LE is a special version of the hardware with Ip Core and Silicon Motion is making this hardware only for Huawei. It is not available to anyone else.

Huawei isn't selling this? I don't understand.

regards,
dan carpenter