Skip to contentSkip to conversation

net: phy: add API to read 802.3-c45 IDs

PATCH Superseded Xu Liang 3 participants 6 messages Jul 1, 2021 – Jul 8, 2021 1 message not in the archive

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Xu Liang

author maintainer
#0 lore raw

PATCH v5 1/2 net: phy: add API to read 802.3-c45 IDs

Add API to read 802.3-c45 IDs so that C22/C45 mixed device can use C45 APIs without failing ID checks.

---
v5 changes:
Fix incorrect prototype name in comment.

 drivers/net/phy/phy_device.c | 14 ++++++++++++++
 include/linux/phy.h          |  1 +
 2 files changed, 15 insertions(+)
drivers/net/phy/phy_device.c +14 -0
index 0a2d8bedf73d..f0ad1c4add48 100644
@@ -935,6 +935,20 @@ void phy_device_remove(struct phy_device *phydev)
 }
 EXPORT_SYMBOL(phy_device_remove);
 
+/**
+ * phy_get_c45_ids - Read 802.3-c45 IDs for phy device.
+ * @phydev: phy_device structure to read 802.3-c45 IDs
+ *
+ * Returns zero on success, %-EIO on bus access error, or %-ENODEV if
+ * the "devices in package" is invalid.
+ */
+int phy_get_c45_ids(struct phy_device *phydev)
+{
+	return get_phy_c45_ids(phydev->mdio.bus, phydev->mdio.addr,
+			       &phydev->c45_ids);
+}
+EXPORT_SYMBOL(phy_get_c45_ids);
+
 /**
  * phy_find_first - finds the first PHY device on the bus
  * @bus: the target MII bus
include/linux/phy.h +1 -0
index 852743f07e3e..e46b23a2113b 100644
@@ -1391,6 +1391,7 @@ static inline int phy_device_register(struct phy_device *phy)
 static inline void phy_device_free(struct phy_device *phydev) { }
 #endif /* CONFIG_PHYLIB */
 void phy_device_remove(struct phy_device *phydev);
+int phy_get_c45_ids(struct phy_device *phydev);
 int phy_init_hw(struct phy_device *phydev);
 int phy_suspend(struct phy_device *phydev);
 int phy_resume(struct phy_device *phydev);
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v5 2/2 net: phy: add Maxlinear GPY115/21x/24x driver

Add driver to support the Maxlinear GPY115, GPY211, GPY212, GPY215, GPY241, GPY245 PHYs. Separate from XWAY PHY driver because this series has different register layout and new features not supported in XWAY PHY.

---
v2 changes:
Fix format warning from checkpath and some comments.
Use smaller PHY ID mask.
Split FWV register mask.
Call phy_trigger_machine if necessary when clear interrupt.
v3 changes:
Replace unnecessary phy_modify_mmd_changed with phy_modify_mmd Move firmware version print to probe.
v4 changes:
Separate PHY ID for new silicon.
Use full Maxlinear name in Kconfig.
Add and use C45 ID read API, and use genphy_c45_pma_read_abilities. Use my name instead of company as author.
v5 changes:
Fix comment for link speed 2.5G.

 MAINTAINERS               |   6 +
 drivers/net/phy/Kconfig   |   6 +
 drivers/net/phy/Makefile  |   1 +
 drivers/net/phy/mxl-gpy.c | 671 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 684 insertions(+)
 create mode 100644 drivers/net/phy/mxl-gpy.c
MAINTAINERS +6 -0
index 19cb1ea49c24..fd02995d7fad 100644
@@ -11180,6 +11180,12 @@ W:	https://linuxtv.org
 T:	git git://linuxtv.org/media_tree.git
 F:	drivers/media/radio/radio-maxiradio*
 
+MAXLINEAR ETHERNET PHY DRIVER
+M:	Xu Liang <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	drivers/net/phy/mxl-gpy.c
+
 MCAN MMIO DEVICE DRIVER
 M:	Chandrasekar Ramakrishnan <[email protected]>
 L:	[email protected]
drivers/net/phy/Kconfig +6 -0
index 288bf405ebdb..7dba83822bc0 100644
@@ -207,6 +207,12 @@ config MARVELL_88X2222_PHY
 	  Support for the Marvell 88X2222 Dual-port Multi-speed Ethernet
 	  Transceiver.
 
+config MAXLINEAR_GPHY
+	tristate "Maxlinear Ethernet PHYs"
+	help
+	  Support for the Maxlinear GPY115, GPY211, GPY212, GPY215,
+	  GPY241, GPY245 PHYs.
+
 config MICREL_PHY
 	tristate "Micrel PHYs"
 	help
drivers/net/phy/Makefile +1 -0
index bcda7ed2455d..7aa3a5bd9bc2 100644
@@ -70,6 +70,7 @@ obj-$(CONFIG_MICREL_PHY)	+= micrel.o
 obj-$(CONFIG_MICROCHIP_PHY)	+= microchip.o
 obj-$(CONFIG_MICROCHIP_T1_PHY)	+= microchip_t1.o
 obj-$(CONFIG_MICROSEMI_PHY)	+= mscc/
+obj-$(CONFIG_MAXLINEAR_GPHY)	+= mxl-gpy.o
 obj-$(CONFIG_NATIONAL_PHY)	+= national.o
 obj-$(CONFIG_NXP_C45_TJA11XX_PHY)	+= nxp-c45-tja11xx.o
 obj-$(CONFIG_NXP_TJA11XX_PHY)	+= nxp-tja11xx.o
drivers/net/phy/mxl-gpy.c new file +671 -0

671 lines not on this page · raw message

Signature · 1 line
2.17.1
author maintainer
#2 lore raw

Re: [PATCH v5 2/2] net: phy: add Maxlinear GPY115/21x/24x driver

Quoted 5 lines · Xu Liang

Add driver to support the Maxlinear GPY115, GPY211, GPY212, GPY215, GPY241, GPY245 PHYs. Separate from XWAY PHY driver because this series has different register layout and new features not supported in XWAY PHY.

Quoted 16 lines

---
v2 changes:
Fix format warning from checkpath and some comments.
Use smaller PHY ID mask.
Split FWV register mask.
Call phy_trigger_machine if necessary when clear interrupt.
v3 changes:
Replace unnecessary phy_modify_mmd_changed with phy_modify_mmd Move firmware version print to probe.
v4 changes:
Separate PHY ID for new silicon.
Use full Maxlinear name in Kconfig.
Add and use C45 ID read API, and use genphy_c45_pma_read_abilities. Use my name instead of company as author.
v5 changes:
Fix comment for link speed 2.5G.

Hi Andrew,

Need your help on this patch.

https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

I see the status is "Not applicable" and description "Guessing tree name failed - patch did not apply".

How should I fix the problem?

Thanks & Regards,

Xu Liang

#3 lore raw

Re: [PATCH v5 2/2] net: phy: add Maxlinear GPY115/21x/24x driver

Quoted 26 lines · Liang Xu
Quoted 5 lines · Xu Liang

Add driver to support the Maxlinear GPY115, GPY211, GPY212, GPY215, GPY241, GPY245 PHYs. Separate from XWAY PHY driver because this series has different register layout and new features not supported in XWAY PHY.

Quoted 16 lines

---
v2 changes:
Fix format warning from checkpath and some comments.
Use smaller PHY ID mask.
Split FWV register mask.
Call phy_trigger_machine if necessary when clear interrupt.
v3 changes:
Replace unnecessary phy_modify_mmd_changed with phy_modify_mmd Move firmware version print to probe.
v4 changes:
Separate PHY ID for new silicon.
Use full Maxlinear name in Kconfig.
Add and use C45 ID read API, and use genphy_c45_pma_read_abilities. Use my name instead of company as author.
v5 changes:
Fix comment for link speed 2.5G.

Hi Andrew,

Quoted 8 lines

Need your help on this patch.

https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

I see the status is "Not applicable" and description "Guessing tree name failed - patch did not apply".

How should I fix the problem?

For netdev, the subject line should contain the tree that you want the patch applied to.

So, "[PATCH net n/N] ..." or "[PATCH net-next n/N] ..."

In this case, because it isn't a fix, you want net-next. However, as we are in the upstream merge window, the net-next tree is currently closed to new submissions. Please wait until it has reopened, which will after -rc1 has been released.

You can check the current status of net-next at:
http://vger.kernel.org/~davem/net-next.html

Thanks.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#5 lore raw

Re: [PATCH v5 2/2] net: phy: add Maxlinear GPY115/21x/24x driver

Quoted 2 lines

Is the merging failure due to the tree declaration? Or something else I also need take care.

It is probably due to the tree declaration, assuming you are actually using the correct tree.

Quoted 2 lines

When did the net-next was closed? I saw some other patches after 1 Jul were accepted, how many days before the close should I submit?

It varies by subsystem. ARM SoC tends to close around a week before the merge window opens. netdev sees some patches accepted one or two days after the merge window opens, but you should not assume patches will be accepted that late. Also, you should submit patches earlier, rather than later. They get more testing that way, you have time to fix issues etc.

Quoted 2 lines

Do I need re-submit the patch when net_next is open again, or the current patch will be pulled in next open window?

You need to resubmit.

Andrew

author maintainer
#6 lore raw

Re: [PATCH v5 2/2] net: phy: add Maxlinear GPY115/21x/24x driver

Quoted 17 lines · Andrew Lunn

This email was sent from outside of MaxLinear.

Quoted 2 lines

Is the merging failure due to the tree declaration? Or something else I also need take care.

It is probably due to the tree declaration, assuming you are actually using the correct tree.

Quoted 2 lines

When did the net-next was closed? I saw some other patches after 1 Jul were accepted, how many days before the close should I submit?

It varies by subsystem. ARM SoC tends to close around a week before the merge window opens. netdev sees some patches accepted one or two days after the merge window opens, but you should not assume patches will be accepted that late. Also, you should submit patches earlier, rather than later. They get more testing that way, you have time to fix issues etc.

Quoted 6 lines
Quoted 2 lines

Do I need re-submit the patch when net_next is open again, or the current patch will be pulled in next open window?

You need to resubmit.

Andrew

Thank you very much.