Lines Matching +full:eeprom +full:- +full:name
1 // SPDX-License-Identifier: ISC
5 * Felix Fietkau <nbd@nbd.name>
10 #include "eeprom.h"
25 return -ETIMEDOUT; in mt7615_efuse_read()
50 if (is_mt7663(&dev->mt76)) in mt7615_efuse_init()
57 dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, len, GFP_KERNEL); in mt7615_efuse_init()
58 dev->mt76.otp.size = len; in mt7615_efuse_init()
59 if (!dev->mt76.otp.data) in mt7615_efuse_init()
60 return -ENOMEM; in mt7615_efuse_init()
62 buf = dev->mt76.otp.data; in mt7615_efuse_init()
80 ret = mt76_eeprom_init(&dev->mt76, MT7615_EEPROM_FULL_SIZE); in mt7615_eeprom_load()
89 u16 val = get_unaligned_le16(dev->eeprom.data); in mt7615_check_eeprom()
97 return -EINVAL; in mt7615_check_eeprom()
104 u8 val, *eeprom = dev->mt76.eeprom.data; in mt7615_eeprom_parse_hw_band_cap() local
106 if (is_mt7663(&dev->mt76)) { in mt7615_eeprom_parse_hw_band_cap()
108 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
109 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
113 if (is_mt7622(&dev->mt76)) { in mt7615_eeprom_parse_hw_band_cap()
115 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
119 if (is_mt7611(&dev->mt76)) { in mt7615_eeprom_parse_hw_band_cap()
121 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
126 eeprom[MT_EE_WIFI_CONF]); in mt7615_eeprom_parse_hw_band_cap()
129 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
132 dev->dbdc_support = true; in mt7615_eeprom_parse_hw_band_cap()
135 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
138 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
139 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
146 u8 *eeprom = dev->mt76.eeprom.data; in mt7615_eeprom_parse_hw_cap() local
151 if (is_mt7663(&dev->mt76)) { in mt7615_eeprom_parse_hw_cap()
154 eeprom[MT7663_EE_HW_CONF1]); in mt7615_eeprom_parse_hw_cap()
158 /* read tx-rx mask from eeprom */ in mt7615_eeprom_parse_hw_cap()
163 eeprom[MT_EE_NIC_CONF_0]); in mt7615_eeprom_parse_hw_cap()
168 dev->chainmask = BIT(tx_mask) - 1; in mt7615_eeprom_parse_hw_cap()
169 dev->mphy.antenna_mask = dev->chainmask; in mt7615_eeprom_parse_hw_cap()
170 dev->mphy.chainmask = dev->chainmask; in mt7615_eeprom_parse_hw_cap()
180 return -EINVAL; in mt7663_eeprom_get_target_power_index()
182 if (chan->band == NL80211_BAND_2GHZ) in mt7663_eeprom_get_target_power_index()
185 group = mt7615_get_channel_group(chan->hw_value); in mt7663_eeprom_get_target_power_index()
200 if (is_mt7663(&dev->mt76)) in mt7615_eeprom_get_target_power_index()
205 return -EINVAL; in mt7615_eeprom_get_target_power_index()
208 if (mt7615_ext_pa_enabled(dev, chan->band)) { in mt7615_eeprom_get_target_power_index()
209 if (chan->band == NL80211_BAND_2GHZ) in mt7615_eeprom_get_target_power_index()
216 if (chan->band == NL80211_BAND_2GHZ) { in mt7615_eeprom_get_target_power_index()
219 int group = mt7615_get_channel_group(chan->hw_value); in mt7615_eeprom_get_target_power_index()
246 if (is_mt7663(&dev->mt76)) { in mt7615_eeprom_get_power_delta_index()
277 u8 *eeprom = dev->mt76.eeprom.data; in mt7615_apply_cal_free_data() local
278 u8 *otp = dev->mt76.otp.data; in mt7615_apply_cal_free_data()
289 eeprom[ical[i]] = otp[ical[i]]; in mt7615_apply_cal_free_data()
292 eeprom[ical_nocheck[i]] = otp[ical_nocheck[i]]; in mt7615_apply_cal_free_data()
300 u8 *eeprom = dev->mt76.eeprom.data; in mt7622_apply_cal_free_data() local
301 u8 *otp = dev->mt76.otp.data; in mt7622_apply_cal_free_data()
311 eeprom[ical[i]] = otp[ical[i]]; in mt7622_apply_cal_free_data()
317 struct device_node *np = dev->mt76.dev->of_node; in mt7615_cal_free_data()
319 if (!np || !of_property_read_bool(np, "mediatek,eeprom-merge-otp")) in mt7615_cal_free_data()
322 switch (mt76_chip(&dev->mt76)) { in mt7615_cal_free_data()
341 ret = mt7615_check_eeprom(&dev->mt76); in mt7615_eeprom_init()
342 if (ret && dev->mt76.otp.data) { in mt7615_eeprom_init()
343 memcpy(dev->mt76.eeprom.data, dev->mt76.otp.data, in mt7615_eeprom_init()
344 dev->mt76.otp.size); in mt7615_eeprom_init()
346 dev->flash_eeprom = true; in mt7615_eeprom_init()
351 memcpy(dev->mphy.macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7615_eeprom_init()
354 mt76_eeprom_override(&dev->mphy); in mt7615_eeprom_init()