Lines Matching +full:fw +full:- +full:cfg

1 // SPDX-License-Identifier: ISC
23 mt76u_vendor_request(&dev->mt76, MT_VEND_DEV_MODE, in mt76x2u_mcu_load_ivb()
30 struct mt76_usb *usb = &dev->mt76.usb; in mt76x2u_mcu_enable_patch()
37 memcpy(usb->data, data, sizeof(data)); in mt76x2u_mcu_enable_patch()
38 mt76u_vendor_request(&dev->mt76, MT_VEND_DEV_MODE, in mt76x2u_mcu_enable_patch()
40 0x12, 0, usb->data, sizeof(data)); in mt76x2u_mcu_enable_patch()
45 struct mt76_usb *usb = &dev->mt76.usb; in mt76x2u_mcu_reset_wmt()
51 memcpy(usb->data, data, sizeof(data)); in mt76x2u_mcu_reset_wmt()
52 mt76u_vendor_request(&dev->mt76, MT_VEND_DEV_MODE, in mt76x2u_mcu_reset_wmt()
54 0x12, 0, usb->data, sizeof(data)); in mt76x2u_mcu_reset_wmt()
62 const struct firmware *fw; in mt76x2u_mcu_load_rom_patch() local
67 dev_err(dev->mt76.dev, in mt76x2u_mcu_load_rom_patch()
69 return -ETIMEDOUT; in mt76x2u_mcu_load_rom_patch()
81 dev_info(dev->mt76.dev, "ROM patch already applied\n"); in mt76x2u_mcu_load_rom_patch()
85 err = request_firmware(&fw, MT7662_ROM_PATCH, dev->mt76.dev); in mt76x2u_mcu_load_rom_patch()
89 if (!fw || !fw->data || fw->size <= sizeof(*hdr)) { in mt76x2u_mcu_load_rom_patch()
90 dev_err(dev->mt76.dev, "failed to load firmware\n"); in mt76x2u_mcu_load_rom_patch()
91 err = -EIO; in mt76x2u_mcu_load_rom_patch()
95 hdr = (struct mt76x02_patch_header *)fw->data; in mt76x2u_mcu_load_rom_patch()
96 dev_info(dev->mt76.dev, "ROM patch build: %.15s\n", hdr->build_time); in mt76x2u_mcu_load_rom_patch()
102 mt76_wr(dev, MT_VEND_ADDR(CFG, MT_USB_U3DMA_CFG), val); in mt76x2u_mcu_load_rom_patch()
108 /* enable FCE to send in-band cmd */ in mt76x2u_mcu_load_rom_patch()
119 err = mt76x02u_mcu_fw_send_data(dev, fw->data + sizeof(*hdr), in mt76x2u_mcu_load_rom_patch()
120 fw->size - sizeof(*hdr), in mt76x2u_mcu_load_rom_patch()
124 err = -EIO; in mt76x2u_mcu_load_rom_patch()
133 dev_err(dev->mt76.dev, "failed to load ROM patch\n"); in mt76x2u_mcu_load_rom_patch()
134 err = -ETIMEDOUT; in mt76x2u_mcu_load_rom_patch()
140 release_firmware(fw); in mt76x2u_mcu_load_rom_patch()
149 const struct firmware *fw; in mt76x2u_mcu_load_firmware() local
151 err = request_firmware(&fw, MT7662_FIRMWARE, dev->mt76.dev); in mt76x2u_mcu_load_firmware()
155 if (!fw || !fw->data || fw->size < sizeof(*hdr)) { in mt76x2u_mcu_load_firmware()
156 err = -EINVAL; in mt76x2u_mcu_load_firmware()
160 hdr = (const struct mt76x02_fw_header *)fw->data; in mt76x2u_mcu_load_firmware()
161 ilm_len = le32_to_cpu(hdr->ilm_len); in mt76x2u_mcu_load_firmware()
162 dlm_len = le32_to_cpu(hdr->dlm_len); in mt76x2u_mcu_load_firmware()
164 if (fw->size != len) { in mt76x2u_mcu_load_firmware()
165 err = -EINVAL; in mt76x2u_mcu_load_firmware()
169 val = le16_to_cpu(hdr->fw_ver); in mt76x2u_mcu_load_firmware()
170 dev_info(dev->mt76.dev, "Firmware Version: %d.%d.%02d\n", in mt76x2u_mcu_load_firmware()
173 val = le16_to_cpu(hdr->build_ver); in mt76x2u_mcu_load_firmware()
174 dev_info(dev->mt76.dev, "Build: %x\n", val); in mt76x2u_mcu_load_firmware()
175 dev_info(dev->mt76.dev, "Build Time: %.16s\n", hdr->build_time); in mt76x2u_mcu_load_firmware()
185 mt76_wr(dev, MT_VEND_ADDR(CFG, MT_USB_U3DMA_CFG), val); in mt76x2u_mcu_load_firmware()
186 /* enable FCE to send in-band cmd */ in mt76x2u_mcu_load_firmware()
198 err = mt76x02u_mcu_fw_send_data(dev, fw->data + sizeof(*hdr), in mt76x2u_mcu_load_firmware()
202 err = -EIO; in mt76x2u_mcu_load_firmware()
209 err = mt76x02u_mcu_fw_send_data(dev, fw->data + sizeof(*hdr) + ilm_len, in mt76x2u_mcu_load_firmware()
213 err = -EIO; in mt76x2u_mcu_load_firmware()
219 dev_err(dev->mt76.dev, "firmware failed to start\n"); in mt76x2u_mcu_load_firmware()
220 err = -ETIMEDOUT; in mt76x2u_mcu_load_firmware()
225 /* enable FCE to send in-band cmd */ in mt76x2u_mcu_load_firmware()
228 dev_dbg(dev->mt76.dev, "firmware running\n"); in mt76x2u_mcu_load_firmware()
231 release_firmware(fw); in mt76x2u_mcu_load_firmware()