Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1058585rwb; Tue, 27 Sep 2022 07:57:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4T54vbbVS4d+6y5AHRg1suSue8wSo5p4x1dBjS3GFMTpISog2iEDsaOlxGmESCdooVnCwE X-Received: by 2002:aa7:df8b:0:b0:44e:882f:7c5c with SMTP id b11-20020aa7df8b000000b0044e882f7c5cmr28021771edy.418.1664290661105; Tue, 27 Sep 2022 07:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664290661; cv=none; d=google.com; s=arc-20160816; b=qJXscEnqvx3HRpH5+FPIFWzSplSSaFgXXUKrTd019LOHb8xfFeEcvDfl3iVhUVYHEd Qan/TY6heMKIa1DBamT6Y/FBXizKL+gEJilgC3WezNX40X8gj/33ZDJh7+89oJc3+duu eM2x2v47TsS2EtdW4Nw5TOn9cLiSSYOehglXkX5fUh29weOzNRp3WVqFYlmUNWLTOCEp 5dGoxsuEcvN6io9RwDE3d6gBK/rSa/Ts1H8JzNdq6hqDYyUxbkpdN5CYjnvbK8pR6Vju M8SUvBTcHbDb/e/E3AUXWgdsBTHwkBkfO3H+aBO3QXRqu4L35i7e1nPdZ/1aSaO6Q2vG QR7w== 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=wQLJt/4AfEbF8qWTSB77diKqqtlCNfgXesF14oyIVmA=; b=H3QOUXT0gBclN93l4i+l5oJww4dD6a+p3r08tc8MmWbKdis6GF1/Maff4C/u4mVJbq QbOSvF2D50yO1fJcChweAJHQ0Uyh48mTCD8C2Av9Hnj//EpZbpThgJdrwSIyfyoMYhGm 9oD4OcpDG5cu9332cL6/KFIxjgOGNXWFwx/EYY65O/5lPBv8cxRXYYhKzAKggioGp/vh q8JlAJDACEyL/ZfvWzXtjI+ffKuaZFfjZHtmCcjI36s+oQrc8cvBq74ti2X16RzLxZ+a 8qIun/+v3TFf1/+agyoa0I76t/klOqtjMfgxn6k+ndrgjaSbANz/HmEcHyP3FQ0eKOuL Wr6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=W55999o2; 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 be21-20020a0564021a3500b00457596e4babsi1558399edb.310.2022.09.27.07.57.15; Tue, 27 Sep 2022 07:57:41 -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=W55999o2; 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 S232906AbiI0N7H (ORCPT + 99 others); Tue, 27 Sep 2022 09:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbiI0N6T (ORCPT ); Tue, 27 Sep 2022 09:58:19 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0957B140F32; Tue, 27 Sep 2022 06:58:17 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28RDNbua007936; Tue, 27 Sep 2022 13:57:37 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=wQLJt/4AfEbF8qWTSB77diKqqtlCNfgXesF14oyIVmA=; b=W55999o2CDGxK5LoElXKEmOtyOTwZ/i4/Pit4pbuqWOeQVPEY6mKv8EWVSdjlSyT2DkY eM25Vu/8eJ8edbWQQEwKJTNuQYQnjsH9OHvgXfE4Msjt5Dy6X4P6cRXCnFeB1S9aBg8z zTCORxlr49y2vmALHZGIK2ZBdOGnt9vbZ1G4sef9TAH+y3YBcPIKwRK3MZAbzqCeBNEH Or7xMqOONP619ftmOmIypMX2p+C8oTlvkb61hPaA9mKBC6OeE0zPGsUW/fIBwWdx7e8C hnB0hlI9BMT0Pr135YZV+P5SD8hv9RgAYZHK+X3jm9AXzfs89vTseKTFIZpKrkLKEmvN vg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jsrwfph90-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Sep 2022 13:57:37 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 28RDvawd000426 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Sep 2022 13:57:36 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; Tue, 27 Sep 2022 06:57:30 -0700 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v9 4/7] remoteproc: qcom: Update rproc parse firmware callback Date: Tue, 27 Sep 2022 19:26:40 +0530 Message-ID: <1664287003-31450-5-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1664287003-31450-1-git-send-email-quic_srivasam@quicinc.com> References: <1664287003-31450-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: fYYXh5Z5QZjNeMwHlY8pa7l28gDc-4AS X-Proofpoint-GUID: fYYXh5Z5QZjNeMwHlY8pa7l28gDc-4AS 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-27_05,2022-09-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 impostorscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209270085 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 14a3864..b8cbbf7 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -439,6 +439,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; @@ -450,7 +471,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