From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver Date: Tue, 5 Dec 2017 23:23:43 +0100 Message-ID: <20171205222342.GC24945@amd> References: <1510886597-5666-1-git-send-email-Tristram.Ha@microchip.com> <1510886597-5666-2-git-send-email-Tristram.Ha@microchip.com> <20171120105609.GA4460@amd> <93AF473E2DA327428DE3D46B72B1E9FD4113DCE0@CHN-SV-EXMX02.mchp-main.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TiqCXmo5T1hvSQQg" Cc: andrew@lunn.ch, f.fainelli@gmail.com, muvarov@gmail.com, nathan.leigh.conrad@gmail.com, vivien.didelot@savoirfairelinux.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org To: Tristram.Ha@microchip.com Return-path: Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:45328 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752780AbdLEWXp (ORCPT ); Tue, 5 Dec 2017 17:23:45 -0500 Content-Disposition: inline In-Reply-To: <93AF473E2DA327428DE3D46B72B1E9FD4113DCE0@CHN-SV-EXMX02.mchp-main.com> Sender: netdev-owner@vger.kernel.org List-ID: --TiqCXmo5T1hvSQQg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2017-12-05 22:16:45, Tristram.Ha@microchip.com wrote: > > Thanks for patches. I installed whole series on top of net-next. > >=20 > > Hardware is: > >=20 > > root@miro:~# cat /proc/cpuinfo > > model name : ARM926EJ-S rev 5 (v5l) > > Hardware : Freescale MXS (Device Tree) > >=20 > > I added devicetree chunks, and enabled DSA in the config. It seems > > switch is detected: > >=20 > > [ 4.775934] Micrel KSZ8051 dsa-0.0:00: attached PHY driver [Micrel > > KSZ8051] (mii_bus:phy_addr=3Ddsa-0.0:00, irq=3DPOLL) > > [ 4.885952] Micrel KSZ8051 dsa-0.0:01: attached PHY driver [Micrel > > KSZ8051] (mii_bus:phy_addr=3Ddsa-0.0:01, irq=3DPOLL) > > [ 4.995934] Micrel KSZ8051 dsa-0.0:02: attached PHY driver [Micrel > > KSZ8051] (mii_bus:phy_addr=3Ddsa-0.0:02, irq=3DPOLL) > > [ 5.011484] DSA: tree 0 setup > >=20 > > root@miro:~# ifconfig lan3 192.168.20.103 netmask 255.255.0.0 up > > [ 131.196667] IPv6: ADDRCONF(NETDEV_UP): lan3: link is not ready > > root@miro:~# [ 132.225863] ksz8895-switch spi2.0 lan3: Link is Up - > > 100Mbps/Full - flow control rx/tx > > [ 132.233939] IPv6: ADDRCONF(NETDEV_CHANGE): lan3: link becomes ready > >=20 > > root@miro:~# ping 192.168.1.1 > > PING 192.168.1.1 (192.168.1.1): 56 data bytes > > ^C > > --- 192.168.1.1 ping statistics --- > > 7 packets transmitted, 0 packets received, 100% packet loss > > root@miro:~# ifconfig [ 149.904234] random: crng init done > >=20 > > But packets do not go through, and there is nothing helpful in > > dmesg. Dts part is: > >=20 > > spi@0 { > > compatible =3D "microchip,ksz8895"; > > spi-max-frequency =3D <25000000>; > > reg =3D <0>; > > // reset-gpios =3D <&gpio2 8 0>; > > status =3D "okay"; > >=20 > > spi-cpha; > > spi-cpol; > > ports { > > #address-cells =3D <1>; > > #size-cells =3D <0>; > > port@0 { > > reg =3D <0>; > > label =3D "lan1"; > > }; > > port@1 { > > reg =3D <1>; > > label =3D "lan2"; > > }; > > port@2 { > > reg =3D <2>; > > label =3D "lan3"; > > }; > > port@4 { > > reg =3D <4>; > > label =3D "cpu"; > > ethernet =3D <&mac0>; > > fixed-link { > > speed =3D <100>; > > full-duplex; > > }; > > }; > > }; > > }; > >=20 > > I went back to my version of dsa patches, and test above works as > > expected. >=20 > Sorry to be this late for the reply. I finally got hold of a KSZ8895 boa= rd that > works with my SoC board to confirm the network communication. >=20 > As expected the KSZ8895 board works correctly as the chip uses the same > tail tagging feature in KSZ8795, and I did verify that board is working. >=20 > One thing to debug this problem is to dump the MIB counters. Use the eth= tool > utility to show MIB counters of both ports: >=20 > ethtool -S lan3 > ethtool -S eth0 >=20 > Assuming eth0 is the MAC controller that drives the switch, the receive c= ounters of > the host port of the switch should match the transmit counters of > lan3, and vice versa. Thanks for reply. I'll get to the tests shortly. Could I get .dts snippet that works for you and commands you are using for testing? Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --TiqCXmo5T1hvSQQg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlonHG4ACgkQMOfwapXb+vIdqwCfaiIQvR42Luepy25DAsFy/4X1 UbkAn2CjvG0NkAN6dNJ6cPbgcS1kcFpp =weUk -----END PGP SIGNATURE----- --TiqCXmo5T1hvSQQg--