Lines Matching +full:mt7986 +full:- +full:wed

1 // SPDX-License-Identifier: ISC
176 /* Only DBDC A-die is used with MT7981 */ in mt798x_wmac_check_adie_type()
177 if (is_mt7981(&dev->mt76)) in mt798x_wmac_check_adie_type()
180 val = readl(dev->sku + MT_TOP_POS_SKU); in mt798x_wmac_check_adie_type()
188 return reset_control_assert(dev->rstc); in mt7986_wmac_consys_reset()
190 mt76_wmac_rmw(dev->sku, MT_TOP_POS_FAST_CTRL, in mt7986_wmac_consys_reset()
194 return reset_control_deassert(dev->rstc); in mt7986_wmac_consys_reset()
205 pinctrl = devm_pinctrl_get(dev->mt76.dev); in mt7986_wmac_gpio_setup()
213 return -EINVAL; in mt7986_wmac_gpio_setup()
218 return -EINVAL; in mt7986_wmac_gpio_setup()
221 return -EINVAL; in mt7986_wmac_gpio_setup()
238 mt76_wmac_rmw(dev->dcm, MT_INFRACFG_AP2CONN_SLPPROT, in mt7986_wmac_consys_lockup()
243 dev->dcm + MT_INFRACFG_AP2CONN_SLPPROT); in mt7986_wmac_consys_lockup()
247 mt76_wmac_rmw(dev->dcm, MT_INFRACFG_AP2CONN_SLPPROT, in mt7986_wmac_consys_lockup()
252 dev->dcm + MT_INFRACFG_AP2CONN_SLPPROT); in mt7986_wmac_consys_lockup()
256 mt76_wmac_rmw(dev->dcm, MT_INFRACFG_CONN2AP_SLPPROT, in mt7986_wmac_consys_lockup()
259 mt76_wmac_rmw(dev->dcm, MT_INFRACFG_CONN2AP_SLPPROT, in mt7986_wmac_consys_lockup()
271 if (is_mt7981(&dev->mt76)) { in mt798x_wmac_coninfra_check()
273 } else if (is_mt7986(&dev->mt76)) { in mt798x_wmac_coninfra_check()
277 return -EINVAL; in mt798x_wmac_coninfra_check()
287 struct device *pdev = dev->mt76.dev; in mt798x_wmac_coninfra_setup()
292 np = of_parse_phandle(pdev->of_node, "memory-region", 0); in mt798x_wmac_coninfra_setup()
294 return -EINVAL; in mt798x_wmac_coninfra_setup()
299 return -EINVAL; in mt798x_wmac_coninfra_setup()
301 val = (rmem->base >> 16) & MT_TOP_MCU_EMI_BASE_MASK; in mt798x_wmac_coninfra_setup()
303 if (is_mt7986(&dev->mt76)) { in mt798x_wmac_coninfra_setup()
314 if (is_mt7981(&dev->mt76)) { in mt798x_wmac_coninfra_setup()
322 mt76_wr(dev, MT_INFRA_BUS_EMI_START, rmem->base); in mt798x_wmac_coninfra_setup()
323 mt76_wr(dev, MT_INFRA_BUS_EMI_END, rmem->size); in mt798x_wmac_coninfra_setup()
342 if (is_mt7986(&dev->mt76)) { in mt798x_wmac_sku_setup()
353 if (is_mt7986(&dev->mt76)) { in mt798x_wmac_sku_setup()
446 *result -= FIELD_GET(MT_ADIE_EFUSE_TRIM_MASK, data); in mt7986_read_efuse_xo_trim_7976()
523 if (is_mt7981(&dev->mt76)) { in mt798x_wmac_adie_patch_7976()
525 } else if (is_mt7986(&dev->mt76)) { in mt798x_wmac_adie_patch_7976()
529 return -EINVAL; in mt798x_wmac_adie_patch_7976()
554 *result -= (data & MT_ADIE_EFUSE_TRIM_MASK); in mt7986_read_efuse_xo_trim_7975()
652 if (is_mt7981(&dev->mt76)) { in mt7986_wmac_adie_patch_7975()
654 } else if (is_mt7986(&dev->mt76)) { in mt7986_wmac_adie_patch_7975()
658 return -EINVAL; in mt7986_wmac_adie_patch_7975()
707 if (is_mt7986(&dev->mt76)) in mt7986_wmac_adie_patch_7975()
802 if (is_mt7981(&dev->mt76)) in mt7986_wmac_afe_cal()
942 if (is_mt7986(&dev->mt76)) in mt7986_wmac_wm_enable()
1040 return -EINVAL; in mt7986_wmac_sku_update()
1042 mt76_wmac_rmw(dev->sku, MT_TOP_POS_SKU, MT_TOP_POS_SKU_MASK, in mt7986_wmac_sku_update()
1137 /* mt7981 doesn't support a second a-die */ in mt7986_wmac_enable()
1138 if (is_mt7986(&dev->mt76)) { in mt7986_wmac_enable()
1197 struct device *pdev = dev->mt76.dev; in mt798x_wmac_init()
1213 dev->dcm = devm_platform_ioremap_resource(pfdev, 1); in mt798x_wmac_init()
1214 if (IS_ERR(dev->dcm)) in mt798x_wmac_init()
1215 return PTR_ERR(dev->dcm); in mt798x_wmac_init()
1217 dev->sku = devm_platform_ioremap_resource(pfdev, 2); in mt798x_wmac_init()
1218 if (IS_ERR(dev->sku)) in mt798x_wmac_init()
1219 return PTR_ERR(dev->sku); in mt798x_wmac_init()
1221 dev->rstc = devm_reset_control_get(pdev, "consys"); in mt798x_wmac_init()
1222 if (IS_ERR(dev->rstc)) in mt798x_wmac_init()
1223 return PTR_ERR(dev->rstc); in mt798x_wmac_init()
1236 chip_id = (uintptr_t)of_device_get_match_data(&pdev->dev); in mt798x_wmac_probe()
1240 dev_err(&pdev->dev, "Failed to get memory resource\n"); in mt798x_wmac_probe()
1244 dev = mt7915_mmio_probe(&pdev->dev, mem_base, chip_id); in mt798x_wmac_probe()
1248 mdev = &dev->mt76; in mt798x_wmac_probe()
1261 ret = devm_request_irq(mdev->dev, irq, mt7915_irq_handler, in mt798x_wmac_probe()
1279 devm_free_irq(mdev->dev, irq, dev); in mt798x_wmac_probe()
1281 if (mtk_wed_device_active(&mdev->mmio.wed)) in mt798x_wmac_probe()
1282 mtk_wed_device_detach(&mdev->mmio.wed); in mt798x_wmac_probe()
1298 { .compatible = "mediatek,mt7981-wmac", .data = (u32 *)0x7981 },
1299 { .compatible = "mediatek,mt7986-wmac", .data = (u32 *)0x7986 },
1307 .name = "mt798x-wmac",