openwrt / openwrt/mt76

All Mediatek Wi-Fi cards not working in hat Raspberry Pi 5

Open
#946 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
888
Forks
436
PR merge metrics
No merged PRs in 30d

Description

Hi,

In Rpi5 MiniPCIe with hat "52Pi Raspberry Pi 5 Mini PCIe Hat M02" I run MiniPCIe Wi-Fi cards based on the following chipsets: MT7603, MT7612 and MT7921. After installing the appropriate driver is not driver visible in lspci -k (no message: "Kernel driver in use"). I run all three cards based on the above-mentioned systems in the other device with 24.10.0-rc5 and they work properly. The issue only Raspberry Pi 5. I noticed that I need to remove wpad* to be able to install kmod-mt*.

Version: r28304-6dacba30a7
Release: 24.10.0-rc5
Target/subtarget: bcm27xx/bcm2712
Device: Raspberry Pi 5 Model B Rev 1.0

Test MT7603:

opkg install kmod-mt7603
dmesg

[  221.100265] kmodloader: loading kernel modules from /etc/modules.d/*
[  221.108524] mt7603e 0000:01:00.0: enabling device (0000 -> 0002)
[  221.115042] mt7603e 0000:01:00.0: ASIC revision: 76030010
[  221.122306] mt7603e: probe of 0000:01:00.0 failed with error -12
[  221.128845] kmodloader: done loading kernel modules from /etc/modules.d/*

lspci -k

0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -2
0000:01:00.0 Network controller: MEDIATEK Corp. MT7612E 802.11acbgn PCI Express Wireless Network Adapter
        Subsystem: MEDIATEK Corp. MT7612E 802.11acbgn PCI Express Wireless Network Adapter
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
        Kernel driver in use: rp1

After reboot:

dmesg | grep "/etc/modules.d/"

[    8.405922] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.543344] kmodloader: done loading kernel modules from /etc/modules.d/*

cat /etc/modules.d/mt7603
mt7603e

cat /sys/bus/pci/devices/0000:01:00.0/vendor
0x14c3

cat /sys/bus/pci/devices/0000:01:00.0/device
0x7603

echo 14c3 7603 > /sys/bus/pci/drivers/mt7603e/new_id
ash: write error: File exists

echo 14c3 7603 > /sys/bus/pci/drivers/mt7603e/remove_id
ash: write error: No such device

echo 14c3 7603 > /sys/bus/pci/drivers/mt7603e/new_id
ash: write error: File exists

echo 14c3 7603 > /sys/bus/pci/drivers/mt7603e/unbind
ash: write error: No such device

echo 14c3 7603 > /sys/bus/pci/drivers/mt7603e/bind
ash: write error: No such device

cat /sys/bus/pci/devices/0000:01:00.0/enable - here is zero, and it should be 1
0

cat /sys/bus/pci/devices/0000:01:00.0/uevent - there is no entry "DRIVER=mt7603e" here

PCI_CLASS=28000
PCI_ID=14C3:7603
PCI_SUBSYS_ID=14C3:7603
PCI_SLOT_NAME=0000:01:00.0
MODALIAS=pci:v000014C3d00007603sv000014C3sd00007603bc02sc80i00

ls /sys/bus/pci/devices/0000:01:00.0/driver/
ls: /sys/bus/pci/devices/0000:01:00.0/driver/: No such file or directory

Test MT7612:

lspci -k

0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -2
0000:01:00.0 Network controller: MEDIATEK Corp. MT7612E 802.11acbgn PCI Express Wireless Network Adapter
        Subsystem: MEDIATEK Corp. MT7612E 802.11acbgn PCI Express Wireless Network Adapter
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
        Kernel driver in use: rp1

opkg remove wpad*
opkg install kmod-mt76x2
dmesg

[  218.645611] kmodloader: loading kernel modules from /etc/modules.d/*
[  218.654506] mt76x2e 0000:01:00.0: enabling device (0000 -> 0002)
[  218.661202] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[  219.315124] mt76x2e: probe of 0000:01:00.0 failed with error -12
[  219.321869] kmodloader: done loading kernel modules from /etc/modules.d/*

lspci -k

0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -2
0000:01:00.0 Network controller: MEDIATEK Corp. MT7612E 802.11acbgn PCI Express Wireless Network Adapter
        Subsystem: MEDIATEK Corp. MT7612E 802.11acbgn PCI Express Wireless Network Adapter
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
        Kernel driver in use: rp1

Test MT7921:

lspci -k

0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -2
0000:01:00.0 Network controller: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter
        Subsystem: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
        Kernel driver in use: rp1

opkg remove wpad*
opkg install kmod-mt7921e
dmesg

[  131.729899] kmodloader: loading kernel modules from /etc/modules.d/*
[  131.739187] mt7921e 0000:01:00.0: enabling device (0000 -> 0002)
[  131.748991] mt7921e 0000:01:00.0: ASIC revision: 79610010
[  131.839817] mt7921e: probe of 0000:01:00.0 failed with error -12
[  131.846186] kmodloader: done loading kernel modules from /etc/modules.d/*

lspci -k

0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -2
0000:01:00.0 Network controller: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter
        Subsystem: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
        Kernel driver in use: pcieport
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
        Kernel driver in use: rp1

Test RTL8125:

lspci -vv

(...)
0000:01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
        Subsystem: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 38
        Region 2: Memory at 1b80000000 (64-bit, non-prefetchable) [size=64K]
        Region 4: Memory at 1b80010000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+
                Address: 0000000000000000  Data: 0000
                Masking: 00000000  Pending: 00000000
        Capabilities: [70] Express (v2) Endpoint, MSI 01
                DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0W
                DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 256 bytes, MaxReadReq 4096 bytes
                DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
                        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+
                        ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 5GT/s, Width x1
                        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ NROPrPrP- LTR+
                         10BitTagComp- 10BitTagReq- OBFF Via message/WAKE#, ExtFmt- EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS- TPHComp+ ExtTPHComp-
                         AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR+ 10BitTagReq- OBFF Disabled,
                         AtomicOpsCtl: ReqEn-
                LnkCap2: Supported Link Speeds: 2.5-5GT/s, Crosslink- Retimer- 2Retimers- DRS-
                LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance Preset/De-emphasis: -6dB de-emphasis, 0dB preshoot
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
                         EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
                         Retimer- 2Retimers- CrosslinkRes: unsupported
        Capabilities: [b0] MSI-X: Enable+ Count=32 Masked-
                Vector table: BAR=4 offset=00000000
                PBA: BAR=4 offset=00000800
        Capabilities: [d0] Vital Product Data
pcilib: sysfs_read_vpd: read failed: No such device
                Not readable
        Capabilities: [100 v2] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
                AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
                        MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
                HeaderLog: 00000000 00000000 00000000 00000000
        Capabilities: [148 v1] Virtual Channel
                Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
                Arb:    Fixed- WRR32- WRR64- WRR128-
                Ctrl:   ArbSelect=Fixed
                Status: InProgress-
                VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
                        Status: NegoPending- InProgress-
        Capabilities: [168 v1] Device Serial Number 01-00-00-00-68-4c-e0-00
        Capabilities: [178 v1] Transaction Processing Hints
                No steering table available
        Capabilities: [204 v1] Latency Tolerance Reporting
                Max snoop latency: 0ns
                Max no snoop latency: 0ns
        Capabilities: [20c v1] L1 PM Substates
                L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
                          PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
                L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
                           T_CommonMode=0us LTR1.2_Threshold=306176ns
                L1SubCtl2: T_PwrOn=150us
        Capabilities: [21c v1] Vendor Specific Information: ID=0002 Rev=4 Len=100 <?>
        Kernel driver in use: r8169
        Kernel modules: r8169
(...)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the MT7603, MT7612, and MT7921 tests on the Raspberry Pi 5 target, focusing on the mt7603e, mt76x2e, and mt7921e probe failures returning error -12. Read the corresponding driver probe paths and compare them with the working environment described in the report. Done means the affected cards complete probing and show a kernel driver in lspci -k.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, raspberry-pi
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.