Changeset 30951


Ignore:
Timestamp:
2012-03-15T17:57:27+01:00 (6 years ago)
Author:
nbd
Message:

ar8216: fix a MTU related regression

Switch reset on AR8316 appears to clobber the MTU configuration register
and possibly other global config registers. Move global configuration
register init writes back to the reset callback.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/net/phy/ar8216.c

    r30928 r30951  
    649649ar8216_hw_init(struct ar8216_priv *priv) 
    650650{ 
    651         /* XXX: undocumented magic from atheros, required! */ 
    652         priv->write(priv, 0x38, 0xc000050e); 
    653  
    654         ar8216_rmw(priv, AR8216_REG_GLOBAL_CTRL, 
    655                    AR8216_GCTRL_MTU, 1518 + 8 + 2); 
    656651        return 0; 
    657652} 
     
    675670        } 
    676671        msleep(1000); 
    677  
    678         /* enable jumbo frames */ 
    679         ar8216_rmw(priv, AR8216_REG_GLOBAL_CTRL, 
    680                    AR8316_GCTRL_MTU, 9018 + 8 + 2); 
    681672 
    682673        priv->initialized = true; 
     
    717708        priv->write(priv, 0x8, newval); 
    718709 
    719         /* standard atheros magic */ 
    720         priv->write(priv, 0x38, 0xc000050e); 
    721  
    722710        /* Initialize the ports */ 
    723711        bus = priv->phy->bus; 
     
    742730        } 
    743731 
    744         /* enable jumbo frames */ 
    745         ar8216_rmw(priv, AR8216_REG_GLOBAL_CTRL, 
    746                    AR8316_GCTRL_MTU, 9018 + 8 + 2); 
    747  
    748         /* enable cpu port to receive multicast and broadcast frames */ 
    749         priv->write(priv, AR8216_REG_FLOOD_MASK, 0x003f003f); 
    750  
    751732out: 
    752733        priv->initialized = true; 
    753734        return 0; 
     735} 
     736 
     737static void 
     738ar8216_init_globals(struct ar8216_priv *priv) 
     739{ 
     740        switch (priv->chip) { 
     741        case AR8216: 
     742                /* standard atheros magic */ 
     743                priv->write(priv, 0x38, 0xc000050e); 
     744 
     745                ar8216_rmw(priv, AR8216_REG_GLOBAL_CTRL, 
     746                           AR8216_GCTRL_MTU, 1518 + 8 + 2); 
     747                break; 
     748        case AR8316: 
     749                /* standard atheros magic */ 
     750                priv->write(priv, 0x38, 0xc000050e); 
     751 
     752                /* enable cpu port to receive multicast and broadcast frames */ 
     753                priv->write(priv, AR8216_REG_FLOOD_MASK, 0x003f003f); 
     754 
     755                /* fall through */ 
     756        case AR8236: 
     757                /* enable jumbo frames */ 
     758                ar8216_rmw(priv, AR8216_REG_GLOBAL_CTRL, 
     759                           AR8316_GCTRL_MTU, 9018 + 8 + 2); 
     760                break; 
     761        } 
    754762} 
    755763 
     
    797805                ar8216_init_port(priv, i); 
    798806 
     807        ar8216_init_globals(priv); 
    799808        mutex_unlock(&priv->reg_mutex); 
     809 
    800810        return ar8216_hw_apply(dev); 
    801811} 
Note: See TracChangeset for help on using the changeset viewer.