Changeset 14586
- Timestamp:
- 06/11/10 04:26:30 (3 years ago)
- Location:
- src/linux/pb42/linux-2.6.23/drivers/net
- Files:
-
- 8 edited
-
Kconfig (modified) (1 diff)
-
ag7100/Makefile (modified) (1 diff)
-
ag7100/adm_phy.c (modified) (1 diff)
-
ag7100/ag7100.c (modified) (5 diffs)
-
ag7100/ag7100.h (modified) (2 diffs)
-
ag7100/ag7100_phy.h (modified) (3 diffs)
-
phy/mvswitch.c (modified) (10 diffs)
-
phy/mvswitch.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/linux/pb42/linux-2.6.23/drivers/net/Kconfig
r14511 r14586 2321 2321 config ADM6996FC_PHY 2322 2322 bool "AdmTek 6996FC" 2323 2324 config MV6060 2325 bool "AdmTek 6996FC" 2326 depends on ADM6996FC_PHY 2323 2327 2324 2328 endchoice -
src/linux/pb42/linux-2.6.23/drivers/net/ag7100/Makefile
r13517 r14586 6 6 obj-phy-$(CONFIG_VITESSE_PHY) = vsc_phy.o 7 7 obj-phy-$(CONFIG_ICPLUS_PHY) = ipPhy.o 8 #obj-phy-$(CONFIG_NET_DSA) = dev-dsa.o 8 9 obj-phy-$(CONFIG_REALTEK_PHY) = rtPhy.o 9 10 obj-phy-$(CONFIG_ADM6996FC_PHY) = adm_phy.o -
src/linux/pb42/linux-2.6.23/drivers/net/ag7100/adm_phy.c
r13356 r14586 343 343 } 344 344 345 #ifdef CONFIG_MV6060 346 /* added by lsz 30Apri07 to configure port vlan registers */ 347 348 /**************************************************************************** 349 Port VLan: 350 351 --------------------------------------------------------------- 352 | | Port6 | Port5 | Port4 | Port3 | Port2 | Port1 | Port0 | 353 --------------------------------------------------------------- 354 | Port0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 355 --------------------------------------------------------------- 356 | Port1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 357 --------------------------------------------------------------- 358 | Port2 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 359 --------------------------------------------------------------- 360 | Port3 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 361 --------------------------------------------------------------- 362 | Port4 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 363 --------------------------------------------------------------- 364 | Port5 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 365 --------------------------------------------------------------- 366 | Port6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 367 --------------------------------------------------------------- 368 369 Port 0: Wan 370 Port 1~4: Lan 371 372 e.g. Port 0 is 010 0000, i.e. 0x20. 373 ****************************************************************************/ 374 #define PORT_VALN_MAP_REG 0x06 375 uint32_t portAddr[7] = {0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE}; 376 377 phy_reg_write(0, portAddr[0], PORT_VALN_MAP_REG, 0x103E); 378 phy_reg_write(0, portAddr[1], PORT_VALN_MAP_REG, 0x103D); 379 phy_reg_write(0, portAddr[2], PORT_VALN_MAP_REG, 0x103B); 380 phy_reg_write(0, portAddr[3], PORT_VALN_MAP_REG, 0x1037); 381 phy_reg_write(0, portAddr[4], PORT_VALN_MAP_REG, 0x102F); 382 phy_reg_write(0, portAddr[5], PORT_VALN_MAP_REG, 0x101F); 383 384 /* phy_reg_write(0, portAddr[0], PORT_VALN_MAP_REG, 0x1020); 385 phy_reg_write(0, portAddr[1], PORT_VALN_MAP_REG, 0x103C); 386 phy_reg_write(0, portAddr[2], PORT_VALN_MAP_REG, 0x103A); 387 phy_reg_write(0, portAddr[3], PORT_VALN_MAP_REG, 0x1036); 388 phy_reg_write(0, portAddr[4], PORT_VALN_MAP_REG, 0x102E); 389 phy_reg_write(0, portAddr[5], PORT_VALN_MAP_REG, 0x101F);*/ 390 //phy_reg_write(0, portAddr[6], PORT_VALN_MAP_REG, 0x0000); 391 392 /* added by lsz to configure header mode registers */ 393 #define PORT_CONTROL_REG 0x04 394 uint16_t reg_data = 0x8803; /* Flow Control | Header Mode | Forwarding */ 395 396 phy_reg_write(0, portAddr[0], PORT_CONTROL_REG, 0x8003); 397 phy_reg_write(0, portAddr[1], PORT_CONTROL_REG, 0x8003); 398 phy_reg_write(0, portAddr[2], PORT_CONTROL_REG, 0x8003); 399 phy_reg_write(0, portAddr[3], PORT_CONTROL_REG, 0x8003); 400 phy_reg_write(0, portAddr[4], PORT_CONTROL_REG, 0x8003); 401 phy_reg_write(0, portAddr[5], PORT_CONTROL_REG, 0x8003); 402 phy_reg_write(0, 0x1E, PORT_CONTROL_REG, reg_data); 403 404 #else 345 405 /* 346 406 * XXX 347 407 */ 348 408 phy_reg_write(0, 0, 0x10, 0x50); 409 #endif 349 410 return (liveLinks > 0); 350 411 } -
src/linux/pb42/linux-2.6.23/drivers/net/ag7100/ag7100.c
r14516 r14586 1666 1666 * also pulls the ether header 1667 1667 */ 1668 skb->protocol = eth_type_trans(skb, dev);1669 1668 skb->dev = dev; 1670 1669 bp->buf_pkt = NULL; … … 1673 1672 quota--; 1674 1673 1675 netif_receive_skb(skb); 1674 if (mac->rx) 1675 mac->rx(skb); 1676 else 1677 { 1678 skb->protocol = eth_type_trans(skb, dev); 1679 netif_receive_skb(skb); 1680 } 1676 1681 #endif 1677 1682 … … 2149 2154 } 2150 2155 2156 #ifdef CONFIG_NET_DSA_MV88E6060 2157 2158 #include "dev-dsa.h" 2159 2160 static struct dsa_chip_data tl_wr941nd_dsa_chip = { 2161 .port_names[0] = "wan", 2162 .port_names[1] = "lan1", 2163 .port_names[2] = "lan2", 2164 .port_names[3] = "lan3", 2165 .port_names[4] = "lan4", 2166 .port_names[5] = "cpu", 2167 }; 2168 2169 static struct dsa_platform_data tl_wr941nd_dsa_data = { 2170 .nr_chips = 1, 2171 .chip = &tl_wr941nd_dsa_chip, 2172 }; 2173 #endif 2151 2174 /* 2152 2175 * All allocations (except irq and rings). … … 2328 2351 goto failed; 2329 2352 } 2330 #ifdef CONFIG_PHY_LAYER 2353 2354 #ifdef CONFIG_NET_DSA_MV88E6060 2355 if (i==0) 2356 { 2357 struct mii_bus *bus = ag7100_mdiobus_setup(i,dev); 2358 ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data,dev,bus); 2359 } 2360 #elif CONFIG_PHY_LAYER 2331 2361 ag7100_mdiobus_setup(i,dev); 2332 2362 #endif 2363 2333 2364 2334 2365 netif_carrier_off(dev); … … 2351 2382 mdelay(100); 2352 2383 2384 2385 2353 2386 } 2354 2387 ag7100_trc_init(); -
src/linux/pb42/linux-2.6.23/drivers/net/ag7100/ag7100.h
r14517 r14586 71 71 typedef struct { 72 72 struct net_device *mac_dev; 73 int (*rx)(struct sk_buff *skb); 73 74 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) 74 75 struct napi_struct mac_napi; … … 188 189 AR7100_RESET_GE0_PHY) 189 190 191 #elif CONFIG_MVSWITCH_PHY 192 #define ag7100_reset_mask(_no) (_no) ? (AR7100_RESET_GE1_MAC) \ 193 : (AR7100_RESET_GE0_MAC) 190 194 #else 191 195 #define ag7100_reset_mask(_no) (_no) ? (AR7100_RESET_GE1_MAC | \ -
src/linux/pb42/linux-2.6.23/drivers/net/ag7100/ag7100_phy.h
r13863 r14586 228 228 } 229 229 230 static inline intag7100_mdiobus_setup(int unit,struct net_device *dev)230 static inline struct mii_bus *ag7100_mdiobus_setup(int unit,struct net_device *dev) 231 231 { 232 232 int i; 233 233 struct phy_device *phydev = NULL; 234 ag7100_mac_t *mac = (ag7100_mac_t *)dev->priv; 234 235 struct mii_bus *mii_bus = kzalloc(sizeof(struct mii_bus),GFP_KERNEL); 235 236 mii_bus->id=unit; … … 244 245 mdiobus_register(mii_bus); 245 246 if (unit==0) 247 { 248 // #ifdef CONFIG_MVSWITCH_PHY 249 // phydev = mii_bus->phy_map[31]; 250 // #else 246 251 phydev = mii_bus->phy_map[0]; 252 // #endif 253 } 247 254 else 248 255 phydev = mii_bus->phy_map[4]; 256 249 257 if (phydev!=NULL) 250 258 { 251 259 phydev = phy_connect(dev, phydev->dev.bus_id, &ag7100_adjust_link, 0,PHY_INTERFACE_MODE_RMII); 260 mac->rx = phydev->netif_receive_skb; 252 261 phydev->supported &= PHY_BASIC_FEATURES; 253 262 phydev->advertising = phydev->supported; … … 256 265 } 257 266 258 return (0);267 return mii_bus; 259 268 } 260 269 -
src/linux/pb42/linux-2.6.23/drivers/net/phy/mvswitch.c
r13356 r14586 44 44 int (*hardstart)(struct sk_buff *skb, struct net_device *dev); 45 45 struct vlan_group *grp; 46 u8 vlans[ 16];46 u8 vlans[2]; 47 47 }; 48 48 … … 129 129 *((__be32 *) buf) = cpu_to_be32(( 130 130 (MV_TRAILER_OVERRIDE << MV_TRAILER_FLAGS_S) | 131 ((priv->vlans[vid] & MV_TRAILER_PORTS_M) << MV_TRAILER_PORTS_S) 131 ((priv->vlans[vid] & MV_TRAILER_PORTS_M) << MV_TRAILER_PORTS_S)//|(0x10<<8) 132 132 )); 133 133 #endif … … 153 153 unsigned char *buf; 154 154 int i; 155 156 155 dev = skb->dev; 157 156 if (!dev) … … 177 176 for (i = 0; i < ARRAY_SIZE(priv->vlans); i++) { 178 177 if ((1 << buf[1]) & priv->vlans[i]) 178 { 179 179 vlan = i; 180 goto receive; 181 } 182 180 183 } 181 184 182 185 if (vlan == -1) 183 186 goto error; 184 187 receive:; 185 188 skb->protocol = eth_type_trans(skb, skb->dev); 186 187 189 if (napi) 188 190 return vlan_hwaccel_receive_skb(skb, priv->grp, vlan); … … 221 223 mvswitch_wait_mask(struct phy_device *pdev, int addr, int reg, u16 mask, u16 val) 222 224 { 223 int i = 100 ;225 int i = 1000; 224 226 u16 r; 225 227 … … 293 295 emask 294 296 ); 297 295 298 /* wait for the phy change to settle in */ 296 299 msleep(2); … … 327 330 w16(pdev, MV_PORTREG(CONTROL, i),emask); 328 331 } 332 // w16(pdev, MV_PORTREG(VLANMAP, MV_CPUPORT), 333 // MV_PORTVLAN_PORTS(0x1f) | 334 // MV_PORTVLAN_ID(MV_CPUPORT) 335 // ); 329 336 330 337 w16(pdev, MV_PORTREG(VLANMAP, MV_CPUPORT), 331 338 MV_PORTVLAN_ID(MV_CPUPORT) 332 339 ); 333 334 340 /* set the port association vector */ 335 341 for (i = 0; i <= MV_PORTS; i++) { … … 439 445 u16 reg; 440 446 int i; 441 442 447 /* we attach to phy id 31 to make sure that the late probe works */ 443 if (addr != 31)448 if (addr != 0) 444 449 return false; 445 446 450 /* look for the switch on the bus */ 447 451 reg = bus->read(bus, MV_PORTREG(IDENT, 0)) & MV_IDENT_MASK; … … 453 457 * get rid of the competition :) 454 458 */ 455 for (i = 0; i < 31; i++) {459 /* for (i = 0; i < 31; i++) { 456 460 if (!bus->phy_map[i]) 457 461 continue; … … 460 464 kfree(bus->phy_map[i]); 461 465 bus->phy_map[i] = NULL; 462 } 466 }*/ 463 467 464 468 return true; -
src/linux/pb42/linux-2.6.23/drivers/net/phy/mvswitch.h
r13356 r14586 28 28 29 29 #define MV_PORTS 5 30 #ifdef CONFIG_MTD_AR531X31 30 #define MV_WANPORT 0 32 #else33 #define MV_WANPORT 434 #endif35 31 #define MV_CPUPORT 5 36 32 37 #define MV_BASE 0 x1033 #define MV_BASE 0 38 34 39 35 #define MV_PHYPORT_BASE (MV_BASE + 0x0)
Note: See TracChangeset
for help on using the changeset viewer.
