Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-04-03 Thread Richard Cochran
On Tue, Apr 03, 2018 at 03:13:19PM +0200, Andrew Lunn wrote: > Have you tried implementing it using a phandle in the phy node, > pointing to the time stamping device? Not yet, but I'll take this up for V2, after the merge window... Thinking about MII, it really is a 1:1 connection between the MAC

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-04-03 Thread Andrew Lunn
> On Mon, Apr 02, 2018 at 08:55:27PM -0700, Richard Cochran wrote: > On Sun, Mar 25, 2018 at 04:01:49PM -0700, Florian Fainelli wrote: > > The best that I can think about and it still is a hack in some way, is > > to you have your time stamping driver create a proxy mii_bus whose > > purpose is jus

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-04-02 Thread Richard Cochran
On Mon, Mar 26, 2018 at 01:01:58AM +0200, Andrew Lunn wrote: > The phylib core code will take the phydev lock before calling into the > driver. By violating the layering, we are missing on this lock. That lock protects the fields within the struct phy_device, like the state field. None of the tim

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-04-02 Thread Richard Cochran
On Sun, Mar 25, 2018 at 04:01:49PM -0700, Florian Fainelli wrote: > The best that I can think about and it still is a hack in some way, is > to you have your time stamping driver create a proxy mii_bus whose > purpose is just to hook to mdio/phy_device events (such as link changes) > in order to do

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-25 Thread Andrew Lunn
> > in the future some devices will be MDIO, or I2C, or SPI. Just call it > > ptpdev. This ptpdev needs to be control bus agnostic. You need a > > ptpdev core API exposing functions like ptpdev_hwtstamp, > > ptpdev_rxtstamp, ptpdev_txtstamp, ptpdev_link_change, which take a > > ptpdev. > > Well, t

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-25 Thread Florian Fainelli
On 03/25/2018 03:10 PM, Richard Cochran wrote: > On Sun, Mar 25, 2018 at 05:59:37PM +0200, Andrew Lunn wrote: 3) How do you limit the MAC/PHY to what the PTP device can do. >>> >>> Hm, I don't think this is important. >> >> So you are happy that the PTP device will cause the MC/PHY link to >

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-25 Thread Andrew Lunn
> > You can then clean up the code in timestamping.c. Code like: > > > > phydev = skb->dev->phydev; > > if (likely(phydev->drv->txtstamp)) { > > clone = skb_clone_sk(skb); > > if (!clone) > > return; > > phydev

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-25 Thread Richard Cochran
On Sun, Mar 25, 2018 at 05:59:37PM +0200, Andrew Lunn wrote: > To keep lifecycle issues simple, i would also keep it in phydev, not > netdev. Okay. Since we don't have any representation for MII anyhow, it seems equally fitting to attach this to the PHY's data structure as to the MAC's. Thanks,

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-25 Thread Richard Cochran
On Sun, Mar 25, 2018 at 05:59:37PM +0200, Andrew Lunn wrote: > > > 3) How do you limit the MAC/PHY to what the PTP device can do. > > > > Hm, I don't think this is important. > > So you are happy that the PTP device will cause the MC/PHY link to > break down when it is asked to do something it ca

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-25 Thread Andrew Lunn
On Sat, Mar 24, 2018 at 09:51:52PM -0700, Richard Cochran wrote: > On Sat, Mar 24, 2018 at 07:48:58PM +0100, Andrew Lunn wrote: > > As far as i can see, you have three basic problems: > > > > 1) How do you associate the PTP device to the netdev? > > 2) How do you get the information you need to co

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-24 Thread Richard Cochran
On Sat, Mar 24, 2018 at 07:48:58PM +0100, Andrew Lunn wrote: > As far as i can see, you have three basic problems: > > 1) How do you associate the PTP device to the netdev? > 2) How do you get the information you need to configure the PTP device Yes, yes. > 3) How do you limit the MAC/PHY to wha

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-24 Thread Andrew Lunn
On Sat, Mar 24, 2018 at 10:12:19AM -0700, Richard Cochran wrote: > On Thu, Mar 22, 2018 at 12:50:07AM +0100, Andrew Lunn wrote: > > How clever is this device? Can it tell the difference between > > 1000Base-X and SGMII? Can it figure out that the MAC is repeating > > every bit 100 times and so has

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-24 Thread Richard Cochran
On Thu, Mar 22, 2018 at 12:50:07AM +0100, Andrew Lunn wrote: > How clever is this device? Can it tell the difference between > 1000Base-X and SGMII? Can it figure out that the MAC is repeating > every bit 100 times and so has dropped to 10Mbits? Does it understand > EEE? Does it need to know if RGM

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Richard Cochran
On Thu, Mar 22, 2018 at 01:43:49AM +0100, Andrew Lunn wrote: > On Wed, Mar 21, 2018 at 03:47:02PM -0700, Richard Cochran wrote: > > I happy to improve the modeling, but the solution should be generic > > and work for every MAC driver. Let me qualify that a bit... > Something else to think about.

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Andrew Lunn
On Wed, Mar 21, 2018 at 03:47:02PM -0700, Richard Cochran wrote: > On Wed, Mar 21, 2018 at 11:16:52PM +0100, Andrew Lunn wrote: > > The MAC drivers are clients of this device. They then use a phandle > > and specifier: > > > > eth0: ethernet-controller@72000 { > > compatible = "mar

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Andrew Lunn
On Wed, Mar 21, 2018 at 03:47:02PM -0700, Richard Cochran wrote: > On Wed, Mar 21, 2018 at 11:16:52PM +0100, Andrew Lunn wrote: > > The MAC drivers are clients of this device. They then use a phandle > > and specifier: > > > > eth0: ethernet-controller@72000 { > > compatible = "mar

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Richard Cochran
On Wed, Mar 21, 2018 at 11:16:52PM +0100, Andrew Lunn wrote: > The MAC drivers are clients of this device. They then use a phandle > and specifier: > > eth0: ethernet-controller@72000 { > compatible = "marvell,kirkwood-eth"; > #address-cells = <1>; >

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Andrew Lunn
On Wed, Mar 21, 2018 at 02:57:29PM -0700, Richard Cochran wrote: > On Wed, Mar 21, 2018 at 10:44:36PM +0100, Andrew Lunn wrote: > > O.K, so lets do the 20 questions approach. > > :) > > > As far as i can see, this is not an MDIO device. It is not connected > > to the MDIO bus, it has no MDIO regi

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Richard Cochran
On Wed, Mar 21, 2018 at 10:44:36PM +0100, Andrew Lunn wrote: > O.K, so lets do the 20 questions approach. :) > As far as i can see, this is not an MDIO device. It is not connected > to the MDIO bus, it has no MDIO registers, you don't even pass a valid > MDIO address in device tree. Right. Ther

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Andrew Lunn
Hi Richard > The only other docs that I have is a PDF of the register layout, but I > don't think I can redistribute that. Actually, there really isn't any > detail in that doc at all. O.K, so lets do the 20 questions approach. As far as i can see, this is not an MDIO device. It is not connecte

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Richard Cochran
On Wed, Mar 21, 2018 at 08:33:15PM +0100, Andrew Lunn wrote: > Can you point us at some documentation for this. The overall one-step functionality is described IEEE 1588. > I think Florian and I want to better understand how this device works, > in order to understand your other changes. The dev

Re: [PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Andrew Lunn
On Wed, Mar 21, 2018 at 11:58:18AM -0700, Richard Cochran wrote: > The InES at the ZHAW offers a PTP time stamping IP core. The FPGA > logic recognizes and time stamps PTP frames on the MII bus. This > patch adds a driver for the core along with a device tree binding to > allow hooking the driver

[PATCH net-next RFC V1 5/5] net: mdio: Add a driver for InES time stamping IP core.

2018-03-21 Thread Richard Cochran
The InES at the ZHAW offers a PTP time stamping IP core. The FPGA logic recognizes and time stamps PTP frames on the MII bus. This patch adds a driver for the core along with a device tree binding to allow hooking the driver to MAC devices. Signed-off-by: Richard Cochran --- Documentation/devi