Skip to contentSkip to conversation

drivers/net/phy: add driver for Microchip LAN867x 10BASE-T1S PHY

PATCH Applied Ramón Nordin Rodriguez 2 participants 2 messages Apr 21, 2023 – Apr 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 drivers/net/phy: add driver for Microchip LAN867x 10BASE-T1S PHY

This patch adds support for the Microchip LAN867x 10BASE-T1S family (LAN8670/1/2). The driver supports P2MP with PLCA.

---
Changes:

    v2:

- Removed mentioning of not supporting auto-negotiation from commit
message
- Renamed file drivers/net/phy/lan867x.c ->
drivers/net/phy/microchip_t1s.c
- Renamed Kconfig option to reflect implementation filename (from
LAN867X_PHY to MICROCHIP_T1S_PHY)
- Moved entry in drivers/net/phy/KConfig to correct sort order
- Moved entry in drivers/net/phy/Makefile to correct sort order
- Moved variable declarations to conform to reverse christmas tree order
(in func lan867x_config_init)
- Moved register write to disable chip interrupts to func lan867x_config_init, when omitting the irq disable all togheter I got null pointer dereference, see the call trace below:

    Call Trace:
     <TASK>
     phy_interrupt+0xa8/0xf0 [libphy]
     irq_thread_fn+0x1c/0x60
     irq_thread+0xf7/0x1c0
     ? __pfx_irq_thread_dtor+0x10/0x10
     ? __pfx_irq_thread+0x10/0x10
     kthread+0xe6/0x110
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x29/0x50
     </TASK>

- Removed func lan867x_config_interrupt and removed the member .config_intr from the phy_driver struct

    v3:

- Indentation level in drivers/net/phy/Kconfig
- Moved const arrays into global scope and made them static in order to have them placed in the .rodata section
- Renamed array variables, since they are no longer as closely scoped as earlier
- Added comment about why phy_write_mmd is used over phy_modify_mmd (this should have been addressed in the V2 change since it was brought up in the V1 review)
- Return result of last call instead of saving it in a var and then returning the var (in lan867x_config_init)

    v4:

- Moved history out of commit message

v5:
- Added Reviewed-by: Andrew Lunn <[email protected]>
- Moved history to (what I truly hope is) the expected location
- Fixed typo in comment (exacly -> exactly)

Testing:
This has been tested with ethtool --set/get-plca-cfg and verified on an oscilloscope where it was observed that:
- The PLCA beacon was enabled/disabled when setting the node-id to 0/not 0
- The PLCA beacon is transmitted with the expected frequency when changing max nodes
- Two devices using the evaluation board EVB-LAN8670-USB could ping each other

---
 drivers/net/phy/Kconfig         |   5 ++
 drivers/net/phy/Makefile        |   1 +
 drivers/net/phy/microchip_t1s.c | 138 ++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+)
 create mode 100644 drivers/net/phy/microchip_t1s.c
drivers/net/phy/Kconfig +5 -0
index 54874555c921..15a0bd95f12c 100644
@@ -235,6 +235,11 @@ config MICREL_PHY
 	help
 	  Supports the KSZ9021, VSC8201, KS8001 PHYs.
 
+config MICROCHIP_T1S_PHY
+	tristate "Microchip 10BASE-T1S Ethernet PHY"
+	help
+	  Currently supports the LAN8670, LAN8671, LAN8672
+
 config MICROCHIP_PHY
 	tristate "Microchip PHYs"
 	help
drivers/net/phy/Makefile +1 -0
index b5138066ba04..64f649f2f62f 100644
@@ -74,6 +74,7 @@ obj-$(CONFIG_MICREL_KS8995MA)	+= spi_ks8995.o
 obj-$(CONFIG_MICREL_PHY)	+= micrel.o
 obj-$(CONFIG_MICROCHIP_PHY)	+= microchip.o
 obj-$(CONFIG_MICROCHIP_T1_PHY)	+= microchip_t1.o
+obj-$(CONFIG_MICROCHIP_T1S_PHY) += microchip_t1s.o
 obj-$(CONFIG_MICROSEMI_PHY)	+= mscc/
 obj-$(CONFIG_MOTORCOMM_PHY)	+= motorcomm.o
 obj-$(CONFIG_NATIONAL_PHY)	+= national.o
drivers/net/phy/microchip_t1s.c new file +138 -0

138 lines not on this page · raw message

Signature · 1 line
2.39.2
#1 lore raw
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 20 lines · On Fri, 21 Apr 2023 18:38:54 +0200 you wrote:

This patch adds support for the Microchip LAN867x 10BASE-T1S family (LAN8670/1/2). The driver supports P2MP with PLCA.

---
Changes:

    v2:

- Removed mentioning of not supporting auto-negotiation from commit
message
- Renamed file drivers/net/phy/lan867x.c ->
drivers/net/phy/microchip_t1s.c
- Renamed Kconfig option to reflect implementation filename (from
LAN867X_PHY to MICROCHIP_T1S_PHY)
- Moved entry in drivers/net/phy/KConfig to correct sort order
- Moved entry in drivers/net/phy/Makefile to correct sort order
- Moved variable declarations to conform to reverse christmas tree order
(in func lan867x_config_init)
- Moved register write to disable chip interrupts to func lan867x_config_init, when omitting the irq disable all togheter I got null pointer dereference, see the call trace below:

Quoted 1 line

[...]

Here is the summary with links:
- [v5] drivers/net/phy: add driver for Microchip LAN867x 10BASE-T1S PHY

    https://git.kernel.org/netdev/net-next/c/4d2bd2581c3b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html