Commit a320dd83 authored by Gary Rookard's avatar Gary Rookard Committed by Greg Kroah-Hartman

Staging: bcm: DDRInit: fix up some bracing issues.

I fixed some brace coding style issues.
Signed-off-by: default avatarGary Alan Rookard <garyrookard@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3055585
...@@ -780,11 +780,9 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -780,11 +780,9 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
UINT uiClockSetting = 0; UINT uiClockSetting = 0;
int retval = STATUS_SUCCESS; int retval = STATUS_SUCCESS;
switch (Adapter->chip_id) switch (Adapter->chip_id) {
{
case 0xbece3200: case 0xbece3200:
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3LP_DDRSetting80MHz; psDDRSetting = asT3LP_DDRSetting80MHz;
RegCount = (sizeof(asT3LP_DDRSetting80MHz)/ RegCount = (sizeof(asT3LP_DDRSetting80MHz)/
...@@ -800,17 +798,13 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -800,17 +798,13 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
RegCount = (sizeof(asT3LP_DDRSetting133MHz)/ RegCount = (sizeof(asT3LP_DDRSetting133MHz)/
sizeof(struct bcm_ddr_setting)); sizeof(struct bcm_ddr_setting));
if (Adapter->bMipsConfig == MIPS_200_MHZ) if (Adapter->bMipsConfig == MIPS_200_MHZ)
{
uiClockSetting = 0x03F13652; uiClockSetting = 0x03F13652;
}
else else
{
uiClockSetting = 0x03F1365B; uiClockSetting = 0x03F1365B;
}
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
break; break;
case T3LPB: case T3LPB:
...@@ -823,22 +817,20 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -823,22 +817,20 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
*/ */
if ((Adapter->chip_id != BCS220_2) && if ((Adapter->chip_id != BCS220_2) &&
(Adapter->chip_id != BCS220_2BC) && (Adapter->chip_id != BCS220_2BC) &&
(Adapter->chip_id != BCS220_3)) (Adapter->chip_id != BCS220_3)) {
{
retval = rdmalt(Adapter,(UINT)0x0f000830, &uiResetValue, sizeof(uiResetValue)); retval = rdmalt(Adapter,(UINT)0x0f000830, &uiResetValue, sizeof(uiResetValue));
if (retval < 0) { if (retval < 0) {
BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__);
return retval; return retval;
} }
uiResetValue |= 0x44; uiResetValue |= 0x44;
retval = wrmalt(Adapter,(UINT)0x0f000830, &uiResetValue, sizeof(uiResetValue)); retval = wrmalt(Adapter,(UINT)0x0f000830, &uiResetValue, sizeof(uiResetValue));
if (retval < 0) { if (retval < 0) {
BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__);
return retval; return retval;
}
} }
switch (Adapter->DDRSetting) }
{ switch (Adapter->DDRSetting) {
...@@ -858,13 +850,9 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -858,13 +850,9 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
sizeof(struct bcm_ddr_setting)); sizeof(struct bcm_ddr_setting));
if (Adapter->bMipsConfig == MIPS_200_MHZ) if (Adapter->bMipsConfig == MIPS_200_MHZ)
{
uiClockSetting = 0x03F13652; uiClockSetting = 0x03F13652;
}
else else
{
uiClockSetting = 0x03F1365B; uiClockSetting = 0x03F1365B;
}
break; break;
case DDR_160_MHZ: case DDR_160_MHZ:
...@@ -872,14 +860,10 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -872,14 +860,10 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
RegCount = sizeof(asT3LPB_DDRSetting160MHz)/sizeof(struct bcm_ddr_setting); RegCount = sizeof(asT3LPB_DDRSetting160MHz)/sizeof(struct bcm_ddr_setting);
if (Adapter->bMipsConfig == MIPS_200_MHZ) if (Adapter->bMipsConfig == MIPS_200_MHZ)
{
uiClockSetting = 0x03F137D2; uiClockSetting = 0x03F137D2;
}
else else
{
uiClockSetting = 0x03F137DB; uiClockSetting = 0x03F137DB;
} }
}
break; break;
case 0xbece0110: case 0xbece0110:
...@@ -888,8 +872,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -888,8 +872,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
case 0xbece0130: case 0xbece0130:
case 0xbece0300: case 0xbece0300:
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "DDR Setting: %x\n", Adapter->DDRSetting); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "DDR Setting: %x\n", Adapter->DDRSetting);
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3_DDRSetting80MHz; psDDRSetting = asT3_DDRSetting80MHz;
RegCount = (sizeof(asT3_DDRSetting80MHz)/ RegCount = (sizeof(asT3_DDRSetting80MHz)/
...@@ -910,8 +893,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -910,8 +893,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
} }
case 0xbece0310: case 0xbece0310:
{ {
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3B_DDRSetting80MHz; psDDRSetting = asT3B_DDRSetting80MHz;
RegCount = (sizeof(asT3B_DDRSetting80MHz)/ RegCount = (sizeof(asT3B_DDRSetting80MHz)/
...@@ -924,28 +906,21 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -924,28 +906,21 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
break; break;
case DDR_133_MHZ: case DDR_133_MHZ:
if (Adapter->bDPLLConfig == PLL_266_MHZ) /* 266Mhz PLL selected. */ if (Adapter->bDPLLConfig == PLL_266_MHZ) { /* 266Mhz PLL selected. */
{
memcpy(asT3B_DDRSetting133MHz, asDPLL_266MHZ, memcpy(asT3B_DDRSetting133MHz, asDPLL_266MHZ,
sizeof(asDPLL_266MHZ)); sizeof(asDPLL_266MHZ));
psDDRSetting = asT3B_DDRSetting133MHz; psDDRSetting = asT3B_DDRSetting133MHz;
RegCount = (sizeof(asT3B_DDRSetting133MHz)/ RegCount = (sizeof(asT3B_DDRSetting133MHz)/
sizeof(struct bcm_ddr_setting)); sizeof(struct bcm_ddr_setting));
} } else {
else
{
psDDRSetting = asT3B_DDRSetting133MHz; psDDRSetting = asT3B_DDRSetting133MHz;
RegCount = (sizeof(asT3B_DDRSetting133MHz)/ RegCount = (sizeof(asT3B_DDRSetting133MHz)/
sizeof(struct bcm_ddr_setting)); sizeof(struct bcm_ddr_setting));
if (Adapter->bMipsConfig == MIPS_200_MHZ) if (Adapter->bMipsConfig == MIPS_200_MHZ)
{
uiClockSetting = 0x07F13652; uiClockSetting = 0x07F13652;
}
else else
{
uiClockSetting = 0x07F1365B; uiClockSetting = 0x07F1365B;
} }
}
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -959,16 +934,11 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -959,16 +934,11 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
value = 0; value = 0;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Register Count is =%lu\n", RegCount); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Register Count is =%lu\n", RegCount);
while (RegCount && !retval) while (RegCount && !retval) {
{
if (uiClockSetting && psDDRSetting->ulRegAddress == MIPS_CLOCK_REG) if (uiClockSetting && psDDRSetting->ulRegAddress == MIPS_CLOCK_REG)
{
value = uiClockSetting; value = uiClockSetting;
}
else else
{
value = psDDRSetting->ulRegValue; value = psDDRSetting->ulRegValue;
}
retval = wrmalt(Adapter, psDDRSetting->ulRegAddress, &value, sizeof(value)); retval = wrmalt(Adapter, psDDRSetting->ulRegAddress, &value, sizeof(value));
if (STATUS_SUCCESS != retval) { if (STATUS_SUCCESS != retval) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__);
...@@ -979,14 +949,12 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -979,14 +949,12 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
psDDRSetting++; psDDRSetting++;
} }
if (Adapter->chip_id >= 0xbece3300) if (Adapter->chip_id >= 0xbece3300) {
{
mdelay(3); mdelay(3);
if ((Adapter->chip_id != BCS220_2) && if ((Adapter->chip_id != BCS220_2) &&
(Adapter->chip_id != BCS220_2BC) && (Adapter->chip_id != BCS220_2BC) &&
(Adapter->chip_id != BCS220_3)) (Adapter->chip_id != BCS220_3)) {
{
/* drive MDDR to half in case of UMA-B: */ /* drive MDDR to half in case of UMA-B: */
uiResetValue = 0x01010001; uiResetValue = 0x01010001;
retval = wrmalt(Adapter, (UINT)0x0F007018, &uiResetValue, sizeof(uiResetValue)); retval = wrmalt(Adapter, (UINT)0x0F007018, &uiResetValue, sizeof(uiResetValue));
...@@ -1021,8 +989,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -1021,8 +989,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
* and since we dont have internal PMU lets do it under UMA-B chip id. * and since we dont have internal PMU lets do it under UMA-B chip id.
* we will change this when we will have internal PMU. * we will change this when we will have internal PMU.
*/ */
if (Adapter->PmuMode == HYBRID_MODE_7C) if (Adapter->PmuMode == HYBRID_MODE_7C) {
{
retval = rdmalt(Adapter,(UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); retval = rdmalt(Adapter,(UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue));
if (retval < 0) { if (retval < 0) {
BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__);
...@@ -1055,9 +1022,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter) ...@@ -1055,9 +1022,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, CMHOST, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__);
return retval; return retval;
} }
} } else if (Adapter->PmuMode == HYBRID_MODE_6) {
else if (Adapter->PmuMode == HYBRID_MODE_6)
{
retval = rdmalt(Adapter,(UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); retval = rdmalt(Adapter,(UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue));
if (retval < 0) { if (retval < 0) {
...@@ -1107,11 +1072,9 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1107,11 +1072,9 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
int retval = STATUS_SUCCESS; int retval = STATUS_SUCCESS;
bool bOverrideSelfRefresh = false; bool bOverrideSelfRefresh = false;
switch (Adapter->chip_id) switch (Adapter->chip_id) {
{
case 0xbece3200: case 0xbece3200:
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3LP_DDRSetting80MHz; psDDRSetting = asT3LP_DDRSetting80MHz;
RegCount = ARRAY_SIZE(asT3LP_DDRSetting80MHz); RegCount = ARRAY_SIZE(asT3LP_DDRSetting80MHz);
...@@ -1141,8 +1104,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1141,8 +1104,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
case BCS220_2BC: case BCS220_2BC:
case BCS250_BC: case BCS250_BC:
case BCS220_3: case BCS220_3:
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3LPB_DDRSetting80MHz; psDDRSetting = asT3LPB_DDRSetting80MHz;
RegCount = ARRAY_SIZE(asT3LPB_DDRSetting80MHz); RegCount = ARRAY_SIZE(asT3LPB_DDRSetting80MHz);
...@@ -1176,8 +1138,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1176,8 +1138,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
} }
break; break;
case 0xbece0300: case 0xbece0300:
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3_DDRSetting80MHz; psDDRSetting = asT3_DDRSetting80MHz;
RegCount = ARRAY_SIZE(asT3_DDRSetting80MHz); RegCount = ARRAY_SIZE(asT3_DDRSetting80MHz);
...@@ -1202,8 +1163,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1202,8 +1163,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
break; break;
case 0xbece0310: case 0xbece0310:
{ {
switch (Adapter->DDRSetting) switch (Adapter->DDRSetting) {
{
case DDR_80_MHZ: case DDR_80_MHZ:
psDDRSetting = asT3B_DDRSetting80MHz; psDDRSetting = asT3B_DDRSetting80MHz;
RegCount = ARRAY_SIZE(asT3B_DDRSetting80MHz); RegCount = ARRAY_SIZE(asT3B_DDRSetting80MHz);
...@@ -1223,7 +1183,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1223,7 +1183,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
RegCount -= T3B_SKIP_CLOCK_PROGRAM_DUMP_133MHZ; RegCount -= T3B_SKIP_CLOCK_PROGRAM_DUMP_133MHZ;
psDDRSetting += T3B_SKIP_CLOCK_PROGRAM_DUMP_133MHZ; psDDRSetting += T3B_SKIP_CLOCK_PROGRAM_DUMP_133MHZ;
break; break;
} }
break; break;
} }
default: default:
...@@ -1232,8 +1192,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1232,8 +1192,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
/* total number of Register that has to be dumped */ /* total number of Register that has to be dumped */
value = RegCount; value = RegCount;
retval = wrmalt(Adapter, ul_ddr_setting_load_addr, &value, sizeof(value)); retval = wrmalt(Adapter, ul_ddr_setting_load_addr, &value, sizeof(value));
if (retval) if (retval) {
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__);
return retval; return retval;
...@@ -1242,8 +1201,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1242,8 +1201,7 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
/* signature */ /* signature */
value = (0x1d1e0dd0); value = (0x1d1e0dd0);
retval = wrmalt(Adapter, ul_ddr_setting_load_addr, &value, sizeof(value)); retval = wrmalt(Adapter, ul_ddr_setting_load_addr, &value, sizeof(value));
if (retval) if (retval) {
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__);
return retval; return retval;
} }
...@@ -1251,24 +1209,19 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter) ...@@ -1251,24 +1209,19 @@ int download_ddr_settings(struct bcm_mini_adapter *Adapter)
ul_ddr_setting_load_addr += sizeof(ULONG); ul_ddr_setting_load_addr += sizeof(ULONG);
RegCount *= (sizeof(struct bcm_ddr_setting)/sizeof(ULONG)); RegCount *= (sizeof(struct bcm_ddr_setting)/sizeof(ULONG));
while (RegCount && !retval) while (RegCount && !retval) {
{
value = psDDRSetting->ulRegAddress; value = psDDRSetting->ulRegAddress;
retval = wrmalt(Adapter, ul_ddr_setting_load_addr, &value, sizeof(value)); retval = wrmalt(Adapter, ul_ddr_setting_load_addr, &value, sizeof(value));
ul_ddr_setting_load_addr += sizeof(ULONG); ul_ddr_setting_load_addr += sizeof(ULONG);
if (!retval) if (!retval) {
{ if (bOverrideSelfRefresh && (psDDRSetting->ulRegAddress == 0x0F007018)) {
if (bOverrideSelfRefresh && (psDDRSetting->ulRegAddress == 0x0F007018))
{
value = (psDDRSetting->ulRegValue |(1<<8)); value = (psDDRSetting->ulRegValue |(1<<8));
if (STATUS_SUCCESS != wrmalt(Adapter, ul_ddr_setting_load_addr, if (STATUS_SUCCESS != wrmalt(Adapter, ul_ddr_setting_load_addr,
&value, sizeof(value))) { &value, sizeof(value))) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "%s:%d\n", __func__, __LINE__);
break; break;
}
} }
else } else {
{
value = psDDRSetting->ulRegValue; value = psDDRSetting->ulRegValue;
if (STATUS_SUCCESS != wrmalt(Adapter, ul_ddr_setting_load_addr , if (STATUS_SUCCESS != wrmalt(Adapter, ul_ddr_setting_load_addr ,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment