mt76: mt7915: add debugfs knob to read efuse value from FW
Subsystems (2)
Shayne Chen
reviewerPATCH 1/1 mt76: mt7915: add debugfs knob to read efuse value from FW
In efuse mode, mt7915 only reads efuse values from FW which driver need. Add a debugfs knob to read addtional efuse values from a specific field, which is useful in some cases such as checking if rf values in efuse are properly burned.
An example of usage:
echo 0x400 > efuse_idx
hexdump -C eeprom
--- .../net/wireless/mediatek/mt76/mt7915/debugfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +16 -0
@@ -73,6 +73,21 @@ mt7915_radar_trigger(void *data, u64 val)DEFINE_DEBUGFS_ATTRIBUTE (fops_radar_trigger,NULL , mt7915_radar_trigger,"%lld\n" ); +static int +mt7915_efuse_idx_set (void *data,u64 val) +{ +struct mt7915_dev *dev = data; +u8 *eep = dev->mt76.eeprom.data; + +if (eep[val] ==0xff && !dev->flash_mode) +mt7915_mcu_get_eeprom (dev, val); + +return 0 ; +} + +DEFINE_DEBUGFS_ATTRIBUTE (fops_efuse_idx,NULL , + mt7915_efuse_idx_set,"0x%llx\n" ); +static int mt7915_fw_debug_set (void *data,u64 val) {
@@ -390,6 +405,7 @@ int mt7915_init_debugfs(struct mt7915_dev *dev)debugfs_create_file ("radar_trigger" ,0200 , dir, dev, &fops_radar_trigger);debugfs_create_file ("ser_trigger" ,0200 , dir, dev, &fops_ser_trigger); +debugfs_create_file ("efuse_idx" ,0200 , dir, dev, &fops_efuse_idx);debugfs_create_devm_seqfile (dev->mt76.dev,"temperature" , dir, mt7915_read_temperature); debugfs_create_devm_seqfile(dev->mt76.dev, "txpower_sku", dir,
Signature · 5 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Felix Fietkau
maintainerQuoted 10 lines · Shayne Chen
In efuse mode, mt7915 only reads efuse values from FW which driver need. Add a debugfs knob to read addtional efuse values from a specific field, which is useful in some cases such as checking if rf values in efuse are properly burned.
An example of usage:
echo0x400>efuse_idx
hexdump -C eepromSigned-off-by Shayne Chen <[email protected]>
I'd prefer if we read the entire efuse and put it in a "otp" debugfs file, like on older chips.
- Felix
Shayne Chen
reviewerQuoted 13 lines · Felix Fietkau
Quoted 12 lines · Shayne Chen
In efuse mode, mt7915 only reads efuse values from FW which driver need.
Add a debugfs knob to read addtional efuse values from a specific field,
which is useful in some cases such as checking if rf values in efuse
are properly burned.An example of usage:
echo0x400>efuse_idx
hexdump -C eeprom
Quoted 6 lines
Quoted 1 line
Signed-off-by Shayne Chen <[email protected]>I'd prefer if we read the entire efuse and put it in a "otp" debugfs file, like on older chips.
- Felix
Hi Felix,
Got it. I'll send another patch, please drop this one.
Thanks,
Shayne