sky2: disable ASF on Yukon Supreme
authorstephen hemminger <shemminger@vyatta.com>
Sun, 7 Feb 2010 06:24:50 +0000 (06:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Feb 2010 01:56:28 +0000 (17:56 -0800)
Clone of vendor code to disable ASF on Extreme and Supreme chips.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sky2.c

index 1593ed49e8fe22fdd4c732816d3381d3d830a158..1aa1f33167029832f671924a632b84979ba5b8f6 100644 (file)
@@ -3035,11 +3035,20 @@ static void sky2_reset(struct sky2_hw *hw)
        u32 hwe_mask = Y2_HWE_ALL_MASK;
 
        /* disable ASF */
-       if (hw->chip_id == CHIP_ID_YUKON_EX) {
+       if (hw->chip_id == CHIP_ID_YUKON_EX
+           || hw->chip_id == CHIP_ID_YUKON_SUPR) {
+               sky2_write32(hw, CPU_WDOG, 0);
                status = sky2_read16(hw, HCU_CCSR);
                status &= ~(HCU_CCSR_AHB_RST | HCU_CCSR_CPU_RST_MODE |
                            HCU_CCSR_UC_STATE_MSK);
+               /*
+                * CPU clock divider shouldn't be used because
+                * - ASF firmware may malfunction
+                * - Yukon-Supreme: Parallel FLASH doesn't support divided clocks
+                */
+               status &= ~HCU_CCSR_CPU_CLK_DIVIDE_MSK;
                sky2_write16(hw, HCU_CCSR, status);
+               sky2_write32(hw, CPU_WDOG, 0);
        } else
                sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET);
        sky2_write16(hw, B0_CTST, Y2_ASF_DISABLE);