mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 03:59:40 +02:00
remoteproc: qcom_q6v5_pas: Add support to setup mpss dsm mem region
MPSS DSM mem region is needed by Modem PDs. This change sets it up before bringing MPSS out of reset. Change-Id: Ic882b678f373deb5c61e250f8620b5dd4c092ee2 Signed-off-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com> Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
This commit is contained in:
parent
f852a8b67d
commit
f5e30fb6c7
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/soc/qcom/smem.h>
|
||||
#include <linux/soc/qcom/smem_state.h>
|
||||
#include <linux/soc/qcom/qcom_aoss.h>
|
||||
#include <soc/qcom/secure_buffer.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/rproc_qcom.h>
|
||||
|
|
@ -49,6 +50,7 @@ static struct icc_path *scm_perf_client;
|
|||
static int scm_pas_bw_count;
|
||||
static DEFINE_MUTEX(scm_pas_bw_mutex);
|
||||
bool timeout_disabled;
|
||||
static bool mpss_dsm_mem_setup;
|
||||
|
||||
struct adsp_data {
|
||||
int crash_reason_smem;
|
||||
|
|
@ -952,6 +954,41 @@ static int adsp_setup_32b_dma_allocs(struct qcom_adsp *adsp)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int setup_mpss_dsm_mem(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *node;
|
||||
struct resource res;
|
||||
int hlosvm[1] = {VMID_HLOS};
|
||||
int mssvm[1] = {VMID_MSS_MSA};
|
||||
int vmperm[1] = {PERM_READ | PERM_WRITE};
|
||||
phys_addr_t mem_phys;
|
||||
u64 mem_size;
|
||||
int ret;
|
||||
|
||||
node = of_parse_phandle(pdev->dev.of_node, "mpss_dsm_mem_reg", 0);
|
||||
if (!node) {
|
||||
dev_err(&pdev->dev, "mpss dsm mem region is missing\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = of_address_to_resource(node, 0, &res);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "address to resource failed for mpss dsm mem\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
mem_phys = res.start;
|
||||
mem_size = resource_size(&res);
|
||||
ret = hyp_assign_phys(mem_phys, mem_size, hlosvm, 1, mssvm, vmperm, 1);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "hyp assign for mpss dsm mem failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
mpss_dsm_mem_setup = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int adsp_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct adsp_data *desc;
|
||||
|
|
@ -975,6 +1012,14 @@ static int adsp_probe(struct platform_device *pdev)
|
|||
if (ret < 0 && ret != -EINVAL)
|
||||
return ret;
|
||||
|
||||
if (!mpss_dsm_mem_setup && !strcmp(fw_name, "modem.mdt")) {
|
||||
ret = setup_mpss_dsm_mem(pdev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to setup mpss dsm mem\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (desc->minidump_id)
|
||||
ops = &adsp_minidump_ops;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user