Lines Matching refs:dev

13 static int mt76x0e_load_firmware(struct mt76x02_dev *dev)  in mt76x0e_load_firmware()  argument
15 bool is_combo_chip = mt76_chip(&dev->mt76) != 0x7610; in mt76x0e_load_firmware()
28 err = request_firmware(&fw, firmware, dev->mt76.dev); in mt76x0e_load_firmware()
51 dev_info(dev->mt76.dev, "Firmware Version: %d.%d.%02d\n", in mt76x0e_load_firmware()
55 dev_dbg(dev->mt76.dev, in mt76x0e_load_firmware()
60 if (is_combo_chip && !mt76_poll(dev, MT_MCU_SEMAPHORE_00, 1, 1, 600)) { in mt76x0e_load_firmware()
61 dev_err(dev->mt76.dev, in mt76x0e_load_firmware()
68 mt76_wr(dev, MT_MCU_PCIE_REMAP_BASE4, 0); in mt76x0e_load_firmware()
74 dev_dbg(dev->mt76.dev, "loading FW - ILM %u\n", ilm_len); in mt76x0e_load_firmware()
75 mt76_wr_copy(dev, MT_MCU_ILM_ADDR + offset, fw_payload + offset, in mt76x0e_load_firmware()
80 dev_dbg(dev->mt76.dev, "loading FW - IVB %u\n", in mt76x0e_load_firmware()
82 mt76_wr_copy(dev, MT_MCU_IVB_ADDR, fw_payload, MT_MCU_IVB_SIZE); in mt76x0e_load_firmware()
86 mt76_wr(dev, MT_MCU_PCIE_REMAP_BASE4, MT_MCU_DLM_OFFSET); in mt76x0e_load_firmware()
88 dev_dbg(dev->mt76.dev, "loading FW - DLM %u\n", dlm_len); in mt76x0e_load_firmware()
89 mt76_wr_copy(dev, MT_MCU_ILM_ADDR, in mt76x0e_load_firmware()
93 mt76_wr(dev, MT_MCU_PCIE_REMAP_BASE4, 0); in mt76x0e_load_firmware()
95 mt76_wr(dev, MT_MCU_INT_LEVEL, 0x3); in mt76x0e_load_firmware()
97 mt76_wr(dev, MT_MCU_RESET_CTL, 0x300); in mt76x0e_load_firmware()
99 if (!mt76_poll_msec(dev, MT_MCU_COM_REG0, 1, 1, 1000)) { in mt76x0e_load_firmware()
100 dev_err(dev->mt76.dev, "Firmware failed to start\n"); in mt76x0e_load_firmware()
105 mt76x02_set_ethtool_fwver(dev, hdr); in mt76x0e_load_firmware()
106 dev_dbg(dev->mt76.dev, "Firmware running!\n"); in mt76x0e_load_firmware()
110 mt76_wr(dev, MT_MCU_SEMAPHORE_00, 0x1); in mt76x0e_load_firmware()
116 int mt76x0e_mcu_init(struct mt76x02_dev *dev) in mt76x0e_mcu_init() argument
124 dev->mt76.mcu_ops = &mt76x0e_mcu_ops; in mt76x0e_mcu_init()
126 err = mt76x0e_load_firmware(dev); in mt76x0e_mcu_init()
130 set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state); in mt76x0e_mcu_init()