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