bus.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #include "bus.h"
  7. #include "debug.h"
  8. #include "pci.h"
  9. enum cnss_dev_bus_type cnss_get_dev_bus_type(struct device *dev)
  10. {
  11. if (!dev)
  12. return CNSS_BUS_NONE;
  13. if (!dev->bus)
  14. return CNSS_BUS_NONE;
  15. if (memcmp(dev->bus->name, "pci", 3) == 0)
  16. return CNSS_BUS_PCI;
  17. else
  18. return CNSS_BUS_NONE;
  19. }
  20. enum cnss_dev_bus_type cnss_get_bus_type(struct cnss_plat_data *plat_priv)
  21. {
  22. int ret;
  23. struct device *dev;
  24. u32 bus_type_dt = CNSS_BUS_NONE;
  25. if (plat_priv->dt_type == CNSS_DTT_MULTIEXCHG) {
  26. dev = &plat_priv->plat_dev->dev;
  27. ret = of_property_read_u32(dev->of_node, "qcom,bus-type",
  28. &bus_type_dt);
  29. if (!ret)
  30. if (bus_type_dt < CNSS_BUS_MAX)
  31. cnss_pr_dbg("Got bus type[%u] from dt\n",
  32. bus_type_dt);
  33. else
  34. bus_type_dt = CNSS_BUS_NONE;
  35. else
  36. cnss_pr_err("No bus type for multi-exchg dt\n");
  37. return bus_type_dt;
  38. }
  39. switch (plat_priv->device_id) {
  40. case QCA6174_DEVICE_ID:
  41. case QCA6290_DEVICE_ID:
  42. case QCA6390_DEVICE_ID:
  43. case QCN7605_DEVICE_ID:
  44. case QCA6490_DEVICE_ID:
  45. case KIWI_DEVICE_ID:
  46. case MANGO_DEVICE_ID:
  47. case PEACH_DEVICE_ID:
  48. return CNSS_BUS_PCI;
  49. default:
  50. cnss_pr_err("Unknown device_id: 0x%lx\n", plat_priv->device_id);
  51. return CNSS_BUS_NONE;
  52. }
  53. }
  54. void *cnss_bus_dev_to_bus_priv(struct device *dev)
  55. {
  56. if (!dev)
  57. return NULL;
  58. switch (cnss_get_dev_bus_type(dev)) {
  59. case CNSS_BUS_PCI:
  60. return cnss_get_pci_priv(to_pci_dev(dev));
  61. default:
  62. return NULL;
  63. }
  64. }
  65. struct cnss_plat_data *cnss_bus_dev_to_plat_priv(struct device *dev)
  66. {
  67. void *bus_priv;
  68. if (!dev)
  69. return cnss_get_plat_priv(NULL);
  70. bus_priv = cnss_bus_dev_to_bus_priv(dev);
  71. if (!bus_priv)
  72. return NULL;
  73. switch (cnss_get_dev_bus_type(dev)) {
  74. case CNSS_BUS_PCI:
  75. return cnss_pci_priv_to_plat_priv(bus_priv);
  76. default:
  77. return NULL;
  78. }
  79. }
  80. int cnss_bus_init(struct cnss_plat_data *plat_priv)
  81. {
  82. if (!plat_priv)
  83. return -ENODEV;
  84. switch (plat_priv->bus_type) {
  85. case CNSS_BUS_PCI:
  86. return cnss_pci_init(plat_priv);
  87. default:
  88. cnss_pr_err("Unsupported bus type: %d\n",
  89. plat_priv->bus_type);
  90. return -EINVAL;
  91. }
  92. }
  93. void cnss_bus_deinit(struct cnss_plat_data *plat_priv)
  94. {
  95. if (!plat_priv)
  96. return;
  97. switch (plat_priv->bus_type) {
  98. case CNSS_BUS_PCI:
  99. return cnss_pci_deinit(plat_priv);
  100. default:
  101. cnss_pr_err("Unsupported bus type: %d\n",
  102. plat_priv->bus_type);
  103. return;
  104. }
  105. }
  106. void cnss_bus_add_fw_prefix_name(struct cnss_plat_data *plat_priv,
  107. char *prefix_name, char *name)
  108. {
  109. if (!plat_priv)
  110. return;
  111. switch (plat_priv->bus_type) {
  112. case CNSS_BUS_PCI:
  113. return cnss_pci_add_fw_prefix_name(plat_priv->bus_priv,
  114. prefix_name, name);
  115. default:
  116. cnss_pr_err("Unsupported bus type: %d\n",
  117. plat_priv->bus_type);
  118. return;
  119. }
  120. }
  121. int cnss_bus_load_m3(struct cnss_plat_data *plat_priv)
  122. {
  123. if (!plat_priv)
  124. return -ENODEV;
  125. switch (plat_priv->bus_type) {
  126. case CNSS_BUS_PCI:
  127. return cnss_pci_load_m3(plat_priv->bus_priv);
  128. default:
  129. cnss_pr_err("Unsupported bus type: %d\n",
  130. plat_priv->bus_type);
  131. return -EINVAL;
  132. }
  133. }
  134. int cnss_bus_handle_dev_sol_irq(struct cnss_plat_data *plat_priv)
  135. {
  136. if (!plat_priv)
  137. return -ENODEV;
  138. switch (plat_priv->bus_type) {
  139. case CNSS_BUS_PCI:
  140. return cnss_pci_handle_dev_sol_irq(plat_priv->bus_priv);
  141. default:
  142. cnss_pr_err("Unsupported bus type: %d\n",
  143. plat_priv->bus_type);
  144. return -EINVAL;
  145. }
  146. }
  147. int cnss_bus_alloc_fw_mem(struct cnss_plat_data *plat_priv)
  148. {
  149. if (!plat_priv)
  150. return -ENODEV;
  151. switch (plat_priv->bus_type) {
  152. case CNSS_BUS_PCI:
  153. return cnss_pci_alloc_fw_mem(plat_priv->bus_priv);
  154. default:
  155. cnss_pr_err("Unsupported bus type: %d\n",
  156. plat_priv->bus_type);
  157. return -EINVAL;
  158. }
  159. }
  160. int cnss_bus_alloc_qdss_mem(struct cnss_plat_data *plat_priv)
  161. {
  162. if (!plat_priv)
  163. return -ENODEV;
  164. switch (plat_priv->bus_type) {
  165. case CNSS_BUS_PCI:
  166. return cnss_pci_alloc_qdss_mem(plat_priv->bus_priv);
  167. default:
  168. cnss_pr_err("Unsupported bus type: %d\n",
  169. plat_priv->bus_type);
  170. return -EINVAL;
  171. }
  172. }
  173. void cnss_bus_free_qdss_mem(struct cnss_plat_data *plat_priv)
  174. {
  175. if (!plat_priv)
  176. return;
  177. switch (plat_priv->bus_type) {
  178. case CNSS_BUS_PCI:
  179. cnss_pci_free_qdss_mem(plat_priv->bus_priv);
  180. return;
  181. default:
  182. cnss_pr_err("Unsupported bus type: %d\n",
  183. plat_priv->bus_type);
  184. return;
  185. }
  186. }
  187. u32 cnss_bus_get_wake_irq(struct cnss_plat_data *plat_priv)
  188. {
  189. if (!plat_priv)
  190. return -ENODEV;
  191. switch (plat_priv->bus_type) {
  192. case CNSS_BUS_PCI:
  193. return cnss_pci_get_wake_msi(plat_priv->bus_priv);
  194. default:
  195. cnss_pr_err("Unsupported bus type: %d\n",
  196. plat_priv->bus_type);
  197. return -EINVAL;
  198. }
  199. }
  200. int cnss_bus_force_fw_assert_hdlr(struct cnss_plat_data *plat_priv)
  201. {
  202. if (!plat_priv)
  203. return -ENODEV;
  204. switch (plat_priv->bus_type) {
  205. case CNSS_BUS_PCI:
  206. return cnss_pci_force_fw_assert_hdlr(plat_priv->bus_priv);
  207. default:
  208. cnss_pr_err("Unsupported bus type: %d\n",
  209. plat_priv->bus_type);
  210. return -EINVAL;
  211. }
  212. }
  213. int cnss_bus_qmi_send_get(struct cnss_plat_data *plat_priv)
  214. {
  215. if (!plat_priv)
  216. return -ENODEV;
  217. switch (plat_priv->bus_type) {
  218. case CNSS_BUS_PCI:
  219. return cnss_pci_qmi_send_get(plat_priv->bus_priv);
  220. default:
  221. cnss_pr_err("Unsupported bus type: %d\n",
  222. plat_priv->bus_type);
  223. return -EINVAL;
  224. }
  225. }
  226. int cnss_bus_qmi_send_put(struct cnss_plat_data *plat_priv)
  227. {
  228. if (!plat_priv)
  229. return -ENODEV;
  230. switch (plat_priv->bus_type) {
  231. case CNSS_BUS_PCI:
  232. return cnss_pci_qmi_send_put(plat_priv->bus_priv);
  233. default:
  234. cnss_pr_err("Unsupported bus type: %d\n",
  235. plat_priv->bus_type);
  236. return -EINVAL;
  237. }
  238. }
  239. void cnss_bus_fw_boot_timeout_hdlr(struct timer_list *t)
  240. {
  241. struct cnss_plat_data *plat_priv =
  242. from_timer(plat_priv, t, fw_boot_timer);
  243. if (!plat_priv)
  244. return;
  245. switch (plat_priv->bus_type) {
  246. case CNSS_BUS_PCI:
  247. return cnss_pci_fw_boot_timeout_hdlr(plat_priv->bus_priv);
  248. default:
  249. cnss_pr_err("Unsupported bus type: %d\n",
  250. plat_priv->bus_type);
  251. return;
  252. }
  253. }
  254. void cnss_bus_collect_dump_info(struct cnss_plat_data *plat_priv, bool in_panic)
  255. {
  256. if (!plat_priv)
  257. return;
  258. switch (plat_priv->bus_type) {
  259. case CNSS_BUS_PCI:
  260. return cnss_pci_collect_dump_info(plat_priv->bus_priv,
  261. in_panic);
  262. default:
  263. cnss_pr_err("Unsupported bus type: %d\n",
  264. plat_priv->bus_type);
  265. return;
  266. }
  267. }
  268. void cnss_bus_device_crashed(struct cnss_plat_data *plat_priv)
  269. {
  270. if (!plat_priv)
  271. return;
  272. switch (plat_priv->bus_type) {
  273. case CNSS_BUS_PCI:
  274. return cnss_pci_device_crashed(plat_priv->bus_priv);
  275. default:
  276. cnss_pr_err("Unsupported bus type: %d\n",
  277. plat_priv->bus_type);
  278. return;
  279. }
  280. }
  281. int cnss_bus_call_driver_probe(struct cnss_plat_data *plat_priv)
  282. {
  283. if (!plat_priv)
  284. return -ENODEV;
  285. switch (plat_priv->bus_type) {
  286. case CNSS_BUS_PCI:
  287. return cnss_pci_call_driver_probe(plat_priv->bus_priv);
  288. default:
  289. cnss_pr_err("Unsupported bus type: %d\n",
  290. plat_priv->bus_type);
  291. return -EINVAL;
  292. }
  293. }
  294. int cnss_bus_call_driver_remove(struct cnss_plat_data *plat_priv)
  295. {
  296. if (!plat_priv)
  297. return -ENODEV;
  298. switch (plat_priv->bus_type) {
  299. case CNSS_BUS_PCI:
  300. return cnss_pci_call_driver_remove(plat_priv->bus_priv);
  301. default:
  302. cnss_pr_err("Unsupported bus type: %d\n",
  303. plat_priv->bus_type);
  304. return -EINVAL;
  305. }
  306. }
  307. int cnss_bus_dev_powerup(struct cnss_plat_data *plat_priv)
  308. {
  309. if (!plat_priv)
  310. return -ENODEV;
  311. switch (plat_priv->bus_type) {
  312. case CNSS_BUS_PCI:
  313. return cnss_pci_dev_powerup(plat_priv->bus_priv);
  314. default:
  315. cnss_pr_err("Unsupported bus type: %d\n",
  316. plat_priv->bus_type);
  317. return -EINVAL;
  318. }
  319. }
  320. int cnss_bus_dev_shutdown(struct cnss_plat_data *plat_priv)
  321. {
  322. if (!plat_priv)
  323. return -ENODEV;
  324. switch (plat_priv->bus_type) {
  325. case CNSS_BUS_PCI:
  326. return cnss_pci_dev_shutdown(plat_priv->bus_priv);
  327. default:
  328. cnss_pr_err("Unsupported bus type: %d\n",
  329. plat_priv->bus_type);
  330. return -EINVAL;
  331. }
  332. }
  333. int cnss_bus_dev_crash_shutdown(struct cnss_plat_data *plat_priv)
  334. {
  335. if (!plat_priv)
  336. return -ENODEV;
  337. switch (plat_priv->bus_type) {
  338. case CNSS_BUS_PCI:
  339. return cnss_pci_dev_crash_shutdown(plat_priv->bus_priv);
  340. default:
  341. cnss_pr_err("Unsupported bus type: %d\n",
  342. plat_priv->bus_type);
  343. return -EINVAL;
  344. }
  345. }
  346. int cnss_bus_dev_ramdump(struct cnss_plat_data *plat_priv)
  347. {
  348. if (!plat_priv)
  349. return -ENODEV;
  350. switch (plat_priv->bus_type) {
  351. case CNSS_BUS_PCI:
  352. return cnss_pci_dev_ramdump(plat_priv->bus_priv);
  353. default:
  354. cnss_pr_err("Unsupported bus type: %d\n",
  355. plat_priv->bus_type);
  356. return -EINVAL;
  357. }
  358. }
  359. int cnss_bus_register_driver_hdlr(struct cnss_plat_data *plat_priv, void *data)
  360. {
  361. if (!plat_priv)
  362. return -ENODEV;
  363. switch (plat_priv->bus_type) {
  364. case CNSS_BUS_PCI:
  365. return cnss_pci_register_driver_hdlr(plat_priv->bus_priv, data);
  366. default:
  367. cnss_pr_err("Unsupported bus type: %d\n",
  368. plat_priv->bus_type);
  369. return -EINVAL;
  370. }
  371. }
  372. int cnss_bus_unregister_driver_hdlr(struct cnss_plat_data *plat_priv)
  373. {
  374. if (!plat_priv)
  375. return -ENODEV;
  376. switch (plat_priv->bus_type) {
  377. case CNSS_BUS_PCI:
  378. return cnss_pci_unregister_driver_hdlr(plat_priv->bus_priv);
  379. default:
  380. cnss_pr_err("Unsupported bus type: %d\n",
  381. plat_priv->bus_type);
  382. return -EINVAL;
  383. }
  384. }
  385. int cnss_bus_call_driver_modem_status(struct cnss_plat_data *plat_priv,
  386. int modem_current_status)
  387. {
  388. if (!plat_priv)
  389. return -ENODEV;
  390. switch (plat_priv->bus_type) {
  391. case CNSS_BUS_PCI:
  392. return cnss_pci_call_driver_modem_status(plat_priv->bus_priv,
  393. modem_current_status);
  394. default:
  395. cnss_pr_err("Unsupported bus type: %d\n",
  396. plat_priv->bus_type);
  397. return -EINVAL;
  398. }
  399. }
  400. int cnss_bus_update_status(struct cnss_plat_data *plat_priv,
  401. enum cnss_driver_status status)
  402. {
  403. if (!plat_priv)
  404. return -ENODEV;
  405. switch (plat_priv->bus_type) {
  406. case CNSS_BUS_PCI:
  407. return cnss_pci_update_status(plat_priv->bus_priv, status);
  408. default:
  409. cnss_pr_err("Unsupported bus type: %d\n",
  410. plat_priv->bus_type);
  411. return -EINVAL;
  412. }
  413. }
  414. int cnss_bus_update_uevent(struct cnss_plat_data *plat_priv,
  415. enum cnss_driver_status status, void *data)
  416. {
  417. if (!plat_priv)
  418. return -ENODEV;
  419. switch (plat_priv->bus_type) {
  420. case CNSS_BUS_PCI:
  421. return cnss_pci_call_driver_uevent(plat_priv->bus_priv,
  422. status, data);
  423. default:
  424. cnss_pr_err("Unsupported bus type: %d\n",
  425. plat_priv->bus_type);
  426. return -EINVAL;
  427. }
  428. }
  429. int cnss_bus_is_device_down(struct cnss_plat_data *plat_priv)
  430. {
  431. if (!plat_priv)
  432. return -ENODEV;
  433. switch (plat_priv->bus_type) {
  434. case CNSS_BUS_PCI:
  435. return cnss_pcie_is_device_down(plat_priv->bus_priv);
  436. default:
  437. cnss_pr_dbg("Unsupported bus type: %d\n",
  438. plat_priv->bus_type);
  439. return 0;
  440. }
  441. }
  442. int cnss_bus_check_link_status(struct cnss_plat_data *plat_priv)
  443. {
  444. if (!plat_priv)
  445. return -ENODEV;
  446. switch (plat_priv->bus_type) {
  447. case CNSS_BUS_PCI:
  448. return cnss_pci_check_link_status(plat_priv->bus_priv);
  449. default:
  450. cnss_pr_dbg("Unsupported bus type: %d\n",
  451. plat_priv->bus_type);
  452. return 0;
  453. }
  454. }
  455. int cnss_bus_recover_link_down(struct cnss_plat_data *plat_priv)
  456. {
  457. if (!plat_priv)
  458. return -ENODEV;
  459. switch (plat_priv->bus_type) {
  460. case CNSS_BUS_PCI:
  461. return cnss_pci_recover_link_down(plat_priv->bus_priv);
  462. default:
  463. cnss_pr_dbg("Unsupported bus type: %d\n",
  464. plat_priv->bus_type);
  465. return -EINVAL;
  466. }
  467. }
  468. int cnss_bus_debug_reg_read(struct cnss_plat_data *plat_priv, u32 offset,
  469. u32 *val, bool raw_access)
  470. {
  471. if (!plat_priv)
  472. return -ENODEV;
  473. switch (plat_priv->bus_type) {
  474. case CNSS_BUS_PCI:
  475. return cnss_pci_debug_reg_read(plat_priv->bus_priv, offset,
  476. val, raw_access);
  477. default:
  478. cnss_pr_dbg("Unsupported bus type: %d\n",
  479. plat_priv->bus_type);
  480. return 0;
  481. }
  482. }
  483. int cnss_bus_debug_reg_write(struct cnss_plat_data *plat_priv, u32 offset,
  484. u32 val, bool raw_access)
  485. {
  486. if (!plat_priv)
  487. return -ENODEV;
  488. switch (plat_priv->bus_type) {
  489. case CNSS_BUS_PCI:
  490. return cnss_pci_debug_reg_write(plat_priv->bus_priv, offset,
  491. val, raw_access);
  492. default:
  493. cnss_pr_dbg("Unsupported bus type: %d\n",
  494. plat_priv->bus_type);
  495. return 0;
  496. }
  497. }
  498. int cnss_bus_get_iova(struct cnss_plat_data *plat_priv, u64 *addr, u64 *size)
  499. {
  500. if (!plat_priv)
  501. return -ENODEV;
  502. switch (plat_priv->bus_type) {
  503. case CNSS_BUS_PCI:
  504. return cnss_pci_get_iova(plat_priv->bus_priv, addr, size);
  505. default:
  506. cnss_pr_err("Unsupported bus type: %d\n",
  507. plat_priv->bus_type);
  508. return -EINVAL;
  509. }
  510. }
  511. int cnss_bus_get_iova_ipa(struct cnss_plat_data *plat_priv, u64 *addr,
  512. u64 *size)
  513. {
  514. if (!plat_priv)
  515. return -ENODEV;
  516. switch (plat_priv->bus_type) {
  517. case CNSS_BUS_PCI:
  518. return cnss_pci_get_iova_ipa(plat_priv->bus_priv, addr, size);
  519. default:
  520. cnss_pr_err("Unsupported bus type: %d\n",
  521. plat_priv->bus_type);
  522. return -EINVAL;
  523. }
  524. }
  525. bool cnss_bus_is_smmu_s1_enabled(struct cnss_plat_data *plat_priv)
  526. {
  527. if (!plat_priv)
  528. return false;
  529. switch (plat_priv->bus_type) {
  530. case CNSS_BUS_PCI:
  531. return cnss_pci_is_smmu_s1_enabled(plat_priv->bus_priv);
  532. default:
  533. cnss_pr_err("Unsupported bus type: %d\n",
  534. plat_priv->bus_type);
  535. return false;
  536. }
  537. }
  538. int cnss_bus_update_time_sync_period(struct cnss_plat_data *plat_priv,
  539. unsigned int time_sync_period)
  540. {
  541. if (!plat_priv)
  542. return -ENODEV;
  543. switch (plat_priv->bus_type) {
  544. case CNSS_BUS_PCI:
  545. return cnss_pci_update_time_sync_period(plat_priv->bus_priv,
  546. time_sync_period);
  547. default:
  548. cnss_pr_err("Unsupported bus type: %d\n",
  549. plat_priv->bus_type);
  550. return -EINVAL;
  551. }
  552. }
  553. int cnss_bus_set_therm_cdev_state(struct cnss_plat_data *plat_priv,
  554. unsigned long thermal_state,
  555. int tcdev_id)
  556. {
  557. if (!plat_priv)
  558. return -ENODEV;
  559. switch (plat_priv->bus_type) {
  560. case CNSS_BUS_PCI:
  561. return cnss_pci_set_therm_cdev_state(plat_priv->bus_priv,
  562. thermal_state,
  563. tcdev_id);
  564. default:
  565. cnss_pr_err("Unsupported bus type: %d\n", plat_priv->bus_type);
  566. return -EINVAL;
  567. }
  568. }
  569. int cnss_bus_get_msi_assignment(struct cnss_plat_data *plat_priv,
  570. char *msi_name,
  571. int *num_vectors,
  572. u32 *user_base_data,
  573. u32 *base_vector)
  574. {
  575. if (!plat_priv)
  576. return -ENODEV;
  577. switch (plat_priv->bus_type) {
  578. case CNSS_BUS_PCI:
  579. return cnss_pci_get_user_msi_assignment(plat_priv->bus_priv,
  580. msi_name,
  581. num_vectors,
  582. user_base_data,
  583. base_vector);
  584. default:
  585. cnss_pr_err("Unsupported bus type: %d\n", plat_priv->bus_type);
  586. return -EINVAL;
  587. }
  588. }
  589. #if IS_ENABLED(CONFIG_MHI_BUS_MISC)
  590. void cnss_bus_disable_mhi_satellite_cfg(struct cnss_plat_data *plat_priv)
  591. {
  592. struct cnss_pci_data *pci_priv;
  593. pci_priv = plat_priv->bus_priv;
  594. if (!pci_priv) {
  595. cnss_pr_err("mhi satellite could not be disabled since pci_priv is NULL\n");
  596. return;
  597. }
  598. switch (plat_priv->bus_type) {
  599. case CNSS_BUS_PCI:
  600. /* MHI satellite configuration is only for KIWI V2 and
  601. * that too only in DRV mode.
  602. */
  603. if (plat_priv->device_id == KIWI_DEVICE_ID &&
  604. plat_priv->device_version.major_version == FW_V2_NUMBER) {
  605. cnss_pr_dbg("Remove MHI satellite configuration\n");
  606. return cnss_mhi_controller_set_base(pci_priv, 0);
  607. }
  608. break;
  609. default:
  610. cnss_pr_dbg("Unsupported bus type: %d, ignore disable mhi satellite cfg\n",
  611. plat_priv->bus_type);
  612. return;
  613. }
  614. return;
  615. }
  616. #else
  617. void cnss_bus_disable_mhi_satellite_cfg(struct cnss_plat_data *pci_priv)
  618. {
  619. }
  620. #endif