dsp: adsp_loader: Load adsp mdt using fuse-not-supported property
As per current code there isn't a way to load custom adsp-mdt image. Use kernel api to load custom adsp-mdt. Change-Id: I42f1186741dff0b9bd953e536eb33907d3c6cb90 Signed-off-by: Faiz Nabi Kuchay <quic_fkuchay@quicinc.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2014, 2017-2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2014, 2017-2021, The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -47,6 +47,7 @@ struct adsp_loader_private {
|
|||||||
struct kobject *boot_adsp_obj;
|
struct kobject *boot_adsp_obj;
|
||||||
struct attribute_group *attr_group;
|
struct attribute_group *attr_group;
|
||||||
char *adsp_fw_name;
|
char *adsp_fw_name;
|
||||||
|
char *adsp_dtb_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct kobj_attribute adsp_boot_attribute =
|
static struct kobj_attribute adsp_boot_attribute =
|
||||||
@@ -152,6 +153,20 @@ load_adsp:
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!priv->adsp_dtb_name) {
|
||||||
|
dev_info(&pdev->dev, "%s: Load default ADSP DTB\n",
|
||||||
|
__func__);
|
||||||
|
} else {
|
||||||
|
dev_info(&pdev->dev, "%s: Load ADSP DTB with fw name %s\n",
|
||||||
|
__func__, priv->adsp_dtb_name);
|
||||||
|
rc = qcom_rproc_set_dtb_firmware(priv->pil_h,
|
||||||
|
priv->adsp_fw_name);
|
||||||
|
if (rc) {
|
||||||
|
dev_err(&pdev->dev, "%s: rproc set dtb firmware failed,\n",
|
||||||
|
__func__);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
rc = rproc_boot(priv->pil_h);
|
rc = rproc_boot(priv->pil_h);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(&pdev->dev, "%s: pil get failed,\n",
|
dev_err(&pdev->dev, "%s: pil get failed,\n",
|
||||||
@@ -340,6 +355,7 @@ static int adsp_loader_probe(struct platform_device *pdev)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
u32 adsp_fuse_not_supported = 0;
|
u32 adsp_fuse_not_supported = 0;
|
||||||
const char *adsp_fw_name;
|
const char *adsp_fw_name;
|
||||||
|
const char *adsp_dtb_name;
|
||||||
struct property *prop;
|
struct property *prop;
|
||||||
int size;
|
int size;
|
||||||
phandle rproc_phandle;
|
phandle rproc_phandle;
|
||||||
@@ -408,6 +424,24 @@ static int adsp_loader_probe(struct platform_device *pdev)
|
|||||||
goto wqueue;
|
goto wqueue;
|
||||||
strlcpy(priv->adsp_fw_name, adsp_fw_name,
|
strlcpy(priv->adsp_fw_name, adsp_fw_name,
|
||||||
fw_name_size);
|
fw_name_size);
|
||||||
|
|
||||||
|
ret = of_property_read_string(pdev->dev.of_node,
|
||||||
|
"adsp-dtb-name",
|
||||||
|
&adsp_dtb_name);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_dbg(&pdev->dev, "%s: unable to read fw-dtb-name\n",
|
||||||
|
__func__);
|
||||||
|
goto wqueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
fw_name_size = strlen(adsp_dtb_name) + 1;
|
||||||
|
priv->adsp_dtb_name = devm_kzalloc(&pdev->dev,
|
||||||
|
fw_name_size,
|
||||||
|
GFP_KERNEL);
|
||||||
|
if (!priv->adsp_dtb_name)
|
||||||
|
goto wqueue;
|
||||||
|
strscpy(priv->adsp_dtb_name, adsp_dtb_name,
|
||||||
|
fw_name_size);
|
||||||
}
|
}
|
||||||
goto wqueue;
|
goto wqueue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user