From 9d6f3945056d07adcb93148c6517521ab7c2277a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 27 Jun 2014 11:55:16 +0200 Subject: [PATCH] Staging: bcm: Lines shortened in ddr_init() Signed-off-by: Matthias Beyer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/bcm/DDRInit.c | 176 ++++++++++++++++++++++++++-------- 1 file changed, 134 insertions(+), 42 deletions(-) diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c index d2646d965211..423bfd9bf4ed 100644 --- a/drivers/staging/bcm/DDRInit.c +++ b/drivers/staging/bcm/DDRInit.c @@ -818,15 +818,21 @@ int ddr_init(struct bcm_mini_adapter *Adapter) if ((Adapter->chip_id != BCS220_2) && (Adapter->chip_id != BCS220_2BC) && (Adapter->chip_id != BCS220_3)) { - retval = rdmalt(Adapter, (UINT)0x0f000830, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000830, &uiResetValue, + sizeof(uiResetValue)); 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; } uiResetValue |= 0x44; - retval = wrmalt(Adapter, (UINT)0x0f000830, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0f000830, &uiResetValue, + sizeof(uiResetValue)); 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; } } @@ -857,7 +863,8 @@ int ddr_init(struct bcm_mini_adapter *Adapter) case DDR_160_MHZ: psDDRSetting = asT3LPB_DDRSetting160MHz; - RegCount = sizeof(asT3LPB_DDRSetting160MHz)/sizeof(struct bcm_ddr_setting); + RegCount = sizeof(asT3LPB_DDRSetting160MHz) / + sizeof(struct bcm_ddr_setting); if (Adapter->bMipsConfig == MIPS_200_MHZ) uiClockSetting = 0x03F137D2; @@ -871,7 +878,8 @@ int ddr_init(struct bcm_mini_adapter *Adapter) case 0xbece0121: case 0xbece0130: 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) { case DDR_80_MHZ: psDDRSetting = asT3_DDRSetting80MHz; @@ -933,15 +941,19 @@ int ddr_init(struct bcm_mini_adapter *Adapter) } 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) { - if (uiClockSetting && psDDRSetting->ulRegAddress == MIPS_CLOCK_REG) + if (uiClockSetting + && psDDRSetting->ulRegAddress == MIPS_CLOCK_REG) value = uiClockSetting; else value = psDDRSetting->ulRegValue; - retval = wrmalt(Adapter, psDDRSetting->ulRegAddress, &value, sizeof(value)); + retval = wrmalt(Adapter, psDDRSetting->ulRegAddress, &value, + sizeof(value)); 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__); break; } @@ -957,27 +969,47 @@ int ddr_init(struct bcm_mini_adapter *Adapter) (Adapter->chip_id != BCS220_3)) { /* drive MDDR to half in case of UMA-B: */ uiResetValue = 0x01010001; - retval = wrmalt(Adapter, (UINT)0x0F007018, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0F007018, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x00040020; - retval = wrmalt(Adapter, (UINT)0x0F007094, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0F007094, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x01020101; - retval = wrmalt(Adapter, (UINT)0x0F00701c, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0F00701c, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x01010000; - retval = wrmalt(Adapter, (UINT)0x0F007018, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0F007018, + &uiResetValue, sizeof(uiResetValue)); 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; } } @@ -990,70 +1022,130 @@ int ddr_init(struct bcm_mini_adapter *Adapter) * we will change this when we will have internal PMU. */ 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) { - 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; } - retval = rdmalt(Adapter, (UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000c00, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x1322a8; - retval = wrmalt(Adapter, (UINT)0x0f000d1c, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0f000d1c, + &uiResetValue, sizeof(uiResetValue)); 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; } - retval = rdmalt(Adapter, (UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000c00, + &uiResetValue, sizeof(uiResetValue)); if (retval < 0) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, RDM, DBG_LVL_ALL, "%s:%d RDM failed\n", __func__, __LINE__); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, RDM, + DBG_LVL_ALL, + "%s:%d RDM failed\n", + __func__, + __LINE__); return retval; } - retval = rdmalt(Adapter, (UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000c00, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x132296; - retval = wrmalt(Adapter, (UINT)0x0f000d14, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0f000d14, + &uiResetValue, sizeof(uiResetValue)); 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; } } 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) { - 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; } - retval = rdmalt(Adapter, (UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000c00, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x6003229a; - retval = wrmalt(Adapter, (UINT)0x0f000d14, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0f000d14, + &uiResetValue, sizeof(uiResetValue)); 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; } - retval = rdmalt(Adapter, (UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000c00, + &uiResetValue, sizeof(uiResetValue)); 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; } - retval = rdmalt(Adapter, (UINT)0x0f000c00, &uiResetValue, sizeof(uiResetValue)); + retval = rdmalt(Adapter, (UINT)0x0f000c00, + &uiResetValue, sizeof(uiResetValue)); 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; } uiResetValue = 0x1322a8; - retval = wrmalt(Adapter, (UINT)0x0f000d1c, &uiResetValue, sizeof(uiResetValue)); + retval = wrmalt(Adapter, (UINT)0x0f000d1c, + &uiResetValue, sizeof(uiResetValue)); 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; } } -- 2.30.2