Changeset 18295


Ignore:
Timestamp:
01/24/12 05:40:42 (17 months ago)
Author:
BrainSlayer
Message:

fix link interrupt

Location:
src/linux/universal/linux-3.2/drivers/net/ethernet/ag7240
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.2/drivers/net/ethernet/ag7240/ag7240.c

    r18294 r18295  
    310310#endif 
    311311     
    312     if (is_ar7240() || is_ar7241() || (is_ar7242() && mac->mac_unit == 1)) 
     312    if (is_ar7240() || is_ar7241() || is_ar933x() || (is_ar7242() && mac->mac_unit == 1)) 
    313313        athrs26_enable_linkIntrs(mac->mac_unit); 
    314314 
  • src/linux/universal/linux-3.2/drivers/net/ethernet/ag7240/ar7240_s26_phy.c

    r18171 r18295  
    385385 
    386386    /* Enable WAN mac inside S26 */ 
    387     if (mac_has_flag(mac,ETH_SWONLY_MODE))  
     387    if (mac_has_flag(mac,ETH_SWONLY_MODE) || is_ar933x() )  
    388388        athrs26_reg_write(PORT_STATUS_REGISTER5,0x200); 
    389389 
     
    579579        athrs26_reg_write(0x104,athrs26_reg_read(0x104)|(0x1<<11)); 
    580580 
    581     if (mac_has_flag(mac,ETH_SWONLY_MODE)) 
     581    if (mac_has_flag(mac,ETH_SWONLY_MODE) || is_ar933x())  
    582582        athrs26_reg_write(PORT_STATUS_REGISTER5,0x200); 
    583583 
     
    10311031        unit = 0; 
    10321032    }  
    1033     else if(is_ar7241() || is_ar7242()) { 
     1033    else if(is_ar7241() || is_ar7242() || is_ar933x()) { 
    10341034        unit = 1; 
    10351035    } 
     
    10651065        unit = 0; 
    10661066    }  
    1067     else if(is_ar7241() || is_ar7242()) { 
     1067    else if(is_ar7241() || is_ar7242() || is_ar933x()) { 
    10681068        unit = 1; 
    10691069    } 
    10701070 
    1071     phy_reg_write(unit,phy_address, reg_address, data); 
    1072  
    1073     phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); 
    1074  
    1075     reg_address = (((addr_temp << 1) & 0x1e) | 0x1); 
    1076     data = s26_write_data >> 16; 
    1077     phy_reg_write(unit,phy_address, reg_address, data); 
    1078      
    1079     reg_address = ((addr_temp << 1) & 0x1e); 
    1080     data = s26_write_data  & 0xffff; 
    1081     phy_reg_write(unit,phy_address, reg_address, data); 
     1071    if(is_ar933x()) 
     1072    { 
     1073        //The writing sequence need special care for register 0x40,0x50,0x98, because the busy bit design 
     1074        //0x98: L->H (write low address first, then high address), 0x40: H->L, 0x50: H->L 
     1075        //Other registers: any sequence is working. 
     1076        if(s26_addr!=0x98) 
     1077        { 
     1078            phy_reg_write(unit, phy_address, reg_address, data); 
     1079 
     1080            phy_address = 0x17 & ((addr_temp >> 4) | 0x10); 
     1081            reg_address = ((addr_temp << 1) & 0x1e) | 0x1; 
     1082            data =  s26_write_data >> 16; 
     1083            phy_reg_write(unit, phy_address, reg_address, data); 
     1084 
     1085            reg_address = reg_address & 0x1e; 
     1086            data = s26_write_data  & 0xffff; 
     1087            phy_reg_write(unit, phy_address, reg_address, data); 
     1088        } 
     1089        else 
     1090        { 
     1091            phy_reg_write(unit, phy_address, reg_address, data); 
     1092 
     1093            phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); 
     1094            reg_address = ((addr_temp << 1) & 0x1e); 
     1095 
     1096            data = s26_write_data  & 0xffff; 
     1097            phy_reg_write(unit, phy_address, reg_address, data); 
     1098 
     1099            reg_address = (((addr_temp << 1) & 0x1e) | 0x1); 
     1100            data = s26_write_data >> 16; 
     1101            phy_reg_write(unit, phy_address, reg_address, data); 
     1102 
     1103        } 
     1104    } 
     1105    else 
     1106    { 
     1107        phy_reg_write(unit,phy_address, reg_address, data); 
     1108 
     1109        phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); 
     1110 
     1111        reg_address = (((addr_temp << 1) & 0x1e) | 0x1); 
     1112        data = s26_write_data >> 16; 
     1113        phy_reg_write(unit,phy_address, reg_address, data); 
     1114 
     1115        reg_address = ((addr_temp << 1) & 0x1e); 
     1116        data = s26_write_data  & 0xffff; 
     1117        phy_reg_write(unit,phy_address, reg_address, data); 
     1118    } 
    10821119} 
    10831120 
Note: See TracChangeset for help on using the changeset viewer.