All of lore.kernel.org
 help / color / mirror / Atom feed
From: jon.mason@broadcom.com (Jon Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/6] net: phy: broadcom: Add BCM54810 PHY entry
Date: Tue, 1 Nov 2016 11:59:53 -0400	[thread overview]
Message-ID: <20161101155950.GA19378@broadcom.com> (raw)
In-Reply-To: <20161029081839.GA32579@lunn.ch>

On Sat, Oct 29, 2016 at 10:18:39AM +0200, Andrew Lunn wrote:
> On Fri, Oct 28, 2016 at 04:56:55PM -0400, Jon Mason wrote:
> > The BCM54810 PHY requires some semi-unique configuration, which results
> > in some additional configuration in addition to the standard config.
> > Also, some users of the BCM54810 require the PHY lanes to be swapped.
> > Since there is no way to detect this, add a device tree query to see if
> > it is applicable.
> > 
> > Inspired-by: Vikas Soni <vsoni@broadcom.com>
> > Signed-off-by: Jon Mason <jon.mason@broadcom.com>
> > ---
> >  drivers/net/phy/Kconfig    |  2 +-
> >  drivers/net/phy/broadcom.c | 58 +++++++++++++++++++++++++++++++++++++++++++++-
> >  include/linux/brcmphy.h    | 10 ++++++++
> 
> Hi Jon
> 
> The binding documentation is missing.
> 
> > +	if (of_property_read_bool(np, "brcm,enet-phy-lane-swap")) {
> > +		/* Lane Swap - Undocumented register...magic! */
> > +		ret = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0x9,
> > +					0x11B);
> > +		if (ret < 0)
> > +			return ret;
> > +	}
> > +
> 
> I wounder if this property could be made generic? What exactly are you
> swapping? Rx and Tx lanes? Maybe we should add it to phy.txt?

Are you envisioning adding a DT check (similar to the
of_property_read_bool above, only with a more generic string) in
phy_device_create(), which will then set a PHY device flag?  This flag
would then be checked for in the PHY driver and the appropriate action
taken (in this case the bcm_phy_write_exp above).

If so, I cam completely fine doing this.  I think the only caveat
would be that this would be creating a generic interface for only 1
user.  If you envision this being used by others, then disregard my
concern.

Thanks,
Jon

> 
> 	  Andrew

WARNING: multiple messages have this Message-ID (diff)
From: Jon Mason <jon.mason@broadcom.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com, rafal@milecki.pl,
	David Miller <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/6] net: phy: broadcom: Add BCM54810 PHY entry
Date: Tue, 1 Nov 2016 11:59:53 -0400	[thread overview]
Message-ID: <20161101155950.GA19378@broadcom.com> (raw)
In-Reply-To: <20161029081839.GA32579@lunn.ch>

On Sat, Oct 29, 2016 at 10:18:39AM +0200, Andrew Lunn wrote:
> On Fri, Oct 28, 2016 at 04:56:55PM -0400, Jon Mason wrote:
> > The BCM54810 PHY requires some semi-unique configuration, which results
> > in some additional configuration in addition to the standard config.
> > Also, some users of the BCM54810 require the PHY lanes to be swapped.
> > Since there is no way to detect this, add a device tree query to see if
> > it is applicable.
> > 
> > Inspired-by: Vikas Soni <vsoni@broadcom.com>
> > Signed-off-by: Jon Mason <jon.mason@broadcom.com>
> > ---
> >  drivers/net/phy/Kconfig    |  2 +-
> >  drivers/net/phy/broadcom.c | 58 +++++++++++++++++++++++++++++++++++++++++++++-
> >  include/linux/brcmphy.h    | 10 ++++++++
> 
> Hi Jon
> 
> The binding documentation is missing.
> 
> > +	if (of_property_read_bool(np, "brcm,enet-phy-lane-swap")) {
> > +		/* Lane Swap - Undocumented register...magic! */
> > +		ret = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0x9,
> > +					0x11B);
> > +		if (ret < 0)
> > +			return ret;
> > +	}
> > +
> 
> I wounder if this property could be made generic? What exactly are you
> swapping? Rx and Tx lanes? Maybe we should add it to phy.txt?

Are you envisioning adding a DT check (similar to the
of_property_read_bool above, only with a more generic string) in
phy_device_create(), which will then set a PHY device flag?  This flag
would then be checked for in the PHY driver and the appropriate action
taken (in this case the bcm_phy_write_exp above).

If so, I cam completely fine doing this.  I think the only caveat
would be that this would be creating a generic interface for only 1
user.  If you envision this being used by others, then disregard my
concern.

Thanks,
Jon

> 
> 	  Andrew

WARNING: multiple messages have this Message-ID (diff)
From: Jon Mason <jon.mason@broadcom.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: David Miller <davem@davemloft.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com, rafal@milecki.pl,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/6] net: phy: broadcom: Add BCM54810 PHY entry
Date: Tue, 1 Nov 2016 11:59:53 -0400	[thread overview]
Message-ID: <20161101155950.GA19378@broadcom.com> (raw)
In-Reply-To: <20161029081839.GA32579@lunn.ch>

On Sat, Oct 29, 2016 at 10:18:39AM +0200, Andrew Lunn wrote:
> On Fri, Oct 28, 2016 at 04:56:55PM -0400, Jon Mason wrote:
> > The BCM54810 PHY requires some semi-unique configuration, which results
> > in some additional configuration in addition to the standard config.
> > Also, some users of the BCM54810 require the PHY lanes to be swapped.
> > Since there is no way to detect this, add a device tree query to see if
> > it is applicable.
> > 
> > Inspired-by: Vikas Soni <vsoni@broadcom.com>
> > Signed-off-by: Jon Mason <jon.mason@broadcom.com>
> > ---
> >  drivers/net/phy/Kconfig    |  2 +-
> >  drivers/net/phy/broadcom.c | 58 +++++++++++++++++++++++++++++++++++++++++++++-
> >  include/linux/brcmphy.h    | 10 ++++++++
> 
> Hi Jon
> 
> The binding documentation is missing.
> 
> > +	if (of_property_read_bool(np, "brcm,enet-phy-lane-swap")) {
> > +		/* Lane Swap - Undocumented register...magic! */
> > +		ret = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0x9,
> > +					0x11B);
> > +		if (ret < 0)
> > +			return ret;
> > +	}
> > +
> 
> I wounder if this property could be made generic? What exactly are you
> swapping? Rx and Tx lanes? Maybe we should add it to phy.txt?

Are you envisioning adding a DT check (similar to the
of_property_read_bool above, only with a more generic string) in
phy_device_create(), which will then set a PHY device flag?  This flag
would then be checked for in the PHY driver and the appropriate action
taken (in this case the bcm_phy_write_exp above).

If so, I cam completely fine doing this.  I think the only caveat
would be that this would be creating a generic interface for only 1
user.  If you envision this being used by others, then disregard my
concern.

Thanks,
Jon

> 
> 	  Andrew

  reply	other threads:[~2016-11-01 15:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 20:56 [PATCH v2 0/6] add NS2 support to bgmac Jon Mason
2016-10-28 20:56 ` Jon Mason
2016-10-28 20:56 ` [PATCH v2 1/6] net: phy: broadcom: add bcm54xx_auxctl_read Jon Mason
2016-10-28 20:56   ` Jon Mason
2016-10-28 20:56 ` [PATCH v2 2/6] net: phy: broadcom: Add BCM54810 PHY entry Jon Mason
2016-10-28 20:56   ` Jon Mason
2016-10-29  8:18   ` Andrew Lunn
2016-10-29  8:18     ` Andrew Lunn
2016-11-01 15:59     ` Jon Mason [this message]
2016-11-01 15:59       ` Jon Mason
2016-11-01 15:59       ` Jon Mason
2016-11-01 16:26       ` Andrew Lunn
2016-11-01 16:26         ` Andrew Lunn
2016-11-01 16:43         ` Jon Mason
2016-11-01 16:43           ` Jon Mason
2016-11-01 16:48           ` Andrew Lunn
2016-11-01 16:48             ` Andrew Lunn
2016-11-01 16:48             ` Andrew Lunn
2016-10-28 20:56 ` [PATCH v2 3/6] Documentation: devicetree: net: add NS2 bindings to amac Jon Mason
2016-10-28 20:56   ` Jon Mason
2016-10-31  6:20   ` Rob Herring
2016-10-31  6:20     ` Rob Herring
2016-10-31  6:20     ` Rob Herring
2016-10-28 20:56 ` [PATCH v2 4/6] net: ethernet: bgmac: device tree phy enablement Jon Mason
2016-10-28 20:56   ` Jon Mason
2016-10-28 20:56 ` [PATCH v2 5/6] net: ethernet: bgmac: add NS2 support Jon Mason
2016-10-28 20:56   ` Jon Mason
2016-10-28 20:56 ` [PATCH v2 6/6] arm64: dts: NS2: add AMAC ethernet support Jon Mason
2016-10-28 20:56   ` Jon Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161101155950.GA19378@broadcom.com \
    --to=jon.mason@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.