Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp270745ybk; Tue, 12 May 2020 22:59:36 -0700 (PDT) X-Google-Smtp-Source: APiQypInCbOFzMqSPdUZZuQ7LbxOkpcIF2v/uVHHKGSeljZ1CWFOQ7bMJwhMScpS61GLvi0g00Gk X-Received: by 2002:aa7:c0d1:: with SMTP id j17mr21275006edp.308.1589349576342; Tue, 12 May 2020 22:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589349576; cv=none; d=google.com; s=arc-20160816; b=smxdfBUFr+j/zxn8GAkKvfsLJcUEH6LHs651Xicdy9GZ68l3ivja1p5f8QU4XofIVA l+6PrIl+a3tlDHXivqqkTM5KuuN8/24ljtYdkhf1wyCm3ieq2EtcReDrqIO+BCthduPY KXNG8KHeLDCE2cq1e8lT/GmLUEOzGdzZa4EAelpTrzb1uv4S8gKuEyudNg40nUx870GV UmU74dyd9LpSpzhPDcTUomdnjU5XvK8P2VRZ9REQTuT20W0X6XUuMW3sH+wrpVjL3NTq /Q2MV/r+gg1vWB3I9FGoqKPqyCLfbxd2xPt7vc2yHiJQCEvHsMEBK6qPmIhByLR6CMb3 A7tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HD1LTSNg68RqiJimoByZ/l0w6Op63ozOb2M6v+ilFQY=; b=ejMRhm+vFaJJKt2HXfctGUCATWgsvAmcIPopUF0n5AigYMXqQ9SZ28GVA0UIw00God xGN3OkAiWvRfjUN3sOKZKWsN4NEjSyVf/ufx9n8pWVBl4dyxe85K8eESg6xdRuMxRxCi Vi1g1Qahl62fcGsYApbkqSxlvxntA/wF3taqMIOHgbWhn7Md71cuua2f6GZC99+kAcNj tlyDWKfXOJap8yBiS5vVldIKXLLOPVjWGS1sJ+fJx5J3oYOFQ86npYj61/+SEOVL22jR aIQ9Vob5/DqNZ3kluMeNuWoIWtEH0DvLArx/VN9Lmq51kYsyygOdskmIexplQHMzG0zG wo8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WBtnkwOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df12si8653675edb.540.2020.05.12.22.59.13; Tue, 12 May 2020 22:59:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WBtnkwOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729238AbgEMF5f (ORCPT + 99 others); Wed, 13 May 2020 01:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729199AbgEMF5e (ORCPT ); Wed, 13 May 2020 01:57:34 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E31FC061A0E for ; Tue, 12 May 2020 22:57:33 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id t7so6408392plr.0 for ; Tue, 12 May 2020 22:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HD1LTSNg68RqiJimoByZ/l0w6Op63ozOb2M6v+ilFQY=; b=WBtnkwOLFmhCHo+vvKyGoGHo0zPNi9prg8+FntowXgGxJ0tQV/nRlakPpm6ZVtKWfz FQ1L1cJzSyzeX8mFgXT7M0Zm/uauiZd69xv16K4UMeuf48nKI2L54U+Ws8YwaAVY1s/t SYcTiV+XLVw12oMV/hG51HXbgtVx41778rNZn7tgdb1IUj+CRo4wmq56LsjnAn3HSGxk c/NvVvN8B7EVHqf9BluxU9gyhqmyA9EqJyXsZkcjZhsuM/JNnPgccOOLedc6rI13eMOd 702faH5FquR5/WV7N+XI4J42AQ9Dbp1NmTIlGbb3t2KXzA4MO3saT6JKp1GgcGxIddr+ iJ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HD1LTSNg68RqiJimoByZ/l0w6Op63ozOb2M6v+ilFQY=; b=j8hUdzFkxYBLZ7IQt20yKgM0jPLVBxuMuOKkoqEztao06IIaZEHUSNuuSGUFHspHxR Db4u2s+43p4TqZlpEQQO238I+kFvod9Rx/V236bTBduW5RCsb2w3bp2Dti+7MG3C+Plu oEkG2R85w28QWFC5jpKxmVbn9jpokXx5LpCduepAn5olosKQg/LpppWZk7efIs8NIkhz 71lg+kU5x2pVDn4BbSUZfCV6ovoLKxatVfd1fmYE/I+hYNtVizmxWuUFuUAODtJUEaVX 3QUojQHa1zbeWEjz9paOIR859KQDdRYHOsmroXcxqRqA94g+mn5aVpz4xFWIy9Rw+2m4 4p5Q== X-Gm-Message-State: AGi0PuaQuTwSLuT5PH7u2H/JLgdc9mosOEUzPzmclgU8cDOKE65x1I9m yVEX1KB0JS7dMpzU9/2JVluzqg== X-Received: by 2002:a17:902:6b48:: with SMTP id g8mr21578357plt.96.1589349452608; Tue, 12 May 2020 22:57:32 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id w192sm14131161pff.126.2020.05.12.22.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 22:57:32 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , Bjorn Andersson , Ohad Ben-Cohen , Rob Herring Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/5] remoteproc: qcom: Update PIL relocation info on load Date: Tue, 12 May 2020 22:56:39 -0700 Message-Id: <20200513055641.1413100-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513055641.1413100-1-bjorn.andersson@linaro.org> References: <20200513055641.1413100-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the PIL relocation information in IMEM with information about where the firmware for various remoteprocs are loaded. Signed-off-by: Bjorn Andersson --- Changes since v4: - Dropped unnecessary comment about ignoring return value. drivers/remoteproc/Kconfig | 3 +++ drivers/remoteproc/qcom_q6v5_adsp.c | 16 +++++++++++++--- drivers/remoteproc/qcom_q6v5_mss.c | 3 +++ drivers/remoteproc/qcom_q6v5_pas.c | 15 ++++++++++++--- drivers/remoteproc/qcom_q6v5_wcss.c | 14 +++++++++++--- drivers/remoteproc/qcom_wcnss.c | 14 +++++++++++--- 6 files changed, 53 insertions(+), 12 deletions(-) diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 8088ca4dd6dc..6bd42a411ca8 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -126,6 +126,7 @@ config QCOM_Q6V5_ADSP depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n depends on QCOM_SYSMON || QCOM_SYSMON=n select MFD_SYSCON + select QCOM_PIL_INFO select QCOM_MDT_LOADER select QCOM_Q6V5_COMMON select QCOM_RPROC_COMMON @@ -158,6 +159,7 @@ config QCOM_Q6V5_PAS depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n depends on QCOM_SYSMON || QCOM_SYSMON=n select MFD_SYSCON + select QCOM_PIL_INFO select QCOM_MDT_LOADER select QCOM_Q6V5_COMMON select QCOM_RPROC_COMMON @@ -209,6 +211,7 @@ config QCOM_WCNSS_PIL depends on QCOM_SMEM depends on QCOM_SYSMON || QCOM_SYSMON=n select QCOM_MDT_LOADER + select QCOM_PIL_INFO select QCOM_RPROC_COMMON select QCOM_SCM help diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index d2a2574dcf35..c539e89664cb 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -26,6 +26,7 @@ #include #include "qcom_common.h" +#include "qcom_pil_info.h" #include "qcom_q6v5.h" #include "remoteproc_internal.h" @@ -82,6 +83,7 @@ struct qcom_adsp { unsigned int halt_lpass; int crash_reason_smem; + const char *info_name; struct completion start_done; struct completion stop_done; @@ -164,10 +166,17 @@ static int qcom_adsp_shutdown(struct qcom_adsp *adsp) static int adsp_load(struct rproc *rproc, const struct firmware *fw) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; + int ret; + + ret = qcom_mdt_load_no_init(adsp->dev, fw, rproc->firmware, 0, + adsp->mem_region, adsp->mem_phys, + adsp->mem_size, &adsp->mem_reloc); + if (ret) + return ret; + + qcom_pil_info_store(adsp->info_name, adsp->mem_reloc, adsp->mem_size); - return qcom_mdt_load_no_init(adsp->dev, fw, rproc->firmware, 0, - adsp->mem_region, adsp->mem_phys, adsp->mem_size, - &adsp->mem_reloc); + return 0; } static int adsp_start(struct rproc *rproc) @@ -436,6 +445,7 @@ static int adsp_probe(struct platform_device *pdev) adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev; adsp->rproc = rproc; + adsp->info_name = desc->sysmon_name; platform_set_drvdata(pdev, adsp); ret = adsp_alloc_memory_region(adsp); diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index c4936f4d1e80..fdbcae11ae64 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -29,6 +29,7 @@ #include "remoteproc_internal.h" #include "qcom_common.h" +#include "qcom_pil_info.h" #include "qcom_q6v5.h" #include @@ -1221,6 +1222,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc) else if (ret < 0) dev_err(qproc->dev, "MPSS authentication failed: %d\n", ret); + qcom_pil_info_store("modem", mpss_reloc, qproc->mpss_size); + release_firmware: release_firmware(fw); out: diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 3bb69f58e086..84cb19231c35 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -25,6 +25,7 @@ #include #include "qcom_common.h" +#include "qcom_pil_info.h" #include "qcom_q6v5.h" #include "remoteproc_internal.h" @@ -64,6 +65,7 @@ struct qcom_adsp { int pas_id; int crash_reason_smem; bool has_aggre2_clk; + const char *info_name; struct completion start_done; struct completion stop_done; @@ -117,11 +119,17 @@ static void adsp_pds_disable(struct qcom_adsp *adsp, struct device **pds, static int adsp_load(struct rproc *rproc, const struct firmware *fw) { struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; + int ret; - return qcom_mdt_load(adsp->dev, fw, rproc->firmware, adsp->pas_id, - adsp->mem_region, adsp->mem_phys, adsp->mem_size, - &adsp->mem_reloc); + ret = qcom_mdt_load(adsp->dev, fw, rproc->firmware, adsp->pas_id, + adsp->mem_region, adsp->mem_phys, adsp->mem_size, + &adsp->mem_reloc); + if (ret) + return ret; + qcom_pil_info_store(adsp->info_name, adsp->mem_reloc, adsp->mem_size); + + return 0; } static int adsp_start(struct rproc *rproc) @@ -405,6 +413,7 @@ static int adsp_probe(struct platform_device *pdev) adsp->rproc = rproc; adsp->pas_id = desc->pas_id; adsp->has_aggre2_clk = desc->has_aggre2_clk; + adsp->info_name = desc->sysmon_name; platform_set_drvdata(pdev, adsp); ret = adsp_alloc_memory_region(adsp); diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c index f1924b740a10..962e37a86b8b 100644 --- a/drivers/remoteproc/qcom_q6v5_wcss.c +++ b/drivers/remoteproc/qcom_q6v5_wcss.c @@ -421,10 +421,18 @@ static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len) static int q6v5_wcss_load(struct rproc *rproc, const struct firmware *fw) { struct q6v5_wcss *wcss = rproc->priv; + int ret; + + ret = qcom_mdt_load_no_init(wcss->dev, fw, rproc->firmware, + 0, wcss->mem_region, wcss->mem_phys, + wcss->mem_size, &wcss->mem_reloc); + if (ret) + return ret; + + /* Failures only affect post mortem debugging, so ignore return value */ + qcom_pil_info_store("wcnss", wcss->mem_reloc, wcss->mem_size); - return qcom_mdt_load_no_init(wcss->dev, fw, rproc->firmware, - 0, wcss->mem_region, wcss->mem_phys, - wcss->mem_size, &wcss->mem_reloc); + return ret; } static const struct rproc_ops q6v5_wcss_ops = { diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index 5d65e1a9329a..229482b3231f 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -27,6 +27,7 @@ #include "qcom_common.h" #include "remoteproc_internal.h" +#include "qcom_pil_info.h" #include "qcom_wcnss.h" #define WCNSS_CRASH_REASON_SMEM 422 @@ -145,10 +146,17 @@ void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss, static int wcnss_load(struct rproc *rproc, const struct firmware *fw) { struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; + int ret; + + ret = qcom_mdt_load(wcnss->dev, fw, rproc->firmware, WCNSS_PAS_ID, + wcnss->mem_region, wcnss->mem_phys, + wcnss->mem_size, &wcnss->mem_reloc); + if (ret) + return ret; + + qcom_pil_info_store("wcnss", wcnss->mem_reloc, wcnss->mem_size); - return qcom_mdt_load(wcnss->dev, fw, rproc->firmware, WCNSS_PAS_ID, - wcnss->mem_region, wcnss->mem_phys, - wcnss->mem_size, &wcnss->mem_reloc); + return 0; } static void wcnss_indicate_nv_download(struct qcom_wcnss *wcnss) -- 2.26.2