wifi: mt76: mt7615: allow forcing DBDC from the device tree - #1119
Open
hwkim3330 wants to merge 1 commit into
Open
wifi: mt76: mt7615: allow forcing DBDC from the device tree#1119hwkim3330 wants to merge 1 commit into
hwkim3330 wants to merge 1 commit into
Conversation
This was referenced Aug 13, 2026
mt7615_eeprom_parse_hw_band_cap() derives the band configuration entirely from MT_EE_WIFI_CONF (EEPROM offset 0x3e, bits 5:4). Some boards are wired for DBDC yet report MT_EE_DUAL_BAND there, because their vendor driver enables DBDC unconditionally and never consults the EEPROM, so the mismatch is invisible in stock firmware. Under mt76 such a board registers a single dual-band phy and only one band is usable at a time. Add a "mediatek,dbdc" boolean so the device tree can correct the EEPROM. The override is applied before the switch, so everything downstream takes the ordinary DBDC path: dbdc_support is set at probe time, mt7615_mcu_init() applies the DBDC calibration cache, and mt7615_register_ext_phy() registers band 1 with mphy->chainmask = dev->chainmask & ~dev->mphy.chainmask. Devices that do not set the property are bit-for-bit unaffected. Alternatives considered: - Rewriting the EEPROM bytes on the way to the driver. There is no mechanism to modify an nvmem cell in flight, and editing the factory partition on the device would be destructive. - Enabling DBDC from userspace through the existing debugfs knob. That works and is what affected boards do today, but the device still comes up wrong on every boot and hardware description ends up in a startup script. - A new compatible string. The chip is not different; only the board's EEPROM contents are, which is what device tree properties describe. The affected device is the ipTIME A3004NS-M (MT7615D). In openwrt/openwrt#4915 ptpt52 identified the encoding of this field, and mans0n then dumped it on the hardware: root@OpenWrt:~# hexdump -e '1/1 "%02x" "\n"' -s $((0x3e)) -n 1 /dev/mtd2 0a 0x0a is band_sel 0, MT_EE_DUAL_BAND, on a board whose second phy works once DBDC is forced through debugfs. That pull request added this device and was then closed by its author, in his words, because "there is no way to override it in dts" and he considered shipping the debugfs workaround "a major flaw". If this is accepted, "mediatek,dbdc" should also be documented in Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml in the kernel tree, which this repository does not carry. Signed-off-by: Hyunwoo Kim <hwkim3330@gmail.com>
hwkim3330
force-pushed
the
mt7615-dbdc-dt
branch
from
August 13, 2026 06:20
a6ed85e to
e538f79
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mt7615_eeprom_parse_hw_band_cap()decides the band configuration entirely fromMT_EE_WIFI_CONF(EEPROM offset 0x3e, bits 5:4). Some boards are wired for DBDCbut ship an EEPROM that still reports
MT_EE_DUAL_BANDthere. Their vendordriver turns DBDC on unconditionally and never reads the field, so the mismatch
is invisible in stock firmware; under mt76 the board registers a single dual-band
phy and only one band is usable at a time.
This adds a
mediatek,dbdcboolean so the device tree can correct the EEPROM.The override is applied before the switch, so everything downstream takes the
ordinary DBDC path —
dbdc_supportat probe, the DBDC calibration cache inmt7615_mcu_init(), andmt7615_register_ext_phy()for band 1. Devices that donot set the property are bit-for-bit unaffected.
Why not one of the alternatives
modify an nvmem cell in flight, and editing the factory partition on the device
would be destructive.
what affected boards do today, but the device still comes up wrong on every
boot and hardware description ends up in a startup script.
contents are, which is what device tree properties describe.
Where this came from
The affected device is the ipTIME A3004NS-M (MT7615D). In
openwrt/openwrt#4915 @ptpt52
identified the encoding of this field and @mans0n dumped it on the hardware:
0x0ais band_sel 0,MT_EE_DUAL_BAND. That pull request added the device andwas then closed by its author because, in his words, "there is no way to
override it in dts" — he considered shipping the debugfs workaround "a major
flaw". This is that override.
Tested on hardware
ipTIME A3004NS-M, ramips/mt7621, kernel 6.18.41:
0x3eon this unit0x0a→ band_sel 0, as reported in 2021phy0at 2412 MHz,phy1at 5180 MHzA3004-24Gch1 HT20 andA3004-5Gch36 VHT80, both Master, simultaneously0x34=0x44→ phy00x3, phy10xc, i.e. 2x2 + 2x2phy1: copying sband (band 1)The
VHT-NSS 2on a live association is worth noting: it confirms the secondphy is running two chains, not that a flag was merely set.
Follow-up
If this is accepted,
mediatek,dbdcshould also be documented inDocumentation/devicetree/bindings/net/wireless/mediatek,mt76.yamlin the kerneltree, which this repository does not carry. Happy to send that separately.