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 12:43:39 -0400	[thread overview]
Message-ID: <20161101164337.GA19654@broadcom.com> (raw)
In-Reply-To: <20161101162648.GG10785@lunn.ch>

On Tue, Nov 01, 2016 at 05:26:48PM +0100, Andrew Lunn wrote:
> > > > +	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).
> 
> I would keep the parsing of the property in the driver. But if we
> think other PHYs could also support this feature, it would be good to
> avoid having "brcm,enet-phy-lane-swap", "marvell,enet-phy-lane-swap",
> "davicom,enet-phy-lane-swap", etc. It would be better to have one well
> defined property documented in phy.txt which any PHY is free to
> implement.

Okay, I understand what you are saying now.  I will assume that if
nothing exists today aside from this Broadcom errata, something in the
future will happen.  So, I agree that making it generic is a good idea.

I'll make the generic string be "enet-phy-lane-swap" (without the
previous "brcm"), and add the flag to phy.txt to document it.

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 12:43:39 -0400	[thread overview]
Message-ID: <20161101164337.GA19654@broadcom.com> (raw)
In-Reply-To: <20161101162648.GG10785@lunn.ch>

On Tue, Nov 01, 2016 at 05:26:48PM +0100, Andrew Lunn wrote:
> > > > +	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).
> 
> I would keep the parsing of the property in the driver. But if we
> think other PHYs could also support this feature, it would be good to
> avoid having "brcm,enet-phy-lane-swap", "marvell,enet-phy-lane-swap",
> "davicom,enet-phy-lane-swap", etc. It would be better to have one well
> defined property documented in phy.txt which any PHY is free to
> implement.

Okay, I understand what you are saying now.  I will assume that if
nothing exists today aside from this Broadcom errata, something in the
future will happen.  So, I agree that making it generic is a good idea.

I'll make the generic string be "enet-phy-lane-swap" (without the
previous "brcm"), and add the flag to phy.txt to document it.

Thanks,
Jon

> 
> 	Andrew

  reply	other threads:[~2016-11-01 16:43 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
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 [this message]
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=20161101164337.GA19654@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.