summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/qcom_common.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-09-05 01:12:26 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-05 01:12:26 +0300
commit2a3a850ed008dba2cb9707c65c5726efcfc72449 (patch)
tree2831430d118e21a22c5f6d121392a196e7a01f6d /drivers/remoteproc/qcom_common.c
parent3d904704c8a23cda6423f82aadea1336df31b864 (diff)
parent18cf4fcd7bdc1864e75127f4fd15abc0bc76ec7f (diff)
downloadlinux-2a3a850ed008dba2cb9707c65c5726efcfc72449.tar.xz
Merge tag 'rproc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull remoteproc updates from Bjorn Andersson: "Support for booting the iMX remoteprocs using MMIO, instead of SMCCC is added. The iMX driver is also extended to support delivering interrupts from an arbitrary number of vdev. Support is added to the TI PRU driver, to allow GPMUX to be controlled from DeviceTree. The Qualcomm coredump collector is extended to fall back to generating a full coredump, in the case that the loaded firmware doesn't support generating minidump. The overly terse MD abbreviation of "MINIDUMP" is expanded, to make the code easier on the eye. The list of Qualcomm Sensor Low Power Island (SLPI) instances supported is cleaned up, and SDM845 is added. SDM630/636/660 support for the modem subsystem (mss) is added. All the Qualcomm drivers are transitioned to of_reserved_mem_lookup() instead of open coding the resolution of reserved-memory regions, to gain handling of error cases. A couple of drivers are transitioned to use devm_platform_ioremap_resource_byname(). The stm32 remoteproc driver's PM operations are updated to modern macros, to avoid the "unused variable"-warning in some configurations. Drivers are transitioned away from directly including of_device.h" * tag 'rproc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (23 commits) remoteproc: pru: add support for configuring GPMUX based on client setup remoteproc: stm32: fix incorrect optional pointers remoteproc: imx_rproc: Switch iMX8MN/MP from SMCCC to MMIO dt-bindings: remoteproc: imx_rproc: Support i.MX8MN/P MMIO dt-bindings: remoteproc: qcom,msm8996-mss-pil: Fix 8996 clocks remoteproc: qcom: pas: add SDM845 SLPI compatible remoteproc: qcom: q6v5-mss: Add support for SDM630/636/660 dt-bindings: remoteproc: qcom,msm8996-mss-pil: Add SDM660 compatible remoteproc: qcom: Expand MD_* as MINIDUMP_* remoteproc: qcom: pas: refactor SLPI remoteproc init dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible remoteproc: qcom: wcnss: use devm_platform_ioremap_resource_byname() remoteproc: qcom: q6v5: use devm_platform_ioremap_resource_byname() dt-bindings: remoteproc: qcom: sm6115-pas: Add QCM2290 remoteproc: qcom: Add full coredump fallback mechanism remoteproc: core: Export the rproc coredump APIs remoteproc: qcom: Use of_reserved_mem_lookup() remoteproc: imx_rproc: iterate all notifiyids in rx callback dt-bindings: remoteproc: qcom,adsp: bring back firmware-name dt-bindings: remoteproc: qcom,sm8550-pas: require memory-region ...
Diffstat (limited to 'drivers/remoteproc/qcom_common.c')
-rw-r--r--drivers/remoteproc/qcom_common.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index a0d4238492e9..03e5f5d533eb 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -29,9 +29,9 @@
#define MAX_NUM_OF_SS 10
#define MAX_REGION_NAME_LENGTH 16
#define SBL_MINIDUMP_SMEM_ID 602
-#define MD_REGION_VALID ('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
-#define MD_SS_ENCR_DONE ('D' << 24 | 'O' << 16 | 'N' << 8 | 'E' << 0)
-#define MD_SS_ENABLED ('E' << 24 | 'N' << 16 | 'B' << 8 | 'L' << 0)
+#define MINIDUMP_REGION_VALID ('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
+#define MINIDUMP_SS_ENCR_DONE ('D' << 24 | 'O' << 16 | 'N' << 8 | 'E' << 0)
+#define MINIDUMP_SS_ENABLED ('E' << 24 | 'N' << 16 | 'B' << 8 | 'L' << 0)
/**
* struct minidump_region - Minidump region
@@ -125,7 +125,7 @@ static int qcom_add_minidump_segments(struct rproc *rproc, struct minidump_subsy
for (i = 0; i < seg_cnt; i++) {
memcpy_fromio(&region, ptr + i, sizeof(region));
- if (le32_to_cpu(region.valid) == MD_REGION_VALID) {
+ if (le32_to_cpu(region.valid) == MINIDUMP_REGION_VALID) {
name = kstrndup(region.name, MAX_REGION_NAME_LENGTH - 1, GFP_KERNEL);
if (!name) {
iounmap(ptr);
@@ -168,12 +168,21 @@ void qcom_minidump(struct rproc *rproc, unsigned int minidump_id,
*/
if (subsystem->regions_baseptr == 0 ||
le32_to_cpu(subsystem->status) != 1 ||
- le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED ||
- le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) {
+ le32_to_cpu(subsystem->enabled) != MINIDUMP_SS_ENABLED) {
+ return rproc_coredump(rproc);
+ }
+
+ if (le32_to_cpu(subsystem->encryption_status) != MINIDUMP_SS_ENCR_DONE) {
dev_err(&rproc->dev, "Minidump not ready, skipping\n");
return;
}
+ /**
+ * Clear out the dump segments populated by parse_fw before
+ * re-populating them with minidump segments.
+ */
+ rproc_coredump_cleanup(rproc);
+
ret = qcom_add_minidump_segments(rproc, subsystem, rproc_dumpfn_t);
if (ret) {
dev_err(&rproc->dev, "Failed with error: %d while adding minidump entries\n", ret);