From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: phy: genphy: Allow overwriting features
Date: Mon, 11 Jan 2016 09:45:15 +0000 [thread overview]
Message-ID: <1452505515.3277.6.camel@synopsys.com> (raw)
In-Reply-To: <1450889081-21717-1-git-send-email-abrodkin@synopsys.com>
Hi Joe,
On Wed, 2015-12-23 at 19:44 +0300, Alexey Brodkin wrote:
> From: Sascha Hauer <s.hauer@pengutronix.de>
>
> of_set_phy_supported allows overwiting hardware capabilities of
> a phy with values from the devicetree. This does not work with
> the genphy driver though because the genphys config_init function
> will overwrite all values adjusted by of_set_phy_supported. Fix
> this by initialising the genphy features in the phy_driver struct
> and in config_init just limit the features to the ones the hardware
> can actually support. The resulting features are a subset of the
> devicetree specified features and the hardware features.
>
> This is a copy of the patch from Linux kernel, see
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c242a47238fa2a6a54af8a16e62b54e6e031d4bc
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> ---
> drivers/net/phy/phy.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 084276f..ec9be6b 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -380,8 +380,6 @@ int genphy_config(struct phy_device *phydev)
> int val;
> u32 features;
>
> - /* For now, I'll claim that the generic driver supports
> - * all possible port types */
> features = (SUPPORTED_TP | SUPPORTED_MII
> | SUPPORTED_AUI | SUPPORTED_FIBRE |
> SUPPORTED_BNC);
> @@ -420,8 +418,8 @@ int genphy_config(struct phy_device *phydev)
> features |= SUPPORTED_1000baseX_Half;
> }
>
> - phydev->supported = features;
> - phydev->advertising = features;
> + phydev->supported &= features;
> + phydev->advertising &= features;
>
> genphy_config_aneg(phydev);
>
> @@ -445,7 +443,9 @@ static struct phy_driver genphy_driver = {
> .uid = 0xffffffff,
> .mask = 0xffffffff,
> .name = "Generic PHY",
> - .features = 0,
> + .features = PHY_GBIT_FEATURES | SUPPORTED_MII |
> + SUPPORTED_AUI | SUPPORTED_FIBRE |
> + SUPPORTED_BNC,
> .config = genphy_config,
> .startup = genphy_startup,
> .shutdown = genphy_shutdown,
Any chance for that one to be applied?
This patch is required to implement phy max
speed limitation by subsequent patches.
-Alexey
next prev parent reply other threads:[~2016-01-11 9:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 16:44 [U-Boot] [PATCH] net: phy: genphy: Allow overwriting features Alexey Brodkin
2016-01-11 9:45 ` Alexey Brodkin [this message]
2016-01-11 16:54 ` Joe Hershberger
2016-01-11 17:50 ` Alexey Brodkin
2016-01-11 17:55 ` Joe Hershberger
2016-01-11 17:57 ` Alexey Brodkin
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=1452505515.3277.6.camel@synopsys.com \
--to=alexey.brodkin@synopsys.com \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox