blob: 184bb7cdf95a519a6df6b035d020f9220a8ff60f [file] [log] [blame]
Thomas Gleixner1802d0b2019-05-27 08:55:21 +02001// SPDX-License-Identifier: GPL-2.0-only
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -07002/*
Avaneesh Kumar Dwivedi90a068e2017-01-30 20:33:08 +05303 * Qualcomm ADSP/SLPI Peripheral Image Loader for MSM8974 and MSM8996
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -07004 *
5 * Copyright (C) 2016 Linaro Ltd
6 * Copyright (C) 2014 Sony Mobile Communications AB
7 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -07008 */
9
Sarangdhar Joshif33a7352016-10-25 13:57:26 -070010#include <linux/clk.h>
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070011#include <linux/firmware.h>
12#include <linux/interrupt.h>
13#include <linux/kernel.h>
14#include <linux/module.h>
15#include <linux/of_address.h>
16#include <linux/of_device.h>
17#include <linux/platform_device.h>
Sibi Sankar17ee2fb2019-11-18 21:43:41 +000018#include <linux/pm_domain.h>
19#include <linux/pm_runtime.h>
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070020#include <linux/qcom_scm.h>
21#include <linux/regulator/consumer.h>
22#include <linux/remoteproc.h>
Bjorn Andersson2aad40d2017-01-27 03:12:57 -080023#include <linux/soc/qcom/mdt_loader.h>
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070024#include <linux/soc/qcom/smem.h>
25#include <linux/soc/qcom/smem_state.h>
26
Bjorn Anderssonbde440e2017-01-27 02:28:32 -080027#include "qcom_common.h"
Bjorn Anderssond4c78d22020-06-22 12:19:40 -070028#include "qcom_pil_info.h"
Bjorn Andersson6103b1a2018-06-04 13:30:37 -070029#include "qcom_q6v5.h"
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070030#include "remoteproc_internal.h"
31
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +053032struct adsp_data {
33 int crash_reason_smem;
34 const char *firmware_name;
35 int pas_id;
Siddharth Gupta8ed84852020-11-19 13:05:34 -080036 unsigned int minidump_id;
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +053037 bool has_aggre2_clk;
Sibi Sankarb7ff96c2019-11-18 21:44:07 +000038 bool auto_boot;
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070039
Sibi Sankar17ee2fb2019-11-18 21:43:41 +000040 char **proxy_pd_names;
41
Sibi Sankarc1fe10d2021-09-16 19:29:21 +053042 const char *load_state;
Bjorn Andersson1e140df2017-07-24 22:56:43 -070043 const char *ssr_name;
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070044 const char *sysmon_name;
45 int ssctl_id;
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +053046};
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070047
48struct qcom_adsp {
49 struct device *dev;
50 struct rproc *rproc;
51
Bjorn Andersson6103b1a2018-06-04 13:30:37 -070052 struct qcom_q6v5 q6v5;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070053
Sarangdhar Joshif33a7352016-10-25 13:57:26 -070054 struct clk *xo;
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +053055 struct clk *aggre2_clk;
Sarangdhar Joshif33a7352016-10-25 13:57:26 -070056
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070057 struct regulator *cx_supply;
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +053058 struct regulator *px_supply;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070059
Sibi Sankar17ee2fb2019-11-18 21:43:41 +000060 struct device *proxy_pds[3];
61
Sibi Sankar17ee2fb2019-11-18 21:43:41 +000062 int proxy_pd_count;
63
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +053064 int pas_id;
Siddharth Gupta8ed84852020-11-19 13:05:34 -080065 unsigned int minidump_id;
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +053066 int crash_reason_smem;
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +053067 bool has_aggre2_clk;
Bjorn Anderssond4c78d22020-06-22 12:19:40 -070068 const char *info_name;
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +053069
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070070 struct completion start_done;
71 struct completion stop_done;
72
73 phys_addr_t mem_phys;
74 phys_addr_t mem_reloc;
75 void *mem_region;
76 size_t mem_size;
Bjorn Andersson4b489212017-01-29 14:05:50 -080077
Bjorn Anderssoneea07022017-08-29 16:13:35 -070078 struct qcom_rproc_glink glink_subdev;
Bjorn Andersson4b489212017-01-29 14:05:50 -080079 struct qcom_rproc_subdev smd_subdev;
Bjorn Andersson1e140df2017-07-24 22:56:43 -070080 struct qcom_rproc_ssr ssr_subdev;
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070081 struct qcom_sysmon *sysmon;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -070082};
83
Siddharth Gupta8ed84852020-11-19 13:05:34 -080084static void adsp_minidump(struct rproc *rproc)
85{
86 struct qcom_adsp *adsp = rproc->priv;
87
88 qcom_minidump(rproc, adsp->minidump_id);
89}
90
Sibi Sankar17ee2fb2019-11-18 21:43:41 +000091static int adsp_pds_enable(struct qcom_adsp *adsp, struct device **pds,
92 size_t pd_count)
93{
94 int ret;
95 int i;
96
97 for (i = 0; i < pd_count; i++) {
98 dev_pm_genpd_set_performance_state(pds[i], INT_MAX);
99 ret = pm_runtime_get_sync(pds[i]);
Zhang Qilongc0a6e5e2020-11-02 22:35:54 +0800100 if (ret < 0) {
101 pm_runtime_put_noidle(pds[i]);
102 dev_pm_genpd_set_performance_state(pds[i], 0);
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000103 goto unroll_pd_votes;
Zhang Qilongc0a6e5e2020-11-02 22:35:54 +0800104 }
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000105 }
106
107 return 0;
108
109unroll_pd_votes:
110 for (i--; i >= 0; i--) {
111 dev_pm_genpd_set_performance_state(pds[i], 0);
112 pm_runtime_put(pds[i]);
113 }
114
115 return ret;
116};
117
118static void adsp_pds_disable(struct qcom_adsp *adsp, struct device **pds,
119 size_t pd_count)
120{
121 int i;
122
123 for (i = 0; i < pd_count; i++) {
124 dev_pm_genpd_set_performance_state(pds[i], 0);
125 pm_runtime_put(pds[i]);
126 }
127}
128
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700129static int adsp_load(struct rproc *rproc, const struct firmware *fw)
130{
131 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
Bjorn Anderssond4c78d22020-06-22 12:19:40 -0700132 int ret;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700133
Bjorn Anderssond4c78d22020-06-22 12:19:40 -0700134 ret = qcom_mdt_load(adsp->dev, fw, rproc->firmware, adsp->pas_id,
135 adsp->mem_region, adsp->mem_phys, adsp->mem_size,
136 &adsp->mem_reloc);
137 if (ret)
138 return ret;
Bjorn Andersson4dd27f52018-01-05 16:04:19 -0800139
Bjorn Anderssond4c78d22020-06-22 12:19:40 -0700140 qcom_pil_info_store(adsp->info_name, adsp->mem_phys, adsp->mem_size);
141
142 return 0;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700143}
144
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700145static int adsp_start(struct rproc *rproc)
146{
147 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
148 int ret;
149
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530150 ret = qcom_q6v5_prepare(&adsp->q6v5);
151 if (ret)
152 return ret;
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000153
154 ret = adsp_pds_enable(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
155 if (ret < 0)
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530156 goto disable_irqs;
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000157
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700158 ret = clk_prepare_enable(adsp->xo);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700159 if (ret)
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000160 goto disable_proxy_pds;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700161
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530162 ret = clk_prepare_enable(adsp->aggre2_clk);
163 if (ret)
164 goto disable_xo_clk;
165
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700166 ret = regulator_enable(adsp->cx_supply);
167 if (ret)
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530168 goto disable_aggre2_clk;
169
170 ret = regulator_enable(adsp->px_supply);
171 if (ret)
172 goto disable_cx_supply;
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700173
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530174 ret = qcom_scm_pas_auth_and_reset(adsp->pas_id);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700175 if (ret) {
176 dev_err(adsp->dev,
177 "failed to authenticate image and release reset\n");
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530178 goto disable_px_supply;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700179 }
180
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700181 ret = qcom_q6v5_wait_for_start(&adsp->q6v5, msecs_to_jiffies(5000));
182 if (ret == -ETIMEDOUT) {
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700183 dev_err(adsp->dev, "start timed out\n");
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530184 qcom_scm_pas_shutdown(adsp->pas_id);
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530185 goto disable_px_supply;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700186 }
187
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700188 return 0;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700189
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530190disable_px_supply:
191 regulator_disable(adsp->px_supply);
192disable_cx_supply:
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700193 regulator_disable(adsp->cx_supply);
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530194disable_aggre2_clk:
195 clk_disable_unprepare(adsp->aggre2_clk);
196disable_xo_clk:
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700197 clk_disable_unprepare(adsp->xo);
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000198disable_proxy_pds:
199 adsp_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
Sibi Sankar2ac91aa2019-11-18 21:43:30 +0000200disable_irqs:
201 qcom_q6v5_unprepare(&adsp->q6v5);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700202
203 return ret;
204}
205
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700206static void qcom_pas_handover(struct qcom_q6v5 *q6v5)
207{
208 struct qcom_adsp *adsp = container_of(q6v5, struct qcom_adsp, q6v5);
209
210 regulator_disable(adsp->px_supply);
211 regulator_disable(adsp->cx_supply);
212 clk_disable_unprepare(adsp->aggre2_clk);
213 clk_disable_unprepare(adsp->xo);
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000214 adsp_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700215}
216
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700217static int adsp_stop(struct rproc *rproc)
218{
219 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700220 int handover;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700221 int ret;
222
Bjorn Anderssoned5da802020-11-21 21:41:34 -0800223 ret = qcom_q6v5_request_stop(&adsp->q6v5, adsp->sysmon);
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700224 if (ret == -ETIMEDOUT)
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700225 dev_err(adsp->dev, "timed out on wait\n");
226
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530227 ret = qcom_scm_pas_shutdown(adsp->pas_id);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700228 if (ret)
229 dev_err(adsp->dev, "failed to shutdown: %d\n", ret);
230
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700231 handover = qcom_q6v5_unprepare(&adsp->q6v5);
232 if (handover)
233 qcom_pas_handover(&adsp->q6v5);
234
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700235 return ret;
236}
237
Peng Fan40df0a92021-03-06 19:24:19 +0800238static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem)
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700239{
240 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
241 int offset;
242
243 offset = da - adsp->mem_reloc;
244 if (offset < 0 || offset + len > adsp->mem_size)
245 return NULL;
246
247 return adsp->mem_region + offset;
248}
249
Bjorn Andersson717c21b2020-03-23 22:29:04 -0700250static unsigned long adsp_panic(struct rproc *rproc)
251{
252 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
253
254 return qcom_q6v5_panic(&adsp->q6v5);
255}
256
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700257static const struct rproc_ops adsp_ops = {
258 .start = adsp_start,
259 .stop = adsp_stop,
260 .da_to_va = adsp_da_to_va,
Sarangdhar Joshidcb57ed2018-01-05 16:04:20 -0800261 .parse_fw = qcom_register_dump_segments,
Bjorn Andersson0f21f9c2018-01-05 15:58:01 -0800262 .load = adsp_load,
Bjorn Andersson717c21b2020-03-23 22:29:04 -0700263 .panic = adsp_panic,
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700264};
265
Siddharth Gupta8ed84852020-11-19 13:05:34 -0800266static const struct rproc_ops adsp_minidump_ops = {
267 .start = adsp_start,
268 .stop = adsp_stop,
269 .da_to_va = adsp_da_to_va,
270 .load = adsp_load,
271 .panic = adsp_panic,
272 .coredump = adsp_minidump,
273};
274
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700275static int adsp_init_clock(struct qcom_adsp *adsp)
276{
277 int ret;
278
279 adsp->xo = devm_clk_get(adsp->dev, "xo");
280 if (IS_ERR(adsp->xo)) {
281 ret = PTR_ERR(adsp->xo);
282 if (ret != -EPROBE_DEFER)
283 dev_err(adsp->dev, "failed to get xo clock");
284 return ret;
285 }
286
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530287 if (adsp->has_aggre2_clk) {
288 adsp->aggre2_clk = devm_clk_get(adsp->dev, "aggre2");
289 if (IS_ERR(adsp->aggre2_clk)) {
290 ret = PTR_ERR(adsp->aggre2_clk);
291 if (ret != -EPROBE_DEFER)
292 dev_err(adsp->dev,
293 "failed to get aggre2 clock");
294 return ret;
295 }
296 }
297
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700298 return 0;
299}
300
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700301static int adsp_init_regulator(struct qcom_adsp *adsp)
302{
303 adsp->cx_supply = devm_regulator_get(adsp->dev, "cx");
304 if (IS_ERR(adsp->cx_supply))
305 return PTR_ERR(adsp->cx_supply);
306
307 regulator_set_load(adsp->cx_supply, 100000);
308
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530309 adsp->px_supply = devm_regulator_get(adsp->dev, "px");
Himanshu Jhac76929b2017-08-29 19:13:18 +0530310 return PTR_ERR_OR_ZERO(adsp->px_supply);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700311}
312
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000313static int adsp_pds_attach(struct device *dev, struct device **devs,
314 char **pd_names)
315{
316 size_t num_pds = 0;
317 int ret;
318 int i;
319
320 if (!pd_names)
321 return 0;
322
323 /* Handle single power domain */
324 if (dev->pm_domain) {
325 devs[0] = dev;
326 pm_runtime_enable(dev);
327 return 1;
328 }
329
330 while (pd_names[num_pds])
331 num_pds++;
332
333 for (i = 0; i < num_pds; i++) {
334 devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
335 if (IS_ERR_OR_NULL(devs[i])) {
336 ret = PTR_ERR(devs[i]) ? : -ENODATA;
337 goto unroll_attach;
338 }
339 }
340
341 return num_pds;
342
343unroll_attach:
344 for (i--; i >= 0; i--)
345 dev_pm_domain_detach(devs[i], false);
346
347 return ret;
348};
349
350static void adsp_pds_detach(struct qcom_adsp *adsp, struct device **pds,
351 size_t pd_count)
352{
353 struct device *dev = adsp->dev;
354 int i;
355
356 /* Handle single power domain */
357 if (dev->pm_domain && pd_count) {
358 pm_runtime_disable(dev);
359 return;
360 }
361
362 for (i = 0; i < pd_count; i++)
363 dev_pm_domain_detach(pds[i], false);
364}
365
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700366static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
367{
368 struct device_node *node;
369 struct resource r;
370 int ret;
371
372 node = of_parse_phandle(adsp->dev->of_node, "memory-region", 0);
373 if (!node) {
374 dev_err(adsp->dev, "no memory-region specified\n");
375 return -EINVAL;
376 }
377
378 ret = of_address_to_resource(node, 0, &r);
379 if (ret)
380 return ret;
381
382 adsp->mem_phys = adsp->mem_reloc = r.start;
383 adsp->mem_size = resource_size(&r);
384 adsp->mem_region = devm_ioremap_wc(adsp->dev, adsp->mem_phys, adsp->mem_size);
385 if (!adsp->mem_region) {
386 dev_err(adsp->dev, "unable to map memory region: %pa+%zx\n",
387 &r.start, adsp->mem_size);
388 return -EBUSY;
389 }
390
391 return 0;
392}
393
394static int adsp_probe(struct platform_device *pdev)
395{
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530396 const struct adsp_data *desc;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700397 struct qcom_adsp *adsp;
398 struct rproc *rproc;
Sibi Sankara5a4e022019-01-15 01:20:01 +0530399 const char *fw_name;
Siddharth Gupta8ed84852020-11-19 13:05:34 -0800400 const struct rproc_ops *ops = &adsp_ops;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700401 int ret;
402
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530403 desc = of_device_get_match_data(&pdev->dev);
404 if (!desc)
405 return -EINVAL;
406
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700407 if (!qcom_scm_is_available())
408 return -EPROBE_DEFER;
409
Sibi Sankara5a4e022019-01-15 01:20:01 +0530410 fw_name = desc->firmware_name;
411 ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
412 &fw_name);
413 if (ret < 0 && ret != -EINVAL)
414 return ret;
415
Siddharth Gupta8ed84852020-11-19 13:05:34 -0800416 if (desc->minidump_id)
417 ops = &adsp_minidump_ops;
418
419 rproc = rproc_alloc(&pdev->dev, pdev->name, ops, fw_name, sizeof(*adsp));
420
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700421 if (!rproc) {
422 dev_err(&pdev->dev, "unable to allocate remoteproc\n");
423 return -ENOMEM;
424 }
425
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000426 rproc->auto_boot = desc->auto_boot;
Clement Leger3898fc92020-04-10 12:24:33 +0200427 rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE);
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000428
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700429 adsp = (struct qcom_adsp *)rproc->priv;
430 adsp->dev = &pdev->dev;
431 adsp->rproc = rproc;
Siddharth Gupta8ed84852020-11-19 13:05:34 -0800432 adsp->minidump_id = desc->minidump_id;
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530433 adsp->pas_id = desc->pas_id;
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530434 adsp->has_aggre2_clk = desc->has_aggre2_clk;
Bjorn Anderssond4c78d22020-06-22 12:19:40 -0700435 adsp->info_name = desc->sysmon_name;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700436 platform_set_drvdata(pdev, adsp);
437
Rishabh Bhatnagara781e5a2020-04-29 11:04:42 -0700438 device_wakeup_enable(adsp->dev);
439
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700440 ret = adsp_alloc_memory_region(adsp);
441 if (ret)
442 goto free_rproc;
443
Sarangdhar Joshif33a7352016-10-25 13:57:26 -0700444 ret = adsp_init_clock(adsp);
445 if (ret)
446 goto free_rproc;
447
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700448 ret = adsp_init_regulator(adsp);
449 if (ret)
450 goto free_rproc;
451
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000452 ret = adsp_pds_attach(&pdev->dev, adsp->proxy_pds,
453 desc->proxy_pd_names);
454 if (ret < 0)
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530455 goto free_rproc;
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000456 adsp->proxy_pd_count = ret;
457
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530458 ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem, desc->load_state,
Bjorn Andersson6103b1a2018-06-04 13:30:37 -0700459 qcom_pas_handover);
460 if (ret)
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000461 goto detach_proxy_pds;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700462
Bjorn Anderssoncd9fc8f2020-04-22 17:37:33 -0700463 qcom_add_glink_subdev(rproc, &adsp->glink_subdev, desc->ssr_name);
Bjorn Andersson4b489212017-01-29 14:05:50 -0800464 qcom_add_smd_subdev(rproc, &adsp->smd_subdev);
Bjorn Andersson1e140df2017-07-24 22:56:43 -0700465 qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name);
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -0700466 adsp->sysmon = qcom_add_sysmon_subdev(rproc,
467 desc->sysmon_name,
468 desc->ssctl_id);
Sibi Sankar027045a2019-01-08 15:53:43 +0530469 if (IS_ERR(adsp->sysmon)) {
470 ret = PTR_ERR(adsp->sysmon);
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000471 goto detach_proxy_pds;
Sibi Sankar027045a2019-01-08 15:53:43 +0530472 }
Bjorn Andersson4b489212017-01-29 14:05:50 -0800473
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700474 ret = rproc_add(rproc);
475 if (ret)
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000476 goto detach_proxy_pds;
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700477
478 return 0;
479
Sibi Sankar17ee2fb2019-11-18 21:43:41 +0000480detach_proxy_pds:
481 adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700482free_rproc:
Bjorn Andersson90a80d82016-11-19 22:42:55 -0800483 rproc_free(rproc);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700484
485 return ret;
486}
487
488static int adsp_remove(struct platform_device *pdev)
489{
490 struct qcom_adsp *adsp = platform_get_drvdata(pdev);
491
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700492 rproc_del(adsp->rproc);
Bjorn Andersson4b489212017-01-29 14:05:50 -0800493
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530494 qcom_q6v5_deinit(&adsp->q6v5);
Bjorn Anderssoneea07022017-08-29 16:13:35 -0700495 qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev);
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -0700496 qcom_remove_sysmon_subdev(adsp->sysmon);
Bjorn Andersson4b489212017-01-29 14:05:50 -0800497 qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev);
Bjorn Andersson1e140df2017-07-24 22:56:43 -0700498 qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
Bjorn Andersson90a80d82016-11-19 22:42:55 -0800499 rproc_free(adsp->rproc);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700500
501 return 0;
502}
503
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530504static const struct adsp_data adsp_resource_init = {
505 .crash_reason_smem = 423,
506 .firmware_name = "adsp.mdt",
507 .pas_id = 1,
Avaneesh Kumar Dwivedie323fc02017-01-30 20:33:07 +0530508 .has_aggre2_clk = false,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000509 .auto_boot = true,
Bjorn Andersson1e140df2017-07-24 22:56:43 -0700510 .ssr_name = "lpass",
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -0700511 .sysmon_name = "adsp",
512 .ssctl_id = 0x14,
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530513};
514
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530515static const struct adsp_data sdm845_adsp_resource_init = {
516 .crash_reason_smem = 423,
517 .firmware_name = "adsp.mdt",
518 .pas_id = 1,
519 .has_aggre2_clk = false,
520 .auto_boot = true,
521 .load_state = "adsp",
522 .ssr_name = "lpass",
523 .sysmon_name = "adsp",
524 .ssctl_id = 0x14,
525};
526
Luca Weissbfd75ae2021-12-13 09:22:04 +0100527static const struct adsp_data sm6350_adsp_resource = {
528 .crash_reason_smem = 423,
529 .firmware_name = "adsp.mdt",
530 .pas_id = 1,
531 .has_aggre2_clk = false,
532 .auto_boot = true,
533 .proxy_pd_names = (char*[]){
534 "lcx",
535 "lmx",
536 NULL
537 },
538 .load_state = "adsp",
539 .ssr_name = "lpass",
540 .sysmon_name = "adsp",
541 .ssctl_id = 0x14,
542};
543
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000544static const struct adsp_data sm8150_adsp_resource = {
545 .crash_reason_smem = 423,
546 .firmware_name = "adsp.mdt",
547 .pas_id = 1,
548 .has_aggre2_clk = false,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000549 .auto_boot = true,
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000550 .proxy_pd_names = (char*[]){
551 "cx",
552 NULL
553 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530554 .load_state = "adsp",
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000555 .ssr_name = "lpass",
556 .sysmon_name = "adsp",
557 .ssctl_id = 0x14,
558};
559
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700560static const struct adsp_data sm8250_adsp_resource = {
561 .crash_reason_smem = 423,
562 .firmware_name = "adsp.mdt",
563 .pas_id = 1,
564 .has_aggre2_clk = false,
565 .auto_boot = true,
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700566 .proxy_pd_names = (char*[]){
567 "lcx",
568 "lmx",
569 NULL
570 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530571 .load_state = "adsp",
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700572 .ssr_name = "lpass",
573 .sysmon_name = "adsp",
574 .ssctl_id = 0x14,
575};
576
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530577static const struct adsp_data sm8350_adsp_resource = {
578 .crash_reason_smem = 423,
579 .firmware_name = "adsp.mdt",
580 .pas_id = 1,
581 .has_aggre2_clk = false,
582 .auto_boot = true,
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530583 .proxy_pd_names = (char*[]){
584 "lcx",
585 "lmx",
586 NULL
587 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530588 .load_state = "adsp",
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530589 .ssr_name = "lpass",
590 .sysmon_name = "adsp",
591 .ssctl_id = 0x14,
592};
593
Yassine Oudjana9ae45032021-09-26 19:06:22 +0000594static const struct adsp_data msm8996_adsp_resource = {
Sibi Sankar7c77e312019-12-18 18:52:15 +0530595 .crash_reason_smem = 423,
596 .firmware_name = "adsp.mdt",
597 .pas_id = 1,
598 .has_aggre2_clk = false,
599 .auto_boot = true,
600 .proxy_pd_names = (char*[]){
601 "cx",
602 NULL
603 },
604 .ssr_name = "lpass",
605 .sysmon_name = "adsp",
606 .ssctl_id = 0x14,
607};
608
Bjorn Andersson3b0d1b62018-08-28 00:14:58 -0700609static const struct adsp_data cdsp_resource_init = {
610 .crash_reason_smem = 601,
611 .firmware_name = "cdsp.mdt",
612 .pas_id = 18,
613 .has_aggre2_clk = false,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000614 .auto_boot = true,
Bjorn Andersson3b0d1b62018-08-28 00:14:58 -0700615 .ssr_name = "cdsp",
616 .sysmon_name = "cdsp",
617 .ssctl_id = 0x17,
618};
619
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530620static const struct adsp_data sdm845_cdsp_resource_init = {
621 .crash_reason_smem = 601,
622 .firmware_name = "cdsp.mdt",
623 .pas_id = 18,
624 .has_aggre2_clk = false,
625 .auto_boot = true,
626 .load_state = "cdsp",
627 .ssr_name = "cdsp",
628 .sysmon_name = "cdsp",
629 .ssctl_id = 0x17,
630};
631
Luca Weiss3bc0d1f2021-12-13 09:22:06 +0100632static const struct adsp_data sm6350_cdsp_resource = {
633 .crash_reason_smem = 601,
634 .firmware_name = "cdsp.mdt",
635 .pas_id = 18,
636 .has_aggre2_clk = false,
637 .auto_boot = true,
638 .proxy_pd_names = (char*[]){
639 "cx",
640 "mx",
641 NULL
642 },
643 .load_state = "cdsp",
644 .ssr_name = "cdsp",
645 .sysmon_name = "cdsp",
646 .ssctl_id = 0x17,
647};
648
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000649static const struct adsp_data sm8150_cdsp_resource = {
650 .crash_reason_smem = 601,
651 .firmware_name = "cdsp.mdt",
652 .pas_id = 18,
653 .has_aggre2_clk = false,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000654 .auto_boot = true,
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000655 .proxy_pd_names = (char*[]){
656 "cx",
657 NULL
658 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530659 .load_state = "cdsp",
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000660 .ssr_name = "cdsp",
661 .sysmon_name = "cdsp",
662 .ssctl_id = 0x17,
663};
664
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700665static const struct adsp_data sm8250_cdsp_resource = {
666 .crash_reason_smem = 601,
667 .firmware_name = "cdsp.mdt",
668 .pas_id = 18,
669 .has_aggre2_clk = false,
670 .auto_boot = true,
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700671 .proxy_pd_names = (char*[]){
672 "cx",
673 NULL
674 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530675 .load_state = "cdsp",
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700676 .ssr_name = "cdsp",
677 .sysmon_name = "cdsp",
678 .ssctl_id = 0x17,
679};
680
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530681static const struct adsp_data sm8350_cdsp_resource = {
682 .crash_reason_smem = 601,
683 .firmware_name = "cdsp.mdt",
684 .pas_id = 18,
685 .has_aggre2_clk = false,
686 .auto_boot = true,
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530687 .proxy_pd_names = (char*[]){
688 "cx",
Sibi Sankardd585d92021-06-25 00:03:25 +0530689 "mxc",
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530690 NULL
691 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530692 .load_state = "cdsp",
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530693 .ssr_name = "cdsp",
694 .sysmon_name = "cdsp",
695 .ssctl_id = 0x17,
696};
697
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000698static const struct adsp_data mpss_resource_init = {
699 .crash_reason_smem = 421,
700 .firmware_name = "modem.mdt",
701 .pas_id = 4,
Siddharth Guptad2debca2020-11-19 13:05:35 -0800702 .minidump_id = 3,
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000703 .has_aggre2_clk = false,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000704 .auto_boot = false,
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000705 .proxy_pd_names = (char*[]){
706 "cx",
707 "mss",
708 NULL
709 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530710 .load_state = "modem",
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000711 .ssr_name = "mpss",
712 .sysmon_name = "modem",
713 .ssctl_id = 0x12,
714};
715
Bjorn Anderssonaef6a522021-06-08 10:49:44 -0700716static const struct adsp_data sc8180x_mpss_resource = {
717 .crash_reason_smem = 421,
718 .firmware_name = "modem.mdt",
719 .pas_id = 4,
720 .has_aggre2_clk = false,
721 .auto_boot = false,
Bjorn Anderssonaef6a522021-06-08 10:49:44 -0700722 .proxy_pd_names = (char*[]){
723 "cx",
724 NULL
725 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530726 .load_state = "modem",
Bjorn Anderssonaef6a522021-06-08 10:49:44 -0700727 .ssr_name = "mpss",
728 .sysmon_name = "modem",
729 .ssctl_id = 0x12,
730};
731
Avaneesh Kumar Dwivedi90a068e2017-01-30 20:33:08 +0530732static const struct adsp_data slpi_resource_init = {
733 .crash_reason_smem = 424,
734 .firmware_name = "slpi.mdt",
735 .pas_id = 12,
736 .has_aggre2_clk = true,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000737 .auto_boot = true,
Yassine Oudjana9ae45032021-09-26 19:06:22 +0000738 .proxy_pd_names = (char*[]){
739 "ssc_cx",
740 NULL
741 },
Bjorn Andersson1e140df2017-07-24 22:56:43 -0700742 .ssr_name = "dsps",
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -0700743 .sysmon_name = "slpi",
744 .ssctl_id = 0x16,
Avaneesh Kumar Dwivedi90a068e2017-01-30 20:33:08 +0530745};
746
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000747static const struct adsp_data sm8150_slpi_resource = {
748 .crash_reason_smem = 424,
749 .firmware_name = "slpi.mdt",
750 .pas_id = 12,
751 .has_aggre2_clk = false,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000752 .auto_boot = true,
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000753 .proxy_pd_names = (char*[]){
754 "lcx",
755 "lmx",
756 NULL
757 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530758 .load_state = "slpi",
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000759 .ssr_name = "dsps",
760 .sysmon_name = "slpi",
761 .ssctl_id = 0x16,
762};
763
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700764static const struct adsp_data sm8250_slpi_resource = {
765 .crash_reason_smem = 424,
766 .firmware_name = "slpi.mdt",
767 .pas_id = 12,
768 .has_aggre2_clk = false,
769 .auto_boot = true,
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700770 .proxy_pd_names = (char*[]){
771 "lcx",
772 "lmx",
773 NULL
774 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530775 .load_state = "slpi",
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700776 .ssr_name = "dsps",
777 .sysmon_name = "slpi",
778 .ssctl_id = 0x16,
779};
780
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530781static const struct adsp_data sm8350_slpi_resource = {
782 .crash_reason_smem = 424,
783 .firmware_name = "slpi.mdt",
784 .pas_id = 12,
785 .has_aggre2_clk = false,
786 .auto_boot = true,
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530787 .proxy_pd_names = (char*[]){
788 "lcx",
789 "lmx",
790 NULL
791 },
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530792 .load_state = "slpi",
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530793 .ssr_name = "dsps",
794 .sysmon_name = "slpi",
795 .ssctl_id = 0x16,
796};
797
Bjorn Andersson0af93682018-09-27 12:03:46 -0700798static const struct adsp_data wcss_resource_init = {
799 .crash_reason_smem = 421,
800 .firmware_name = "wcnss.mdt",
801 .pas_id = 6,
Sibi Sankarb7ff96c2019-11-18 21:44:07 +0000802 .auto_boot = true,
Bjorn Andersson0af93682018-09-27 12:03:46 -0700803 .ssr_name = "mpss",
804 .sysmon_name = "wcnss",
805 .ssctl_id = 0x12,
806};
807
Manivannan Sadhasivam3fdba9d2021-04-08 22:42:11 +0530808static const struct adsp_data sdx55_mpss_resource = {
809 .crash_reason_smem = 421,
810 .firmware_name = "modem.mdt",
811 .pas_id = 4,
812 .has_aggre2_clk = false,
813 .auto_boot = true,
814 .proxy_pd_names = (char*[]){
815 "cx",
816 "mss",
817 NULL
818 },
819 .ssr_name = "mpss",
820 .sysmon_name = "modem",
821 .ssctl_id = 0x22,
822};
823
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700824static const struct of_device_id adsp_of_match[] = {
Avaneesh Kumar Dwivedic7715e42017-01-30 20:33:06 +0530825 { .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
Yassine Oudjana9ae45032021-09-26 19:06:22 +0000826 { .compatible = "qcom,msm8996-adsp-pil", .data = &msm8996_adsp_resource},
Avaneesh Kumar Dwivedi90a068e2017-01-30 20:33:08 +0530827 { .compatible = "qcom,msm8996-slpi-pil", .data = &slpi_resource_init},
Yassine Oudjana9ae45032021-09-26 19:06:22 +0000828 { .compatible = "qcom,msm8998-adsp-pas", .data = &msm8996_adsp_resource},
829 { .compatible = "qcom,msm8998-slpi-pas", .data = &slpi_resource_init},
Bjorn Andersson0af93682018-09-27 12:03:46 -0700830 { .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init },
831 { .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init },
832 { .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init },
Sibi Sankar620d70b2020-04-21 20:02:23 +0530833 { .compatible = "qcom,sc7180-mpss-pas", .data = &mpss_resource_init},
Sibi Sankar58c8db932021-09-17 19:25:27 +0530834 { .compatible = "qcom,sc7280-mpss-pas", .data = &mpss_resource_init},
Bjorn Anderssonaef6a522021-06-08 10:49:44 -0700835 { .compatible = "qcom,sc8180x-adsp-pas", .data = &sm8150_adsp_resource},
836 { .compatible = "qcom,sc8180x-cdsp-pas", .data = &sm8150_cdsp_resource},
837 { .compatible = "qcom,sc8180x-mpss-pas", .data = &sc8180x_mpss_resource},
Konrad Dybcioa0a77022021-07-28 23:52:12 +0200838 { .compatible = "qcom,sdm660-adsp-pas", .data = &adsp_resource_init},
Sibi Sankarc1fe10d2021-09-16 19:29:21 +0530839 { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},
840 { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},
Manivannan Sadhasivam3fdba9d2021-04-08 22:42:11 +0530841 { .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},
Luca Weissbfd75ae2021-12-13 09:22:04 +0100842 { .compatible = "qcom,sm6350-adsp-pas", .data = &sm6350_adsp_resource},
Luca Weiss3bc0d1f2021-12-13 09:22:06 +0100843 { .compatible = "qcom,sm6350-cdsp-pas", .data = &sm6350_cdsp_resource},
Luca Weiss42a3f552021-12-13 09:22:02 +0100844 { .compatible = "qcom,sm6350-mpss-pas", .data = &mpss_resource_init},
Sibi Sankar15f4ae12019-11-18 21:43:58 +0000845 { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
846 { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
847 { .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init},
848 { .compatible = "qcom,sm8150-slpi-pas", .data = &sm8150_slpi_resource},
Bjorn Anderssonf6da4832020-04-30 11:00:51 -0700849 { .compatible = "qcom,sm8250-adsp-pas", .data = &sm8250_adsp_resource},
850 { .compatible = "qcom,sm8250-cdsp-pas", .data = &sm8250_cdsp_resource},
851 { .compatible = "qcom,sm8250-slpi-pas", .data = &sm8250_slpi_resource},
Vinod Koule8b4e9a2021-02-10 16:15:39 +0530852 { .compatible = "qcom,sm8350-adsp-pas", .data = &sm8350_adsp_resource},
853 { .compatible = "qcom,sm8350-cdsp-pas", .data = &sm8350_cdsp_resource},
854 { .compatible = "qcom,sm8350-slpi-pas", .data = &sm8350_slpi_resource},
855 { .compatible = "qcom,sm8350-mpss-pas", .data = &mpss_resource_init},
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700856 { },
857};
Bjorn Andersson62423472016-11-19 22:41:56 -0800858MODULE_DEVICE_TABLE(of, adsp_of_match);
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700859
860static struct platform_driver adsp_driver = {
861 .probe = adsp_probe,
862 .remove = adsp_remove,
863 .driver = {
Bjorn Andersson9e004f92018-09-24 16:45:25 -0700864 .name = "qcom_q6v5_pas",
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700865 .of_match_table = adsp_of_match,
866 },
867};
868
869module_platform_driver(adsp_driver);
Bjorn Andersson9e004f92018-09-24 16:45:25 -0700870MODULE_DESCRIPTION("Qualcomm Hexagon v5 Peripheral Authentication Service driver");
Bjorn Anderssonb9e718e2016-08-22 22:57:44 -0700871MODULE_LICENSE("GPL v2");