Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268807
b: refs/heads/master
c: 2f0f395
h: refs/heads/master
i:
  268805: eb3e42c
  268803: f7c1764
  268799: e3ba49f
v: v3
  • Loading branch information
Aaro Koskinen authored and Greg Kroah-Hartman committed Oct 12, 2011
1 parent db05e8e commit 42d6fc6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee055a48ce6272016cbb7e6f1a7de151bab7e1e0
refs/heads/master: 2f0f395ef788319b03bc0be785c5bee8d8bececa
32 changes: 15 additions & 17 deletions trunk/drivers/staging/xgifb/vb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

#include <linux/io.h>

static unsigned char XGINew_DataBusWidth;

static unsigned short XGINew_DDRDRAM_TYPE340[4][5] = {
{ 2, 13, 9, 64, 0x45},
{ 2, 12, 9, 32, 0x35},
Expand Down Expand Up @@ -610,7 +608,7 @@ static unsigned short XGINew_SetDRAMSizeReg(int index,
int RankSize;
unsigned char ChannelNo;

RankSize = DRAMTYPE_TABLE[index][3] * XGINew_DataBusWidth / 32;
RankSize = DRAMTYPE_TABLE[index][3] * pVBInfo->ram_bus / 32;
data = xgifb_reg_get(pVBInfo->P3c4, 0x13);
data &= 0x80;

Expand All @@ -637,7 +635,7 @@ static unsigned short XGINew_SetDRAMSizeReg(int index,
(data & 0xF0));

/* data |= pVBInfo->ram_channel << 2; */
/* data |= (XGINew_DataBusWidth / 64) << 1; */
/* data |= (pVBInfo->ram_bus / 64) << 1; */
/* xgifb_reg_set(pVBInfo->P3c4, 0x14, data); */

/* should delay */
Expand All @@ -654,7 +652,7 @@ static unsigned short XGINew_SetDRAMSize20Reg(int index,
int RankSize;
unsigned char ChannelNo;

RankSize = DRAMTYPE_TABLE[index][3] * XGINew_DataBusWidth / 8;
RankSize = DRAMTYPE_TABLE[index][3] * pVBInfo->ram_bus / 8;
data = xgifb_reg_get(pVBInfo->P3c4, 0x13);
data &= 0x80;

Expand Down Expand Up @@ -682,7 +680,7 @@ static unsigned short XGINew_SetDRAMSize20Reg(int index,
udelay(15);

/* data |= pVBInfo->ram_channel << 2; */
/* data |= (XGINew_DataBusWidth / 64) << 1; */
/* data |= (pVBInfo->ram_bus / 64) << 1; */
/* xgifb_reg_set(pVBInfo->P3c4, 0x14, data); */

/* should delay */
Expand Down Expand Up @@ -753,7 +751,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
if ((HwDeviceExtension->ulVideoMemorySize - 1)
> 0x1000000) {

XGINew_DataBusWidth = 32; /* 32 bits */
pVBInfo->ram_bus = 32; /* 32 bits */
/* 22bit + 2 rank + 32bit */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x52);
Expand Down Expand Up @@ -782,7 +780,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,

if ((HwDeviceExtension->ulVideoMemorySize - 1) >
0x800000) {
XGINew_DataBusWidth = 16; /* 16 bits */
pVBInfo->ram_bus = 16; /* 16 bits */
/* 22bit + 2 rank + 16bit */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x41);
Expand All @@ -800,7 +798,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
} else { /* Dual_16_8 */
if ((HwDeviceExtension->ulVideoMemorySize - 1) >
0x800000) {
XGINew_DataBusWidth = 16; /* 16 bits */
pVBInfo->ram_bus = 16; /* 16 bits */
/* (0x31:12x8x2) 22bit + 2 rank */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1);
/* 0x41:16Mx16 bit*/
Expand Down Expand Up @@ -831,7 +829,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,

if ((HwDeviceExtension->ulVideoMemorySize - 1) >
0x400000) {
XGINew_DataBusWidth = 8; /* 8 bits */
pVBInfo->ram_bus = 8; /* 8 bits */
/* (0x31:12x8x2) 22bit + 2 rank */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1);
/* 0x30:8Mx8 bit*/
Expand All @@ -850,13 +848,13 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
break;

case XG27:
XGINew_DataBusWidth = 16; /* 16 bits */
pVBInfo->ram_bus = 16; /* 16 bits */
pVBInfo->ram_channel = 1; /* Single channel */
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x51); /* 32Mx16 bit*/
break;
case XG41:
if (XGINew_CheckFrequence(pVBInfo) == 1) {
XGINew_DataBusWidth = 32; /* 32 bits */
pVBInfo->ram_bus = 32; /* 32 bits */
pVBInfo->ram_channel = 3; /* Quad Channel */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x4C);
Expand Down Expand Up @@ -889,7 +887,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
else
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x39);
} else { /* DDR */
XGINew_DataBusWidth = 64; /* 64 bits */
pVBInfo->ram_bus = 64; /* 64 bits */
pVBInfo->ram_channel = 2; /* Dual channels */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x5A);
Expand Down Expand Up @@ -935,7 +933,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
It's Different from Other XG40 Series.
*/
if (XGINew_CheckFrequence(pVBInfo) == 1) { /* DDRII, DDR2x */
XGINew_DataBusWidth = 32; /* 32 bits */
pVBInfo->ram_bus = 32; /* 32 bits */
pVBInfo->ram_channel = 2; /* 2 Channel */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x44);
Expand All @@ -959,7 +957,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
}
} else { /* DDR */
XGINew_DataBusWidth = 64; /* 64 bits */
pVBInfo->ram_bus = 64; /* 64 bits */
pVBInfo->ram_channel = 1; /* 1 channels */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x52);
Expand All @@ -977,7 +975,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
default: /* XG40 */

if (XGINew_CheckFrequence(pVBInfo) == 1) { /* DDRII */
XGINew_DataBusWidth = 32; /* 32 bits */
pVBInfo->ram_bus = 32; /* 32 bits */
pVBInfo->ram_channel = 3;
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x4C);
Expand All @@ -1001,7 +999,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x38);
}
} else { /* DDR */
XGINew_DataBusWidth = 64; /* 64 bits */
pVBInfo->ram_bus = 64; /* 64 bits */
pVBInfo->ram_channel = 2; /* 2 channels */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1);
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x5A);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/xgifb/vb_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ struct vb_device_info {

int ram_type;
int ram_channel;
int ram_bus;
}; /* _struct vb_device_info */

#endif /* _VB_STRUCT_ */

0 comments on commit 42d6fc6

Please sign in to comment.