Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp83232ybk; Tue, 19 May 2020 16:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8qKowFaNozziz+05FdNrfgjxSOYR2IBYl87FyQ1COYz6AeAJPVaJSWO+P4lfq2o0wYLA4 X-Received: by 2002:a05:6402:3cd:: with SMTP id t13mr946643edw.285.1589929824444; Tue, 19 May 2020 16:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589929824; cv=none; d=google.com; s=arc-20160816; b=DmEyMl/1Y+NFUFd5UbaCxJ5SS2+etywCiYhBociewfQm2ug4w2vqPiaHLta2svwvJH B6tpQu9BtH2W2oFUzUdkeEfufqztD/ebOda4nTY+vyN9evA7HikILVs+NygZhaem6Uul DHoA5EatyFmZ5WFsU/vrMIOVo0Eoye9VX/dxMRvgygi6A59RVDF/G2WUMIx8i7gT4NEP D/ZtE+pDXhz/9XpisnRA9KOEjrkFnTMdPH8cHex434zjRPX6/B5xUlp4TdvJjdcdZLZo lELkI6+zqxt4kMvYx9o+EMpCgoAx9Of+LloQ02c9hSDSS/7Uhxs4levvsq/W/sdnon5G q0OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ixiNo870L0O1tt3XKRzXP6CLMwM6qsLZGdg3orveJ2c=; b=RmYGgxksWO2BzTeBqUiim83EPjrKM79mF+m+KhX0FsZ0XbIxrUImugn2laLPA8cJOT mxZHrXpV3zbWu7uSV64WHBIOY+0WnMLMkKepo+SGt3Zl0dyf4ITU4DMMJTDyAxpuVcqQ XJAfnZp2cZoStckOT5vu8SSjcgy8W20uydNcpB3fSKLN8/H7VH/4QUzCDrbNaEv8ocI2 U7uu4T+uGNM0INVAR07hNbOCP2Fp7WpoT1qM5liOtzvGfR7HQF69yH6XpLj5L2nD3Pzu Q1gKnGiQiLj2FANK1jkg6Fwl5t66H92KANbhZpd2lvCGB/fBtdo02RwE7MdxqEVJ2U/w ScCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v5UbAXUn; 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 b2si634027edq.115.2020.05.19.16.10.01; Tue, 19 May 2020 16:10:24 -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=v5UbAXUn; 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 S1727983AbgESXIf (ORCPT + 99 others); Tue, 19 May 2020 19:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbgESXIe (ORCPT ); Tue, 19 May 2020 19:08:34 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 391DFC061A0E for ; Tue, 19 May 2020 16:08:33 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id y198so640203pfb.4 for ; Tue, 19 May 2020 16:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ixiNo870L0O1tt3XKRzXP6CLMwM6qsLZGdg3orveJ2c=; b=v5UbAXUn670k0FjId5F7YzbW0fcW5cn2gHPMS0Gj4Zk2ddoPIrDhWCG7BFXfHcji2d 9LX2nlqhy+empqSs9qr1M35ULuuyLPYvUYG7Tbf4PVaBY4Nu9i/W1gUlKp9Vwx/CBjec iIWCw++l2BQz6VVpT3Xyl3dQM/XP0WROJLw+H1ij4R0yVTgAamijl2PiJCB4/zrDfRnP geemSmsmxETLj6rBBVRrr/CRr1BMSZhlFKNotBYD1mhC83pJUYVWfSq3N2Z7MFlCj4Df 2IjyfPkGLOn0+otKJQg13e2mxEhOHEGItzW0N4V/cnGE+xihULDKasBxnz2PPBYl0cVc +71g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ixiNo870L0O1tt3XKRzXP6CLMwM6qsLZGdg3orveJ2c=; b=kgO0SASSfju6eGO7yAt3EoFsiLZ71J+cpJ7aqv3Y/Eb7/mOXa26/zPtfmuTkc2IuLk axbmgSLiog3gxVDIiDcGGQKT+xfNOLWtALYVpW7Crvzx8YG2kOyDM/k53wppay7NzES7 SSAyO1sk0l4nlPZtvNejTEwrixq7FZQqKSOajY4/p/XRU1GZOydE3l7ccfHznzv3vJR8 7KkS7ROWBw/ndJYNAtCTh6NlRPp+do61c0eb3qEeCuglmRNmwOxoUfOlwO02NIGgHMKK 5R5wuyMP+1nCV5oE+tW8yaKxPyXXXu4zqV21rNaJ/eDOoyvDMy/3u+Frl1NGxkn7P1Jx HpkA== X-Gm-Message-State: AOAM531xzpxY6E1OIwhR/DfeC57joR+xmBUNcnZKvf0eOeqLEtDHgoYg 82u/Up+W4zswPx9b9G0cE6a33A== X-Received: by 2002:a65:68d2:: with SMTP id k18mr1413767pgt.110.1589929712508; Tue, 19 May 2020 16:08:32 -0700 (PDT) Received: from ripper (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id p6sm391805pgl.26.2020.05.19.16.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 16:08:31 -0700 (PDT) Date: Tue, 19 May 2020 16:07:59 -0700 From: Bjorn Andersson To: rishabhb@codeaurora.org Cc: Andy Gross , Ohad Ben-Cohen , Rob Herring , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc-owner@vger.kernel.org Subject: Re: [PATCH v5 3/5] remoteproc: qcom: Update PIL relocation info on load Message-ID: <20200519230759.GA3008945@ripper> References: <20200513055641.1413100-1-bjorn.andersson@linaro.org> <20200513055641.1413100-4-bjorn.andersson@linaro.org> <3ff29ccc94d3097fb39b7df377754af6@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ff29ccc94d3097fb39b7df377754af6@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 19 May 11:14 PDT 2020, rishabhb@codeaurora.org wrote: > On 2020-05-12 22:56, Bjorn Andersson wrote: > > 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); > mem_reloc is used to calculate offset and then we again add that offset to > the > ioremapped region base. So we should pass adsp->mem_phys as start here? You're correct, I will respin this. Thanks, Bjorn