From patchwork Wed Aug 7 05:39:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55E8213A4 for ; Wed, 7 Aug 2019 05:40:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FD5B289A1 for ; Wed, 7 Aug 2019 05:40:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 349E9289A6; Wed, 7 Aug 2019 05:40:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9865E289A1 for ; Wed, 7 Aug 2019 05:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbfHGFjs (ORCPT ); Wed, 7 Aug 2019 01:39:48 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44366 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbfHGFjs (ORCPT ); Wed, 7 Aug 2019 01:39:48 -0400 Received: by mail-pl1-f193.google.com with SMTP id t14so38912663plr.11 for ; Tue, 06 Aug 2019 22:39:47 -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; bh=VrnrHGkgnpRnail7FR0yXmhVfImCqH1AKJenb0HTXUk=; b=Ev0gn7hc6T6RQfu0MYvWNGkczGBxYOX2l3keLxAhbp/IkAeape8SKPwzf++pPc4NyO rNbfA/E67xIWJq8YxTaHEvFumAA2Zue/KgD2T3bxbYFTdhJZtMo63qeRVb4A+MDJlgWj l+OVYBfA70JtOtHPeXefuSTdZQda/vkdrgqv6JPHwi/u6OTkkQr8Rw0Cx33GlLybvr7Z ql44GsVlcF3Mmcwl4Fc96CRAIpLUDuXAML9DupedbLEDWaBcfKmbolVtfPSWnTjP5cLN zeYa0KZT2zmv/3Re3I97tweFQ/GPYgGBXGBb4UJtZEIpNbms0dFDhU9IwUHHJTH6g6Bv ATDw== 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; bh=VrnrHGkgnpRnail7FR0yXmhVfImCqH1AKJenb0HTXUk=; b=rDwHZX9oyR6j/DRyQkhp+Iv2/SsZbP2wLiU0JWNNRyK3grGqyhm2mhiTwEpzxOngVo OtXS9p3k4lJl1AHA/JJBHJ5hFw4sjVgH3Ymk31/ODMXW1qPGSq47AQe8xzdwUq4Sr4Zx 4aL/DWG8Zm7m2vd8Cgr8LYfg5UMTvTn3glP/0cgRWkcoyXHt7vli2SHewFpFcrCXw8Zm J9bwaGZO7URH9V/2MAbYvaq1kDyhoY0GyO1SpXqtczCTlWBWlYv6HRlZyxHtmPJjp/G7 iBZjCA6+ORrKqmGtxTlaCHXWr9MixAzjkKBw1Zavjtbm9QsUd2zZXpRy4b5U4Hpvfpcn PsxA== X-Gm-Message-State: APjAAAX+gBFP03Iw34JBLnvL1F2R89eDlwwd6eZ7cGenk75yExIp0PNW 1cse236RmvJA/lADXgWlzRjA5g== X-Google-Smtp-Source: APXvYqxO5Mdc9kifnW5FwNDwgTCwI4hDaC9MaKZPp9skC/H9/Pkz8fh1+4h5DM79ZWvXkx2aGxoLbQ== X-Received: by 2002:a17:902:d890:: with SMTP id b16mr6445015plz.315.1565156387325; Tue, 06 Aug 2019 22:39:47 -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 u7sm86070777pfm.96.2019.08.06.22.39.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:46 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 1/9] remoteproc: qcom: Introduce driver to store pil info in IMEM Date: Tue, 6 Aug 2019 22:39:34 -0700 Message-Id: <20190807053942.9836-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A region in IMEM is used to communicate load addresses of remoteproc to post mortem debug tools. Implement a driver that can be used to store this information in order to enable these tools to process collected ramdumps. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/Kconfig | 3 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/qcom_pil_info.c | 139 +++++++++++++++++++++++++++++ drivers/remoteproc/qcom_pil_info.h | 6 ++ 4 files changed, 149 insertions(+) create mode 100644 drivers/remoteproc/qcom_pil_info.c create mode 100644 drivers/remoteproc/qcom_pil_info.h diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 28ed306982f7..3984bd16e670 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -85,6 +85,9 @@ config KEYSTONE_REMOTEPROC It's safe to say N here if you're not interested in the Keystone DSPs or just want to use a bare minimum kernel. +config QCOM_PIL_INFO + tristate + config QCOM_RPROC_COMMON tristate diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile index 00f09e658cb3..c1b46e9033cb 100644 --- a/drivers/remoteproc/Makefile +++ b/drivers/remoteproc/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_OMAP_REMOTEPROC) += omap_remoteproc.o obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o obj-$(CONFIG_KEYSTONE_REMOTEPROC) += keystone_remoteproc.o +obj-$(CONFIG_QCOM_PIL_INFO) += qcom_pil_info.o obj-$(CONFIG_QCOM_RPROC_COMMON) += qcom_common.o obj-$(CONFIG_QCOM_Q6V5_COMMON) += qcom_q6v5.o obj-$(CONFIG_QCOM_Q6V5_ADSP) += qcom_q6v5_adsp.o diff --git a/drivers/remoteproc/qcom_pil_info.c b/drivers/remoteproc/qcom_pil_info.c new file mode 100644 index 000000000000..aa42732016f3 --- /dev/null +++ b/drivers/remoteproc/qcom_pil_info.c @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2019 Linaro Ltd. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +struct pil_reloc_entry { + char name[8]; + __le64 base; + __le32 size; +} __packed; + +#define PIL_INFO_SIZE 200 +#define PIL_INFO_ENTRIES (PIL_INFO_SIZE / sizeof(struct pil_reloc_entry)) + +struct pil_reloc { + struct device *dev; + struct regmap *map; + u32 offset; + int val_bytes; + + struct pil_reloc_entry entries[PIL_INFO_ENTRIES]; +}; + +static struct pil_reloc *_reloc; +static DEFINE_MUTEX(reloc_mutex); + +/** + * qcom_pil_info_store() - store PIL information of image in IMEM + * @image: name of the image + * @base: base address of the loaded image + * @size: size of the loaded image + */ +void qcom_pil_info_store(const char *image, phys_addr_t base, size_t size) +{ + struct pil_reloc_entry *entry; + int idx = -1; + int i; + + mutex_lock(&reloc_mutex); + if (!_reloc) + goto unlock; + + for (i = 0; i < PIL_INFO_ENTRIES; i++) { + if (!_reloc->entries[i].name[0]) { + if (idx == -1) + idx = i; + continue; + } + + if (!strncmp(_reloc->entries[i].name, image, 8)) { + idx = i; + goto found; + } + } + + if (idx) { + dev_warn(_reloc->dev, "insufficient PIL info slots\n"); + goto unlock; + } + +found: + entry = &_reloc->entries[idx]; + stracpy(entry->name, image); + entry->base = base; + entry->size = size; + + regmap_bulk_write(_reloc->map, _reloc->offset + idx * sizeof(*entry), + entry, sizeof(*entry) / _reloc->val_bytes); + +unlock: + mutex_unlock(&reloc_mutex); +} +EXPORT_SYMBOL_GPL(qcom_pil_info_store); + +static int pil_reloc_probe(struct platform_device *pdev) +{ + struct pil_reloc *reloc; + + reloc = devm_kzalloc(&pdev->dev, sizeof(*reloc), GFP_KERNEL); + if (!reloc) + return -ENOMEM; + + reloc->dev = &pdev->dev; + reloc->map = syscon_node_to_regmap(pdev->dev.parent->of_node); + if (IS_ERR(reloc->map)) + return PTR_ERR(reloc->map); + + if (of_property_read_u32(pdev->dev.of_node, "offset", &reloc->offset)) + return -EINVAL; + + reloc->val_bytes = regmap_get_val_bytes(reloc->map); + if (reloc->val_bytes < 0) + return -EINVAL; + + regmap_bulk_write(reloc->map, reloc->offset, reloc->entries, + sizeof(reloc->entries) / reloc->val_bytes); + + mutex_lock(&reloc_mutex); + _reloc = reloc; + mutex_unlock(&reloc_mutex); + + return 0; +} + +static int pil_reloc_remove(struct platform_device *pdev) +{ + mutex_lock(&reloc_mutex); + _reloc = NULL; + mutex_unlock(&reloc_mutex); + + return 0; +} + +static const struct of_device_id pil_reloc_of_match[] = { + { .compatible = "qcom,pil-reloc-info" }, + {} +}; +MODULE_DEVICE_TABLE(of, pil_reloc_of_match); + +static struct platform_driver pil_reloc_driver = { + .probe = pil_reloc_probe, + .remove = pil_reloc_remove, + .driver = { + .name = "qcom-pil-reloc-info", + .of_match_table = pil_reloc_of_match, + }, +}; +module_platform_driver(pil_reloc_driver); + +MODULE_DESCRIPTION("Qualcomm PIL relocation info"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/remoteproc/qcom_pil_info.h b/drivers/remoteproc/qcom_pil_info.h new file mode 100644 index 000000000000..c30c186b665d --- /dev/null +++ b/drivers/remoteproc/qcom_pil_info.h @@ -0,0 +1,6 @@ +#ifndef __QCOM_PIL_INFO_H__ +#define __QCOM_PIL_INFO_H__ + +void qcom_pil_info_store(const char *image, phys_addr_t base, size_t size); + +#endif From patchwork Wed Aug 7 05:39:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7639E13A4 for ; Wed, 7 Aug 2019 05:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66C2328606 for ; Wed, 7 Aug 2019 05:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B7FD289A1; Wed, 7 Aug 2019 05:40:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B3D42899F for ; Wed, 7 Aug 2019 05:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726182AbfHGFkV (ORCPT ); Wed, 7 Aug 2019 01:40:21 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43372 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727130AbfHGFjt (ORCPT ); Wed, 7 Aug 2019 01:39:49 -0400 Received: by mail-pl1-f193.google.com with SMTP id 4so31939474pld.10 for ; Tue, 06 Aug 2019 22:39:48 -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; bh=Azf6n5aesLfo8ksF3UKgIcdUJWEiOJj+3CTvEIIBQEU=; b=r+ko+PGSH4q8aK6qnYsbCZwtAtGxCRoBAu0UqNc0v5qIAR1lC/J8nryL8EDZyoEMDG 4r9EpEmt/97cLz8NEBISJRXL0rMq9YX93YRnbATgXoVc+oMZ1CZ1KAW97mWoeS8T5i63 7Z+e8Rx1mPZHgYWigWROV/kgUgBJuSuSKQZGQdQ/S77mJodtmalmc0ov7gSKpf59tQu8 +vhcxV3mwTeFx2YGPSEWzCuRVr1+uEoIGHp7XA4AbYpIboXOzCKseekx1AViw+avyrUS E+Z91JLny9fG6QnGJS3wocoAWRaJ7DUWgZ83p/mpnLRMxyWKseQMJ55WUSUsyQQoBKA0 Ebgw== 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; bh=Azf6n5aesLfo8ksF3UKgIcdUJWEiOJj+3CTvEIIBQEU=; b=Ch0jL4ZsajQFqcZrzEi5OhyJn0G/oqh5aHQ4rzdhvsbbAN9xgwJNJvvjbwHn1hD5E2 6910Esg95kJuDtRfeTPFjce8i21w82PQRtHNICJ/DbMw0YroKtUBBFSkbL4r01Xg/UFM n5Kj6HSehXRqqaJF1Qn/nDbof3qHt68y3IqRfrKVcgqHISOcCkEQ7HEi/fppkCm4jVRh 1X3gGm/siVCNj8V9J2WrirTeYVsMF6c1CjvMAF44KnMlwGaIDLG8LUgKfpdBuJG9qxlW nbGAL+0WgleiDDfn7tDss6Ji8fZWykJKoAekxTA+nwqXbgQ7va2NHe9JNq3VZgM8NJ4h jrUA== X-Gm-Message-State: APjAAAW3U7UVFJZ1hUtCthGV+dg66diKccr8W5XLIkXxoVCexLPhWaD3 V64Y98aVy5uhHM8cswMY3J/zTA== X-Google-Smtp-Source: APXvYqyKuaBrPqGXok98ifNvfg6y5GqCqXCL+MIHLatCigfYzr5K3VlYQwdzBhg3v3fj813Aanwqyw== X-Received: by 2002:a17:902:788f:: with SMTP id q15mr6697292pll.236.1565156388456; Tue, 06 Aug 2019 22:39:48 -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 u7sm86070777pfm.96.2019.08.06.22.39.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:47 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 2/9] remoteproc: qcom: mss: Update IMEM PIL info on load Date: Tue, 6 Aug 2019 22:39:35 -0700 Message-Id: <20190807053942.9836-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the MPSS address is calculated during load store it, and the size, in the PIL info region structure in IMEM. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/Kconfig | 1 + drivers/remoteproc/qcom_q6v5_mss.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 3984bd16e670..b88d74632d39 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -119,6 +119,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 diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 8fcf9d28dd73..d9192fa40e05 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 @@ -1040,6 +1041,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: From patchwork Wed Aug 7 05:39:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 119C614DB for ; Wed, 7 Aug 2019 05:40:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01BD32847B for ; Wed, 7 Aug 2019 05:40:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA62F2879E; Wed, 7 Aug 2019 05:40:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B4E028995 for ; Wed, 7 Aug 2019 05:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725995AbfHGFkQ (ORCPT ); Wed, 7 Aug 2019 01:40:16 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33234 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727139AbfHGFju (ORCPT ); Wed, 7 Aug 2019 01:39:50 -0400 Received: by mail-pl1-f196.google.com with SMTP id c14so38853730plo.0 for ; Tue, 06 Aug 2019 22:39:50 -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; bh=vtVBkwA1h86i3IgqSipfDgtWxsjyT/oqz+jf2YjzTg0=; b=iDiNfOYEotcvnZDMgdSF14s4ZRODb3EgWflPP8UEq63YZ6JuonspSElpfLSHlmoxPo MX+ciKThLCRBrbSaIo1zbMQj2UuQ54eZQdhDOfsmP2assVHrNGLQSg+aH2QXqLcD1JyU +zWJ8soLGnEGo7wEmwfmXbfZ2sC54VvDaQAPdaBBZ+E6PJ5FPoGJK9uUWqPTnqaHYxPE gwhr+a5HX58ntzLFq/gUsB87gWlfl6RVnNf77xc0V01/fvK/whZvLUHku3r5Gc5wz/AF elNfZYSG+TyTdEf9pSPQQTl7I0IvBhnG31tHLDttd4QQkvoc9aNMWpX72GXnxKKGmrXn c1Cg== 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; bh=vtVBkwA1h86i3IgqSipfDgtWxsjyT/oqz+jf2YjzTg0=; b=qBb2tsPtX2KmTo32HhLcp7E2KN1sNOLbgwiYoKgEf727wiettuio2r4s0mudNRWRc6 32fDJpy0PdL+G9gTjcjOOFym9cHfJa92aH4DqnOrzaMdc0Sdx9Z/d2VSrSMR98r65IdN oT2VIPnffUFyIIKzbsxDZe6o4GtsWopD0tyLykEgLD+abH9hMOfWeEEPz0iAmmpM8LMh hPpk0nAiaNaI3y0P2gju3J6mek5n/RBn4zYZGJNVvVV/3XLOrGcYvGKXN9C8T8tR06r5 TJC6oIutkCDVBGqgLFaBPoOrps6YX9xM8M/aKeSHGNQLTr9SECsDpWcolMpH2nMZim1m sT/A== X-Gm-Message-State: APjAAAVoNF9vQYagotqU5Sc8WwEpEfZpuQ0hAkG7/FImjjpJYI4L9j6d GRHi3tMa0B+mFucff3hqrm1Xww== X-Google-Smtp-Source: APXvYqzYQWYWNf5ijMzlNvQnGiClXZkVi04WghDqhwDQYKzd6NeApOL9QtUEQkEmhvej3QVDF3ZkNw== X-Received: by 2002:a17:902:ac87:: with SMTP id h7mr6812117plr.36.1565156389577; Tue, 06 Aug 2019 22:39:49 -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 u7sm86070777pfm.96.2019.08.06.22.39.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:49 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 3/9] remoteproc: qcom: pas: Update IMEM PIL info on load Date: Tue, 6 Aug 2019 22:39:36 -0700 Message-Id: <20190807053942.9836-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the sysmon_name as identifier and store the relocated base address and size of the memory region in the PIL reloation info structure in IMEM. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/Kconfig | 1 + drivers/remoteproc/qcom_q6v5_pas.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index b88d74632d39..2aa0743fc05b 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -136,6 +136,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 diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index db4b3c4bacd7..bfb622d36cb3 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -23,6 +23,7 @@ #include #include "qcom_common.h" +#include "qcom_pil_info.h" #include "qcom_q6v5.h" #include "remoteproc_internal.h" @@ -52,6 +53,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; @@ -70,11 +72,17 @@ struct qcom_adsp { 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) @@ -278,6 +286,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); From patchwork Wed Aug 7 05:39:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80B6C14DB for ; Wed, 7 Aug 2019 05:40:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 726122847B for ; Wed, 7 Aug 2019 05:40:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66A19289A1; Wed, 7 Aug 2019 05:40:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BEC32899F for ; Wed, 7 Aug 2019 05:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbfHGFjw (ORCPT ); Wed, 7 Aug 2019 01:39:52 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45437 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727173AbfHGFjv (ORCPT ); Wed, 7 Aug 2019 01:39:51 -0400 Received: by mail-pl1-f194.google.com with SMTP id y8so38952935plr.12 for ; Tue, 06 Aug 2019 22:39:51 -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; bh=DHLSpNf1LsuJ1wDDF5wISNJL3XiKw5OPuws/j+9mEZ4=; b=oKH3tIkLcOj5q28FdagPOcCl8w1CPiQNdCAVUaqi/AaD/hNMH2zdiCwbcoQ03uypze IaOOoFZXCjw3UyiXTHidDRMzG62oDDK4nU4GhB07Yl/+8300sDfaDJ0vAmpHO2kMFpg5 Y9V0Vi+ARHOiGQqL0Q0GRpkLQNXFykRRKoD8H2lMZ29hPJrqx5VD/RGdyMhd2BP0YrKl upPN/mSJxWgdE3Z2eoaHAelNrz8Gu8oiDPfrgCUHOc1Rwx2W/+++AD9nIae/fJKRMIM3 +kHiSMB4w/q3t45uQlUAzjnmg2/36p8PklnCYc4H68lwnZvqy4b8113aaezP2AjdwBIf VHXQ== 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; bh=DHLSpNf1LsuJ1wDDF5wISNJL3XiKw5OPuws/j+9mEZ4=; b=WOAvx5qT0sBL3S0/f5GRYaXlVUezP8v3dReBl1si2gVyqOw/JiG0a4CpIsX4b76tJD iHubuoN0Bg2Im/cuEEWj/Ra9QNnepOF0HB9L0/VzYPeOu2iVapmZFyod3HRy7wklZvdX oj54yehOTGTt2u1DVY/qmLkYUX5tVgxB+jgOWNVCTK/Wt+tVcLyTiGpccTYaz43yPcl3 3Q9qk8CsGc1xujHW10wjS1BAh65Ik+GNMbwdQ1OeKIj7Tn25oc7N3j8CNYAKNC8DPnlu GGwu4OqFJ1XIbXoBnZ4cPJxsohg1cauPjo2Abq1KOsAs7Y9G5EoETVSG8gEJsrzlN93n j9kg== X-Gm-Message-State: APjAAAWp/jgpBvdUGI5Mbow6jXcAKzMAuO58yNhtTT98zabWc5ATErK3 uTemFXSq4upQDfoHZoebB538Ew== X-Google-Smtp-Source: APXvYqwUd+/t1/18/8l+XVokh3+ItPFBiNlUa9UXozM+ztWtnzV2TZs3IM70LQjnOiY+jk9Oscpzqg== X-Received: by 2002:a63:4522:: with SMTP id s34mr6167748pga.362.1565156390665; Tue, 06 Aug 2019 22:39:50 -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 u7sm86070777pfm.96.2019.08.06.22.39.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:50 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 4/9] remoteproc: qcom: wcnss: Update IMEM PIL info on load Date: Tue, 6 Aug 2019 22:39:37 -0700 Message-Id: <20190807053942.9836-5-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Store the relocated base address and size in the PIL relocation info structure in IMEM. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/Kconfig | 1 + drivers/remoteproc/qcom_wcnss.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 2aa0743fc05b..3f976ce3df3c 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -185,6 +185,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_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index dc135754bb9c..9db9a3d25af4 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) From patchwork Wed Aug 7 05:39:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDB8314DB for ; Wed, 7 Aug 2019 05:40:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADFAB2847B for ; Wed, 7 Aug 2019 05:40:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2E1128995; Wed, 7 Aug 2019 05:40:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45F612847B for ; Wed, 7 Aug 2019 05:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbfHGFjx (ORCPT ); Wed, 7 Aug 2019 01:39:53 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35947 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfHGFjw (ORCPT ); Wed, 7 Aug 2019 01:39:52 -0400 Received: by mail-pl1-f195.google.com with SMTP id k8so38955755plt.3 for ; Tue, 06 Aug 2019 22:39:52 -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; bh=LuR1ky4R+W8DnJlClr7ItKCcIJSpq5BHTgJG+rP0wz4=; b=BN1iYmX3VS7iNjW36GRLTazm6lrD0RRsFwt3TRZMMqbhiC7X6+9Uzi4RYwPKB60hQn 4nS2QQ4CVKBocbEcvJEM7OOGQcV7THez5IHf0FQiGx7UInJSEoH3dELsSjvHwx0Jg2JJ eJgm6W9JJfX0M5zOEKyX3dQj5qdXRl6ruoNTm2zdwPcLNEq4xOoe7o3FKadQa8TJZRHv dFFgTWSlwiRuxq20DKWLdBaPUkkHgfoyJrhSienE5+enZLqZzBFOdQGx/z7+54x9dfFP llaWNYh0YsFjxuK9DISr6aso0211Ps+SesAbVPKLemIq78WkV4K1X++La0IY9sSuR84O QkSA== 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; bh=LuR1ky4R+W8DnJlClr7ItKCcIJSpq5BHTgJG+rP0wz4=; b=RZle1KQQCbroNJXA2Oy22sOQYeg/1IzPuJ4867zWUR9BAG440bzYXQ6/PfHzeuKO9M hGW2LCpr58z2WDfvxlktccNxZg6gQmJ9nrBFYdBi3KUtmesqTwgdD7HZdJxIJYB+a65A AiyuD8KgHpYqY8VW9VdNqte7LRwdNeqko9Ld+inL3xrBNKT5gW6LZhi7XRPbFbwGVS2r QPdXmcpieldPjN+EApOjnjydaIoPjX6ku1ezs2lbxBxGqohCrSttPGtdIHYR0J5w5kLr zoV72NRTqWTFfqih5cEWQ1NkkYvRgkcBy8hDnuEI3NAz/Sql/U+4w6QvuiGtrjC9l3Gy pCyA== X-Gm-Message-State: APjAAAVmPlsHqm4uJTPyBp1x0tBoxM/8GM4QFZYm2lcUMYbZNHp/WUY1 lBH2yFiy5tU913jGtsrPNwcY8Q== X-Google-Smtp-Source: APXvYqwteeE9q8f83hjRPGYATCdDy8cEXcbkYjbkT24pE6lGFv27jx/C08Js6EVAX5W6MsCH9hmiMA== X-Received: by 2002:a17:902:7612:: with SMTP id k18mr6498473pll.48.1565156391829; Tue, 06 Aug 2019 22:39:51 -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 u7sm86070777pfm.96.2019.08.06.22.39.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:51 -0700 (PDT) From: Bjorn Andersson To: Andy Gross Cc: Ohad Ben-Cohen , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 5/9] arm64: dts: qcom: qcs404: Add IMEM and PIL info region Date: Tue, 6 Aug 2019 22:39:38 -0700 Message-Id: <20190807053942.9836-6-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a simple-mfd representing IMEM on QCS404 and define the PIL relocation info region, so that post mortem tools will be able to locate the loaded remoteprocs. Signed-off-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/qcs404.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi index 3d0789775009..1604a9697832 100644 --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi @@ -845,6 +845,16 @@ status = "disabled"; }; + imem@8600000 { + compatible = "syscon", "simple-mfd"; + reg = <0x08600000 0x1000>; + + pil-reloc { + compatible ="qcom,pil-reloc-info"; + offset = <0x94c>; + }; + }; + intc: interrupt-controller@b000000 { compatible = "qcom,msm-qgic2"; interrupt-controller; From patchwork Wed Aug 7 05:39:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70BF813A4 for ; Wed, 7 Aug 2019 05:40:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FB532879E for ; Wed, 7 Aug 2019 05:40:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54316289A2; Wed, 7 Aug 2019 05:40:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01FF028995 for ; Wed, 7 Aug 2019 05:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727187AbfHGFjy (ORCPT ); Wed, 7 Aug 2019 01:39:54 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38536 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727186AbfHGFjx (ORCPT ); Wed, 7 Aug 2019 01:39:53 -0400 Received: by mail-pl1-f194.google.com with SMTP id m12so329762plt.5 for ; Tue, 06 Aug 2019 22:39:53 -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; bh=PtD4kVuMP62M8z8TfrTANyGVjPACMbwaEsr3rVieEXs=; b=t0ISAbXeSaPvfdlidC94DFCEL+uR6mZHC8q7ZvIX58dgbq8WgM8xBaCIE4XaxFya6z 8nEKRwo9q+R6sN0sV7dwExFSNd7k3yIRS8RTsfKOIwv4vvQeX1wOHQvydZO/G1nE5HJu gRLfzzYLc8hMpSchbKxO+aooyzRCIeDt9+m//fO6V2OL3Kta58cFxLfOajfTJcth1i1V IRHuh8VkJf+JyXvNaJTeK6i47vqB3+YRuZEW3giFTe/eJXdColYu7dF7GrMYJYMHmus4 NUoNMYbJpjnZTwHmv0tt82p081flHa4WPZ/PEYvyNI6kHE1dhkWGoCUQTtMM7jzcdHZ8 RSXQ== 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; bh=PtD4kVuMP62M8z8TfrTANyGVjPACMbwaEsr3rVieEXs=; b=bTPiNQwGD3EgPwT4wFWAFbRNhkp5jMf5IYOZ7brUOUEkVxsYSAskMGpQoT6UN8n75A IDjlJ9tEhuzl5IwS1gTZmf1SAXbmN+IgwnxjiiVYqFTGD5mztW/xnD4RJhLae3Pseh81 5dYesPn2XsM8Bpen9nZ0xWIgeZsMC+CHm7yVrmrMaRcUMsM131GZPwWbBFcerutlSWKk IWRZVWs/Ub08Cq/y5DkYCsWijQO6t87i5/4iBFegHr+OF0S8ur82psmziTsciMXDQDBI tGHTVuesxkJEFFyXCY1WLW5SnH4VjfsIfR446Ytek9kvuBXZ7FBra2rQwKWk0mmayRqA 0slQ== X-Gm-Message-State: APjAAAVtreZ7sAzR4LH2NYIpELJwAaw7I+8bkbmVO/77pBL/YUcwF9Yx VzAT8D1tHTpmVwYCltxxl0oDCQ== X-Google-Smtp-Source: APXvYqwp4Je0AaxMcBaoABd/4NVbB7F+zYuCe3c+QTEfgFQqSKjQ4ov5rj52FIdOy9DdfB+uOMHIIA== X-Received: by 2002:a63:dd16:: with SMTP id t22mr6263088pgg.140.1565156392905; Tue, 06 Aug 2019 22:39:52 -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 u7sm86070777pfm.96.2019.08.06.22.39.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:52 -0700 (PDT) From: Bjorn Andersson To: Andy Gross Cc: Ohad Ben-Cohen , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 6/9] arm64: dts: qcom: sdm845: Add IMEM and PIL info region Date: Tue, 6 Aug 2019 22:39:39 -0700 Message-Id: <20190807053942.9836-7-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a simple-mfd representing IMEM on SDM845 and define the PIL relocation info region, so that post mortem tools will be able to locate the loaded remoteprocs. Signed-off-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index c8ebe21f7673..38a6b304dba3 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -2456,6 +2456,16 @@ cell-index = <0>; }; + imem@146bf000 { + compatible = "syscon", "simple-mfd"; + reg = <0 0x146bf000 0 0x1000>; + + pil-reloc { + compatible ="qcom,pil-reloc-info"; + offset = <0x94c>; + }; + }; + apps_smmu: iommu@15000000 { compatible = "qcom,sdm845-smmu-500", "arm,mmu-500"; reg = <0 0x15000000 0 0x80000>; From patchwork Wed Aug 7 05:39:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C49C13A4 for ; Wed, 7 Aug 2019 05:39:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39EFC2847B for ; Wed, 7 Aug 2019 05:39:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E02028606; Wed, 7 Aug 2019 05:39:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2C442847B for ; Wed, 7 Aug 2019 05:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727275AbfHGFj4 (ORCPT ); Wed, 7 Aug 2019 01:39:56 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45451 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727185AbfHGFjz (ORCPT ); Wed, 7 Aug 2019 01:39:55 -0400 Received: by mail-pl1-f194.google.com with SMTP id y8so38953165plr.12 for ; Tue, 06 Aug 2019 22:39:54 -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; bh=hV2OpNDlf9B8X2Y4BzyxalclcI5O3SjBzPMCmfPooZQ=; b=cIXhIatsOcPuqn1+MgSm/QQB00cmGPVG8EbiRAPHUblko3fhn/9Pkpx/65QgW82eNH M0NEPAUTZxkplleu9px9+XRjuwTitLxz1ocIySnkyfqIvPgUWfLOZP4JvFXaeDAGHuZf gfb+cgF+zUNZJoCL70yvlLUa1ZzUuJXe6Wkujgon5BgiOZruSI4mqq+7l2Az18BLZMJa hIgU/T237Nrn1TzV5hATl8jhLt3m7srfJmdcAEm+yU+ToxZ8gJi1xu1FnqOX2Dhnktp+ 6+Crb6NnrQKI5jNDt6RGfuKMOiXcj/jhR316UzF1+SlE5hhasDGbjw0nzwq6pkPCkU0g oWaw== 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; bh=hV2OpNDlf9B8X2Y4BzyxalclcI5O3SjBzPMCmfPooZQ=; b=XUfQVA9RC4I2GGyWLCIQ5aw3GYURCOLqEsr0KPSMapMAoxlCe4cal27vGZa9xFxz99 WlJhU66BOOfEIPe52VCsSj2cbsn5l0QD4XJqRwdWGDHCZW9VA3QdNxlfCDOjdjtSnYjT AyjEltwK/8uIkNuubN/ySs0ueu/yri0+tyTtb7qo6Ebyk/Prp0JY2ctyrOrXVXOehI/G E+YzZEHuYfcQltW8BjdsfXyFrOms/yYzDmAzZLA6z05nGk36lzmeAChpRUlXwk9s2Bjw BFOqNuwfPp3VsBT1v0NtErTZ0avKuHMEG5zaCXvt95HFfxjt+bW56T/K6PKJvabeTnEG 2m1A== X-Gm-Message-State: APjAAAU7MPhzj9gFWVWCswmUdCk0EMpWp+ESot4DEEs85SZOtN6mrIj1 AGDozg7Xnnzv+tm7IkUGiH0lVg== X-Google-Smtp-Source: APXvYqxVdFtsesLs97Pm6ige+MLx7B4T80576E9cEvBvip+y9DeCaBSXv/ssBsoin6c7szx10I2wuQ== X-Received: by 2002:a62:2ccc:: with SMTP id s195mr7503689pfs.256.1565156394058; Tue, 06 Aug 2019 22:39:54 -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 u7sm86070777pfm.96.2019.08.06.22.39.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:53 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 7/9] remoteproc: Introduce "panic" callback in ops Date: Tue, 6 Aug 2019 22:39:40 -0700 Message-Id: <20190807053942.9836-8-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce a "panic" function in the remoteproc ops table, to allow remoteproc instances to perform operations needed in order to aid in post mortem system debugging, such as flushing caches etc, when the kernel panics. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 16 ++++++++++++++++ include/linux/remoteproc.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 3c5fbbbfb0f1..cc47797c6496 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1833,6 +1833,16 @@ void rproc_shutdown(struct rproc *rproc) } EXPORT_SYMBOL(rproc_shutdown); +static int rproc_panic_handler(struct notifier_block *nb, unsigned long event, + void *ptr) +{ + struct rproc *rproc = container_of(nb, struct rproc, panic_nb); + + rproc->ops->panic(rproc); + + return NOTIFY_DONE; +} + /** * rproc_get_by_phandle() - find a remote processor by phandle * @phandle: phandle to the rproc @@ -2058,6 +2068,12 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->ops->get_boot_addr = rproc_elf_get_boot_addr; } + /* Register panic notifier for remoteprocs with "panic" callback */ + if (rproc->ops->panic) { + rproc->panic_nb.notifier_call = rproc_panic_handler; + atomic_notifier_chain_register(&panic_notifier_list, &rproc->panic_nb); + } + mutex_init(&rproc->lock); idr_init(&rproc->notifyids); diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 16ad66683ad0..33553f6d8ff0 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -383,6 +383,7 @@ struct rproc_ops { int (*load)(struct rproc *rproc, const struct firmware *fw); int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); u32 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); + void (*panic)(struct rproc *rproc); }; /** @@ -481,6 +482,7 @@ struct rproc_dump_segment { * @auto_boot: flag to indicate if remote processor should be auto-started * @dump_segments: list of segments in the firmware * @nb_vdev: number of vdev currently handled by rproc + * @panic_nb: notifier_block for remoteproc's panic handler */ struct rproc { struct list_head node; @@ -514,6 +516,7 @@ struct rproc { bool auto_boot; struct list_head dump_segments; int nb_vdev; + struct notifier_block panic_nb; }; /** From patchwork Wed Aug 7 05:39:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF50C14DB for ; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F9E22855D for ; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 938402879E; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3092F2847B for ; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbfHGFkC (ORCPT ); Wed, 7 Aug 2019 01:40:02 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45455 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727272AbfHGFj4 (ORCPT ); Wed, 7 Aug 2019 01:39:56 -0400 Received: by mail-pl1-f194.google.com with SMTP id y8so38953228plr.12 for ; Tue, 06 Aug 2019 22:39:55 -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; bh=fsAZ/nMaAQwkSV7ok0DKoJTylqdRDHaUnbG8Kv9af6Y=; b=o7CDKF6Q9zJTqEn21bYLJqPajiZGXPc5Y9e/zNWTyKu0+rkskbOrSSsGUkphqHIUHC L4OHacF4qz/6w8cQ32lfzrB1nkoknbDFJxBpQiIYgvrd88hm7N8DOaHYJb3Tah3UL39o t83/EM7kkNOm1uCsLc/QzL7k1O0ncR/5mxsy9z5vIslOVkpGjT63wF7ZjwgNvZ4UAjr/ ljBgWOJYrDHfa2DfV7GeuAnipqrKg99clqucGsPDtJ0t79TgUtVilCHfVXmeE6bTTU/a 2UjvkV3Pjiy5/OfMi72US0LbfusZ5Hd2hdKpVi+UsbQWJZMhxWKYWLonDywV2YhG8l5o N8pQ== 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; bh=fsAZ/nMaAQwkSV7ok0DKoJTylqdRDHaUnbG8Kv9af6Y=; b=krdgHui7eqC/HhTUot13ujfV9m1EVzD5+4zLqFr5/bEUT4SeTHUXoCeYlfw2HYOLGV dMJsEi+nexG/p+4sMj0vtv9y1JobOSnQJf6HCvPv4EJ1ZYbQFj31FmNirCMGjrV2Vnq8 r3pEeiHmcDTLLMIQXEWZtxgODB4M6G/jAzZok+P7FQfSlhdpgc8ZCrsLjEpmsL/kcGbN 6Liy3OajHD0G0RcqCqsNUDn9hJTSv0IsajmCTW+MH59glmu7NCFAFrxC0oyzEdx3wVQT o5CpU9YamX9xqmQ5RDS+4PxAvreZns+UYUKPiyolQFvXwZq6sYP7QEXCC3STLknZ0DeO dyJA== X-Gm-Message-State: APjAAAUIilGgrwA/rYCHNE/PyxO2zFRKb80dn8Dm9Zj2hGLVgryZAcTu S4hBm6LKWZX6bqHWbFq1BlNncw== X-Google-Smtp-Source: APXvYqwYzZ7cbSTohFYWqK8L+390c3t/+Un1jgCkK4FhKNI89l4dBmXtgyyItDaDM+/UUu2V8QHg8Q== X-Received: by 2002:a62:198d:: with SMTP id 135mr7484409pfz.169.1565156395121; Tue, 06 Aug 2019 22:39:55 -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 u7sm86070777pfm.96.2019.08.06.22.39.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:54 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 8/9] remoteproc: qcom: q6v5: Add common panic handler Date: Tue, 6 Aug 2019 22:39:41 -0700 Message-Id: <20190807053942.9836-9-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a common panic handler that invokes a stop request and sleep enough to let the remoteproc flush it's caches etc in order to aid post mortem debugging. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_q6v5.c | 19 +++++++++++++++++++ drivers/remoteproc/qcom_q6v5.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c index 0d33e3079f0d..0aebae893362 100644 --- a/drivers/remoteproc/qcom_q6v5.c +++ b/drivers/remoteproc/qcom_q6v5.c @@ -6,6 +6,7 @@ * Copyright (C) 2014 Sony Mobile Communications AB * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. */ +#include #include #include #include @@ -15,6 +16,8 @@ #include #include "qcom_q6v5.h" +#define Q6V5_PANIC_DELAY_MS 200 + /** * qcom_q6v5_prepare() - reinitialize the qcom_q6v5 context before start * @q6v5: reference to qcom_q6v5 context to be reinitialized @@ -162,6 +165,22 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5) } EXPORT_SYMBOL_GPL(qcom_q6v5_request_stop); +/** + * qcom_q6v5_panic() - panic handler to invoke a stop on the remote + * @q6v5: reference to qcom_q6v5 context + * + * Set the stop bit and sleep in order to allow the remote processor to flush + * its caches etc for post mortem debugging. + */ +void qcom_q6v5_panic(struct qcom_q6v5 *q6v5) +{ + qcom_smem_state_update_bits(q6v5->state, + BIT(q6v5->stop_bit), BIT(q6v5->stop_bit)); + + mdelay(Q6V5_PANIC_DELAY_MS); +} +EXPORT_SYMBOL_GPL(qcom_q6v5_panic); + /** * qcom_q6v5_init() - initializer of the q6v5 common struct * @q6v5: handle to be initialized diff --git a/drivers/remoteproc/qcom_q6v5.h b/drivers/remoteproc/qcom_q6v5.h index 7ac92c1e0f49..c37e6fd063e4 100644 --- a/drivers/remoteproc/qcom_q6v5.h +++ b/drivers/remoteproc/qcom_q6v5.h @@ -42,5 +42,6 @@ int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5); int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5); int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5); int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout); +void qcom_q6v5_panic(struct qcom_q6v5 *q6v5); #endif From patchwork Wed Aug 7 05:39:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11081007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4955813A4 for ; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A2712855D for ; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 163AF2891F; Wed, 7 Aug 2019 05:40:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D06F2847B for ; Wed, 7 Aug 2019 05:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727344AbfHGFj7 (ORCPT ); Wed, 7 Aug 2019 01:39:59 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39869 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbfHGFj5 (ORCPT ); Wed, 7 Aug 2019 01:39:57 -0400 Received: by mail-pl1-f195.google.com with SMTP id b7so38991836pls.6 for ; Tue, 06 Aug 2019 22:39:56 -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; bh=h/HptULj1ZkwXqtKtnx9KrZAoKYoT1D4MPjQTFSgnOE=; b=VxaiY8HUkDhAJK5OgMj/acEOEgWXyEaHjVYNOdw1Hci6Y4sEt+drKbkvjpYDtH9KV0 3BEfBbpJCoFTh72TNpLRW8ZWifVynAXWjfY6sUAiMiqJKT9tLty9vJCR1YNJzFr/NIBW UUM6JWhYW7Ehntlr86XA3il2jvwRb/3IMVJ97+UQihBCQTf/eOKHrxE2DL/Ol0AP3ews 35YHA/qZ+9AxgOiNzRKa4YvGB437AL0RuTDL/YjdfnLxKpGoyq0Id7izZ7NBHXxurj0v Onjldxfpe6qOvoAQFjAcFFpic3OWRLTg35c3GXLxAufgxgfV1BNINACjeAjiflGAu6tD ELFw== 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; bh=h/HptULj1ZkwXqtKtnx9KrZAoKYoT1D4MPjQTFSgnOE=; b=aGqh3Lvv6ew6LD/ljJJSiRjXMe5LoX7ayyuFAttYzoPZ35//HhyJpec5NT078iYVBZ ut9t28+WJFHm/4W0Xp2vqgT+OyBXWsgkeWmcSvjmAVeNbyOHb5yi1V3JinvrWYELKL7P s7mj7QhX62WeQUTsZiUkPGdv3V66TAlv/i1lrVuaQX43gTfHa3wELkcmd1eElcfDvmRO UIRBGC5JhbppY+6hP09yrnMr4L+6E+zTawk6r8hNeZiP5UKaOa3paDrDDHMTlML/fRwe Uzpz5wiNwtZCOfyZWDFzh+bjOOof1+jTSSBqFK3z7TbpqrcjRPeAdU89ONqnE8xOLxLL /qLQ== X-Gm-Message-State: APjAAAXowbWWDcGzYLXrOzkMXPUT686XxrHjEMmKo/AcvEper7/Z9IM7 Wu/9kaxNlsTQNH+u/CTC820jxg== X-Google-Smtp-Source: APXvYqwttlgTM1Ho7Jfwf4iaKjnCWr2MGVOw6C7n3fYbk8Bd7mv+IC8hWlxN2qTtA0SQh54WjIETKw== X-Received: by 2002:aa7:98da:: with SMTP id e26mr7570022pfm.34.1565156396240; Tue, 06 Aug 2019 22:39:56 -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 u7sm86070777pfm.96.2019.08.06.22.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 22:39:55 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Andy Gross , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH 9/9] remoteproc: qcom: Introduce panic handler for PAS and ADSP Date: Tue, 6 Aug 2019 22:39:42 -0700 Message-Id: <20190807053942.9836-10-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190807053942.9836-1-bjorn.andersson@linaro.org> References: <20190807053942.9836-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make the PAS and ADSP/CDSP remoteproc drivers implement the panic handler that will invoke a stop to prepare the remoteprocs for post mortem debugging. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_q6v5_adsp.c | 8 ++++++++ drivers/remoteproc/qcom_q6v5_pas.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index e953886b2eb7..3de1683903db 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -282,12 +282,20 @@ static void *adsp_da_to_va(struct rproc *rproc, u64 da, int len) return adsp->mem_region + offset; } +static void adsp_panic(struct rproc *rproc) +{ + struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; + + qcom_q6v5_panic(&adsp->q6v5); +} + static const struct rproc_ops adsp_ops = { .start = adsp_start, .stop = adsp_stop, .da_to_va = adsp_da_to_va, .parse_fw = qcom_register_dump_segments, .load = adsp_load, + .panic = adsp_panic, }; static int adsp_init_clock(struct qcom_adsp *adsp, const char **clk_ids) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index bfb622d36cb3..31ff09bcd3ee 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -179,12 +179,20 @@ static void *adsp_da_to_va(struct rproc *rproc, u64 da, int len) return adsp->mem_region + offset; } +static void adsp_panic(struct rproc *rproc) +{ + struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; + + qcom_q6v5_panic(&adsp->q6v5); +} + static const struct rproc_ops adsp_ops = { .start = adsp_start, .stop = adsp_stop, .da_to_va = adsp_da_to_va, .parse_fw = qcom_register_dump_segments, .load = adsp_load, + .panic = adsp_panic, }; static int adsp_init_clock(struct qcom_adsp *adsp)