1 void recov_phy_marvell(MAC_ENGINE *eng); 2 void phy_marvell(MAC_ENGINE *eng); 3 void recov_phy_marvell0(MAC_ENGINE *eng); 4 void phy_marvell0(MAC_ENGINE *eng); 5 void recov_phy_marvell1(MAC_ENGINE *eng); 6 void phy_marvell1(MAC_ENGINE *eng); 7 void recov_phy_marvell2(MAC_ENGINE *eng); 8 void phy_marvell2(MAC_ENGINE *eng); 9 void phy_marvell3(MAC_ENGINE *eng); 10 void phy_broadcom(MAC_ENGINE *eng); 11 void recov_phy_broadcom0(MAC_ENGINE *eng); 12 void phy_broadcom0(MAC_ENGINE *eng); 13 void phy_realtek(MAC_ENGINE *eng); 14 void phy_realtek0(MAC_ENGINE *eng); 15 void recov_phy_realtek1(MAC_ENGINE *eng); 16 void phy_realtek1(MAC_ENGINE *eng); 17 void recov_phy_realtek2(MAC_ENGINE *eng); 18 void recov_phy_realtek3(MAC_ENGINE *eng); 19 void phy_realtek3(MAC_ENGINE *eng); 20 void phy_realtek4(MAC_ENGINE *eng); 21 void phy_realtek2(MAC_ENGINE *eng); 22 void recov_phy_realtek5(MAC_ENGINE *eng); 23 void phy_realtek5(MAC_ENGINE *eng); 24 void phy_realtek6(MAC_ENGINE *eng); 25 void phy_smsc(MAC_ENGINE *eng); 26 void phy_micrel(MAC_ENGINE *eng); 27 void phy_micrel0(MAC_ENGINE *eng); 28 void phy_micrel1(MAC_ENGINE *eng); 29 void phy_micrel2(MAC_ENGINE *eng); 30 void recov_phy_vitesse(MAC_ENGINE *eng); 31 void phy_vitesse(MAC_ENGINE *eng); 32 void recov_phy_atheros(MAC_ENGINE *eng); 33 void phy_atheros(MAC_ENGINE *eng); 34 void phy_default(MAC_ENGINE *eng); 35 36 struct phy_desc { 37 uint16_t id1; 38 uint16_t id2; 39 uint16_t id2_mask; 40 uint8_t name[64]; 41 PHY_ENGINE cfg; 42 }; 43 44 #define PHY_LOOKUP_N 33 45 static const struct phy_desc phy_lookup_tbl[PHY_LOOKUP_N] = { 46 { .id1 = 0x001c, 47 .id2 = 0xc916, 48 .id2_mask = 0xffff, 49 .name = "RTL8211F", 50 .cfg.fp_set = phy_realtek5, 51 .cfg.fp_clr = recov_phy_realtek5 }, 52 { .id1 = 0x001c, 53 .id2 = 0xc915, 54 .id2_mask = 0xffff, 55 .name = "RTL8211E", 56 .cfg.fp_set = phy_realtek2, 57 .cfg.fp_clr = recov_phy_realtek2 }, 58 { .id1 = 0x001c, 59 .id2 = 0xc914, 60 .id2_mask = 0xffff, 61 .name = "RTL8211D", 62 .cfg.fp_set = phy_realtek1, 63 .cfg.fp_clr = recov_phy_realtek1 }, 64 { .id1 = 0x001c, 65 .id2 = 0xc912, 66 .id2_mask = 0xffff, 67 .name = "RTL8211C", 68 .cfg.fp_set = phy_realtek3, 69 .cfg.fp_clr = recov_phy_realtek3 }, 70 { .id1 = 0x001c, 71 .id2 = 0xc930, 72 .id2_mask = 0xffff, 73 .name = "RTL8363S", 74 .cfg.fp_set = phy_realtek6, 75 .cfg.fp_clr = NULL }, 76 { .id1 = 0x001c, 77 .id2 = 0xc816, 78 .id2_mask = 0xffff, 79 .name = "RTL8201F", 80 .cfg.fp_set = phy_realtek4, 81 .cfg.fp_clr = NULL }, 82 { .id1 = 0x001c, 83 .id2 = 0xc815, 84 .id2_mask = 0xfff0, 85 .name = "RTL8201E", 86 .cfg.fp_set = phy_realtek0, 87 .cfg.fp_clr = NULL }, 88 { .id1 = 0x0000, 89 .id2 = 0x8201, 90 .id2_mask = PHYID3_Mask, 91 .name = "RTL8201N", 92 .cfg.fp_set = phy_realtek, 93 .cfg.fp_clr = NULL }, 94 { .id1 = 0x0143, 95 .id2 = 0xbcb2, 96 .id2_mask = 0xfff0, 97 .name = "BCM5482", 98 .cfg.fp_set = phy_broadcom0, 99 .cfg.fp_clr = recov_phy_broadcom0 }, 100 { .id1 = 0x0143, 101 .id2 = 0xbca0, 102 .id2_mask = 0xfff0, 103 .name = "BCM5481", 104 .cfg.fp_set = phy_broadcom0, 105 .cfg.fp_clr = recov_phy_broadcom0 }, 106 { .id1 = 0x0362, 107 .id2 = 0x5e6a, 108 .id2_mask = 0xfff0, 109 .name = "BCM54612", 110 .cfg.fp_set = phy_broadcom0, 111 .cfg.fp_clr = recov_phy_broadcom0 }, 112 { .id1 = 0x0362, 113 .id2 = 0x5d10, 114 .id2_mask = 0xfff0, 115 .name = "BCM54616S", 116 .cfg.fp_set = phy_broadcom0, 117 .cfg.fp_clr = recov_phy_broadcom0 }, 118 { .id1 = 0x0020, 119 .id2 = 0x60b0, 120 .id2_mask = 0xfff0, 121 .name = "BCM5464SR", 122 .cfg.fp_set = phy_broadcom0, 123 .cfg.fp_clr = recov_phy_broadcom0 }, 124 { .id1 = 0x0020, 125 .id2 = 0x60c1, 126 .id2_mask = 0xfff0, 127 .name = "BCM5461S", 128 .cfg.fp_set = phy_broadcom0, 129 .cfg.fp_clr = recov_phy_broadcom0 }, 130 { .id1 = 0x600d, 131 .id2 = 0x84a2, 132 .id2_mask = 0xfff0, 133 .name = "BCM5421x", 134 .cfg.fp_set = phy_broadcom0, 135 .cfg.fp_clr = recov_phy_broadcom0 }, 136 { .id1 = 0x0143, 137 .id2 = 0xbd63, 138 .id2_mask = 0xfff0, 139 .name = "BCM54610C", 140 .cfg.fp_set = phy_broadcom0, 141 .cfg.fp_clr = recov_phy_broadcom0 }, 142 { .id1 = 0x0040, 143 .id2 = 0x61e0, 144 .id2_mask = PHYID3_Mask, 145 .name = "BCM5221", 146 .cfg.fp_set = phy_broadcom, 147 .cfg.fp_clr = NULL }, 148 { .id1 = 0x0141, 149 .id2 = 0x0e22, 150 .id2_mask = 0xfff0, 151 .name = "88E3019", 152 .cfg.fp_set = phy_marvell3, 153 .cfg.fp_clr = NULL }, 154 { .id1 = 0x0141, 155 .id2 = 0x0dd0, 156 .id2_mask = 0xfff0, 157 .name = "88E15 10/12/14/18", 158 .cfg.fp_set = phy_marvell2, 159 .cfg.fp_clr = recov_phy_marvell2 }, 160 { .id1 = 0xff00, 161 .id2 = 0x1761, 162 .id2_mask = 0xffff, 163 .name = "88E6176(IntLoop)", 164 .cfg.fp_set = phy_marvell1, 165 .cfg.fp_clr = recov_phy_marvell1 }, 166 { .id1 = 0xff00, 167 .id2 = 0x1152, 168 .id2_mask = 0xffff, 169 .name = "88E6320(IntLoop)", 170 .cfg.fp_set = phy_marvell1, 171 .cfg.fp_clr = recov_phy_marvell1 }, 172 { .id1 = 0x0141, 173 .id2 = 0x0e90, 174 .id2_mask = 0xfff0, 175 .name = "88E1310", 176 .cfg.fp_set = phy_marvell0, 177 .cfg.fp_clr = recov_phy_marvell0 }, 178 { .id1 = 0x0141, 179 .id2 = 0x0cc0, 180 .id2_mask = PHYID3_Mask, 181 .name = "88E1111", 182 .cfg.fp_set = phy_marvell, 183 .cfg.fp_clr = recov_phy_marvell }, 184 { .id1 = 0x0022, 185 .id2 = 0x1555, 186 .id2_mask = 0xfff0, 187 .name = "KSZ8031/KSZ8051", 188 .cfg.fp_set = phy_micrel0, 189 .cfg.fp_clr = NULL }, 190 { .id1 = 0x0022, 191 .id2 = 0x1622, 192 .id2_mask = 0xfff0, 193 .name = "KSZ9031", 194 .cfg.fp_set = phy_micrel1, 195 .cfg.fp_clr = NULL }, 196 { .id1 = 0x0022, 197 .id2 = 0x1562, 198 .id2_mask = 0xfff0, 199 .name = "KSZ8081", 200 .cfg.fp_set = phy_micrel2, 201 .cfg.fp_clr = NULL }, 202 { .id1 = 0x0022, 203 .id2 = 0x1512, 204 .id2_mask = 0xfff0, 205 .name = "KSZ8041", 206 .cfg.fp_set = phy_micrel, 207 .cfg.fp_clr = NULL }, 208 { .id1 = 0x004d, 209 .id2 = 0xd072, 210 .id2_mask = 0xfff0, 211 .name = "AR8035", 212 .cfg.fp_set = phy_atheros, 213 .cfg.fp_clr = recov_phy_atheros }, 214 { .id1 = 0x0007, 215 .id2 = 0xc0c4, 216 .id2_mask = PHYID3_Mask, 217 .name = "LAN8700", 218 .cfg.fp_set = phy_smsc, 219 .cfg.fp_clr = NULL }, 220 { .id1 = 0x000f, 221 .id2 = 0xc4b1, 222 .id2_mask = 0xfff0, 223 .name = "VSC8211", 224 .cfg.fp_set = phy_vitesse, 225 .cfg.fp_clr = recov_phy_vitesse }, 226 { .id1 = 0x0007, 227 .id2 = 0x0421, 228 .id2_mask = 0xfff0, 229 .name = "VSC8601", 230 .cfg.fp_set = phy_vitesse, 231 .cfg.fp_clr = recov_phy_vitesse }, 232 { .id1 = 0x0007, 233 .id2 = 0x0431, 234 .id2_mask = 0xfff0, 235 .name = "VSC8641", 236 .cfg.fp_set = phy_vitesse, 237 .cfg.fp_clr = recov_phy_vitesse }, 238 { .id1 = 0x0000, 239 .id2 = 0x0000, 240 .id2_mask = 0x0000, 241 .name = "default", 242 .cfg.fp_set = phy_default, 243 .cfg.fp_clr = NULL }, 244 };