Hello Nerijus, On Fri, Sep 29, 2017 at 7:32 PM, Nerijus Baliunas <neri...@users.sourceforge.net> wrote: > On Fri, 8 Sep 2017 22:50:13 +0300 Sergey Ryazanov <ryazanov....@gmail.com> > wrote: >> >> >> Did you see the "Marvell 88E6060 PHY driver attached" in kernel >> >> >> messages log? If not then the mwswitch driver did not attached and >> >> >> you should fix this first. And only then go to the interface >> >> >> configuration. >> >> > >> >> > No, dmesg|grep 6060 does not show anything. How do I fix it? >> >> >> >> Try to check, which MDIO addresses PHY core (or Ethernet MAC driver) >> >> scans to detect connected PHYs. >> > >> > I enabled #define DEBUG_MDIO 1 in ixp4xx_eth.c and got this: >> > # dmesg|grep -i MII|grep -v took >> > ... >> > [ 0.976646] IXP4xx MII Bus #16: MII read [2] -> 0x141 >> > [ 0.976747] IXP4xx MII Bus #16: MII read [3] -> 0xC87 >> > [ 0.978682] IXP4xx MII Bus #24: MII read [3] -> 0x602 >> >> Looks like mvswitch driver tries to check chip here and got an >> expected value 0x060X from register 3. So on the one hand the driver >> is functioning, but on the other hand it can not detect switch IC. >> >> Can you go to the /sys/class/mdio_bus/ and for each bus check driver >> and ID of the each detected device. E.g.: >> # cd /sys/class/mdio_bus >> # ls -l */*/driver > > lrwxrwxrwx 1 root root 0 Jul 22 21:31 > ixp4xx-eth-0/ixp4xx-eth-0:01/driver -> > ../../../../../bus/mdio_bus/drivers/Generic PHY > lrwxrwxrwx 1 root root 0 Jul 22 21:31 > ixp4xx-eth-0/ixp4xx-eth-0:10/driver -> > ../../../../../bus/mdio_bus/drivers/Marvell 88E6060 >
After these lines, I carefully examine available data about WRT300Nv2 and related code and found several interesting things. Usually SoC in the router have only one ethernet interface and vendors pair it with manageable switch IC. This swith IC accepts packets from LAN and WAN ports, then it tags them and forward to the SoC. Thus, using VLAN tags, SoC can distinguish from which port the packet was received and handle it appropriately. So the firmware should contains a driver for switch IC to be able to properly configure ports and VLANs inside the switch. In case of WRT300Nv2 the SoC contains two ethernet adapters: NPE-C (eth1), which has own phy and acted as a WAN port and NPE-B (eth0), which is connected to switch IC, each port of which is acting as LAN port. So since all ports of switch are equal then the switch themself requires a minimal (if any) configuration. And this router can possibly act without any special driver for switch IC. Also I found why the switch is properly detected on the MDIO bus but not used as phy-device. This happened because PHY ID for eth0 is hardcoded inside WRT300Nv2 setup code. To check whether your board can act without dedicated driver for 88E6060: * revert any earlier modifications to LEDE if you do any * disable any drivers for 88E6060 (e.g. disable both CONFIG_NET_DSA_MV88E6060 and CONFIG_MVSWITCH_PHY) * place attached patch to the target/linux/ixp4xx/patches-4.4 * rebuild and boot new firmware * check dmesg for "eth0: link up" message * check eth0 functioning: check packets receiving with tcpdump or manually assign IP address to the eth0 interface (without any VLAN's and so on) and try to ping. -- Sergey
999-ixp4xx-fix-nophy-link-status.patch
Description: Binary data
_______________________________________________ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev