Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4313831ybv; Mon, 10 Feb 2020 16:54:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzO1m7oO7AXmqFSOQxXcJ1HI4NwYKG4QnNEfBcdzi5UoaI88rwQETm5lBIQxx639BmF1nWc X-Received: by 2002:aca:cdd0:: with SMTP id d199mr1281823oig.49.1581382476326; Mon, 10 Feb 2020 16:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581382476; cv=none; d=google.com; s=arc-20160816; b=jtNBssmEBktXWj0moGgKQNSQ1HWMbwAJxiW4l/z0+U8kTJaL28imMCr46UaX1jNopF kflkViUOYW76uu9HcP/ktU4oU/WD4N0Y+lwWrrD2y7NxFfkjRvYvCB0f5ig/fSfC8LsY vNiGjGTh61zTP9KIO7fg8RfVxwA/zCWJ/Rh9T0Kir6Q75u2+x27XmROtWvKSjIsQfSJ8 e26hbnOES8am85ZfpxrrUs3T2jQXgKtbtByRVCRpekQM7r+pyyge0KHpITESQvXVmTST Vb1WK53XPmJTWCJOVQ73YM5ZuSj0n75Ygtg6K4125lccD355ClNwRowauAFneZioxpTk cwSg== 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=oxAAk0R22IM81nachEV7uLIIgcESZ111r/417hPADp4=; b=HB1xQ+Wyjvh5IZWfKl0o1MjKnZwi+9ZCvDny3z8f2edX8q9bgAniT0c0kHrWgTGNvq PU18nqnWueMH+sBWwFk3CXIROfwN9ukpMEwGtyWs28u2OoYUTLOoQ39rInyVLLocLK+K EK7SIXwjvgMEm78ZJ7C+uybVIrJ0vxNiNtd8EOcxjLQ3SMzygZhPOMz71BS10eMZRy4M yl73K6z2JFN93pvSbEh1FYnFi0Vo6d9AijLgz5i4mOJ+pX/Kb7CLfTCyrSj7Sc7+eggB JlB0j4SOTw/8MJ8IC+88oshpvFQuXM9P4/elNeNh7VTgoShN+FUDKR0dXDb9iTMYi7Ed bQcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FS9SQCcU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w197si966994oia.101.2020.02.10.16.54.23; Mon, 10 Feb 2020 16:54:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FS9SQCcU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727821AbgBKAwn (ORCPT + 99 others); Mon, 10 Feb 2020 19:52:43 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:53551 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727635AbgBKAwN (ORCPT ); Mon, 10 Feb 2020 19:52:13 -0500 Received: by mail-pj1-f66.google.com with SMTP id n96so527833pjc.3 for ; Mon, 10 Feb 2020 16:52:13 -0800 (PST) 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=oxAAk0R22IM81nachEV7uLIIgcESZ111r/417hPADp4=; b=FS9SQCcUwhRF76ZZTJ+7VOq9qQglqeJNMReMgR8pKHZuA6ivzxzx2yyZoBqY8ET0iG mgpL9/8bneZrw0J2GKmszK4jmAgX1PglxvTwe9fQSzGBfRanL2itNh2yGHV034WenHZ/ 9zIfk83WRBGUvPG6bDNHoqaBIrx/SgiN/NZpArqWXZ1mE51D13xCzArVj9DQUK6ekRfT gpX9oGQsuCVnBBGcAEHha5aGcCiOxPhklNM8CX3xetvZF6RvoQIO5x2eoroyW4BQps8e tb1jZaOX+cxdEDzkIACZAB75/6jwFncbhpIVW2kOQqcSjceEROKRSc9iGNKM7nqQvkqg F5UA== 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=oxAAk0R22IM81nachEV7uLIIgcESZ111r/417hPADp4=; b=Z8M+wxYT3RlslPebSq/w+BzBI/A4G4daxfPeOv6SulVPbBBkdefl65ShPytjqG6Jtl 9KsbDmn7DJ06p8IEM9wvu5kWGRJRXwT9ufykMH+hbEbXW3ljeVoIer7/HcFXNfcA0oAm MFkiCPr+kJ2MUkOiGiSVJykdzir8/89ydpuJwTW9otwbKExSSUCopEX4SKQ74nO55YIJ 58f5x9OtD+jqtBtmn4pyr5aLGUncfGvfFb7bVzH9Aktv9dzpwLIGb6Q5RQgY+2NOiwX/ z7ZcMw/dXozdD6qWEx/2uZvDZrDrn1xpE//QmgQjv/J0DeZr0cR3LKWBoMSjPbd7N8b3 Xbew== X-Gm-Message-State: APjAAAV6kFr4PgYpenB6gXyZt0LRCYQNwOyEQ79khy936InwTiTeyNOZ OiKm53k02izwknls2agNr/uujA== X-Received: by 2002:a17:902:8498:: with SMTP id c24mr608660plo.233.1581382332976; Mon, 10 Feb 2020 16:52:12 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id q21sm1538480pff.105.2020.02.10.16.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 16:52:12 -0800 (PST) From: Bjorn Andersson To: Bjorn Andersson , Ohad Ben-Cohen Cc: Andy Gross , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sibi Sankar , Rishabh Bhatnagar Subject: [PATCH v3 3/8] remoteproc: qcom: Update IMEM PIL info on load Date: Mon, 10 Feb 2020 16:50:54 -0800 Message-Id: <20200211005059.1377279-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200211005059.1377279-1-bjorn.andersson@linaro.org> References: <20200211005059.1377279-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 info region structure in IMEM with information about where the firmware for various remoteprocs are loaded. Signed-off-by: Bjorn Andersson --- Changes since v2: - Wrapped a long line drivers/remoteproc/Kconfig | 3 +++ drivers/remoteproc/qcom_q6v5_adsp.c | 19 ++++++++++++++++--- drivers/remoteproc/qcom_q6v5_mss.c | 6 ++++++ drivers/remoteproc/qcom_q6v5_pas.c | 18 +++++++++++++++--- drivers/remoteproc/qcom_wcnss.c | 17 ++++++++++++++--- 5 files changed, 54 insertions(+), 9 deletions(-) diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 20c8194e610e..7f4834ab06c2 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -129,6 +129,7 @@ config QCOM_Q6V5_MSS 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 @@ -145,6 +146,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 @@ -193,6 +195,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 e953886b2eb7..19f784adf91c 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; - return qcom_mdt_load_no_init(adsp->dev, fw, rproc->firmware, 0, - adsp->mem_region, adsp->mem_phys, adsp->mem_size, - &adsp->mem_reloc); + qcom_pil_info_store(adsp->info_name, adsp->mem_reloc, adsp->mem_size); + + return 0; } static int adsp_start(struct rproc *rproc) @@ -413,6 +422,9 @@ static int adsp_probe(struct platform_device *pdev) struct rproc *rproc; int ret; + if (!qcom_pil_info_available()) + return -EPROBE_DEFER; + desc = of_device_get_match_data(&pdev->dev); if (!desc) return -EINVAL; @@ -427,6 +439,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 a1cc9cbe038f..66ed4600db78 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -28,6 +28,7 @@ #include "remoteproc_internal.h" #include "qcom_common.h" +#include "qcom_pil_info.h" #include "qcom_q6v5.h" #include @@ -1166,6 +1167,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: @@ -1555,6 +1558,9 @@ static int q6v5_probe(struct platform_device *pdev) if (desc->need_mem_protection && !qcom_scm_is_available()) return -EPROBE_DEFER; + if (!qcom_pil_info_available()) + return -EPROBE_DEFER; + mba_image = desc->hexagon_mba_image; ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name", 0, &mba_image); diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index edf9d0e1a235..d20ce3c62256 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; + + 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; - return qcom_mdt_load(adsp->dev, fw, rproc->firmware, adsp->pas_id, - adsp->mem_region, adsp->mem_phys, adsp->mem_size, - &adsp->mem_reloc); + qcom_pil_info_store(adsp->info_name, adsp->mem_reloc, adsp->mem_size); + return 0; } static int adsp_start(struct rproc *rproc) @@ -376,6 +384,9 @@ static int adsp_probe(struct platform_device *pdev) if (!qcom_scm_is_available()) return -EPROBE_DEFER; + if (!qcom_pil_info_available()) + return -EPROBE_DEFER; + fw_name = desc->firmware_name; ret = of_property_read_string(pdev->dev.of_node, "firmware-name", &fw_name); @@ -396,6 +407,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_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index dc135754bb9c..2c1cefeacf97 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; - return qcom_mdt_load(wcnss->dev, fw, rproc->firmware, WCNSS_PAS_ID, - wcnss->mem_region, wcnss->mem_phys, - wcnss->mem_size, &wcnss->mem_reloc); + qcom_pil_info_store("wcnss", wcnss->mem_reloc, wcnss->mem_size); + + return 0; } static void wcnss_indicate_nv_download(struct qcom_wcnss *wcnss) @@ -469,6 +477,9 @@ static int wcnss_probe(struct platform_device *pdev) if (!qcom_scm_is_available()) return -EPROBE_DEFER; + if (!qcom_pil_info_available()) + return -EPROBE_DEFER; + if (!qcom_scm_pas_supported(WCNSS_PAS_ID)) { dev_err(&pdev->dev, "PAS is not available for WCNSS\n"); return -ENXIO; -- 2.24.0