Lines Matching +full:sc7180 +full:- +full:mss

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
100 for (i--; i >= 0; i--) { in adsp_pds_enable()
121 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; in adsp_load()
124 ret = qcom_mdt_load(adsp->dev, fw, rproc->firmware, adsp->pas_id, in adsp_load()
125 adsp->mem_region, adsp->mem_phys, adsp->mem_size, in adsp_load()
126 &adsp->mem_reloc); in adsp_load()
130 qcom_pil_info_store(adsp->info_name, adsp->mem_phys, adsp->mem_size); in adsp_load()
137 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; in adsp_start()
140 qcom_q6v5_prepare(&adsp->q6v5); in adsp_start()
142 ret = adsp_pds_enable(adsp, adsp->active_pds, adsp->active_pd_count); in adsp_start()
146 ret = adsp_pds_enable(adsp, adsp->proxy_pds, adsp->proxy_pd_count); in adsp_start()
150 ret = clk_prepare_enable(adsp->xo); in adsp_start()
154 ret = clk_prepare_enable(adsp->aggre2_clk); in adsp_start()
158 ret = regulator_enable(adsp->cx_supply); in adsp_start()
162 ret = regulator_enable(adsp->px_supply); in adsp_start()
166 ret = qcom_scm_pas_auth_and_reset(adsp->pas_id); in adsp_start()
168 dev_err(adsp->dev, in adsp_start()
173 ret = qcom_q6v5_wait_for_start(&adsp->q6v5, msecs_to_jiffies(5000)); in adsp_start()
174 if (ret == -ETIMEDOUT) { in adsp_start()
175 dev_err(adsp->dev, "start timed out\n"); in adsp_start()
176 qcom_scm_pas_shutdown(adsp->pas_id); in adsp_start()
183 regulator_disable(adsp->px_supply); in adsp_start()
185 regulator_disable(adsp->cx_supply); in adsp_start()
187 clk_disable_unprepare(adsp->aggre2_clk); in adsp_start()
189 clk_disable_unprepare(adsp->xo); in adsp_start()
191 adsp_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count); in adsp_start()
193 adsp_pds_disable(adsp, adsp->active_pds, adsp->active_pd_count); in adsp_start()
195 qcom_q6v5_unprepare(&adsp->q6v5); in adsp_start()
204 regulator_disable(adsp->px_supply); in qcom_pas_handover()
205 regulator_disable(adsp->cx_supply); in qcom_pas_handover()
206 clk_disable_unprepare(adsp->aggre2_clk); in qcom_pas_handover()
207 clk_disable_unprepare(adsp->xo); in qcom_pas_handover()
208 adsp_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count); in qcom_pas_handover()
213 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; in adsp_stop()
217 ret = qcom_q6v5_request_stop(&adsp->q6v5); in adsp_stop()
218 if (ret == -ETIMEDOUT) in adsp_stop()
219 dev_err(adsp->dev, "timed out on wait\n"); in adsp_stop()
221 ret = qcom_scm_pas_shutdown(adsp->pas_id); in adsp_stop()
223 dev_err(adsp->dev, "failed to shutdown: %d\n", ret); in adsp_stop()
225 adsp_pds_disable(adsp, adsp->active_pds, adsp->active_pd_count); in adsp_stop()
226 handover = qcom_q6v5_unprepare(&adsp->q6v5); in adsp_stop()
228 qcom_pas_handover(&adsp->q6v5); in adsp_stop()
235 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; in adsp_da_to_va()
238 offset = da - adsp->mem_reloc; in adsp_da_to_va()
239 if (offset < 0 || offset + len > adsp->mem_size) in adsp_da_to_va()
242 return adsp->mem_region + offset; in adsp_da_to_va()
247 struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; in adsp_panic()
249 return qcom_q6v5_panic(&adsp->q6v5); in adsp_panic()
265 adsp->xo = devm_clk_get(adsp->dev, "xo"); in adsp_init_clock()
266 if (IS_ERR(adsp->xo)) { in adsp_init_clock()
267 ret = PTR_ERR(adsp->xo); in adsp_init_clock()
268 if (ret != -EPROBE_DEFER) in adsp_init_clock()
269 dev_err(adsp->dev, "failed to get xo clock"); in adsp_init_clock()
273 if (adsp->has_aggre2_clk) { in adsp_init_clock()
274 adsp->aggre2_clk = devm_clk_get(adsp->dev, "aggre2"); in adsp_init_clock()
275 if (IS_ERR(adsp->aggre2_clk)) { in adsp_init_clock()
276 ret = PTR_ERR(adsp->aggre2_clk); in adsp_init_clock()
277 if (ret != -EPROBE_DEFER) in adsp_init_clock()
278 dev_err(adsp->dev, in adsp_init_clock()
289 adsp->cx_supply = devm_regulator_get(adsp->dev, "cx"); in adsp_init_regulator()
290 if (IS_ERR(adsp->cx_supply)) in adsp_init_regulator()
291 return PTR_ERR(adsp->cx_supply); in adsp_init_regulator()
293 regulator_set_load(adsp->cx_supply, 100000); in adsp_init_regulator()
295 adsp->px_supply = devm_regulator_get(adsp->dev, "px"); in adsp_init_regulator()
296 return PTR_ERR_OR_ZERO(adsp->px_supply); in adsp_init_regulator()
310 if (dev->pm_domain) { in adsp_pds_attach()
322 ret = PTR_ERR(devs[i]) ? : -ENODATA; in adsp_pds_attach()
330 for (i--; i >= 0; i--) in adsp_pds_attach()
339 struct device *dev = adsp->dev; in adsp_pds_detach()
343 if (dev->pm_domain && pd_count) { in adsp_pds_detach()
358 node = of_parse_phandle(adsp->dev->of_node, "memory-region", 0); in adsp_alloc_memory_region()
360 dev_err(adsp->dev, "no memory-region specified\n"); in adsp_alloc_memory_region()
361 return -EINVAL; in adsp_alloc_memory_region()
368 adsp->mem_phys = adsp->mem_reloc = r.start; in adsp_alloc_memory_region()
369 adsp->mem_size = resource_size(&r); in adsp_alloc_memory_region()
370 adsp->mem_region = devm_ioremap_wc(adsp->dev, adsp->mem_phys, adsp->mem_size); in adsp_alloc_memory_region()
371 if (!adsp->mem_region) { in adsp_alloc_memory_region()
372 dev_err(adsp->dev, "unable to map memory region: %pa+%zx\n", in adsp_alloc_memory_region()
373 &r.start, adsp->mem_size); in adsp_alloc_memory_region()
374 return -EBUSY; in adsp_alloc_memory_region()
388 desc = of_device_get_match_data(&pdev->dev); in adsp_probe()
390 return -EINVAL; in adsp_probe()
393 return -EPROBE_DEFER; in adsp_probe()
395 fw_name = desc->firmware_name; in adsp_probe()
396 ret = of_property_read_string(pdev->dev.of_node, "firmware-name", in adsp_probe()
398 if (ret < 0 && ret != -EINVAL) in adsp_probe()
401 rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops, in adsp_probe()
404 dev_err(&pdev->dev, "unable to allocate remoteproc\n"); in adsp_probe()
405 return -ENOMEM; in adsp_probe()
408 rproc->auto_boot = desc->auto_boot; in adsp_probe()
411 adsp = (struct qcom_adsp *)rproc->priv; in adsp_probe()
412 adsp->dev = &pdev->dev; in adsp_probe()
413 adsp->rproc = rproc; in adsp_probe()
414 adsp->pas_id = desc->pas_id; in adsp_probe()
415 adsp->has_aggre2_clk = desc->has_aggre2_clk; in adsp_probe()
416 adsp->info_name = desc->sysmon_name; in adsp_probe()
419 device_wakeup_enable(adsp->dev); in adsp_probe()
433 ret = adsp_pds_attach(&pdev->dev, adsp->active_pds, in adsp_probe()
434 desc->active_pd_names); in adsp_probe()
437 adsp->active_pd_count = ret; in adsp_probe()
439 ret = adsp_pds_attach(&pdev->dev, adsp->proxy_pds, in adsp_probe()
440 desc->proxy_pd_names); in adsp_probe()
443 adsp->proxy_pd_count = ret; in adsp_probe()
445 ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem, in adsp_probe()
450 qcom_add_glink_subdev(rproc, &adsp->glink_subdev, desc->ssr_name); in adsp_probe()
451 qcom_add_smd_subdev(rproc, &adsp->smd_subdev); in adsp_probe()
452 qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name); in adsp_probe()
453 adsp->sysmon = qcom_add_sysmon_subdev(rproc, in adsp_probe()
454 desc->sysmon_name, in adsp_probe()
455 desc->ssctl_id); in adsp_probe()
456 if (IS_ERR(adsp->sysmon)) { in adsp_probe()
457 ret = PTR_ERR(adsp->sysmon); in adsp_probe()
468 adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count); in adsp_probe()
470 adsp_pds_detach(adsp, adsp->active_pds, adsp->active_pd_count); in adsp_probe()
481 rproc_del(adsp->rproc); in adsp_remove()
483 qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev); in adsp_remove()
484 qcom_remove_sysmon_subdev(adsp->sysmon); in adsp_remove()
485 qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev); in adsp_remove()
486 qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev); in adsp_remove()
487 rproc_free(adsp->rproc); in adsp_remove()
618 "mss",
703 { .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
704 { .compatible = "qcom,msm8996-adsp-pil", .data = &adsp_resource_init},
705 { .compatible = "qcom,msm8996-slpi-pil", .data = &slpi_resource_init},
706 { .compatible = "qcom,msm8998-adsp-pas", .data = &msm8998_adsp_resource},
707 { .compatible = "qcom,msm8998-slpi-pas", .data = &msm8998_slpi_resource},
708 { .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init },
709 { .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init },
710 { .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init },
711 { .compatible = "qcom,sc7180-mpss-pas", .data = &mpss_resource_init},
712 { .compatible = "qcom,sdm845-adsp-pas", .data = &adsp_resource_init},
713 { .compatible = "qcom,sdm845-cdsp-pas", .data = &cdsp_resource_init},
714 { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
715 { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
716 { .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init},
717 { .compatible = "qcom,sm8150-slpi-pas", .data = &sm8150_slpi_resource},
718 { .compatible = "qcom,sm8250-adsp-pas", .data = &sm8250_adsp_resource},
719 { .compatible = "qcom,sm8250-cdsp-pas", .data = &sm8250_cdsp_resource},
720 { .compatible = "qcom,sm8250-slpi-pas", .data = &sm8250_slpi_resource},