diff mbox series

[v3,net-next,1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.

Message ID 20220504152822.11890-2-yuiko.oshino@microchip.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: phy: add LAN8742 phy support | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 5 maintainers not CCed: pabeni@redhat.com hkallweit1@gmail.com kuba@kernel.org edumazet@google.com linux@armlinux.org.uk
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 22 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yuiko Oshino May 4, 2022, 3:28 p.m. UTC
update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy.

The current phy IDs on the available hardware.
        LAN8742 0x0007C130, 0x0007C131
        LAN88xx 0x0007C132

Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
---
 drivers/net/phy/microchip.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Andrew Lunn May 4, 2022, 9:41 p.m. UTC | #1
On Wed, May 04, 2022 at 08:28:21AM -0700, Yuiko Oshino wrote:
> update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy.
> 
> The current phy IDs on the available hardware.
>         LAN8742 0x0007C130, 0x0007C131
>         LAN88xx 0x0007C132
> 
> Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>

>  static struct phy_driver microchip_phy_driver[] = {
>  {
> -	.phy_id		= 0x0007c130,
> -	.phy_id_mask	= 0xfffffff0,
> +	.phy_id		= 0x0007c132,
> +	/* This mask (0xfffffff2) is to differentiate from
> +	 * LAN8742 (phy_id 0x0007c130 and 0x0007c131)
> +	 * and allows future phy_id revisions.
> +	 */
> +	.phy_id_mask	= 0xfffffff2,

It is odd, but you should be able to change your mind later if the
hardware engineers don't actually stick to this odd scheme.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
index 9f1f2b6c97d4..ccecee2524ce 100644
--- a/drivers/net/phy/microchip.c
+++ b/drivers/net/phy/microchip.c
@@ -344,8 +344,12 @@  static int lan88xx_config_aneg(struct phy_device *phydev)
 
 static struct phy_driver microchip_phy_driver[] = {
 {
-	.phy_id		= 0x0007c130,
-	.phy_id_mask	= 0xfffffff0,
+	.phy_id		= 0x0007c132,
+	/* This mask (0xfffffff2) is to differentiate from
+	 * LAN8742 (phy_id 0x0007c130 and 0x0007c131)
+	 * and allows future phy_id revisions.
+	 */
+	.phy_id_mask	= 0xfffffff2,
 	.name		= "Microchip LAN88xx",
 
 	/* PHY_GBIT_FEATURES */
@@ -369,7 +373,7 @@  static struct phy_driver microchip_phy_driver[] = {
 module_phy_driver(microchip_phy_driver);
 
 static struct mdio_device_id __maybe_unused microchip_tbl[] = {
-	{ 0x0007c130, 0xfffffff0 },
+	{ 0x0007c132, 0xfffffff2 },
 	{ }
 };