openwrt / openwrt/mt76

mt7615 read eeprom

Open
#614 0 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

mt7615 reads the calibration according to the following function ,
read eeprom first, if you don't get the data, then read efuse

========================================================
static int mt7615_eeprom_load(struct mt7615_dev *dev, u32 addr)
{
int ret;

      ret = mt76_eeprom_init(&dev->mt76, MT7615_EEPROM_FULL_SIZE);
      if (ret < 0) 
            return ret;

    return mt7615_efuse_init(dev, addr);

}

mt76_get_of_eeprom is called last in mt76_eeprom_init

mt76_eeprom_init(struct mt76_dev *dev, int len)
{
dev->eeprom.size = len;
dev->eeprom.data = devm_kzalloc(dev->dev, len, GFP_KERNEL);
if (!dev->eeprom.data)
return -ENOMEM;

    return !mt76_get_of_eeprom(dev, dev->eeprom.data, 0, len);

}

In this function, we can find that the eeprom mentioned here is actually'mediatek,mtd-eeprom', but this'mediatek,mtd-eeprom' is actually the partition data specified in dts .

ls: mediatek,mtd-eeprom = <&factory 0x0>;

This is not a hardware eeprom storage device .

int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
{
.......
list = of_get_property(np, "mediatek,mtd-eeprom", &size);
if (!list)
return -ENOENT;
........
}

According to my understanding, it only supports reading data from efuse and flash( mediatek,mtd-eeprom = <&factory 0x0>), and does not see the operation of reading data from eeprom.

If I have eeprom and efuse on my pcie card, does it support reading eeprom on pcie card?

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

Read the mt7615_eeprom_load, mt76_eeprom_init, mt76_get_of_eeprom, and mt7615_efuse_init paths first. Determine whether a PCIe EEPROM path exists separately from mediatek,mtd-eeprom and efuse, then document the supported behavior or the required scope for adding it.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.