net: phy: add LAN8742 phy support
Subsystems (3)
v2 cover net: phy: add LAN8742 phy support
add LAN8742 phy support
update LAN88xx phy ID and phy ID mask so that it can coexist with LAN8742
The current phy IDs on the available hardware.
LAN8742 0x0007C130, 0x0007C131
LAN88xx 0x0007C132v1->v2:
-removed "REVIEW REQUEST3" from the PATCH 1/2.
Yuiko Oshino (2):
net: phy: microchip: update LAN88xx phy ID and phy ID mask.
net: phy: smsc: add LAN8742 phy support.
drivers/net/phy/microchip.c | 6 +++--- drivers/net/phy/smsc.c | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 net: phy: microchip: update LAN88xx phy ID and phy ID mask.
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--- drivers/net/phy/microchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/microchip.c +3 -3
@@ -344,8 +344,8 @@ 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 , + .phy_id_mask =0xfffffff2 , .name ="Microchip LAN88xx" ,/* PHY_GBIT_FEATURES */
@@ -369,7 +369,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 }, { } };
Signature · 1 line
2.25.1
Andrew Lunn
maintainerRe: [PATCH net-next v2 1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.
Quoted 16 lines · Yuiko Oshino
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 0x0007C132Signed-off-by Yuiko Oshino <[email protected]>--- drivers/net/phy/microchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/phy/microchip.c +0
-0
drivers/net/phy/microchip.c static int lan88xx_config_aneg(struct phy_device *phydev) · line 348
Quoted 7 lines
drivers/net/phy/microchip.c +2
-2@@ -344,8 +344,8 @@ 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 , + .phy_id_mask =0xfffffff2 ,
Just so my comment on the previous version does not get lost, is this the correct mask, because it is very odd. I think you really want 0xfffffffe?
Andrew
RE: [PATCH net-next v2 1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.
Quoted 43 lines
-----Original Message-----
From: Andrew Lunn <[email protected]>
Sent: Wednesday, April 27, 2022 11:37 AM
To: Yuiko Oshino - C18177 <[email protected]>
Cc: Woojung Huh - C21699 <[email protected]>; [email protected]; [email protected]; Ravi Hegde - C21689 <[email protected]>; UNGLinuxDriver <[email protected]>
Subject: Re: [PATCH net-next v2 1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 1 line · Yuiko Oshino
update LAN88xx phy ID and phy ID mask because the existing code conflicts
with the LAN8742 phy.
Quoted 15 lines
The current phy IDs on the available hardware.
LAN8742 0x0007C130, 0x0007C131 LAN88xx 0x0007C132Signed-off-by Yuiko Oshino <[email protected]>--- drivers/net/phy/microchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/phy/microchip.c +0
-0drivers/net/phy/microchip.c static int lan88xx_config_aneg(struct phy_device · line 348
Quoted 7 lines
drivers/net/phy/microchip.c +2
-2@@ -344,8 +344,8 @@ 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 , + .phy_id_mask =0xfffffff2 ,Just so my comment on the previous version does not get lost, is this the correct mask, because it is very odd. I think you really want
0xfffffffe?
Quoted 1 line
Andrew
Hi Andrew,
thank you for your review.
Yes, 0xfffffff2 is correct for us.
We would like to have bits for future revisions of the hardware without updating the driver source code in the future. If we use 0xfffffffe, then we need to submit a patch again when we have a new hardware revision.
Yuiko
Andrew Lunn
maintainerRe: [PATCH net-next v2 1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.
Quoted 25 lines
Quoted 25 lines
Quoted 14 lines
The current phy IDs on the available hardware.
LAN8742 0x0007C130, 0x0007C131 LAN88xx 0x0007C132Signed-off-by Yuiko Oshino <[email protected]>--- drivers/net/phy/microchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/phy/microchip.c +0
-0drivers/net/phy/microchip.c static int lan88xx_config_aneg(struct phy_device · line 348
Quoted 7 lines
drivers/net/phy/microchip.c +2
-2@@ -344,8 +344,8 @@ 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 , + .phy_id_mask =0xfffffff2 ,Just so my comment on the previous version does not get lost, is this the correct mask, because it is very odd. I think you really want
0xfffffffe?
Quoted 8 lines
Quoted 1 line
Andrew
Hi Andrew,
thank you for your review.
Yes,0xfffffff2is correct for us.
We would like to have bits for future revisions of the hardware without updating the driver source code in the future. If we use0xfffffffe, then we need to submit a patch again when we have a new hardware revision.
This has some risks. Do you really have enough control over the hardware people to say that:
LAN8742 0x0007C130, 0x0007C131, 0x0007C134, 0x0007C135, 0x0007C138, 0x0007C139, ... LAN88xx 0x0007C132, 0x0007C133, 0x0007C136, 0x0007C137, 0x0007C13a, 0x0007C13b, ...
It seems safer to wait until there is new hardware and then update the list given whatever they decide on is next.
At minimum, please add a comment in the code, otherwise you are going to get asked, is this correct, it looks wrong?
Andrew
PATCH v2 2/2 net: phy: smsc: add LAN8742 phy support.
In reply to Yuiko OshinoThe current phy IDs on the available hardware.
LAN8742 0x0007C130, 0x0007C131
--- drivers/net/phy/smsc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
drivers/net/phy/smsc.c +27 -0
@@ -483,6 +483,32 @@ static struct phy_driver smsc_phy_driver[] = { .suspend = genphy_suspend, .resume = genphy_resume, +}, { + .phy_id = 0x0007c130, /* 0x0007c130 and 0x0007c131 */ + .phy_id_mask = 0xfffffff2, + .name = "Microchip LAN8742", + +/* PHY_BASIC_FEATURES */ + .flags = PHY_RST_AFTER_CLK_EN, + + .probe = smsc_phy_probe, + +/* basic functions */ + .read_status = lan87xx_read_status, + .config_init = smsc_phy_config_init, + .soft_reset = smsc_phy_reset, + +/* IRQ related */ + .config_intr = smsc_phy_config_intr, + .handle_interrupt = smsc_phy_handle_interrupt, + +/* Statistics */ + .get_sset_count = smsc_get_sset_count, + .get_strings = smsc_get_strings, + .get_stats = smsc_get_stats, + + .suspend = genphy_suspend, + .resume = genphy_resume, } };module_phy_driver (smsc_phy_driver);
@@ -498,6 +524,7 @@ static struct mdio_device_id __maybe_unused smsc_tbl[] = { { 0x0007c0d0, 0xfffffff0 }, { 0x0007c0f0, 0xfffffff0 }, { 0x0007c110, 0xfffffff0 }, + { 0x0007c130, 0xfffffff2 }, { } };
Signature · 1 line
2.25.1