fw.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  24. * USA
  25. *
  26. * The full GNU General Public License is included in this distribution
  27. * in the file called COPYING.
  28. *
  29. * Contact Information:
  30. * Intel Linux Wireless <linuxwifi@intel.com>
  31. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  32. *
  33. * BSD LICENSE
  34. *
  35. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  36. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  37. * All rights reserved.
  38. *
  39. * Redistribution and use in source and binary forms, with or without
  40. * modification, are permitted provided that the following conditions
  41. * are met:
  42. *
  43. * * Redistributions of source code must retain the above copyright
  44. * notice, this list of conditions and the following disclaimer.
  45. * * Redistributions in binary form must reproduce the above copyright
  46. * notice, this list of conditions and the following disclaimer in
  47. * the documentation and/or other materials provided with the
  48. * distribution.
  49. * * Neither the name Intel Corporation nor the names of its
  50. * contributors may be used to endorse or promote products derived
  51. * from this software without specific prior written permission.
  52. *
  53. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  54. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  55. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  56. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  57. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  58. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  59. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  60. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  61. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  62. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  63. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  64. *
  65. *****************************************************************************/
  66. #include <net/mac80211.h>
  67. #include "iwl-trans.h"
  68. #include "iwl-op-mode.h"
  69. #include "iwl-fw.h"
  70. #include "iwl-debug.h"
  71. #include "iwl-csr.h" /* for iwl_mvm_rx_card_state_notif */
  72. #include "iwl-io.h" /* for iwl_mvm_rx_card_state_notif */
  73. #include "iwl-prph.h"
  74. #include "iwl-eeprom-parse.h"
  75. #include "mvm.h"
  76. #include "fw-dbg.h"
  77. #include "iwl-phy-db.h"
  78. #define MVM_UCODE_ALIVE_TIMEOUT HZ
  79. #define MVM_UCODE_CALIB_TIMEOUT (2*HZ)
  80. #define UCODE_VALID_OK cpu_to_le32(0x1)
  81. struct iwl_mvm_alive_data {
  82. bool valid;
  83. u32 scd_base_addr;
  84. };
  85. static inline const struct fw_img *
  86. iwl_get_ucode_image(struct iwl_mvm *mvm, enum iwl_ucode_type ucode_type)
  87. {
  88. if (ucode_type >= IWL_UCODE_TYPE_MAX)
  89. return NULL;
  90. return &mvm->fw->img[ucode_type];
  91. }
  92. static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
  93. {
  94. struct iwl_tx_ant_cfg_cmd tx_ant_cmd = {
  95. .valid = cpu_to_le32(valid_tx_ant),
  96. };
  97. IWL_DEBUG_FW(mvm, "select valid tx ant: %u\n", valid_tx_ant);
  98. return iwl_mvm_send_cmd_pdu(mvm, TX_ANT_CONFIGURATION_CMD, 0,
  99. sizeof(tx_ant_cmd), &tx_ant_cmd);
  100. }
  101. static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm)
  102. {
  103. int i;
  104. struct iwl_rss_config_cmd cmd = {
  105. .flags = cpu_to_le32(IWL_RSS_ENABLE),
  106. .hash_mask = IWL_RSS_HASH_TYPE_IPV4_TCP |
  107. IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |
  108. IWL_RSS_HASH_TYPE_IPV6_TCP |
  109. IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
  110. };
  111. for (i = 0; i < ARRAY_SIZE(cmd.indirection_table); i++)
  112. cmd.indirection_table[i] = i % mvm->trans->num_rx_queues;
  113. memcpy(cmd.secret_key, mvm->secret_key, sizeof(cmd.secret_key));
  114. return iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
  115. }
  116. static void iwl_free_fw_paging(struct iwl_mvm *mvm)
  117. {
  118. int i;
  119. if (!mvm->fw_paging_db[0].fw_paging_block)
  120. return;
  121. for (i = 0; i < NUM_OF_FW_PAGING_BLOCKS; i++) {
  122. if (!mvm->fw_paging_db[i].fw_paging_block) {
  123. IWL_DEBUG_FW(mvm,
  124. "Paging: block %d already freed, continue to next page\n",
  125. i);
  126. continue;
  127. }
  128. __free_pages(mvm->fw_paging_db[i].fw_paging_block,
  129. get_order(mvm->fw_paging_db[i].fw_paging_size));
  130. }
  131. kfree(mvm->trans->paging_download_buf);
  132. memset(mvm->fw_paging_db, 0, sizeof(mvm->fw_paging_db));
  133. }
  134. static int iwl_fill_paging_mem(struct iwl_mvm *mvm, const struct fw_img *image)
  135. {
  136. int sec_idx, idx;
  137. u32 offset = 0;
  138. /*
  139. * find where is the paging image start point:
  140. * if CPU2 exist and it's in paging format, then the image looks like:
  141. * CPU1 sections (2 or more)
  142. * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between CPU1 to CPU2
  143. * CPU2 sections (not paged)
  144. * PAGING_SEPARATOR_SECTION delimiter - separate between CPU2
  145. * non paged to CPU2 paging sec
  146. * CPU2 paging CSS
  147. * CPU2 paging image (including instruction and data)
  148. */
  149. for (sec_idx = 0; sec_idx < IWL_UCODE_SECTION_MAX; sec_idx++) {
  150. if (image->sec[sec_idx].offset == PAGING_SEPARATOR_SECTION) {
  151. sec_idx++;
  152. break;
  153. }
  154. }
  155. if (sec_idx >= IWL_UCODE_SECTION_MAX) {
  156. IWL_ERR(mvm, "driver didn't find paging image\n");
  157. iwl_free_fw_paging(mvm);
  158. return -EINVAL;
  159. }
  160. /* copy the CSS block to the dram */
  161. IWL_DEBUG_FW(mvm, "Paging: load paging CSS to FW, sec = %d\n",
  162. sec_idx);
  163. memcpy(page_address(mvm->fw_paging_db[0].fw_paging_block),
  164. image->sec[sec_idx].data,
  165. mvm->fw_paging_db[0].fw_paging_size);
  166. IWL_DEBUG_FW(mvm,
  167. "Paging: copied %d CSS bytes to first block\n",
  168. mvm->fw_paging_db[0].fw_paging_size);
  169. sec_idx++;
  170. /*
  171. * copy the paging blocks to the dram
  172. * loop index start from 1 since that CSS block already copied to dram
  173. * and CSS index is 0.
  174. * loop stop at num_of_paging_blk since that last block is not full.
  175. */
  176. for (idx = 1; idx < mvm->num_of_paging_blk; idx++) {
  177. memcpy(page_address(mvm->fw_paging_db[idx].fw_paging_block),
  178. image->sec[sec_idx].data + offset,
  179. mvm->fw_paging_db[idx].fw_paging_size);
  180. IWL_DEBUG_FW(mvm,
  181. "Paging: copied %d paging bytes to block %d\n",
  182. mvm->fw_paging_db[idx].fw_paging_size,
  183. idx);
  184. offset += mvm->fw_paging_db[idx].fw_paging_size;
  185. }
  186. /* copy the last paging block */
  187. if (mvm->num_of_pages_in_last_blk > 0) {
  188. memcpy(page_address(mvm->fw_paging_db[idx].fw_paging_block),
  189. image->sec[sec_idx].data + offset,
  190. FW_PAGING_SIZE * mvm->num_of_pages_in_last_blk);
  191. IWL_DEBUG_FW(mvm,
  192. "Paging: copied %d pages in the last block %d\n",
  193. mvm->num_of_pages_in_last_blk, idx);
  194. }
  195. return 0;
  196. }
  197. static int iwl_alloc_fw_paging_mem(struct iwl_mvm *mvm,
  198. const struct fw_img *image)
  199. {
  200. struct page *block;
  201. dma_addr_t phys = 0;
  202. int blk_idx = 0;
  203. int order, num_of_pages;
  204. int dma_enabled;
  205. if (mvm->fw_paging_db[0].fw_paging_block)
  206. return 0;
  207. dma_enabled = is_device_dma_capable(mvm->trans->dev);
  208. /* ensure BLOCK_2_EXP_SIZE is power of 2 of PAGING_BLOCK_SIZE */
  209. BUILD_BUG_ON(BIT(BLOCK_2_EXP_SIZE) != PAGING_BLOCK_SIZE);
  210. num_of_pages = image->paging_mem_size / FW_PAGING_SIZE;
  211. mvm->num_of_paging_blk = ((num_of_pages - 1) /
  212. NUM_OF_PAGE_PER_GROUP) + 1;
  213. mvm->num_of_pages_in_last_blk =
  214. num_of_pages -
  215. NUM_OF_PAGE_PER_GROUP * (mvm->num_of_paging_blk - 1);
  216. IWL_DEBUG_FW(mvm,
  217. "Paging: allocating mem for %d paging blocks, each block holds 8 pages, last block holds %d pages\n",
  218. mvm->num_of_paging_blk,
  219. mvm->num_of_pages_in_last_blk);
  220. /* allocate block of 4Kbytes for paging CSS */
  221. order = get_order(FW_PAGING_SIZE);
  222. block = alloc_pages(GFP_KERNEL, order);
  223. if (!block) {
  224. /* free all the previous pages since we failed */
  225. iwl_free_fw_paging(mvm);
  226. return -ENOMEM;
  227. }
  228. mvm->fw_paging_db[blk_idx].fw_paging_block = block;
  229. mvm->fw_paging_db[blk_idx].fw_paging_size = FW_PAGING_SIZE;
  230. if (dma_enabled) {
  231. phys = dma_map_page(mvm->trans->dev, block, 0,
  232. PAGE_SIZE << order, DMA_BIDIRECTIONAL);
  233. if (dma_mapping_error(mvm->trans->dev, phys)) {
  234. /*
  235. * free the previous pages and the current one since
  236. * we failed to map_page.
  237. */
  238. iwl_free_fw_paging(mvm);
  239. return -ENOMEM;
  240. }
  241. mvm->fw_paging_db[blk_idx].fw_paging_phys = phys;
  242. } else {
  243. mvm->fw_paging_db[blk_idx].fw_paging_phys = PAGING_ADDR_SIG |
  244. blk_idx << BLOCK_2_EXP_SIZE;
  245. }
  246. IWL_DEBUG_FW(mvm,
  247. "Paging: allocated 4K(CSS) bytes (order %d) for firmware paging.\n",
  248. order);
  249. /*
  250. * allocate blocks in dram.
  251. * since that CSS allocated in fw_paging_db[0] loop start from index 1
  252. */
  253. for (blk_idx = 1; blk_idx < mvm->num_of_paging_blk + 1; blk_idx++) {
  254. /* allocate block of PAGING_BLOCK_SIZE (32K) */
  255. order = get_order(PAGING_BLOCK_SIZE);
  256. block = alloc_pages(GFP_KERNEL, order);
  257. if (!block) {
  258. /* free all the previous pages since we failed */
  259. iwl_free_fw_paging(mvm);
  260. return -ENOMEM;
  261. }
  262. mvm->fw_paging_db[blk_idx].fw_paging_block = block;
  263. mvm->fw_paging_db[blk_idx].fw_paging_size = PAGING_BLOCK_SIZE;
  264. if (dma_enabled) {
  265. phys = dma_map_page(mvm->trans->dev, block, 0,
  266. PAGE_SIZE << order,
  267. DMA_BIDIRECTIONAL);
  268. if (dma_mapping_error(mvm->trans->dev, phys)) {
  269. /*
  270. * free the previous pages and the current one
  271. * since we failed to map_page.
  272. */
  273. iwl_free_fw_paging(mvm);
  274. return -ENOMEM;
  275. }
  276. mvm->fw_paging_db[blk_idx].fw_paging_phys = phys;
  277. } else {
  278. mvm->fw_paging_db[blk_idx].fw_paging_phys =
  279. PAGING_ADDR_SIG |
  280. blk_idx << BLOCK_2_EXP_SIZE;
  281. }
  282. IWL_DEBUG_FW(mvm,
  283. "Paging: allocated 32K bytes (order %d) for firmware paging.\n",
  284. order);
  285. }
  286. return 0;
  287. }
  288. static int iwl_save_fw_paging(struct iwl_mvm *mvm,
  289. const struct fw_img *fw)
  290. {
  291. int ret;
  292. ret = iwl_alloc_fw_paging_mem(mvm, fw);
  293. if (ret)
  294. return ret;
  295. return iwl_fill_paging_mem(mvm, fw);
  296. }
  297. /* send paging cmd to FW in case CPU2 has paging image */
  298. static int iwl_send_paging_cmd(struct iwl_mvm *mvm, const struct fw_img *fw)
  299. {
  300. int blk_idx;
  301. __le32 dev_phy_addr;
  302. struct iwl_fw_paging_cmd fw_paging_cmd = {
  303. .flags =
  304. cpu_to_le32(PAGING_CMD_IS_SECURED |
  305. PAGING_CMD_IS_ENABLED |
  306. (mvm->num_of_pages_in_last_blk <<
  307. PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS)),
  308. .block_size = cpu_to_le32(BLOCK_2_EXP_SIZE),
  309. .block_num = cpu_to_le32(mvm->num_of_paging_blk),
  310. };
  311. /* loop for for all paging blocks + CSS block */
  312. for (blk_idx = 0; blk_idx < mvm->num_of_paging_blk + 1; blk_idx++) {
  313. dev_phy_addr =
  314. cpu_to_le32(mvm->fw_paging_db[blk_idx].fw_paging_phys >>
  315. PAGE_2_EXP_SIZE);
  316. fw_paging_cmd.device_phy_addr[blk_idx] = dev_phy_addr;
  317. }
  318. return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(FW_PAGING_BLOCK_CMD,
  319. IWL_ALWAYS_LONG_GROUP, 0),
  320. 0, sizeof(fw_paging_cmd), &fw_paging_cmd);
  321. }
  322. /*
  323. * Send paging item cmd to FW in case CPU2 has paging image
  324. */
  325. static int iwl_trans_get_paging_item(struct iwl_mvm *mvm)
  326. {
  327. int ret;
  328. struct iwl_fw_get_item_cmd fw_get_item_cmd = {
  329. .item_id = cpu_to_le32(IWL_FW_ITEM_ID_PAGING),
  330. };
  331. struct iwl_fw_get_item_resp *item_resp;
  332. struct iwl_host_cmd cmd = {
  333. .id = iwl_cmd_id(FW_GET_ITEM_CMD, IWL_ALWAYS_LONG_GROUP, 0),
  334. .flags = CMD_WANT_SKB | CMD_SEND_IN_RFKILL,
  335. .data = { &fw_get_item_cmd, },
  336. };
  337. cmd.len[0] = sizeof(struct iwl_fw_get_item_cmd);
  338. ret = iwl_mvm_send_cmd(mvm, &cmd);
  339. if (ret) {
  340. IWL_ERR(mvm,
  341. "Paging: Failed to send FW_GET_ITEM_CMD cmd (err = %d)\n",
  342. ret);
  343. return ret;
  344. }
  345. item_resp = (void *)((struct iwl_rx_packet *)cmd.resp_pkt)->data;
  346. if (item_resp->item_id != cpu_to_le32(IWL_FW_ITEM_ID_PAGING)) {
  347. IWL_ERR(mvm,
  348. "Paging: got wrong item in FW_GET_ITEM_CMD resp (item_id = %u)\n",
  349. le32_to_cpu(item_resp->item_id));
  350. ret = -EIO;
  351. goto exit;
  352. }
  353. mvm->trans->paging_download_buf = kzalloc(MAX_PAGING_IMAGE_SIZE,
  354. GFP_KERNEL);
  355. if (!mvm->trans->paging_download_buf) {
  356. ret = -ENOMEM;
  357. goto exit;
  358. }
  359. mvm->trans->paging_req_addr = le32_to_cpu(item_resp->item_val);
  360. mvm->trans->paging_db = mvm->fw_paging_db;
  361. IWL_DEBUG_FW(mvm,
  362. "Paging: got paging request address (paging_req_addr 0x%08x)\n",
  363. mvm->trans->paging_req_addr);
  364. exit:
  365. iwl_free_resp(&cmd);
  366. return ret;
  367. }
  368. static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
  369. struct iwl_rx_packet *pkt, void *data)
  370. {
  371. struct iwl_mvm *mvm =
  372. container_of(notif_wait, struct iwl_mvm, notif_wait);
  373. struct iwl_mvm_alive_data *alive_data = data;
  374. struct mvm_alive_resp_ver1 *palive1;
  375. struct mvm_alive_resp_ver2 *palive2;
  376. struct mvm_alive_resp *palive;
  377. if (iwl_rx_packet_payload_len(pkt) == sizeof(*palive1)) {
  378. palive1 = (void *)pkt->data;
  379. mvm->support_umac_log = false;
  380. mvm->error_event_table =
  381. le32_to_cpu(palive1->error_event_table_ptr);
  382. mvm->log_event_table =
  383. le32_to_cpu(palive1->log_event_table_ptr);
  384. alive_data->scd_base_addr = le32_to_cpu(palive1->scd_base_ptr);
  385. alive_data->valid = le16_to_cpu(palive1->status) ==
  386. IWL_ALIVE_STATUS_OK;
  387. IWL_DEBUG_FW(mvm,
  388. "Alive VER1 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n",
  389. le16_to_cpu(palive1->status), palive1->ver_type,
  390. palive1->ver_subtype, palive1->flags);
  391. } else if (iwl_rx_packet_payload_len(pkt) == sizeof(*palive2)) {
  392. palive2 = (void *)pkt->data;
  393. mvm->error_event_table =
  394. le32_to_cpu(palive2->error_event_table_ptr);
  395. mvm->log_event_table =
  396. le32_to_cpu(palive2->log_event_table_ptr);
  397. alive_data->scd_base_addr = le32_to_cpu(palive2->scd_base_ptr);
  398. mvm->umac_error_event_table =
  399. le32_to_cpu(palive2->error_info_addr);
  400. mvm->sf_space.addr = le32_to_cpu(palive2->st_fwrd_addr);
  401. mvm->sf_space.size = le32_to_cpu(palive2->st_fwrd_size);
  402. alive_data->valid = le16_to_cpu(palive2->status) ==
  403. IWL_ALIVE_STATUS_OK;
  404. if (mvm->umac_error_event_table)
  405. mvm->support_umac_log = true;
  406. IWL_DEBUG_FW(mvm,
  407. "Alive VER2 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n",
  408. le16_to_cpu(palive2->status), palive2->ver_type,
  409. palive2->ver_subtype, palive2->flags);
  410. IWL_DEBUG_FW(mvm,
  411. "UMAC version: Major - 0x%x, Minor - 0x%x\n",
  412. palive2->umac_major, palive2->umac_minor);
  413. } else if (iwl_rx_packet_payload_len(pkt) == sizeof(*palive)) {
  414. palive = (void *)pkt->data;
  415. mvm->error_event_table =
  416. le32_to_cpu(palive->error_event_table_ptr);
  417. mvm->log_event_table =
  418. le32_to_cpu(palive->log_event_table_ptr);
  419. alive_data->scd_base_addr = le32_to_cpu(palive->scd_base_ptr);
  420. mvm->umac_error_event_table =
  421. le32_to_cpu(palive->error_info_addr);
  422. mvm->sf_space.addr = le32_to_cpu(palive->st_fwrd_addr);
  423. mvm->sf_space.size = le32_to_cpu(palive->st_fwrd_size);
  424. alive_data->valid = le16_to_cpu(palive->status) ==
  425. IWL_ALIVE_STATUS_OK;
  426. if (mvm->umac_error_event_table)
  427. mvm->support_umac_log = true;
  428. IWL_DEBUG_FW(mvm,
  429. "Alive VER3 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n",
  430. le16_to_cpu(palive->status), palive->ver_type,
  431. palive->ver_subtype, palive->flags);
  432. IWL_DEBUG_FW(mvm,
  433. "UMAC version: Major - 0x%x, Minor - 0x%x\n",
  434. le32_to_cpu(palive->umac_major),
  435. le32_to_cpu(palive->umac_minor));
  436. }
  437. return true;
  438. }
  439. static bool iwl_wait_phy_db_entry(struct iwl_notif_wait_data *notif_wait,
  440. struct iwl_rx_packet *pkt, void *data)
  441. {
  442. struct iwl_phy_db *phy_db = data;
  443. if (pkt->hdr.cmd != CALIB_RES_NOTIF_PHY_DB) {
  444. WARN_ON(pkt->hdr.cmd != INIT_COMPLETE_NOTIF);
  445. return true;
  446. }
  447. WARN_ON(iwl_phy_db_set_section(phy_db, pkt, GFP_ATOMIC));
  448. return false;
  449. }
  450. static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
  451. enum iwl_ucode_type ucode_type)
  452. {
  453. struct iwl_notification_wait alive_wait;
  454. struct iwl_mvm_alive_data alive_data;
  455. const struct fw_img *fw;
  456. int ret, i;
  457. enum iwl_ucode_type old_type = mvm->cur_ucode;
  458. static const u16 alive_cmd[] = { MVM_ALIVE };
  459. struct iwl_sf_region st_fwrd_space;
  460. if (ucode_type == IWL_UCODE_REGULAR &&
  461. iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE))
  462. fw = iwl_get_ucode_image(mvm, IWL_UCODE_REGULAR_USNIFFER);
  463. else
  464. fw = iwl_get_ucode_image(mvm, ucode_type);
  465. if (WARN_ON(!fw))
  466. return -EINVAL;
  467. mvm->cur_ucode = ucode_type;
  468. mvm->ucode_loaded = false;
  469. iwl_init_notification_wait(&mvm->notif_wait, &alive_wait,
  470. alive_cmd, ARRAY_SIZE(alive_cmd),
  471. iwl_alive_fn, &alive_data);
  472. ret = iwl_trans_start_fw(mvm->trans, fw, ucode_type == IWL_UCODE_INIT);
  473. if (ret) {
  474. mvm->cur_ucode = old_type;
  475. iwl_remove_notification(&mvm->notif_wait, &alive_wait);
  476. return ret;
  477. }
  478. /*
  479. * Some things may run in the background now, but we
  480. * just wait for the ALIVE notification here.
  481. */
  482. ret = iwl_wait_notification(&mvm->notif_wait, &alive_wait,
  483. MVM_UCODE_ALIVE_TIMEOUT);
  484. if (ret) {
  485. if (mvm->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000)
  486. IWL_ERR(mvm,
  487. "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n",
  488. iwl_read_prph(mvm->trans, SB_CPU_1_STATUS),
  489. iwl_read_prph(mvm->trans, SB_CPU_2_STATUS));
  490. mvm->cur_ucode = old_type;
  491. return ret;
  492. }
  493. if (!alive_data.valid) {
  494. IWL_ERR(mvm, "Loaded ucode is not valid!\n");
  495. mvm->cur_ucode = old_type;
  496. return -EIO;
  497. }
  498. /*
  499. * update the sdio allocation according to the pointer we get in the
  500. * alive notification.
  501. */
  502. st_fwrd_space.addr = mvm->sf_space.addr;
  503. st_fwrd_space.size = mvm->sf_space.size;
  504. ret = iwl_trans_update_sf(mvm->trans, &st_fwrd_space);
  505. if (ret) {
  506. IWL_ERR(mvm, "Failed to update SF size. ret %d\n", ret);
  507. return ret;
  508. }
  509. iwl_trans_fw_alive(mvm->trans, alive_data.scd_base_addr);
  510. /*
  511. * configure and operate fw paging mechanism.
  512. * driver configures the paging flow only once, CPU2 paging image
  513. * included in the IWL_UCODE_INIT image.
  514. */
  515. if (fw->paging_mem_size) {
  516. /*
  517. * When dma is not enabled, the driver needs to copy / write
  518. * the downloaded / uploaded page to / from the smem.
  519. * This gets the location of the place were the pages are
  520. * stored.
  521. */
  522. if (!is_device_dma_capable(mvm->trans->dev)) {
  523. ret = iwl_trans_get_paging_item(mvm);
  524. if (ret) {
  525. IWL_ERR(mvm, "failed to get FW paging item\n");
  526. return ret;
  527. }
  528. }
  529. ret = iwl_save_fw_paging(mvm, fw);
  530. if (ret) {
  531. IWL_ERR(mvm, "failed to save the FW paging image\n");
  532. return ret;
  533. }
  534. ret = iwl_send_paging_cmd(mvm, fw);
  535. if (ret) {
  536. IWL_ERR(mvm, "failed to send the paging cmd\n");
  537. iwl_free_fw_paging(mvm);
  538. return ret;
  539. }
  540. }
  541. /*
  542. * Note: all the queues are enabled as part of the interface
  543. * initialization, but in firmware restart scenarios they
  544. * could be stopped, so wake them up. In firmware restart,
  545. * mac80211 will have the queues stopped as well until the
  546. * reconfiguration completes. During normal startup, they
  547. * will be empty.
  548. */
  549. memset(&mvm->queue_info, 0, sizeof(mvm->queue_info));
  550. mvm->queue_info[IWL_MVM_CMD_QUEUE].hw_queue_refcount = 1;
  551. for (i = 0; i < IEEE80211_MAX_QUEUES; i++)
  552. atomic_set(&mvm->mac80211_queue_stop_count[i], 0);
  553. mvm->ucode_loaded = true;
  554. return 0;
  555. }
  556. static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
  557. {
  558. struct iwl_phy_cfg_cmd phy_cfg_cmd;
  559. enum iwl_ucode_type ucode_type = mvm->cur_ucode;
  560. /* Set parameters */
  561. phy_cfg_cmd.phy_cfg = cpu_to_le32(iwl_mvm_get_phy_config(mvm));
  562. phy_cfg_cmd.calib_control.event_trigger =
  563. mvm->fw->default_calib[ucode_type].event_trigger;
  564. phy_cfg_cmd.calib_control.flow_trigger =
  565. mvm->fw->default_calib[ucode_type].flow_trigger;
  566. IWL_DEBUG_INFO(mvm, "Sending Phy CFG command: 0x%x\n",
  567. phy_cfg_cmd.phy_cfg);
  568. return iwl_mvm_send_cmd_pdu(mvm, PHY_CONFIGURATION_CMD, 0,
  569. sizeof(phy_cfg_cmd), &phy_cfg_cmd);
  570. }
  571. int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
  572. {
  573. struct iwl_notification_wait calib_wait;
  574. static const u16 init_complete[] = {
  575. INIT_COMPLETE_NOTIF,
  576. CALIB_RES_NOTIF_PHY_DB
  577. };
  578. int ret;
  579. lockdep_assert_held(&mvm->mutex);
  580. if (WARN_ON_ONCE(mvm->calibrating))
  581. return 0;
  582. iwl_init_notification_wait(&mvm->notif_wait,
  583. &calib_wait,
  584. init_complete,
  585. ARRAY_SIZE(init_complete),
  586. iwl_wait_phy_db_entry,
  587. mvm->phy_db);
  588. /* Will also start the device */
  589. ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_INIT);
  590. if (ret) {
  591. IWL_ERR(mvm, "Failed to start INIT ucode: %d\n", ret);
  592. goto error;
  593. }
  594. ret = iwl_send_bt_init_conf(mvm);
  595. if (ret)
  596. goto error;
  597. /* Read the NVM only at driver load time, no need to do this twice */
  598. if (read_nvm) {
  599. /* Read nvm */
  600. ret = iwl_nvm_init(mvm, true);
  601. if (ret) {
  602. IWL_ERR(mvm, "Failed to read NVM: %d\n", ret);
  603. goto error;
  604. }
  605. }
  606. /* In case we read the NVM from external file, load it to the NIC */
  607. if (mvm->nvm_file_name)
  608. iwl_mvm_load_nvm_to_nic(mvm);
  609. ret = iwl_nvm_check_version(mvm->nvm_data, mvm->trans);
  610. WARN_ON(ret);
  611. /*
  612. * abort after reading the nvm in case RF Kill is on, we will complete
  613. * the init seq later when RF kill will switch to off
  614. */
  615. if (iwl_mvm_is_radio_hw_killed(mvm)) {
  616. IWL_DEBUG_RF_KILL(mvm,
  617. "jump over all phy activities due to RF kill\n");
  618. iwl_remove_notification(&mvm->notif_wait, &calib_wait);
  619. ret = 1;
  620. goto out;
  621. }
  622. mvm->calibrating = true;
  623. /* Send TX valid antennas before triggering calibrations */
  624. ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm));
  625. if (ret)
  626. goto error;
  627. /*
  628. * Send phy configurations command to init uCode
  629. * to start the 16.0 uCode init image internal calibrations.
  630. */
  631. ret = iwl_send_phy_cfg_cmd(mvm);
  632. if (ret) {
  633. IWL_ERR(mvm, "Failed to run INIT calibrations: %d\n",
  634. ret);
  635. goto error;
  636. }
  637. /*
  638. * Some things may run in the background now, but we
  639. * just wait for the calibration complete notification.
  640. */
  641. ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,
  642. MVM_UCODE_CALIB_TIMEOUT);
  643. if (ret && iwl_mvm_is_radio_hw_killed(mvm)) {
  644. IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");
  645. ret = 1;
  646. }
  647. goto out;
  648. error:
  649. iwl_remove_notification(&mvm->notif_wait, &calib_wait);
  650. out:
  651. mvm->calibrating = false;
  652. if (iwlmvm_mod_params.init_dbg && !mvm->nvm_data) {
  653. /* we want to debug INIT and we have no NVM - fake */
  654. mvm->nvm_data = kzalloc(sizeof(struct iwl_nvm_data) +
  655. sizeof(struct ieee80211_channel) +
  656. sizeof(struct ieee80211_rate),
  657. GFP_KERNEL);
  658. if (!mvm->nvm_data)
  659. return -ENOMEM;
  660. mvm->nvm_data->bands[0].channels = mvm->nvm_data->channels;
  661. mvm->nvm_data->bands[0].n_channels = 1;
  662. mvm->nvm_data->bands[0].n_bitrates = 1;
  663. mvm->nvm_data->bands[0].bitrates =
  664. (void *)mvm->nvm_data->channels + 1;
  665. mvm->nvm_data->bands[0].bitrates->hw_value = 10;
  666. }
  667. return ret;
  668. }
  669. static void iwl_mvm_get_shared_mem_conf(struct iwl_mvm *mvm)
  670. {
  671. struct iwl_host_cmd cmd = {
  672. .id = SHARED_MEM_CFG,
  673. .flags = CMD_WANT_SKB,
  674. .data = { NULL, },
  675. .len = { 0, },
  676. };
  677. struct iwl_rx_packet *pkt;
  678. struct iwl_shared_mem_cfg *mem_cfg;
  679. u32 i;
  680. lockdep_assert_held(&mvm->mutex);
  681. if (WARN_ON(iwl_mvm_send_cmd(mvm, &cmd)))
  682. return;
  683. pkt = cmd.resp_pkt;
  684. mem_cfg = (void *)pkt->data;
  685. mvm->shared_mem_cfg.shared_mem_addr =
  686. le32_to_cpu(mem_cfg->shared_mem_addr);
  687. mvm->shared_mem_cfg.shared_mem_size =
  688. le32_to_cpu(mem_cfg->shared_mem_size);
  689. mvm->shared_mem_cfg.sample_buff_addr =
  690. le32_to_cpu(mem_cfg->sample_buff_addr);
  691. mvm->shared_mem_cfg.sample_buff_size =
  692. le32_to_cpu(mem_cfg->sample_buff_size);
  693. mvm->shared_mem_cfg.txfifo_addr = le32_to_cpu(mem_cfg->txfifo_addr);
  694. for (i = 0; i < ARRAY_SIZE(mvm->shared_mem_cfg.txfifo_size); i++)
  695. mvm->shared_mem_cfg.txfifo_size[i] =
  696. le32_to_cpu(mem_cfg->txfifo_size[i]);
  697. for (i = 0; i < ARRAY_SIZE(mvm->shared_mem_cfg.rxfifo_size); i++)
  698. mvm->shared_mem_cfg.rxfifo_size[i] =
  699. le32_to_cpu(mem_cfg->rxfifo_size[i]);
  700. mvm->shared_mem_cfg.page_buff_addr =
  701. le32_to_cpu(mem_cfg->page_buff_addr);
  702. mvm->shared_mem_cfg.page_buff_size =
  703. le32_to_cpu(mem_cfg->page_buff_size);
  704. IWL_DEBUG_INFO(mvm, "SHARED MEM CFG: got memory offsets/sizes\n");
  705. iwl_free_resp(&cmd);
  706. }
  707. static int iwl_mvm_config_ltr(struct iwl_mvm *mvm)
  708. {
  709. struct iwl_ltr_config_cmd cmd = {
  710. .flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
  711. };
  712. if (!mvm->trans->ltr_enabled)
  713. return 0;
  714. return iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
  715. sizeof(cmd), &cmd);
  716. }
  717. int iwl_mvm_up(struct iwl_mvm *mvm)
  718. {
  719. int ret, i;
  720. struct ieee80211_channel *chan;
  721. struct cfg80211_chan_def chandef;
  722. lockdep_assert_held(&mvm->mutex);
  723. ret = iwl_trans_start_hw(mvm->trans);
  724. if (ret)
  725. return ret;
  726. /*
  727. * If we haven't completed the run of the init ucode during
  728. * module loading, load init ucode now
  729. * (for example, if we were in RFKILL)
  730. */
  731. ret = iwl_run_init_mvm_ucode(mvm, false);
  732. if (ret && !iwlmvm_mod_params.init_dbg) {
  733. IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
  734. /* this can't happen */
  735. if (WARN_ON(ret > 0))
  736. ret = -ERFKILL;
  737. goto error;
  738. }
  739. if (!iwlmvm_mod_params.init_dbg) {
  740. /*
  741. * Stop and start the transport without entering low power
  742. * mode. This will save the state of other components on the
  743. * device that are triggered by the INIT firwmare (MFUART).
  744. */
  745. _iwl_trans_stop_device(mvm->trans, false);
  746. ret = _iwl_trans_start_hw(mvm->trans, false);
  747. if (ret)
  748. goto error;
  749. }
  750. if (iwlmvm_mod_params.init_dbg)
  751. return 0;
  752. ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR);
  753. if (ret) {
  754. IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret);
  755. goto error;
  756. }
  757. iwl_mvm_get_shared_mem_conf(mvm);
  758. ret = iwl_mvm_sf_update(mvm, NULL, false);
  759. if (ret)
  760. IWL_ERR(mvm, "Failed to initialize Smart Fifo\n");
  761. mvm->fw_dbg_conf = FW_DBG_INVALID;
  762. /* if we have a destination, assume EARLY START */
  763. if (mvm->fw->dbg_dest_tlv)
  764. mvm->fw_dbg_conf = FW_DBG_START_FROM_ALIVE;
  765. iwl_mvm_start_fw_dbg_conf(mvm, FW_DBG_START_FROM_ALIVE);
  766. ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm));
  767. if (ret)
  768. goto error;
  769. ret = iwl_send_bt_init_conf(mvm);
  770. if (ret)
  771. goto error;
  772. /* Send phy db control command and then phy db calibration*/
  773. ret = iwl_send_phy_db_data(mvm->phy_db);
  774. if (ret)
  775. goto error;
  776. ret = iwl_send_phy_cfg_cmd(mvm);
  777. if (ret)
  778. goto error;
  779. /* Init RSS configuration */
  780. if (iwl_mvm_has_new_rx_api(mvm)) {
  781. ret = iwl_send_rss_cfg_cmd(mvm);
  782. if (ret) {
  783. IWL_ERR(mvm, "Failed to configure RSS queues: %d\n",
  784. ret);
  785. goto error;
  786. }
  787. }
  788. /* init the fw <-> mac80211 STA mapping */
  789. for (i = 0; i < IWL_MVM_STATION_COUNT; i++)
  790. RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL);
  791. mvm->tdls_cs.peer.sta_id = IWL_MVM_STATION_COUNT;
  792. /* reset quota debouncing buffer - 0xff will yield invalid data */
  793. memset(&mvm->last_quota_cmd, 0xff, sizeof(mvm->last_quota_cmd));
  794. /* Add auxiliary station for scanning */
  795. ret = iwl_mvm_add_aux_sta(mvm);
  796. if (ret)
  797. goto error;
  798. /* Add all the PHY contexts */
  799. chan = &mvm->hw->wiphy->bands[IEEE80211_BAND_2GHZ]->channels[0];
  800. cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
  801. for (i = 0; i < NUM_PHY_CTX; i++) {
  802. /*
  803. * The channel used here isn't relevant as it's
  804. * going to be overwritten in the other flows.
  805. * For now use the first channel we have.
  806. */
  807. ret = iwl_mvm_phy_ctxt_add(mvm, &mvm->phy_ctxts[i],
  808. &chandef, 1, 1);
  809. if (ret)
  810. goto error;
  811. }
  812. #ifdef CONFIG_THERMAL
  813. if (iwl_mvm_is_tt_in_fw(mvm)) {
  814. /* in order to give the responsibility of ct-kill and
  815. * TX backoff to FW we need to send empty temperature reporting
  816. * cmd during init time
  817. */
  818. iwl_mvm_send_temp_report_ths_cmd(mvm);
  819. } else {
  820. /* Initialize tx backoffs to the minimal possible */
  821. iwl_mvm_tt_tx_backoff(mvm, 0);
  822. }
  823. /* TODO: read the budget from BIOS / Platform NVM */
  824. if (iwl_mvm_is_ctdp_supported(mvm) && mvm->cooling_dev.cur_state > 0)
  825. ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_START,
  826. mvm->cooling_dev.cur_state);
  827. #else
  828. /* Initialize tx backoffs to the minimal possible */
  829. iwl_mvm_tt_tx_backoff(mvm, 0);
  830. #endif
  831. WARN_ON(iwl_mvm_config_ltr(mvm));
  832. ret = iwl_mvm_power_update_device(mvm);
  833. if (ret)
  834. goto error;
  835. /*
  836. * RTNL is not taken during Ct-kill, but we don't need to scan/Tx
  837. * anyway, so don't init MCC.
  838. */
  839. if (!test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status)) {
  840. ret = iwl_mvm_init_mcc(mvm);
  841. if (ret)
  842. goto error;
  843. }
  844. if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) {
  845. mvm->scan_type = IWL_SCAN_TYPE_NOT_SET;
  846. ret = iwl_mvm_config_scan(mvm);
  847. if (ret)
  848. goto error;
  849. }
  850. if (iwl_mvm_is_csum_supported(mvm) &&
  851. mvm->cfg->features & NETIF_F_RXCSUM)
  852. iwl_trans_write_prph(mvm->trans, RX_EN_CSUM, 0x3);
  853. /* allow FW/transport low power modes if not during restart */
  854. if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
  855. iwl_mvm_unref(mvm, IWL_MVM_REF_UCODE_DOWN);
  856. IWL_DEBUG_INFO(mvm, "RT uCode started.\n");
  857. return 0;
  858. error:
  859. iwl_trans_stop_device(mvm->trans);
  860. return ret;
  861. }
  862. int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm)
  863. {
  864. int ret, i;
  865. lockdep_assert_held(&mvm->mutex);
  866. ret = iwl_trans_start_hw(mvm->trans);
  867. if (ret)
  868. return ret;
  869. ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_WOWLAN);
  870. if (ret) {
  871. IWL_ERR(mvm, "Failed to start WoWLAN firmware: %d\n", ret);
  872. goto error;
  873. }
  874. ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm));
  875. if (ret)
  876. goto error;
  877. /* Send phy db control command and then phy db calibration*/
  878. ret = iwl_send_phy_db_data(mvm->phy_db);
  879. if (ret)
  880. goto error;
  881. ret = iwl_send_phy_cfg_cmd(mvm);
  882. if (ret)
  883. goto error;
  884. /* init the fw <-> mac80211 STA mapping */
  885. for (i = 0; i < IWL_MVM_STATION_COUNT; i++)
  886. RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL);
  887. /* Add auxiliary station for scanning */
  888. ret = iwl_mvm_add_aux_sta(mvm);
  889. if (ret)
  890. goto error;
  891. return 0;
  892. error:
  893. iwl_trans_stop_device(mvm->trans);
  894. return ret;
  895. }
  896. void iwl_mvm_rx_card_state_notif(struct iwl_mvm *mvm,
  897. struct iwl_rx_cmd_buffer *rxb)
  898. {
  899. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  900. struct iwl_card_state_notif *card_state_notif = (void *)pkt->data;
  901. u32 flags = le32_to_cpu(card_state_notif->flags);
  902. IWL_DEBUG_RF_KILL(mvm, "Card state received: HW:%s SW:%s CT:%s\n",
  903. (flags & HW_CARD_DISABLED) ? "Kill" : "On",
  904. (flags & SW_CARD_DISABLED) ? "Kill" : "On",
  905. (flags & CT_KILL_CARD_DISABLED) ?
  906. "Reached" : "Not reached");
  907. }
  908. void iwl_mvm_rx_mfuart_notif(struct iwl_mvm *mvm,
  909. struct iwl_rx_cmd_buffer *rxb)
  910. {
  911. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  912. struct iwl_mfuart_load_notif *mfuart_notif = (void *)pkt->data;
  913. IWL_DEBUG_INFO(mvm,
  914. "MFUART: installed ver: 0x%08x, external ver: 0x%08x, status: 0x%08x, duration: 0x%08x\n",
  915. le32_to_cpu(mfuart_notif->installed_ver),
  916. le32_to_cpu(mfuart_notif->external_ver),
  917. le32_to_cpu(mfuart_notif->status),
  918. le32_to_cpu(mfuart_notif->duration));
  919. }