[BPI-R4] and SFP

I hope it cheers you up a bit: on a 6.1 kernel, the i2c commands give exactly the same output, but the sfp device works. this means the error is probably not at i2c related devices, right?

No it is not i2c related, you can read the eeprom ok.

I am still cureous what the command:

i2cdetect -y <bus-nr-found>

Gives you for the module. You can check if you have the correct bus number, if the module is removed, some addresses would be removed, although this is probably not going to help you.

I am interested in modules where the PHY is accessible If it isn’t then the module is treated as if it is an optical module, without much control over the connection that is made over the rj45.

On your 6.1 kernel it is treated as an optical module. This means the connection between module and mac will always operate on the highest speed, even when the linkpartner is slower.

So most likely, in your 6.1 kenel there is a quirk that helps adding to the eeprom information and helps selecting the correct interface mode. In 6.6 there isn’t this quirk for this module, which results in: no common interface modes

Thank you for helping testing and bringing Linux 6.6 into shape, appreciated. First of all everything relevant for the R4 and MT7988 SoC in OpenWrt has also been backported to Linux 6.1, however, Linux 6.6 has many advances regarding phylink. With regard to those 2.5G SFP modules the best will be to port @ericwoud’s pending patches to OpenWrt, so we can properly detect the PHY inside those SFP modules…

1 Like
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 -- -- -- -- 56 -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: UU -- -- -- -- -- -- --  

this is with modules inserted, with modules removed:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: UU -- -- -- -- -- -- --    

Ok, so this might still be a rollball module. There was a case before, we could only read ff’s at 0x56, but is still was the rollball module.

I can add the module to my bpir-rolling-stable branch, and can have an archlinux-arm image for R3 ready within a few days. Perhapse you can try it, when it is finished.

Anyway, I should update my bpir-rolling-stable to the newest version of the patch-set.

That’s very kind of you, thx!

@jpsollie You have a R3 lying around? Or only a R4?

Only R4. But don’t worry, just pass me the commit ids related to your work, I’ll dump them into patches-6.6 of the openwrt vanilla tree, and build a R4 around

Can you share your git repo? I want to test eric’s series on r3, but I cannot connect to eric’s ftp site while compiling by myself.

It is up… Should be ok

Maybe you have no connectivity at all?

Emmm I think my isp might banned your website or something… still cannot connect to that server

Hi eric, I saw you rebased your patches … why do you still keep using the rollball function in commit 99d5221717430ee042031b9e3fe2c607f2080a53 even though you say it’s not working? I’m trying to understand what the rollball issue is, I never heard of that protocol before

try with a traceroute … I have no issue pinging Eric’s server. it won’t fix, but might tell if the issue is DNS or routing of your ISP (but it often is DNS)

you don’t need my git repo to do so. Just go to his github dir and fetch the patches he has for these SFP issues: https://github.com/ericwoud/linux/commit/(sha commit id).patch. Put those in target/linux/mediatek/patches-6.6/ of your openwrt dir and you’re ready to go

Seems banned by ISP…:disappointed: and thanks for sharing this this

I found:

But, in China, all Dynamic DNS providers are banned by the Great Firewall of China

So this would be the problem…

You can read about it in the patches which introduced it to the linux kernel…

You will need the last 9 commits of:

https://github.com/ericwoud/linux/commits/net-next-realtek-phy-v4/

And this one:

net: sfp: Fixup for OEM SFP-2G5 module · ericwoud/linux@a56e164 (github.com)

For your module.

I applied your patches (with a few backport modifications - it’s 6.6 not 6.7 …) to vanilla openwrt 6.6 kernel, but there is something strange about it:

<6>[   29.826457] sfp sfp1: module OEM              SFP-2G5          rev 1.0  sn 2G522112324218   dc 220801  
<6>[   29.886607] sfp sfp2: module OEM              SFP-2G5          rev 1.0  sn 2G522112324218   dc 220801  
<7>[   29.905260] mtk-pcie-gen3 11290000.pcie: msi#0x1 address_hi 0x0 address_lo 0x11290c00 data 1
<6>[   29.946575] mt7915e 0002:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20230202144915a
<6>[   29.946575] 
<6>[   29.962544] mt7915e 0002:01:00.0: WM Firmware Version: ____000000, Build Time: 20230202145005
<6>[   29.997912] mt7915e 0002:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20230202143332
<6>[   30.164430] mt7915e 0002:01:00.0: registering led 'mt76-phy0'
<7>[   30.170237] device: 'mt76-phy0': device_add
<7>[   30.174475] PM: Adding info for No Bus:mt76-phy0
<7>[   30.179532] device: 'phy0': device_add
<7>[   30.183311] PM: Adding info for No Bus:phy0
<7>[   30.187975] device: 'rfkill1': device_add
<7>[   30.192035] PM: Adding info for No Bus:rfkill1
<7>[   30.196664] device: 'cooling_device0': device_add
<7>[   30.201403] PM: Adding info for No Bus:cooling_device0
<7>[   30.206720] device: 'hwmon1': device_add
<7>[   30.210670] PM: Adding info for No Bus:hwmon1
<6>[   30.215077] mt7915e 0002:01:00.0: registering led 'mt76-phy1'
<7>[   30.220836] device: 'mt76-phy1': device_add
<7>[   30.225026] PM: Adding info for No Bus:mt76-phy1
<7>[   30.229840] device: 'phy1': device_add
<7>[   30.233612] PM: Adding info for No Bus:phy1
<7>[   38.456484] device: 'rfkill2': device_add
<7>[   38.460563] PM: Adding info for No Bus:rfkill2
<7>[   38.465072] device: 'cooling_device1': device_add
<7>[   38.469884] PM: Adding info for No Bus:cooling_device1
<7>[   38.475392] device: 'hwmon2': device_add
<7>[   38.479329] PM: Adding info for No Bus:hwmon2
<7>[   38.483945] driver: 'mt7915e': driver_bound: bound to device '0002:01:00.0'
<7>[   38.490935] bus: 'pci': really_probe: bound device 0002:01:00.0 to driver mt7915e
<7>[   38.498416] bus: 'pci': __driver_probe_device: matched device 0000:01:00.0 with driver mt7915e
<7>[   38.507018] bus: 'pci': really_probe: probing driver mt7915e with device 0000:01:00.0
<7>[   38.514850] mt7915e 0000:01:00.0: no default pinctrl state
<7>[   38.520369] mt7915e 0000:01:00.0: assign IRQ: got 114
<6>[   38.525422] mt7915e 0000:01:00.0: enabling device (0000 -> 0002)
<7>[   38.531454] mt7915e 0000:01:00.0: enabling bus mastering
<7>[   38.655282] mtk-pcie-gen3 11300000.pcie: msi#0x1 address_hi 0x0 address_lo 0x11300c00 data 1
<6>[   38.685480] mt7915e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20220929104113a
<6>[   38.685480] 
<6>[   38.702547] mt7915e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20220929104145
<6>[   38.725564] mt7915e 0000:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20220929104205
<6>[   38.882973] mt7915e 0000:01:00.0: registering led 'mt76-phy2'
<7>[   38.888785] device: 'mt76-phy2': device_add
<7>[   38.893017] PM: Adding info for No Bus:mt76-phy2
<7>[   38.898040] device: 'phy2': device_add
<7>[   38.901826] PM: Adding info for No Bus:phy2
<7>[   38.906672] device: 'rfkill3': device_add
<7>[   38.910735] PM: Adding info for No Bus:rfkill3
<7>[   38.915399] device: 'cooling_device2': device_add
<7>[   38.920148] PM: Adding info for No Bus:cooling_device2
<7>[   38.925476] device: 'hwmon3': device_add
<7>[   38.929422] PM: Adding info for No Bus:hwmon3
<6>[   38.933826] mt7915e 0000:01:00.0: registering led 'mt76-phy3'
<7>[   38.939586] device: 'mt76-phy3': device_add
<7>[   38.943782] PM: Adding info for No Bus:mt76-phy3
<7>[   38.948596] device: 'phy3': device_add
<7>[   38.952369] PM: Adding info for No Bus:phy3
<7>[   44.242702] device: 'rfkill4': device_add
<7>[   44.246799] PM: Adding info for No Bus:rfkill4
<7>[   44.251318] device: 'cooling_device3': device_add
<7>[   44.256047] PM: Adding info for No Bus:cooling_device3
<7>[   44.261393] device: 'hwmon4': device_add
<7>[   44.265338] PM: Adding info for No Bus:hwmon4
<7>[   44.269857] driver: 'mt7915e': driver_bound: bound to device '0000:01:00.0'
<7>[   44.276847] bus: 'pci': really_probe: bound device 0000:01:00.0 to driver mt7915e
<7>[   44.284390] bus: 'platform': add driver mt798x-wmac
<7>[   44.298473] bus: 'usb': add driver qmi_wwan
<6>[   44.302739] usbcore: registered new interface driver qmi_wwan
<7>[   44.312938] bus: 'usb': add driver mt7921u
<7>[   44.317079] bus: 'usb': __driver_probe_device: matched device 2-1.1:1.3 with driver mt7921u
<7>[   44.325438] bus: 'usb': really_probe: probing driver mt7921u with device 2-1.1:1.3
<7>[   44.333011] mt7921u 2-1.1:1.3: no default pinctrl state
<7>[   44.338814] PM: Removing info for No Bus:rfkill0
<7>[   44.343499] PM: Removing info for No Bus:hci0
<6>[   44.455745] usb 2-1.1: reset SuperSpeed USB device number 3 using xhci-mtk
<7>[   44.487482] bus: 'usb': __driver_probe_device: matched device 2-1.1:1.0 with driver btusb
<7>[   44.495718] bus: 'usb': really_probe: probing driver btusb with device 2-1.1:1.0
<7>[   44.503138] btusb 2-1.1:1.0: no default pinctrl state
<7>[   44.508279] driver: 'btusb': driver_bound: bound to device '2-1.1:1.1'
<7>[   44.515015] device: 'hci0': device_add
<7>[   44.518842] PM: Adding info for No Bus:hci0
<7>[   44.523083] device: 'rfkill5': device_add
<7>[   44.527241] PM: Adding info for No Bus:rfkill5
<7>[   44.531854] driver: 'btusb': driver_bound: bound to device '2-1.1:1.0'
<7>[   44.538446] bus: 'usb': really_probe: bound device 2-1.1:1.0 to driver btusb
<3>[   44.545645] Bluetooth: hci0: Failed to register coredump (-95)
<6>[   44.551751] Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20231109191416
<6>[   44.694516] Bluetooth: hci0: Device setup in 158747 usecs
<7>[   44.697035] driver: 'mt7921u': driver_bound: bound to device '2-1.1:1.3'
<4>[   44.700005] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
<7>[   44.706767] bus: 'usb': really_probe: bound device 2-1.1:1.3 to driver mt7921u
<6>[   44.724163] usbcore: registered new interface driver mt7921u
<6>[   44.730227] mt7921u 2-1.1:1.3: HW/SW Version: 0x8a108a10, Build Time: 20231109190918a
<6>[   44.730227] 
<3>[   44.739761] Error: Driver 'gpio-keys' is already registered, aborting...
<6>[   44.755011] mt7921u 2-1.1:1.3: WM Firmware Version: ____010000, Build Time: 20231109190959
<6>[   44.788900] Bluetooth: hci0: AOSP extensions version v1.00
<6>[   44.794400] Bluetooth: hci0: AOSP quality report is supported
<3>[   44.826390] Error: Driver 'gpio-keys-polled' is already registered, aborting...
<11>[   44.905593] kmodloader: 2 modules could not be probed
<11>[   44.910942] kmodloader: - gpio_keys - 0
<11>[   44.915053] kmodloader: - gpio_keys_polled - 0
<7>[   46.361262] device: 'phy4': device_add
<7>[   46.365078] PM: Adding info for No Bus:phy4
<7>[   46.389472] device: 'rfkill6': device_add
<7>[   46.393548] PM: Adding info for No Bus:rfkill6
<7>[   46.401832] device: 'hwmon5': device_add
<7>[   46.405840] PM: Adding info for No Bus:hwmon5
<7>[   48.363807] device: 'br-lan': device_add
<7>[   48.367870] PM: Adding info for No Bus:br-lan
<6>[   48.376405] mtk_soc_eth 15100000.ethernet eth0: Link is Down
<6>[   48.391754] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/internal link mode
<6>[   48.399965] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 10Gbps/Full - flow control rx/tx
<6>[   48.411048] mt7530-mmio 15020000.switch lan1: configuring for phy/internal link mode
<6>[   48.420701] br-lan: port 1(lan1) entered blocking state
<6>[   48.426039] br-lan: port 1(lan1) entered disabled state
<6>[   48.431298] mt7530-mmio 15020000.switch lan1: entered allmulticast mode
<6>[   48.437956] mtk_soc_eth 15100000.ethernet eth0: entered allmulticast mode
<6>[   48.444975] mt7530-mmio 15020000.switch lan1: entered promiscuous mode
<6>[   48.458781] mt7530-mmio 15020000.switch lan2: configuring for phy/internal link mode
<6>[   48.468746] br-lan: port 2(lan2) entered blocking state
<6>[   48.473998] br-lan: port 2(lan2) entered disabled state
<6>[   48.479330] mt7530-mmio 15020000.switch lan2: entered allmulticast mode
<6>[   48.486171] mt7530-mmio 15020000.switch lan2: entered promiscuous mode
<6>[   48.495666] mt7530-mmio 15020000.switch lan3: configuring for phy/internal link mode
<6>[   48.503695] br-lan: port 3(lan3) entered blocking state
<6>[   48.509014] br-lan: port 3(lan3) entered disabled state
<6>[   48.514270] mt7530-mmio 15020000.switch lan3: entered allmulticast mode
<6>[   48.521165] mt7530-mmio 15020000.switch lan3: entered promiscuous mode
<6>[   48.529297] mtk_soc_eth 15100000.ethernet eth1: configuring for inband/10gbase-r link mode
<6>[   48.561709] br-lan: port 4(eth1) entered blocking state
<6>[   48.567019] br-lan: port 4(eth1) entered disabled state
<6>[   48.572287] mtk_soc_eth 15100000.ethernet eth1: entered allmulticast mode
<6>[   48.579357] mtk_soc_eth 15100000.ethernet eth1: entered promiscuous mode
<7>[   48.588536] device: 'br-wan': device_add
<7>[   48.592556] PM: Adding info for No Bus:br-wan
<6>[   48.601935] mt7530-mmio 15020000.switch wan: configuring for phy/internal link mode
<6>[   48.613552] br-wan: port 1(wan) entered blocking state
<6>[   48.618746] br-wan: port 1(wan) entered disabled state
<6>[   48.623913] mt7530-mmio 15020000.switch wan: entered allmulticast mode
<6>[   48.630688] mt7530-mmio 15020000.switch wan: entered promiscuous mode
<6>[   48.640175] mtk_soc_eth 15100000.ethernet eth2: configuring for inband/10gbase-r link mode
<6>[   48.675913] br-wan: port 2(eth2) entered blocking state
<6>[   48.681160] br-wan: port 2(eth2) entered disabled state
<6>[   48.686472] mtk_soc_eth 15100000.ethernet eth2: entered allmulticast mode
<6>[   48.693792] mtk_soc_eth 15100000.ethernet eth2: entered promiscuous mode
<6>[   48.871759] Bluetooth: MGMT ver 1.22
<3>[   48.878532] Bluetooth: hci0: Failed to register coredump (-95)
<6>[   48.884687] Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20231109191416
<6>[   49.024266] Bluetooth: hci0: Device setup in 142707 usecs
<4>[   49.029712] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
<6>[   49.111315] Bluetooth: hci0: AOSP extensions version v1.00
<6>[   49.116857] Bluetooth: hci0: AOSP quality report is supported
<7>[   50.755491] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
<6>[   50.763337] NFSD: Using legacy client tracking operations.
<6>[   50.768826] NFSD: starting 10-second grace period (net f0000000)
<6>[   51.398009] mt7530-mmio 15020000.switch lan1: Link is Up - 1Gbps/Full - flow control rx/tx
<6>[   51.406728] br-lan: port 1(lan1) entered blocking state
<6>[   51.411954] br-lan: port 1(lan1) entered forwarding state
<7>[   74.075843] device: 'i2c:sfp2': device_add
<7>[   74.080169] PM: Adding info for No Bus:i2c:sfp2
<7>[  101.438139] device: 'i2c:sfp1': device_add
<7>[  101.442465] PM: Adding info for No Bus:i2c:sfp1
<6>[  702.827234] sfp sfp2: no PHY detected
<6>[  702.830924] mtk_soc_eth 15100000.ethernet eth1: switched to inband/2500base-x link mode
<6>[  730.167235] sfp sfp1: no PHY detected
<6>[  730.170926] mtk_soc_eth 15100000.ethernet eth2: switched to inband/2500base-x link mode
<6>[  730.185191] mtk_soc_eth 15100000.ethernet eth2: Link is Up - 2.5Gbps/Full - flow control off
<6>[  730.193692] br-wan: port 2(eth2) entered blocking state
<6>[  730.198956] br-wan: port 2(eth2) entered forwarding state
<4>[  730.217239] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  730.227632] br-wan: received packet on eth2 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<6>[  730.237860] IPv6: br-wan: IPv6 duplicate address fe80::7caf:71ff:feb9:e83e used by 7e:af:71:b9:e8:3e detected!
<4>[  730.248001] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  730.295403] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  730.355255] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  731.405250] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  731.870207] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  731.880336] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)
<4>[  731.890424] br-lan: received packet on lan1 with own address as source address (addr:7e:af:71:b9:e8:3e, vlan:0)

after 10 mins (600-700) the modules start to work. Before, commands like “ifconfig” work very slowly for any device. After that, it works without any issue.

Any clue what’s going wrong?

EDIT: yes duplicate packet is normal, I have lan1 and eth2 connected to the same switch, they won’t loop because they are attached to a different bridge (br-lan and br-wan)

I would say that the delay is the waiting for phy…as you see after 700 seconds there is a message “no phy detected”