From patchwork Fri Jul 27 15:19:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10547323 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 19A351822 for ; Fri, 27 Jul 2018 15:21:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 093372C071 for ; Fri, 27 Jul 2018 15:21:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 073622C04E; Fri, 27 Jul 2018 15:21:14 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 8529D2C04E for ; Fri, 27 Jul 2018 15:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388708AbeG0Qnf (ORCPT ); Fri, 27 Jul 2018 12:43:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53826 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732752AbeG0Qnf (ORCPT ); Fri, 27 Jul 2018 12:43:35 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2CBE060481; Fri, 27 Jul 2018 15:21:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704872; bh=jUEUG1Zoe9hQ6lqR7Oo6DNpf4+svISBtdkV6AjUBcZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EPVItMJW17kMoJmrEqJKtwE5Y5MUzCL4BySaWyIE6k6duZ8bhGQVvPJdh97CVnBeZ KYmwufgYQaFdDH1cr8PO8uZJ/KJXIDmG0mpXIOXjuVJrlfEOIK9dRRGxHRJRh//l/m yArW0HSZIcpGTOmcYI7Y4EufYA+7XmxtmANgp29I= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3A0FF60B15; Fri, 27 Jul 2018 15:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704871; bh=jUEUG1Zoe9hQ6lqR7Oo6DNpf4+svISBtdkV6AjUBcZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xd6XU8J09MsWXsq/l0nc9aNrg6URyTek0f/FPpsBYEBJXRsifAW2uQ6aBvkAeTrXa h/zdXZqs+GiQ4GpCmf6NRmOFIvQEPbvekQd//h077/m0gjjT79mjg8mzAZ0i2Cp1tm uNPl2SP12Gf/TBeoIAd51oS7uimDKdvfFoR9SxPs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3A0FF60B15 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org, Sibi Sankar Subject: [PATCH v3 1/6] remoteproc: Introduce custom dump function for each remoteproc segment Date: Fri, 27 Jul 2018 20:49:58 +0530 Message-Id: <20180727152003.11663-2-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180727152003.11663-1-sibis@codeaurora.org> References: <20180727152003.11663-1-sibis@codeaurora.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 custom dump function per remoteproc segment. It is responsible for filling the device memory segment associated with coredump Signed-off-by: Sibi Sankar --- drivers/remoteproc/remoteproc_core.c | 15 ++++++++++----- include/linux/remoteproc.h | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 283b258f5e0f..ec56cd822b26 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1183,13 +1183,18 @@ static void rproc_coredump(struct rproc *rproc) phdr->p_align = 0; ptr = rproc_da_to_va(rproc, segment->da, segment->size); - if (!ptr) { - dev_err(&rproc->dev, + + if (segment->dump) { + segment->dump(rproc, ptr, segment->size, data + offset); + } else { + if (!ptr) { + dev_err(&rproc->dev, "invalid coredump segment (%pad, %zu)\n", &segment->da, segment->size); - memset(data + offset, 0xff, segment->size); - } else { - memcpy(data + offset, ptr, segment->size); + memset(data + offset, 0xff, segment->size); + } else { + memcpy(data + offset, ptr, segment->size); + } } offset += phdr->p_filesz; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index e3c5d856b6da..0fbb01a9955c 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -399,6 +399,8 @@ enum rproc_crash_type { * @node: list node related to the rproc segment list * @da: device address of the segment * @size: size of the segment + * @dump: custom dump function to fill device memory segment associated + * with coredump */ struct rproc_dump_segment { struct list_head node; @@ -406,6 +408,7 @@ struct rproc_dump_segment { dma_addr_t da; size_t size; + void (*dump)(struct rproc *rproc, void *ptr, size_t len, void *priv); loff_t offset; }; From patchwork Fri Jul 27 15:19:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10547327 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 D269C174A for ; Fri, 27 Jul 2018 15:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFC8A2BF6D for ; Fri, 27 Jul 2018 15:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD7BF2C085; Fri, 27 Jul 2018 15:21:19 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 3F4AB2BF6D for ; Fri, 27 Jul 2018 15:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388616AbeG0Qnl (ORCPT ); Fri, 27 Jul 2018 12:43:41 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53964 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732148AbeG0Qnk (ORCPT ); Fri, 27 Jul 2018 12:43:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 053DE60B15; Fri, 27 Jul 2018 15:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704877; bh=JJKdiMhCOpy/wg/pc2M43YVTGwRSA5EPGVCe9iEl3W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gGtnxDm3UC52RwY+x01axLH0rEmcAmUlOrbURxL2r92pF7SzdnTdbxg4FLJh72Vrc SvJfPR7eBaOdsjszabocmkMzVwaX+b+miuOrYiVraEDsFQj5vXVofzayA/rtepks5j hu/61wSKbFZ2iOPHz7Y/laT6V91OybFmulh8sX+c= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C863660B7A; Fri, 27 Jul 2018 15:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704876; bh=JJKdiMhCOpy/wg/pc2M43YVTGwRSA5EPGVCe9iEl3W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=neXPn40aT2B6KcgcbdtYbQeXncCD7+RutYH8eTF2Gpo1O6iw+JYkbB8hI73BNRBmE Rv+Dxd+RO4TgXBQchDR+7uhm1jnlHPJZGeOqQOcx9ANav0Z+XFA0v2HU+5MdfRHNo/ Nh/Y/6AFrRB9Y8FB8lZFxNhyEoNlPCRTDtkO/QO4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C863660B7A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org, Sibi Sankar Subject: [PATCH v3 2/6] remoteproc: Add mechanism for custom dump function assignment Date: Fri, 27 Jul 2018 20:49:59 +0530 Message-Id: <20180727152003.11663-3-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180727152003.11663-1-sibis@codeaurora.org> References: <20180727152003.11663-1-sibis@codeaurora.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 This patch adds a mechanism for assigning each rproc segment with a custom dump function. It is to be called for each rproc segment during coredump if assigned. Signed-off-by: Sibi Sankar --- drivers/remoteproc/remoteproc_core.c | 37 ++++++++++++++++++++++++++++ include/linux/remoteproc.h | 5 ++++ 2 files changed, 42 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ec56cd822b26..3d70b7dd1f18 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1120,6 +1120,43 @@ int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size) } EXPORT_SYMBOL(rproc_coredump_add_segment); +/** + * rproc_coredump_add_custom_segment() - add segment of device memory to + * coredump and extend it with custom + * dump function + * @rproc: handle of a remote processor + * @da: device address + * @size: size of segment + * @dumpfn: custom dump function called for each segment during coredump + * + * Add device memory to the list of segments to be included in a coredump for + * the remoteproc and associate the segment with the given custom dump + * function. + * + * Return: 0 on success, negative errno on error. + */ +int rproc_coredump_add_custom_segment(struct rproc *rproc, + dma_addr_t da, size_t size, + void (*dumpfn)(struct rproc *rproc, + void *ptr, size_t len, + void *priv)) +{ + struct rproc_dump_segment *segment; + + segment = kzalloc(sizeof(*segment), GFP_KERNEL); + if (!segment) + return -ENOMEM; + + segment->da = da; + segment->size = size; + segment->dump = dumpfn; + + list_add_tail(&segment->node, &rproc->dump_segments); + + return 0; +} +EXPORT_SYMBOL(rproc_coredump_add_custom_segment); + /** * rproc_coredump() - perform coredump * @rproc: rproc handle diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 0fbb01a9955c..5a1ad008ec28 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -560,6 +560,11 @@ int rproc_boot(struct rproc *rproc); void rproc_shutdown(struct rproc *rproc); void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type); int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size); +int rproc_coredump_add_custom_segment(struct rproc *rproc, + dma_addr_t da, size_t size, + void (*dumpfn)(struct rproc *rproc, + void *ptr, size_t len, + void *priv)); static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev) { From patchwork Fri Jul 27 15:20:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10547333 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 5C5871822 for ; Fri, 27 Jul 2018 15:21:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4988428B44 for ; Fri, 27 Jul 2018 15:21:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C9CF2BF62; Fri, 27 Jul 2018 15:21:28 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 DB56D2BF6D for ; Fri, 27 Jul 2018 15:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388622AbeG0Qns (ORCPT ); Fri, 27 Jul 2018 12:43:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54190 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732148AbeG0Qns (ORCPT ); Fri, 27 Jul 2018 12:43:48 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0D8346085F; Fri, 27 Jul 2018 15:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704885; bh=CNkLO5LsULva/c9lIxv79aEi8wqIM1+PcyJ/Jh6uW7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NtvjaQ3FrJ/RU+Ozi3mdAy5JALc5vf6CK3RNXr3yKfvTIkOuuOc5E0w71R3yxETW6 YKHf+rDB15PMS3hJfPD2gdBAmDpBV0jill3nHwMS4+1hcMSRydPukuaGeCTAlKC5H4 D8EuRC/Bkss08pUQoeQqZYwFdqHYw4scgyt0SmTg= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1EFBB60B7B; Fri, 27 Jul 2018 15:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704883; bh=CNkLO5LsULva/c9lIxv79aEi8wqIM1+PcyJ/Jh6uW7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3xx32ZY8AEP7mPRO8LDraZcXSGNf4Umkg/DDrdGSLauxcKJLrGZT0WocboUCAWyt 4lkWJn0KYVXkOXQNgRNH6p/NU/NGg7Kk0hRnoTAyaDb11u3cBVaNssW8xgFdGtr1xL YHdtPsbU0HfEt+yU2HHJ9Xb/PbSrbNcu/s7bWjA8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1EFBB60B7B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org, Sibi Sankar Subject: [PATCH v3 3/6] remoteproc: qcom: q6v5-pil: Refactor mba load/unload sequence Date: Fri, 27 Jul 2018 20:50:00 +0530 Message-Id: <20180727152003.11663-4-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180727152003.11663-1-sibis@codeaurora.org> References: <20180727152003.11663-1-sibis@codeaurora.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 Refactor re-useable parts of mba load/unload sequence into mba_load and mba_reclaim respectively and introduce mba_load flag. This is done in order to prevent code duplication for modem coredump which requires the mba to be loaded. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_pil.c | 243 +++++++++++++++++------------ 1 file changed, 144 insertions(+), 99 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index d7a4b9eca5d2..eacf9f0bf49e 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -165,6 +165,7 @@ struct q6v5 { int proxy_reg_count; bool running; + bool mba_loaded; phys_addr_t mba_phys; void *mba_region; @@ -669,6 +670,145 @@ static bool q6v5_phdr_valid(const struct elf32_phdr *phdr) return true; } +static int q6v5_mba_load(struct q6v5 *qproc) +{ + int ret; + int xfermemop_ret; + + ret = q6v5_regulator_enable(qproc, qproc->proxy_regs, + qproc->proxy_reg_count); + if (ret) { + dev_err(qproc->dev, "failed to enable proxy supplies\n"); + return ret; + } + + ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks, + qproc->proxy_clk_count); + if (ret) { + dev_err(qproc->dev, "failed to enable proxy clocks\n"); + goto disable_proxy_reg; + } + + ret = q6v5_regulator_enable(qproc, qproc->active_regs, + qproc->active_reg_count); + if (ret) { + dev_err(qproc->dev, "failed to enable supplies\n"); + goto disable_proxy_clk; + } + + ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks, + qproc->reset_clk_count); + if (ret) { + dev_err(qproc->dev, "failed to enable reset clocks\n"); + goto disable_vdd; + } + + ret = q6v5_reset_deassert(qproc); + if (ret) { + dev_err(qproc->dev, "failed to deassert mss restart\n"); + goto disable_reset_clks; + } + + ret = q6v5_clk_enable(qproc->dev, qproc->active_clks, + qproc->active_clk_count); + if (ret) { + dev_err(qproc->dev, "failed to enable clocks\n"); + goto assert_reset; + } + + /* Assign MBA image access in DDR to q6 */ + ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, + qproc->mba_phys, qproc->mba_size); + if (ret) { + dev_err(qproc->dev, + "assigning Q6 access to mba memory failed: %d\n", ret); + goto disable_active_clks; + } + + writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG); + + ret = q6v5proc_reset(qproc); + if (ret) + goto reclaim_mba; + + ret = q6v5_rmb_mba_wait(qproc, 0, 5000); + if (ret == -ETIMEDOUT) { + dev_err(qproc->dev, "MBA boot timed out\n"); + goto halt_axi_ports; + } else if (ret != RMB_MBA_XPU_UNLOCKED && + ret != RMB_MBA_XPU_UNLOCKED_SCRIBBLED) { + dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret); + ret = -EINVAL; + goto halt_axi_ports; + } + + qproc->mba_loaded = true; + return 0; + +halt_axi_ports: + q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6); + q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem); + q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc); + +reclaim_mba: + xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, + qproc->mba_phys, + qproc->mba_size); + if (xfermemop_ret) { + dev_err(qproc->dev, + "Failed to reclaim mba buffer, system may become unstable\n"); + } + +disable_active_clks: + q6v5_clk_disable(qproc->dev, qproc->active_clks, + qproc->active_clk_count); +assert_reset: + q6v5_reset_assert(qproc); +disable_reset_clks: + q6v5_clk_disable(qproc->dev, qproc->reset_clks, + qproc->reset_clk_count); +disable_vdd: + q6v5_regulator_disable(qproc, qproc->active_regs, + qproc->active_reg_count); +disable_proxy_clk: + q6v5_clk_disable(qproc->dev, qproc->proxy_clks, + qproc->proxy_clk_count); +disable_proxy_reg: + q6v5_regulator_disable(qproc, qproc->proxy_regs, + qproc->proxy_reg_count); + + return ret; +} + +static void q6v5_mba_reclaim(struct q6v5 *qproc) +{ + int xfermemop_ret; + + qproc->mba_loaded = false; + q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6); + q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem); + q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc); + xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, + qproc->mba_phys, + qproc->mba_size); + if (xfermemop_ret) { + dev_err(qproc->dev, + "Failed to reclaim mba buffer, system may become unstable\n"); + } + + q6v5_clk_disable(qproc->dev, qproc->active_clks, + qproc->active_clk_count); + q6v5_reset_assert(qproc); + q6v5_clk_disable(qproc->dev, qproc->reset_clks, + qproc->reset_clk_count); + q6v5_regulator_disable(qproc, qproc->active_regs, + qproc->active_reg_count); + q6v5_clk_disable(qproc->dev, qproc->proxy_clks, + qproc->proxy_clk_count); + q6v5_regulator_disable(qproc, qproc->proxy_regs, + qproc->proxy_reg_count); +} + static int q6v5_mpss_load(struct q6v5 *qproc) { const struct elf32_phdr *phdrs; @@ -792,72 +932,9 @@ static int q6v5_start(struct rproc *rproc) qcom_q6v5_prepare(&qproc->q6v5); - ret = q6v5_regulator_enable(qproc, qproc->proxy_regs, - qproc->proxy_reg_count); - if (ret) { - dev_err(qproc->dev, "failed to enable proxy supplies\n"); - goto disable_irqs; - } - - ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks, - qproc->proxy_clk_count); - if (ret) { - dev_err(qproc->dev, "failed to enable proxy clocks\n"); - goto disable_proxy_reg; - } - - ret = q6v5_regulator_enable(qproc, qproc->active_regs, - qproc->active_reg_count); - if (ret) { - dev_err(qproc->dev, "failed to enable supplies\n"); - goto disable_proxy_clk; - } - - ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks, - qproc->reset_clk_count); - if (ret) { - dev_err(qproc->dev, "failed to enable reset clocks\n"); - goto disable_vdd; - } - - ret = q6v5_reset_deassert(qproc); - if (ret) { - dev_err(qproc->dev, "failed to deassert mss restart\n"); - goto disable_reset_clks; - } - - ret = q6v5_clk_enable(qproc->dev, qproc->active_clks, - qproc->active_clk_count); - if (ret) { - dev_err(qproc->dev, "failed to enable clocks\n"); - goto assert_reset; - } - - /* Assign MBA image access in DDR to q6 */ - ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true, - qproc->mba_phys, qproc->mba_size); - if (ret) { - dev_err(qproc->dev, - "assigning Q6 access to mba memory failed: %d\n", ret); - goto disable_active_clks; - } - - writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG); - - ret = q6v5proc_reset(qproc); + ret = q6v5_mba_load(qproc); if (ret) - goto reclaim_mba; - - ret = q6v5_rmb_mba_wait(qproc, 0, 5000); - if (ret == -ETIMEDOUT) { - dev_err(qproc->dev, "MBA boot timed out\n"); - goto halt_axi_ports; - } else if (ret != RMB_MBA_XPU_UNLOCKED && - ret != RMB_MBA_XPU_UNLOCKED_SCRIBBLED) { - dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret); - ret = -EINVAL; - goto halt_axi_ports; - } + goto disable_irqs; dev_info(qproc->dev, "MBA booted, loading mpss\n"); @@ -886,40 +963,7 @@ static int q6v5_start(struct rproc *rproc) false, qproc->mpss_phys, qproc->mpss_size); WARN_ON(xfermemop_ret); - -halt_axi_ports: - q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6); - q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem); - q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc); - -reclaim_mba: - xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false, - qproc->mba_phys, - qproc->mba_size); - if (xfermemop_ret) { - dev_err(qproc->dev, - "Failed to reclaim mba buffer, system may become unstable\n"); - } - -disable_active_clks: - q6v5_clk_disable(qproc->dev, qproc->active_clks, - qproc->active_clk_count); - -assert_reset: - q6v5_reset_assert(qproc); -disable_reset_clks: - q6v5_clk_disable(qproc->dev, qproc->reset_clks, - qproc->reset_clk_count); -disable_vdd: - q6v5_regulator_disable(qproc, qproc->active_regs, - qproc->active_reg_count); -disable_proxy_clk: - q6v5_clk_disable(qproc->dev, qproc->proxy_clks, - qproc->proxy_clk_count); -disable_proxy_reg: - q6v5_regulator_disable(qproc, qproc->proxy_regs, - qproc->proxy_reg_count); - + q6v5_mba_reclaim(qproc); disable_irqs: qcom_q6v5_unprepare(&qproc->q6v5); @@ -933,6 +977,7 @@ static int q6v5_stop(struct rproc *rproc) u32 val; qproc->running = false; + qproc->mba_loaded = false; ret = qcom_q6v5_request_stop(&qproc->q6v5); if (ret == -ETIMEDOUT) From patchwork Fri Jul 27 15:20:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10547345 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 24F46174A for ; Fri, 27 Jul 2018 15:21:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13D7328660 for ; Fri, 27 Jul 2018 15:21:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07B022BF62; Fri, 27 Jul 2018 15:21:50 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A684D28660 for ; Fri, 27 Jul 2018 15:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388613AbeG0Qnx (ORCPT ); Fri, 27 Jul 2018 12:43:53 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54322 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732148AbeG0Qnx (ORCPT ); Fri, 27 Jul 2018 12:43:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D564560BDE; Fri, 27 Jul 2018 15:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704889; bh=z57x3kTRV2Kfa/bgAAXopQMiUscqL3vNVmmMM9E57Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hcywg3eZ+CFnqUpk3LpSIqnACdV0VMFzYOvpJJ5xL4dieBatYYu+1VjKYO2fwsAlz LWCAmrJVz3AD8qJl5+L273oG9nz8+ogPRhyo46NSHu6Iw9ptqjVYoM3i8/WD7lcWjI jNXVdHlQPJhXyB3akXkuwD3tEfYp6loE60ZJ2cG0= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5B96760B19; Fri, 27 Jul 2018 15:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704888; bh=z57x3kTRV2Kfa/bgAAXopQMiUscqL3vNVmmMM9E57Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLAmOHHlgdDixtHlOr506QoYq98USVpJwEGFu1yQSEd+Z3ENVShI4zib5yucKOUE4 3YUZaXIwvlDt5rIbCaXXU33DrFBbntdTg2VrD8xXNURgcOBy2BWupd+8LSQcHqQJrD GJ9lRCDqvsWHQK+U5fmwIEOG8f/MuNlUy1gaMbc8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5B96760B19 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org, Sibi Sankar Subject: [PATCH v3 4/6] remoteproc: qcom: q6v5-pil: Add custom dump function for modem Date: Fri, 27 Jul 2018 20:50:01 +0530 Message-Id: <20180727152003.11663-5-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180727152003.11663-1-sibis@codeaurora.org> References: <20180727152003.11663-1-sibis@codeaurora.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 The per segment dump function is responsible for loading the mba before device memory segments associated with coredump can be populated and for cleaning up the resources post coredump. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_pil.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index eacf9f0bf49e..ac3342f9ea5a 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -182,6 +182,7 @@ struct q6v5 { struct qcom_sysmon *sysmon; bool need_mem_protection; bool has_alt_reset; + u32 valid_mask; int mpss_perm; int mba_perm; int version; @@ -924,6 +925,30 @@ static int q6v5_mpss_load(struct q6v5 *qproc) return ret < 0 ? ret : 0; } +static void qcom_q6v5_dump_segment(struct rproc *rproc, void *ptr, size_t len, + void *priv) +{ + int ret = 0; + struct q6v5 *qproc = (struct q6v5 *)rproc->priv; + static u32 pending_mask; + + /* Unlock mba before copying segments */ + if (!qproc->mba_loaded) + ret = q6v5_mba_load(qproc); + + if (!ptr || ret) + memset(priv, 0xff, len); + else + memcpy(priv, ptr, len); + + pending_mask++; + if (pending_mask == qproc->valid_mask) { + if (qproc->mba_loaded) + q6v5_mba_reclaim(qproc); + pending_mask = 0; + } +} + static int q6v5_start(struct rproc *rproc) { struct q6v5 *qproc = (struct q6v5 *)rproc->priv; From patchwork Fri Jul 27 15:20:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10547339 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 1739C1822 for ; Fri, 27 Jul 2018 15:21:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05A8828660 for ; Fri, 27 Jul 2018 15:21:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED6702BF62; Fri, 27 Jul 2018 15:21:44 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9864B28B44 for ; Fri, 27 Jul 2018 15:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388870AbeG0Qn4 (ORCPT ); Fri, 27 Jul 2018 12:43:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54358 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732148AbeG0Qn4 (ORCPT ); Fri, 27 Jul 2018 12:43:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C078F60B81; Fri, 27 Jul 2018 15:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704892; bh=jmvOYhAM99oDfrUOYVrn3B7+tmkxBw4h+TdgSkaaj7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=okUjbF9bHh9nMuny8Q/I/GItpbaU+bJ5CLltQ0QVSmHcQULGDs8b7A0Lisy0OwZ0c LPkEaKITU4uHU15UaTe8SGW6b3u4AUr3cDRJ9BfYVijdUml4kyn3TkKzP4AbxteA1J /1XbSOR5kzSLBPhhVwS41iW3GUMSJADFRgJDpOYU= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A17C560B7E; Fri, 27 Jul 2018 15:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704892; bh=jmvOYhAM99oDfrUOYVrn3B7+tmkxBw4h+TdgSkaaj7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=okUjbF9bHh9nMuny8Q/I/GItpbaU+bJ5CLltQ0QVSmHcQULGDs8b7A0Lisy0OwZ0c LPkEaKITU4uHU15UaTe8SGW6b3u4AUr3cDRJ9BfYVijdUml4kyn3TkKzP4AbxteA1J /1XbSOR5kzSLBPhhVwS41iW3GUMSJADFRgJDpOYU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A17C560B7E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org, Sibi Sankar Subject: [PATCH v3 5/6] remoteproc: qcom: q6v5-pil: Register segments/dumpfn for coredump Date: Fri, 27 Jul 2018 20:50:02 +0530 Message-Id: <20180727152003.11663-6-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180727152003.11663-1-sibis@codeaurora.org> References: <20180727152003.11663-1-sibis@codeaurora.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 Register the MDT segments and custom dumpfn with the remoteproc core dump functionality. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_pil.c | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index ac3342f9ea5a..22bb049c3e7f 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -1058,10 +1058,50 @@ static void *q6v5_da_to_va(struct rproc *rproc, u64 da, int len) return qproc->mpss_region + offset; } +static int qcom_q6v5_register_dump_segments(struct rproc *rproc, + const struct firmware *fw_unused) +{ + const struct firmware *fw; + const struct elf32_phdr *phdrs; + const struct elf32_phdr *phdr; + const struct elf32_hdr *ehdr; + struct q6v5 *qproc = (struct q6v5 *)rproc->priv; + int ret; + int i; + + ret = request_firmware(&fw, "modem.mdt", qproc->dev); + if (ret < 0) { + dev_err(qproc->dev, "unable to load modem.mdt\n"); + return ret; + } + + qproc->valid_mask = 0; + ehdr = (struct elf32_hdr *)fw->data; + phdrs = (struct elf32_phdr *)(ehdr + 1); + + for (i = 0; i < ehdr->e_phnum; i++) { + phdr = &phdrs[i]; + + if (!q6v5_phdr_valid(phdr)) + continue; + + ret = rproc_coredump_add_custom_segment(rproc, phdr->p_paddr, + phdr->p_memsz, qcom_q6v5_dump_segment); + if (ret) + break; + + qproc->valid_mask++; + } + + release_firmware(fw); + return ret; +} + static const struct rproc_ops q6v5_ops = { .start = q6v5_start, .stop = q6v5_stop, .da_to_va = q6v5_da_to_va, + .parse_fw = qcom_q6v5_register_dump_segments, .load = q6v5_load, }; From patchwork Fri Jul 27 15:20:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10547335 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 3B2B414E0 for ; Fri, 27 Jul 2018 15:21:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2883D28660 for ; Fri, 27 Jul 2018 15:21:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A3202BF62; Fri, 27 Jul 2018 15:21:44 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 B1F3F28660 for ; Fri, 27 Jul 2018 15:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388892AbeG0QoA (ORCPT ); Fri, 27 Jul 2018 12:44:00 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54458 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732148AbeG0Qn7 (ORCPT ); Fri, 27 Jul 2018 12:43:59 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DE9C960B83; Fri, 27 Jul 2018 15:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704896; bh=z9AXPBQQWRivJrxXKe2Idv9ECGtSqlnLhLGztoHwNPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G5RWflH9xmmaDlBRnTVq6WB3jGpj09x1KILCdplBRH1BEgfvNsfgxuycIx/Opnwg9 ILyTAw1FrH9XBS1JPAriFJr8AV6eXcOxGhDwK9VhSRCygJGB+MyqlF+Lr5mDW23xd4 bVvhMzEkxo0FRQAzwae2X5cROlDADZ65b5cwklB4= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id AE09E60B11; Fri, 27 Jul 2018 15:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532704896; bh=z9AXPBQQWRivJrxXKe2Idv9ECGtSqlnLhLGztoHwNPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G5RWflH9xmmaDlBRnTVq6WB3jGpj09x1KILCdplBRH1BEgfvNsfgxuycIx/Opnwg9 ILyTAw1FrH9XBS1JPAriFJr8AV6eXcOxGhDwK9VhSRCygJGB+MyqlF+Lr5mDW23xd4 bVvhMzEkxo0FRQAzwae2X5cROlDADZ65b5cwklB4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AE09E60B11 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org, Sibi Sankar Subject: [PATCH v3 6/6] remoteproc: qcom: q6v5-pil: Assign the relocated address Date: Fri, 27 Jul 2018 20:50:03 +0530 Message-Id: <20180727152003.11663-7-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180727152003.11663-1-sibis@codeaurora.org> References: <20180727152003.11663-1-sibis@codeaurora.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 Assign the relocated base of the modem image, as the offsets from the virtual memory might not be based on the physical address. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_pil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 22bb049c3e7f..b1296d614b8b 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -862,6 +862,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) } mpss_reloc = relocate ? min_addr : qproc->mpss_phys; + qproc->mpss_reloc = mpss_reloc; /* Load firmware segments */ for (i = 0; i < ehdr->e_phnum; i++) { phdr = &phdrs[i];