Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935066AbcKOWfK (ORCPT ); Tue, 15 Nov 2016 17:35:10 -0500 Received: from mout.gmx.net ([212.227.17.20]:61461 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbcKOWfI (ORCPT ); Tue, 15 Nov 2016 17:35:08 -0500 Subject: Re: [net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver To: Andrew Lunn References: <1479012453-19410-1-git-send-email-LinoSanfilippo@gmx.de> <1479012453-19410-2-git-send-email-LinoSanfilippo@gmx.de> <20161113195544.GA18258@lunn.ch> <69558f55-824a-7063-d9b3-ccc0a6113b87@gmx.de> <4450caf4-e1cf-5187-1337-c46b81b08708@gmail.com> <0d1b4dee-11bb-3605-699c-ea417484cb68@gmx.de> <20161115215907.GF23231@lunn.ch> Cc: Florian Fainelli , davem@davemloft.net, charrer@alacritech.com, liodot@gmail.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org From: Lino Sanfilippo Message-ID: <86165d2b-f9d5-a380-9bb0-f77c12691eb6@gmx.de> Date: Tue, 15 Nov 2016 23:34:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161115215907.GF23231@lunn.ch> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:q8c1h0GxM4/bu0Nm4R0iGToEtEown3GxEg49Av90lkIoFuUuOZY ThJFcyH4cPVBpc1mmL90qFzNYN17Z+ftecCH8MHZV/YkxyOJw4wjLurrnl0i5ixRxZb7SR4 VLYJDLhNvc9TH+BvSf57MT7V21OhWI8WkjNl//KR4XMb2j9t/ZM7B0ftcmQkUPoRGaYDZ26 uf1Rf4tORAUq1vmxbL6Yw== X-UI-Out-Filterresults: notjunk:1;V01:K0:4ioC6wpxkDE=:kZeVl1v7WPOzMGopKvJakD wdTWVa+JSHxfkLd2BnCBPgf2aToOXrObUg3TkwEgPocJrDCWex7JPB2Yq8mWwcYSQJRGk5/vt GcWejao503K17vcx0PZe2R5aO7oY8m/xcnDOd4USISdI1R7mkYJxxX0J73VlkcWo2zbG/ZT0M 8TY8caOa67ROJ80GToxM/dwxBmFu6Kgru6M/WzIp52n7M/VcaJIpBLHKUDyo2pS8GgkxGoPDq HcOgZnypd/hXDPdfDlsGmhisPUx57Jv6h9WVECN6HCIJW1jO/xH2NZDnQ9UtzqY+rxL9D6bab TAH/Er6DM1XDf/y7wnLpN8aLHb3nqgt2NZX/pruz5qIcKke4rRlV4K3kZjNRB7ctNUg1b1yfN 0yRy08VVNou89QxPZA+JNc2vFYu/osGvPCU+EbCow0S4UYSXv6nlSsvjE/QA+yUD83WH92Vvi J2iyPwd4KyM6jHABF4/oW65OQJuOJqCRBlqdqySZsbSjZa22k7n9RVI6Bx6mCT3TvWSjyDzmf U5jp8C4M5gVU2YtErWr92ODA6r2czA7gDZ6gich0I0fuwnGgBMSr9V88J2tLxBDV3JmwPV0g4 x6OByH6evQoLDYI1GOzGjuKcP4hTy7P3rUfW86NiYGF0TdyrtyAKWCnNHsXrrWhwZRMibwEg6 UP3rAxdDAQJqYsHTuGHjhoSndfe5u2hrk81Vyt1SSmgY1+faOWRI8uLqSXZm6z4rlAN5I4DRL 4guQWD0pXrNYGKI6i5EwQ/SzkL4VLwcie+tgAOH0zRe9hwAh3wElvBmN3ieDvrmJjgqwVigu9 bFOaM5U Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1495 Lines: 33 On 15.11.2016 22:59, Andrew Lunn wrote: >> The link state is retrieved by a command to the application processor that is running >> on the network card. Also the register to set the phy configuration is write-only, so >> it is not even possible to do the usual mdio bit-banging in the Phy read() and write() >> functions (however there seems to be another application processor command reserved >> for retrieving the PHY settings, but I have not tried it yet). > >>> + val = MII_BMCR << 16 | SLIC_PCR_AUTONEG | >>> + SLIC_PCR_AUTONEG_RST; >>> + slic_write(sdev, SLIC_REG_WPHY, val); > > This actually looks a lot like an MDIO write operation. The upper 16 > bits are the register, and the lower 16 bits are the data. What you > don't have is the address. But maybe it is limited to one address. > > If the processor command reserved for read works in a similar way, you > have enough to do an MDIO bus. > Ok, I will give it a try. Reading values via the application processor is a bit awkward though, since it requires an address to a dma area as part of the command and then the AP informs the driver via irq that the dma memory has been written. So probably the irq handler will have to set some flag and the mdio_read() function will have to poll for that flag in place of doing bit-banging a register. > If you can get the read working look at registers 2 and 3. Compare > what you get with the values at the end of marvell.c. > Will do, thank you! Lino