mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-28 01:28:59 +00:00
45053b507c
The EEPROMs on SFP modules are compatible both to I2C as well as SMBus. However, the kernel so far only supports I2C access. We add SMBus access routines, because the I2C driver for the RTL9300 HW only supports that protocol. At the same time we disable I2C access to PHYs on SFP modules as otherwise detection of any SFP module would fail. This is not in any way problematic at this point in time since the RTL93XX platform so far does not support PHYs on SFP modules. The patches are copied and rebased version of: https://bootlin.com/blog/sfp-modules-on-a-board-running-linux/ Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
27 lines
906 B
Diff
27 lines
906 B
Diff
From a381ac0aa281fdb0b41a39d8a2bc08fd88f6db92 Mon Sep 17 00:00:00 2001
|
|
From: Antoine Tenart <antoine.tenart@bootlin.com>
|
|
Date: Tue, 25 Feb 2020 16:32:37 +0100
|
|
Subject: [PATCH 1/3] net: phy: sfp: re-probe modules on DEV_UP event
|
|
|
|
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
|
|
---
|
|
drivers/net/phy/sfp.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
--- a/drivers/net/phy/sfp.c
|
|
+++ b/drivers/net/phy/sfp.c
|
|
@@ -1959,6 +1959,13 @@ static void sfp_sm_module(struct sfp *sf
|
|
return;
|
|
}
|
|
|
|
+ /* Re-probe the SFP modules when an interface is brought up, as the MAC
|
|
+ * do not report its link status (This means Phylink wouldn't be
|
|
+ * triggered if the PHY had a link before a MAC is brought up).
|
|
+ */
|
|
+ if (event == SFP_E_DEV_UP && sfp->sm_mod_state == SFP_MOD_PRESENT)
|
|
+ sfp_sm_mod_next(sfp, SFP_MOD_PROBE, T_SERIAL);
|
|
+
|
|
switch (sfp->sm_mod_state) {
|
|
default:
|
|
if (event == SFP_E_INSERT) {
|