qcom_scm.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /*
  2. * Qualcomm SCM driver
  3. *
  4. * Copyright (c) 2010,2015, The Linux Foundation. All rights reserved.
  5. * Copyright (C) 2015 Linaro Ltd.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 and
  9. * only version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #include <linux/platform_device.h>
  18. #include <linux/init.h>
  19. #include <linux/cpumask.h>
  20. #include <linux/export.h>
  21. #include <linux/dma-mapping.h>
  22. #include <linux/module.h>
  23. #include <linux/types.h>
  24. #include <linux/qcom_scm.h>
  25. #include <linux/of.h>
  26. #include <linux/of_address.h>
  27. #include <linux/of_platform.h>
  28. #include <linux/clk.h>
  29. #include <linux/reset-controller.h>
  30. #include "qcom_scm.h"
  31. static bool download_mode = IS_ENABLED(CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT);
  32. module_param(download_mode, bool, 0);
  33. #define SCM_HAS_CORE_CLK BIT(0)
  34. #define SCM_HAS_IFACE_CLK BIT(1)
  35. #define SCM_HAS_BUS_CLK BIT(2)
  36. struct qcom_scm {
  37. struct device *dev;
  38. struct clk *core_clk;
  39. struct clk *iface_clk;
  40. struct clk *bus_clk;
  41. struct reset_controller_dev reset;
  42. u64 dload_mode_addr;
  43. };
  44. struct qcom_scm_current_perm_info {
  45. __le32 vmid;
  46. __le32 perm;
  47. __le64 ctx;
  48. __le32 ctx_size;
  49. __le32 unused;
  50. };
  51. struct qcom_scm_mem_map_info {
  52. __le64 mem_addr;
  53. __le64 mem_size;
  54. };
  55. static struct qcom_scm *__scm;
  56. static int qcom_scm_clk_enable(void)
  57. {
  58. int ret;
  59. ret = clk_prepare_enable(__scm->core_clk);
  60. if (ret)
  61. goto bail;
  62. ret = clk_prepare_enable(__scm->iface_clk);
  63. if (ret)
  64. goto disable_core;
  65. ret = clk_prepare_enable(__scm->bus_clk);
  66. if (ret)
  67. goto disable_iface;
  68. return 0;
  69. disable_iface:
  70. clk_disable_unprepare(__scm->iface_clk);
  71. disable_core:
  72. clk_disable_unprepare(__scm->core_clk);
  73. bail:
  74. return ret;
  75. }
  76. static void qcom_scm_clk_disable(void)
  77. {
  78. clk_disable_unprepare(__scm->core_clk);
  79. clk_disable_unprepare(__scm->iface_clk);
  80. clk_disable_unprepare(__scm->bus_clk);
  81. }
  82. /**
  83. * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
  84. * @entry: Entry point function for the cpus
  85. * @cpus: The cpumask of cpus that will use the entry point
  86. *
  87. * Set the cold boot address of the cpus. Any cpu outside the supported
  88. * range would be removed from the cpu present mask.
  89. */
  90. int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
  91. {
  92. return __qcom_scm_set_cold_boot_addr(entry, cpus);
  93. }
  94. EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr);
  95. /**
  96. * qcom_scm_set_warm_boot_addr() - Set the warm boot address for cpus
  97. * @entry: Entry point function for the cpus
  98. * @cpus: The cpumask of cpus that will use the entry point
  99. *
  100. * Set the Linux entry point for the SCM to transfer control to when coming
  101. * out of a power down. CPU power down may be executed on cpuidle or hotplug.
  102. */
  103. int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
  104. {
  105. return __qcom_scm_set_warm_boot_addr(__scm->dev, entry, cpus);
  106. }
  107. EXPORT_SYMBOL(qcom_scm_set_warm_boot_addr);
  108. /**
  109. * qcom_scm_cpu_power_down() - Power down the cpu
  110. * @flags - Flags to flush cache
  111. *
  112. * This is an end point to power down cpu. If there was a pending interrupt,
  113. * the control would return from this function, otherwise, the cpu jumps to the
  114. * warm boot entry point set for this cpu upon reset.
  115. */
  116. void qcom_scm_cpu_power_down(u32 flags)
  117. {
  118. __qcom_scm_cpu_power_down(flags);
  119. }
  120. EXPORT_SYMBOL(qcom_scm_cpu_power_down);
  121. /**
  122. * qcom_scm_hdcp_available() - Check if secure environment supports HDCP.
  123. *
  124. * Return true if HDCP is supported, false if not.
  125. */
  126. bool qcom_scm_hdcp_available(void)
  127. {
  128. int ret = qcom_scm_clk_enable();
  129. if (ret)
  130. return ret;
  131. ret = __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_HDCP,
  132. QCOM_SCM_CMD_HDCP);
  133. qcom_scm_clk_disable();
  134. return ret > 0 ? true : false;
  135. }
  136. EXPORT_SYMBOL(qcom_scm_hdcp_available);
  137. /**
  138. * qcom_scm_hdcp_req() - Send HDCP request.
  139. * @req: HDCP request array
  140. * @req_cnt: HDCP request array count
  141. * @resp: response buffer passed to SCM
  142. *
  143. * Write HDCP register(s) through SCM.
  144. */
  145. int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp)
  146. {
  147. int ret = qcom_scm_clk_enable();
  148. if (ret)
  149. return ret;
  150. ret = __qcom_scm_hdcp_req(__scm->dev, req, req_cnt, resp);
  151. qcom_scm_clk_disable();
  152. return ret;
  153. }
  154. EXPORT_SYMBOL(qcom_scm_hdcp_req);
  155. /**
  156. * qcom_scm_pas_supported() - Check if the peripheral authentication service is
  157. * available for the given peripherial
  158. * @peripheral: peripheral id
  159. *
  160. * Returns true if PAS is supported for this peripheral, otherwise false.
  161. */
  162. bool qcom_scm_pas_supported(u32 peripheral)
  163. {
  164. int ret;
  165. ret = __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_PIL,
  166. QCOM_SCM_PAS_IS_SUPPORTED_CMD);
  167. if (ret <= 0)
  168. return false;
  169. return __qcom_scm_pas_supported(__scm->dev, peripheral);
  170. }
  171. EXPORT_SYMBOL(qcom_scm_pas_supported);
  172. /**
  173. * qcom_scm_pas_init_image() - Initialize peripheral authentication service
  174. * state machine for a given peripheral, using the
  175. * metadata
  176. * @peripheral: peripheral id
  177. * @metadata: pointer to memory containing ELF header, program header table
  178. * and optional blob of data used for authenticating the metadata
  179. * and the rest of the firmware
  180. * @size: size of the metadata
  181. *
  182. * Returns 0 on success.
  183. */
  184. int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size)
  185. {
  186. dma_addr_t mdata_phys;
  187. void *mdata_buf;
  188. int ret;
  189. /*
  190. * During the scm call memory protection will be enabled for the meta
  191. * data blob, so make sure it's physically contiguous, 4K aligned and
  192. * non-cachable to avoid XPU violations.
  193. */
  194. mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys,
  195. GFP_KERNEL);
  196. if (!mdata_buf) {
  197. dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
  198. return -ENOMEM;
  199. }
  200. memcpy(mdata_buf, metadata, size);
  201. ret = qcom_scm_clk_enable();
  202. if (ret)
  203. goto free_metadata;
  204. ret = __qcom_scm_pas_init_image(__scm->dev, peripheral, mdata_phys);
  205. qcom_scm_clk_disable();
  206. free_metadata:
  207. dma_free_coherent(__scm->dev, size, mdata_buf, mdata_phys);
  208. return ret;
  209. }
  210. EXPORT_SYMBOL(qcom_scm_pas_init_image);
  211. /**
  212. * qcom_scm_pas_mem_setup() - Prepare the memory related to a given peripheral
  213. * for firmware loading
  214. * @peripheral: peripheral id
  215. * @addr: start address of memory area to prepare
  216. * @size: size of the memory area to prepare
  217. *
  218. * Returns 0 on success.
  219. */
  220. int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size)
  221. {
  222. int ret;
  223. ret = qcom_scm_clk_enable();
  224. if (ret)
  225. return ret;
  226. ret = __qcom_scm_pas_mem_setup(__scm->dev, peripheral, addr, size);
  227. qcom_scm_clk_disable();
  228. return ret;
  229. }
  230. EXPORT_SYMBOL(qcom_scm_pas_mem_setup);
  231. /**
  232. * qcom_scm_pas_auth_and_reset() - Authenticate the given peripheral firmware
  233. * and reset the remote processor
  234. * @peripheral: peripheral id
  235. *
  236. * Return 0 on success.
  237. */
  238. int qcom_scm_pas_auth_and_reset(u32 peripheral)
  239. {
  240. int ret;
  241. ret = qcom_scm_clk_enable();
  242. if (ret)
  243. return ret;
  244. ret = __qcom_scm_pas_auth_and_reset(__scm->dev, peripheral);
  245. qcom_scm_clk_disable();
  246. return ret;
  247. }
  248. EXPORT_SYMBOL(qcom_scm_pas_auth_and_reset);
  249. /**
  250. * qcom_scm_pas_shutdown() - Shut down the remote processor
  251. * @peripheral: peripheral id
  252. *
  253. * Returns 0 on success.
  254. */
  255. int qcom_scm_pas_shutdown(u32 peripheral)
  256. {
  257. int ret;
  258. ret = qcom_scm_clk_enable();
  259. if (ret)
  260. return ret;
  261. ret = __qcom_scm_pas_shutdown(__scm->dev, peripheral);
  262. qcom_scm_clk_disable();
  263. return ret;
  264. }
  265. EXPORT_SYMBOL(qcom_scm_pas_shutdown);
  266. static int qcom_scm_pas_reset_assert(struct reset_controller_dev *rcdev,
  267. unsigned long idx)
  268. {
  269. if (idx != 0)
  270. return -EINVAL;
  271. return __qcom_scm_pas_mss_reset(__scm->dev, 1);
  272. }
  273. static int qcom_scm_pas_reset_deassert(struct reset_controller_dev *rcdev,
  274. unsigned long idx)
  275. {
  276. if (idx != 0)
  277. return -EINVAL;
  278. return __qcom_scm_pas_mss_reset(__scm->dev, 0);
  279. }
  280. static const struct reset_control_ops qcom_scm_pas_reset_ops = {
  281. .assert = qcom_scm_pas_reset_assert,
  282. .deassert = qcom_scm_pas_reset_deassert,
  283. };
  284. int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare)
  285. {
  286. return __qcom_scm_restore_sec_cfg(__scm->dev, device_id, spare);
  287. }
  288. EXPORT_SYMBOL(qcom_scm_restore_sec_cfg);
  289. int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size)
  290. {
  291. return __qcom_scm_iommu_secure_ptbl_size(__scm->dev, spare, size);
  292. }
  293. EXPORT_SYMBOL(qcom_scm_iommu_secure_ptbl_size);
  294. int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare)
  295. {
  296. return __qcom_scm_iommu_secure_ptbl_init(__scm->dev, addr, size, spare);
  297. }
  298. EXPORT_SYMBOL(qcom_scm_iommu_secure_ptbl_init);
  299. int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val)
  300. {
  301. return __qcom_scm_io_readl(__scm->dev, addr, val);
  302. }
  303. EXPORT_SYMBOL(qcom_scm_io_readl);
  304. int qcom_scm_io_writel(phys_addr_t addr, unsigned int val)
  305. {
  306. return __qcom_scm_io_writel(__scm->dev, addr, val);
  307. }
  308. EXPORT_SYMBOL(qcom_scm_io_writel);
  309. static void qcom_scm_set_download_mode(bool enable)
  310. {
  311. bool avail;
  312. int ret = 0;
  313. avail = __qcom_scm_is_call_available(__scm->dev,
  314. QCOM_SCM_SVC_BOOT,
  315. QCOM_SCM_SET_DLOAD_MODE);
  316. if (avail) {
  317. ret = __qcom_scm_set_dload_mode(__scm->dev, enable);
  318. } else if (__scm->dload_mode_addr) {
  319. ret = __qcom_scm_io_writel(__scm->dev, __scm->dload_mode_addr,
  320. enable ? QCOM_SCM_SET_DLOAD_MODE : 0);
  321. } else {
  322. dev_err(__scm->dev,
  323. "No available mechanism for setting download mode\n");
  324. }
  325. if (ret)
  326. dev_err(__scm->dev, "failed to set download mode: %d\n", ret);
  327. }
  328. static int qcom_scm_find_dload_address(struct device *dev, u64 *addr)
  329. {
  330. struct device_node *tcsr;
  331. struct device_node *np = dev->of_node;
  332. struct resource res;
  333. u32 offset;
  334. int ret;
  335. tcsr = of_parse_phandle(np, "qcom,dload-mode", 0);
  336. if (!tcsr)
  337. return 0;
  338. ret = of_address_to_resource(tcsr, 0, &res);
  339. of_node_put(tcsr);
  340. if (ret)
  341. return ret;
  342. ret = of_property_read_u32_index(np, "qcom,dload-mode", 1, &offset);
  343. if (ret < 0)
  344. return ret;
  345. *addr = res.start + offset;
  346. return 0;
  347. }
  348. /**
  349. * qcom_scm_is_available() - Checks if SCM is available
  350. */
  351. bool qcom_scm_is_available(void)
  352. {
  353. return !!__scm;
  354. }
  355. EXPORT_SYMBOL(qcom_scm_is_available);
  356. int qcom_scm_set_remote_state(u32 state, u32 id)
  357. {
  358. return __qcom_scm_set_remote_state(__scm->dev, state, id);
  359. }
  360. EXPORT_SYMBOL(qcom_scm_set_remote_state);
  361. /**
  362. * qcom_scm_assign_mem() - Make a secure call to reassign memory ownership
  363. * @mem_addr: mem region whose ownership need to be reassigned
  364. * @mem_sz: size of the region.
  365. * @srcvm: vmid for current set of owners, each set bit in
  366. * flag indicate a unique owner
  367. * @newvm: array having new owners and corrsponding permission
  368. * flags
  369. * @dest_cnt: number of owners in next set.
  370. *
  371. * Return negative errno on failure, 0 on success, with @srcvm updated.
  372. */
  373. int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
  374. unsigned int *srcvm,
  375. struct qcom_scm_vmperm *newvm, int dest_cnt)
  376. {
  377. struct qcom_scm_current_perm_info *destvm;
  378. struct qcom_scm_mem_map_info *mem_to_map;
  379. phys_addr_t mem_to_map_phys;
  380. phys_addr_t dest_phys;
  381. dma_addr_t ptr_phys;
  382. size_t mem_to_map_sz;
  383. size_t dest_sz;
  384. size_t src_sz;
  385. size_t ptr_sz;
  386. int next_vm;
  387. __le32 *src;
  388. void *ptr;
  389. int ret;
  390. int len;
  391. int i;
  392. src_sz = hweight_long(*srcvm) * sizeof(*src);
  393. mem_to_map_sz = sizeof(*mem_to_map);
  394. dest_sz = dest_cnt * sizeof(*destvm);
  395. ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) +
  396. ALIGN(dest_sz, SZ_64);
  397. ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_phys, GFP_KERNEL);
  398. if (!ptr)
  399. return -ENOMEM;
  400. /* Fill source vmid detail */
  401. src = ptr;
  402. len = hweight_long(*srcvm);
  403. for (i = 0; i < len; i++) {
  404. src[i] = cpu_to_le32(ffs(*srcvm) - 1);
  405. *srcvm ^= 1 << (ffs(*srcvm) - 1);
  406. }
  407. /* Fill details of mem buff to map */
  408. mem_to_map = ptr + ALIGN(src_sz, SZ_64);
  409. mem_to_map_phys = ptr_phys + ALIGN(src_sz, SZ_64);
  410. mem_to_map[0].mem_addr = cpu_to_le64(mem_addr);
  411. mem_to_map[0].mem_size = cpu_to_le64(mem_sz);
  412. next_vm = 0;
  413. /* Fill details of next vmid detail */
  414. destvm = ptr + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);
  415. dest_phys = ptr_phys + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);
  416. for (i = 0; i < dest_cnt; i++) {
  417. destvm[i].vmid = cpu_to_le32(newvm[i].vmid);
  418. destvm[i].perm = cpu_to_le32(newvm[i].perm);
  419. destvm[i].ctx = 0;
  420. destvm[i].ctx_size = 0;
  421. next_vm |= BIT(newvm[i].vmid);
  422. }
  423. ret = __qcom_scm_assign_mem(__scm->dev, mem_to_map_phys, mem_to_map_sz,
  424. ptr_phys, src_sz, dest_phys, dest_sz);
  425. dma_free_coherent(__scm->dev, ptr_sz, ptr, ptr_phys);
  426. if (ret) {
  427. dev_err(__scm->dev,
  428. "Assign memory protection call failed %d.\n", ret);
  429. return -EINVAL;
  430. }
  431. *srcvm = next_vm;
  432. return 0;
  433. }
  434. EXPORT_SYMBOL(qcom_scm_assign_mem);
  435. static int qcom_scm_probe(struct platform_device *pdev)
  436. {
  437. struct qcom_scm *scm;
  438. unsigned long clks;
  439. int ret;
  440. scm = devm_kzalloc(&pdev->dev, sizeof(*scm), GFP_KERNEL);
  441. if (!scm)
  442. return -ENOMEM;
  443. ret = qcom_scm_find_dload_address(&pdev->dev, &scm->dload_mode_addr);
  444. if (ret < 0)
  445. return ret;
  446. clks = (unsigned long)of_device_get_match_data(&pdev->dev);
  447. if (clks & SCM_HAS_CORE_CLK) {
  448. scm->core_clk = devm_clk_get(&pdev->dev, "core");
  449. if (IS_ERR(scm->core_clk)) {
  450. if (PTR_ERR(scm->core_clk) != -EPROBE_DEFER)
  451. dev_err(&pdev->dev,
  452. "failed to acquire core clk\n");
  453. return PTR_ERR(scm->core_clk);
  454. }
  455. }
  456. if (clks & SCM_HAS_IFACE_CLK) {
  457. scm->iface_clk = devm_clk_get(&pdev->dev, "iface");
  458. if (IS_ERR(scm->iface_clk)) {
  459. if (PTR_ERR(scm->iface_clk) != -EPROBE_DEFER)
  460. dev_err(&pdev->dev,
  461. "failed to acquire iface clk\n");
  462. return PTR_ERR(scm->iface_clk);
  463. }
  464. }
  465. if (clks & SCM_HAS_BUS_CLK) {
  466. scm->bus_clk = devm_clk_get(&pdev->dev, "bus");
  467. if (IS_ERR(scm->bus_clk)) {
  468. if (PTR_ERR(scm->bus_clk) != -EPROBE_DEFER)
  469. dev_err(&pdev->dev,
  470. "failed to acquire bus clk\n");
  471. return PTR_ERR(scm->bus_clk);
  472. }
  473. }
  474. scm->reset.ops = &qcom_scm_pas_reset_ops;
  475. scm->reset.nr_resets = 1;
  476. scm->reset.of_node = pdev->dev.of_node;
  477. ret = devm_reset_controller_register(&pdev->dev, &scm->reset);
  478. if (ret)
  479. return ret;
  480. /* vote for max clk rate for highest performance */
  481. ret = clk_set_rate(scm->core_clk, INT_MAX);
  482. if (ret)
  483. return ret;
  484. __scm = scm;
  485. __scm->dev = &pdev->dev;
  486. __qcom_scm_init();
  487. /*
  488. * If requested enable "download mode", from this point on warmboot
  489. * will cause the the boot stages to enter download mode, unless
  490. * disabled below by a clean shutdown/reboot.
  491. */
  492. if (download_mode)
  493. qcom_scm_set_download_mode(true);
  494. return 0;
  495. }
  496. static void qcom_scm_shutdown(struct platform_device *pdev)
  497. {
  498. /* Clean shutdown, disable download mode to allow normal restart */
  499. if (download_mode)
  500. qcom_scm_set_download_mode(false);
  501. }
  502. static const struct of_device_id qcom_scm_dt_match[] = {
  503. { .compatible = "qcom,scm-apq8064",
  504. /* FIXME: This should have .data = (void *) SCM_HAS_CORE_CLK */
  505. },
  506. { .compatible = "qcom,scm-msm8660",
  507. .data = (void *) SCM_HAS_CORE_CLK,
  508. },
  509. { .compatible = "qcom,scm-msm8960",
  510. .data = (void *) SCM_HAS_CORE_CLK,
  511. },
  512. { .compatible = "qcom,scm-msm8996",
  513. .data = NULL, /* no clocks */
  514. },
  515. { .compatible = "qcom,scm-ipq4019",
  516. .data = NULL, /* no clocks */
  517. },
  518. { .compatible = "qcom,scm",
  519. .data = (void *)(SCM_HAS_CORE_CLK
  520. | SCM_HAS_IFACE_CLK
  521. | SCM_HAS_BUS_CLK),
  522. },
  523. {}
  524. };
  525. static struct platform_driver qcom_scm_driver = {
  526. .driver = {
  527. .name = "qcom_scm",
  528. .of_match_table = qcom_scm_dt_match,
  529. },
  530. .probe = qcom_scm_probe,
  531. .shutdown = qcom_scm_shutdown,
  532. };
  533. static int __init qcom_scm_init(void)
  534. {
  535. return platform_driver_register(&qcom_scm_driver);
  536. }
  537. subsys_initcall(qcom_scm_init);