From: Andrew Lunn <andrew@lunn.ch>
To: "Kamil Horák - 2N" <kamilh@axis.com>
Cc: florian.fainelli@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, hkallweit1@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/3] net: phy: bcm-phy-lib: Implement BroadR-Reach link modes
Date: Thu, 6 Jun 2024 04:10:40 +0200 [thread overview]
Message-ID: <7a313ff6-574b-425d-be06-23bb588402c8@lunn.ch> (raw)
In-Reply-To: <20240605095646.3924454-4-kamilh@axis.com>
On Wed, Jun 05, 2024 at 11:56:46AM +0200, Kamil Horák - 2N wrote:
> Implement single-pair BroadR-Reach modes on bcm5481x PHY by Broadcom.
> Create set of functions alternative to IEEE 802.3 to handle configuration
> of these modes on compatible Broadcom PHYs.
>
> Change-Id: I592d261bc0d60aaa78fc1717a315b0b1c1449c81
> Signed-off-by: Kamil Horák - 2N <kamilh@axis.com>
> ---
> drivers/net/phy/bcm-phy-lib.c | 123 ++++++++++++
> drivers/net/phy/bcm-phy-lib.h | 4 +
> drivers/net/phy/broadcom.c | 368 ++++++++++++++++++++++++++++++++--
> drivers/net/phy/phy-core.c | 2 +-
> include/linux/brcmphy.h | 9 +
> 5 files changed, 488 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
> index 876f28fd8256..cc1b5e5a958c 100644
> --- a/drivers/net/phy/bcm-phy-lib.c
> +++ b/drivers/net/phy/bcm-phy-lib.c
> @@ -794,6 +794,47 @@ static int _bcm_phy_cable_test_get_status(struct phy_device *phydev,
> return ret;
> }
>
> +static int bcm_setup_forced(struct phy_device *phydev)
> +{
> + u16 ctl = 0;
> +
> + phydev->pause = 0;
> + phydev->asym_pause = 0;
> +
> + if (phydev->speed == SPEED_100)
> + ctl |= LRECR_SPEED100;
> +
> + if (phydev->duplex != DUPLEX_FULL)
> + return -EOPNOTSUPP;
> +
> + return phy_modify(phydev, MII_BCM54XX_LRECR, LRECR_SPEED100, ctl);
We should consider naming here. I assume this will not work for IEEE
forced mode? So maybe this should have _lre_ or _brr_ in the name to
make it clear what it actually does.
> +}
> +
> +/**
> + * bcm_linkmode_adv_to_mii_adv_t
> + * @advertising: the linkmode advertisement settings
> + * @return: LDS Auto-Negotiation Advertised Ability register value
> + *
> + * A small helper function that translates linkmode advertisement
> + * settings to phy autonegotiation advertisements for the
> + * MII_BCM54XX_LREANAA register of Broadcom PHYs capable of LDS
> + */
> +static u32 bcm_linkmode_adv_to_mii_adv_t(unsigned long *advertising)
> +{
> + u32 result = 0;
Make here, and maybe lre_advertising?
Please go through all the functions and think about naming.
Andrew
---
pw-bot: cr
next prev parent reply other threads:[~2024-06-06 2:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 9:56 [PATCH v5 0/3] net: phy: bcm5481x: add support for BroadR-Reach mode Kamil Horák - 2N
2024-06-05 9:56 ` [PATCH v5 1/3] net: phy: bcm54811: New link mode for BroadR-Reach Kamil Horák - 2N
2024-06-06 2:04 ` Andrew Lunn
2024-06-05 9:56 ` [PATCH v5 2/3] net: phy: bcm54811: Add LRE registers definitions Kamil Horák - 2N
2024-06-05 9:56 ` [PATCH v5 3/3] net: phy: bcm-phy-lib: Implement BroadR-Reach link modes Kamil Horák - 2N
2024-06-06 2:10 ` Andrew Lunn [this message]
2024-06-06 9:34 ` Simon Horman
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=7a313ff6-574b-425d-be06-23bb588402c8@lunn.ch \
--to=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=kamilh@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®