Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp955796rwb; Fri, 23 Sep 2022 06:29:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hzy/Kq+PfAKRKTh1vDuRdB10ZwmQ8HYpjMSR4Cj3VfK3CCassXjzgVKH0IHbD98JUyDBA X-Received: by 2002:a05:6a00:1312:b0:536:fefd:e64a with SMTP id j18-20020a056a00131200b00536fefde64amr9019903pfu.26.1663939761441; Fri, 23 Sep 2022 06:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663939761; cv=none; d=google.com; s=arc-20160816; b=BDXLUmqu0Oq7YMF99T6xuvG2NH2JTgfhlvozrQwIFn4sGTZAtZpqBdrNKry15rwvs0 L7hkZPSauIKw2m0uPQw3lS7Q50llnj6zlTtfSgsn1X2KUYjrJLSfk5ODHbvSSbmw9b+g 37nDGlFFm1uqHSXUEu6FC5rNysy01k4L0X2P8c6Q62GOQmZEIzCB1jB9W0qisb4pitcR xvDWnuZ8OFD0UVI2gPwsoXK5rqt3/Yx1KfxZFHQN5oIT+mP4Qul/J+GDRdTggRE5ZgAI /+DWRr1lvOTudBfiMjlDzzjnb3Akkj12bZcFkUIJx/jXI+GOW3cUU458hYotzemmm8+w dzvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=N9Yn54dUST2gKFnCMhKvfF8BV8CmnCL0NZ9qkX3jmbg=; b=gkiM+ledS7F5JGNwQMvR39pATWq+V4nWzAi35xqD2QQKC3Fz3DFCTrsL39TwGV9mR8 ROSdnhAdz14NTOEHEU+hq5sUyUpCZTeWXNGmOseqSQ5HpTT04+ouOPytsFMpCJt2Q1hY Wwq1SN57SRzYOOkzI6rE3hDlxX/e9CgplRM0EOLTm0r4PUdwQBKvXbbZ+CxyPZ9ojyNt ah+DDWIBnQIDFS/qJIcqm5E4o/OMhu1boBrM7iHqaaBM0/zU5H6ro+qy+JU9iRbZuRHo lEXV4pBChHKG45E6SILM3ynHXVwcNquGzCOVoUlKg0QGo2suCEBcC8hcJNYgsSuK06Hu J77g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="TzwC3+/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a170902724500b00178aa0b29ebsi2613879pll.552.2022.09.23.06.29.09; Fri, 23 Sep 2022 06:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="TzwC3+/9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbiIWNHV (ORCPT + 99 others); Fri, 23 Sep 2022 09:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbiIWNHH (ORCPT ); Fri, 23 Sep 2022 09:07:07 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A072B13A3B3; Fri, 23 Sep 2022 06:07:04 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28NBDmJe019385; Fri, 23 Sep 2022 13:06:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=N9Yn54dUST2gKFnCMhKvfF8BV8CmnCL0NZ9qkX3jmbg=; b=TzwC3+/92fVMyPyCbfmoIcSTZKFCmZbtBmeNU3k5n0M5IsUnakjLunvo19VG9wkM1Bz9 dsKahHMEQ8z7/m/y9fnkQEs612/07cPuEGgcGX5SlafZo7D30D2BWKl7U3RjA6tkq6VU tXTtFn3z5UREvvAekSHPCvJODpv+34c7SGitQcp890fLBltIjL/vo4fYYV+MCWWXQoq2 qr9BVEEM8FMuNxr2mcA6zGPyTEalp2RmcyZIQoJ0U9X+eKT8zKHaqs57ix5XoHdy8BuZ nox3KmCPBGOiye/iMRrt/kvYd0F9R7wrs/egZHABBpw+VAUvt5DsM5O6vnJSeMVpLKBE 6A== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3js67nhm4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 13:06:23 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 28ND6Nme028216 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 13:06:23 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 23 Sep 2022 06:06:17 -0700 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v8 4/7] remoteproc: qcom: Update rproc parse firmware callback Date: Fri, 23 Sep 2022 18:35:37 +0530 Message-ID: <1663938340-24345-5-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663938340-24345-1-git-send-email-quic_srivasam@quicinc.com> References: <1663938340-24345-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: oD7qGAtLSrMQIXR1aIet06OSBI4f1Qw- X-Proofpoint-GUID: oD7qGAtLSrMQIXR1aIet06OSBI4f1Qw- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-23_04,2022-09-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209230085 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change parse_fw callback in rproc ops from qcom_register_dump_segments to local function such that, it can perform coredump segments registration and it can parse section header in memory sandboxing required platforms. Signed-off-by: Srinivasa Rao Mandadapu --- Changes since V6: -- Update parse firmware callback. drivers/remoteproc/qcom_q6v5_adsp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index 02d17b4..9ea10b7 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -440,6 +440,27 @@ static void *adsp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iom return adsp->mem_region + offset; } +static int adsp_parse_firmware(struct rproc *rproc, const struct firmware *fw) +{ + struct qcom_adsp *adsp = rproc->priv; + int ret; + + ret = qcom_register_dump_segments(rproc, fw); + if (ret) { + dev_err(&rproc->dev, "Error in registering dump segments\n"); + return ret; + } + + if (adsp->has_iommu) { + ret = rproc_elf_load_rsc_table(rproc, fw); + if (ret) { + dev_err(&rproc->dev, "Error in loading resource table\n"); + return ret; + } + } + return 0; +} + static unsigned long adsp_panic(struct rproc *rproc) { struct qcom_adsp *adsp = rproc->priv; @@ -451,7 +472,7 @@ 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, + .parse_fw = adsp_parse_firmware, .load = adsp_load, .panic = adsp_panic, }; -- 2.7.4