From patchwork Thu Apr 20 13:13:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijaya Krishna Nivarthi X-Patchwork-Id: 85907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp333030vqo; Thu, 20 Apr 2023 06:24:14 -0700 (PDT) X-Google-Smtp-Source: AKy350YtPDzT1fHJuP5e0pCasOJzsZCuNHTIoYkOs2UnZVvpvztRpyZbvQXGCwMHu0KkzgIBbSpf X-Received: by 2002:a05:6a20:ad89:b0:de:526b:f292 with SMTP id dd9-20020a056a20ad8900b000de526bf292mr1858990pzb.19.1681997054437; Thu, 20 Apr 2023 06:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681997054; cv=none; d=google.com; s=arc-20160816; b=my+rtiAMGwhl06uUwYCqsyJ55EgNm9CxZ+t1mROE8nYUchdyvYGRdgPGlXljkojuPP CTPNHo4NVz1VVnTSgqoFYi4dS0tf2d/fQ5lx7LiHTz4n8267ztWN/CtkKNOEV0TZMGrM 6yJImJllK1IfUQN/QglhpNCPtlUIyjeQIbwY7G7XIYtBlyuXjpfna2tGDKJuQWK4dVDn T7jRDaLkw7fotTMkZCBnRRbTagym1dLeq7YGPuuwzNY7pMh3aj2YzLqAU0l8B7zeG2pv MWfxdbXLqNM5gPlhiu0UEcPBDykUhONA7IYoQ/pvByYsHclMh4WfDTX6iX8Bnd0nl53y YE/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=UyQDTzzQqxum/33pd4jjg9xw/wtGJmqeFRVXu5eOoM8=; b=zEajNkpXKZm2mn3VikpqmB6gG+FCfiEnDGub5r6HuKZQyCj77cO5KiqIm9ByvHkq42 hd8rV0yEfAvWMMkY6bRT+CehAKMGdAZj7Zr0eVD3gmWwe4H0baecOkM6YVn1GL8D5X5s XvH/ItFf5/5Ye+ZkbYEvybtgnA0Z1l8YtCvQdtpZSXnbRcUHxy1zzTAbSQr16xcLL/dJ VGhEToMw7KwKrC/YPlU2Is9pssWecC7GZsyLbOiAGsHxIu1bH0e64D41mNKf7m13BPX+ 0Yhj0cW3UsUmLeofG8Xn4PaU8n7XaG6nLKwIeWCZEFhr+ehugCOgKAspw6E/EaZJqwhp YhFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AVb4vuYg; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv189-20020a632ec6000000b005139bf86110si1566665pgb.673.2023.04.20.06.24.01; Thu, 20 Apr 2023 06:24:14 -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=AVb4vuYg; 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 S231514AbjDTNNg (ORCPT + 99 others); Thu, 20 Apr 2023 09:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231470AbjDTNN3 (ORCPT ); Thu, 20 Apr 2023 09:13:29 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7315271C; Thu, 20 Apr 2023 06:13:26 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KAqksn025719; Thu, 20 Apr 2023 13:13:23 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; s=qcppdkim1; bh=UyQDTzzQqxum/33pd4jjg9xw/wtGJmqeFRVXu5eOoM8=; b=AVb4vuYgRdoT195wpHqfUKdr4sdh4dQA/n8X6WHPd9AtGj38YRq1QmCSECxArusTtvFi aSjhV6rt2/ukLm34FADqUYkJjPU4y+7AFShdKP5fSr6vLEjcJSi/8gfOY0t9QeDN/KuS wMjGoOilX8zUvAKoXuuv15V4xqG2872KJYQGgxOVt1EBNgUh/lZFDncQ7sAU4B90YPIS /B9qzsBBPQpoDQaXmVkyW0iCOuOE6+/VThhelOIVb5AmHYwQ2nDTAfxv4qn1g6i891uS gYx2m7XKOj3jb37tXktkx5ASYWbZG/V9qE0cpVjhQaYCriPjo2qAENQw9Njc2Ziq2eWj hg== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q2uh3hexj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 13:13:23 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 33KDDK7S012054; Thu, 20 Apr 2023 13:13:20 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3pyn0kkgpt-1; Thu, 20 Apr 2023 13:13:20 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33KDDJGa012048; Thu, 20 Apr 2023 13:13:19 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-vnivarth-hyd.qualcomm.com [10.213.111.166]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 33KDDJ7k012047; Thu, 20 Apr 2023 13:13:19 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3994820) id 0EEBA47A4; Thu, 20 Apr 2023 18:43:19 +0530 (+0530) From: Vijaya Krishna Nivarthi To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, cros-qcom-dts-watchers@chromium.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_msavaliy@quicinc.com, dianders@chromium.org, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com, Vijaya Krishna Nivarthi Subject: [PATCH v4 1/5] spi: dt-bindings: qcom,spi-qcom-qspi: Add iommus Date: Thu, 20 Apr 2023 18:43:10 +0530 Message-Id: <1681996394-13099-2-git-send-email-quic_vnivarth@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> References: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 5QaNJ4fUdOXnFiT_woRNmtRmNZXHgWjR X-Proofpoint-GUID: 5QaNJ4fUdOXnFiT_woRNmtRmNZXHgWjR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-20_09,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=490 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304200107 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763701743133828924?= X-GMAIL-MSGID: =?utf-8?q?1763701743133828924?= Add iommus binding for DMA mode support Signed-off-by: Vijaya Krishna Nivarthi Acked-by: Krzysztof Kozlowski --- v2 -> v3: - modified commit message --- Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml index ee8f7ea..1696ac4 100644 --- a/Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml +++ b/Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml @@ -29,6 +29,9 @@ properties: reg: maxItems: 1 + iommus: + maxItems: 1 + interrupts: maxItems: 1 From patchwork Thu Apr 20 13:13:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijaya Krishna Nivarthi X-Patchwork-Id: 85906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp330665vqo; Thu, 20 Apr 2023 06:20:48 -0700 (PDT) X-Google-Smtp-Source: AKy350blff+BvrB0EuBc+1rnEE5UU6LTPRpUwzfZB1OatP6pJq6bUvSVMGsojqnMWHy1GkmLPmvD X-Received: by 2002:a05:6a00:22c1:b0:63b:4e99:807d with SMTP id f1-20020a056a0022c100b0063b4e99807dmr1533139pfj.8.1681996848068; Thu, 20 Apr 2023 06:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681996848; cv=none; d=google.com; s=arc-20160816; b=Eo9Nplt+vj5JSqZVXYiHodINJ8kZGsqaXX+DKITuSSs9Zdw/Ra0Q3ZW4aZy8LMaWGo P2rpXjL4efzTN+O5Bw5N1TqEp2GOfsq5cuhC5ymGkRWC7DKoBlRCSjb6M9Vmg2cmd2Fp 9YbFmffp+/sAMjLznzr/IhGoP0ZzHUhzgEhMH72V3HjMjQAZRFue+1ZIXGpqPaLQw4Se M22gzj77OtHTNY/AQnagPlPu994LxKDXYEOyKw7sw/tdoFAFGiNfta5z6P7rwA2VKRN+ G3rRR/HCtXB8c7z4y4DnJ4H24PHW9ag3vclxaF7ldeF5Jr4wcYb+Uk+KAPQVj3Fv2J94 ceeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=pBmUyE2rykBLWlH3uCf353d+zAx+TbY9zw1OUF+b1os=; b=brGa65MSpwyJaZkXx9ybVQhGxnNFPFX4MoACS4gCzu3hQOeY+FTPfInSEzSJGZeFcY L6m6Av74ktX9Zk/FFs3oTKgUMykDt6erhI9mFV2cPtbMpPtsv2P9TEjgSzy/JbZHF4xV h9CnzoKtd9FRZvw4+ZsSuPC+6smRLFijkB8uoKe9vaoyQ3LMrDUJoxPFzqkI2RwkB0z6 R9RU2BzDWnAX5SxteH45tG7q8xhE/wLXa5my/S0baMDTRwtHoClth3R6Y2WPVEwvklD7 eG2FbhxTB883sGERwqsk4ZHomZ+QzTKFqiBX6rpyM3giDJJdO92nRxckmfLzvFDlzMFP GVDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PTIREmLd; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r27-20020aa79edb000000b0063d67f6ec91si1575614pfq.282.2023.04.20.06.20.31; Thu, 20 Apr 2023 06:20:48 -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=PTIREmLd; 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 S230477AbjDTNNj (ORCPT + 99 others); Thu, 20 Apr 2023 09:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbjDTNN3 (ORCPT ); Thu, 20 Apr 2023 09:13:29 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF8B49CE; Thu, 20 Apr 2023 06:13:27 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KAojwb011149; Thu, 20 Apr 2023 13:13:25 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; s=qcppdkim1; bh=pBmUyE2rykBLWlH3uCf353d+zAx+TbY9zw1OUF+b1os=; b=PTIREmLde3Rgn2WNHe2yMEAA9OzJ/UsUZ62kHJ3pa7VxmwdepMQ8yVRaPq/BmDO1eSQC o2ph0CvSbJ0wVUEv9ueDZ9xxSL/uwbjTQmY7hbjd3WuPmGc2G/bgnhiGbXLgHhOFFVx0 WKs9GxoTcUNvSJ8NRnYWnPsDKCT4zpLKKqIuKQDPbIb4KKO97No0oNArVQ/KNc4mZFiK uAsGqPdyzjQGivIm3eWjzu/w+8HRSZGixzXQZQs8/z2t1KZZr3utXKMeDz6ex5U2BC8v bCHBktASTRSCE5D3pjV1i58k68jCdR1L0b31vltf6zBPLgy7TtHdYJJlUKK8W/GYxTbW YQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q32cnrh4d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 13:13:24 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 33KDDL0X012069; Thu, 20 Apr 2023 13:13:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3pyn0kkgq1-1; Thu, 20 Apr 2023 13:13:21 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33KDDKvQ012063; Thu, 20 Apr 2023 13:13:21 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-vnivarth-hyd.qualcomm.com [10.213.111.166]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 33KDDKSq012062; Thu, 20 Apr 2023 13:13:20 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3994820) id 2BAF447A4; Thu, 20 Apr 2023 18:43:20 +0530 (+0530) From: Vijaya Krishna Nivarthi To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, cros-qcom-dts-watchers@chromium.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_msavaliy@quicinc.com, dianders@chromium.org, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com, Vijaya Krishna Nivarthi Subject: [PATCH v4 2/5] arm64: dts: qcom: sc7180: Add stream-id of qspi to iommus Date: Thu, 20 Apr 2023 18:43:11 +0530 Message-Id: <1681996394-13099-3-git-send-email-quic_vnivarth@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> References: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: s7p2jh_lleRfa2Cxvo0OB3eYGF0f39DT X-Proofpoint-ORIG-GUID: s7p2jh_lleRfa2Cxvo0OB3eYGF0f39DT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-20_09,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 clxscore=1015 malwarescore=0 suspectscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=576 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304200107 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763701526941831481?= X-GMAIL-MSGID: =?utf-8?q?1763701526941831481?= As part of DMA mode support to qspi driver. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson --- arch/arm64/boot/dts/qcom/sc7180.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi index ea1ffade..4c1bec7 100644 --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi @@ -2691,6 +2691,7 @@ qspi: spi@88dc000 { compatible = "qcom,sc7180-qspi", "qcom,qspi-v1"; reg = <0 0x088dc000 0 0x600>; + iommus = <&apps_smmu 0x20 0x0>; #address-cells = <1>; #size-cells = <0>; interrupts = ; From patchwork Thu Apr 20 13:13:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijaya Krishna Nivarthi X-Patchwork-Id: 85903 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp327368vqo; Thu, 20 Apr 2023 06:16:17 -0700 (PDT) X-Google-Smtp-Source: AKy350bvEO9R1inOKQ6i2QQSj6GWMJBz0XgF7EOmX+O5BKW3nflTGv0/NSy+HFHK9QtY7fxEXtc+ X-Received: by 2002:a05:6a00:18a5:b0:63b:22e7:6ee6 with SMTP id x37-20020a056a0018a500b0063b22e76ee6mr1709271pfh.31.1681996577541; Thu, 20 Apr 2023 06:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681996577; cv=none; d=google.com; s=arc-20160816; b=BZGHt2yDY0Bg03snwpASNe1tFMvDQ8t04shxsQ+2qzXyWmrLin1xbJQBOm0bt6lY/D 0aaDSPyG/csKLztCvu8G8SB5BFt+7sTJwF8Kts1WrO/dN2gtEqRsPwirtkUK0i7n3w7X RYp4iZoDLfTySzsYhfYIcpVvU6C4Rq7hEGPE9AH1A9GYfht7YSvXLvjRYHuLRMNpRpJz Hpg8vW8jti6edv/ZtAK877vHDgkYbGCQaud2LImle3PG2d9AFi/YdaFYquTYepmPOC+C VJScqHXVpIKqWyd/+fTeFqK6rllgCaqJPkoosrSHDjZ0WMUHtJBN24eVP6sAKlEV3zCm fDLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=aSGy/6L3Sa9Hl9XV6jA3GTtSF3ICUl9iaHgYnt+Nkno=; b=tbTfvUddef8Ng/9/EpRoKHNev5tIobSjajx1FmfPtKfdbrZtRFHo9x5zg1SQmnflw5 st0JWyzUcvNM0tRGmWlIAA3ZCi0/fUq5yJDe7QQN3IWswlcWf6DL3Oag7cizwMmc0+hs pYobI9RpTwwGsiIvvLQX95RBcydcvkda8ROcM/WPkf88JvxaNs2HN3SE4uxBu7Emz5mC VuWOLbiJMa4HQgBRhM+k8AzoUGq9OIi9A68bPl9/woTojrH0SWegTBjU5Tf7CdcG3jHQ IxGDT8FG96ESXH5hj3p6H+5uzuEq+p+wFo99U3VkO30x/r94e3ED5XWQ0cqVrwMBc2Kh IHIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CvEbbZwm; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r27-20020aa79edb000000b0063d67f6ec91si1575614pfq.282.2023.04.20.06.15.57; Thu, 20 Apr 2023 06:16:17 -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=CvEbbZwm; 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 S231646AbjDTNNm (ORCPT + 99 others); Thu, 20 Apr 2023 09:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbjDTNN3 (ORCPT ); Thu, 20 Apr 2023 09:13:29 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36294C26; Thu, 20 Apr 2023 06:13:28 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KAp36e008299; Thu, 20 Apr 2023 13:13:25 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; s=qcppdkim1; bh=aSGy/6L3Sa9Hl9XV6jA3GTtSF3ICUl9iaHgYnt+Nkno=; b=CvEbbZwmv5KgHy+AALSrK5c2K8LqPtF+wGy1aNcekG24NjeNxoB9SXDTEvn43K8fshcT 0rd/yqf1CAQco4MrZn9ZpLznatjGuGna+Ln6DCWdpjqAkF+pjteSiEFMJTfTxx9/oYK6 kEjIdZsYgAHEFag9wt6Q+/p0MUzdueG3ZerjFD/FVd4HIzV7Av6Rx35GHP9aQpSM1o5n 6MKg7Zj8u3IFNDPDsue7dzBrE+31kWKJHovVmS7pydhIbEF87G1wgSmaWt91TRei00Eg 9981msGG/s4PjDjNJqifk9wRcVbz+0Nb3cyUfgzX+TozKXyoKV8gpmKJeNThXra48RIG sQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q2uj3sf8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 13:13:25 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 33KDDMPY012081; Thu, 20 Apr 2023 13:13:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3pyn0kkgq6-1; Thu, 20 Apr 2023 13:13:22 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33KDDMLS012075; Thu, 20 Apr 2023 13:13:22 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-vnivarth-hyd.qualcomm.com [10.213.111.166]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 33KDDLR8012074; Thu, 20 Apr 2023 13:13:22 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3994820) id 4ACA747A4; Thu, 20 Apr 2023 18:43:21 +0530 (+0530) From: Vijaya Krishna Nivarthi To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, cros-qcom-dts-watchers@chromium.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_msavaliy@quicinc.com, dianders@chromium.org, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com, Vijaya Krishna Nivarthi Subject: [PATCH v4 3/5] arm64: dts: qcom: sc7280: Add stream-id of qspi to iommus Date: Thu, 20 Apr 2023 18:43:12 +0530 Message-Id: <1681996394-13099-4-git-send-email-quic_vnivarth@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> References: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: gJiP5_A6FGDMRWwhJCSbIQYoh6A8nJfr X-Proofpoint-ORIG-GUID: gJiP5_A6FGDMRWwhJCSbIQYoh6A8nJfr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-20_09,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0 clxscore=1015 mlxlogscore=609 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304200107 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763701243112034233?= X-GMAIL-MSGID: =?utf-8?q?1763701243112034233?= As part of DMA mode support to qspi driver. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson --- v2 -> v3: - modified commit message --- arch/arm64/boot/dts/qcom/sc7280.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi index 31728f4..03a55b8 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -3432,6 +3432,7 @@ qspi: spi@88dc000 { compatible = "qcom,sc7280-qspi", "qcom,qspi-v1"; reg = <0 0x088dc000 0 0x1000>; + iommus = <&apps_smmu 0x20 0x0>; #address-cells = <1>; #size-cells = <0>; interrupts = ; From patchwork Thu Apr 20 13:13:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijaya Krishna Nivarthi X-Patchwork-Id: 85904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp327547vqo; Thu, 20 Apr 2023 06:16:29 -0700 (PDT) X-Google-Smtp-Source: AKy350Z2wdCjudPYKdK8gH/v5x/IOBKuwV0ALh9slcFH3iCNhopqq928+Iy6WMFBgEnPOTzZgfVy X-Received: by 2002:a17:902:9b95:b0:1a5:2a50:e177 with SMTP id y21-20020a1709029b9500b001a52a50e177mr1422460plp.55.1681996588572; Thu, 20 Apr 2023 06:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681996588; cv=none; d=google.com; s=arc-20160816; b=cVbrnHoOns4PBgNK8UX67WVZg+ZzVUOtZ0OtVlbBjnKLtjk4nwmAceO/tlvQSlAdSz spzv0JZlsQywfQYK9s5z6dT8zGFtbbLmVSSyEE3t1Ca4REGXlwKOMiatJi7RYJe3Ym6V 7l4SaidbgstSzxkFvbIAgNY+ZFZqUnPi47e47aOBdvmKw46wLPX1W7zvYsmTpshWcZB0 I+5OGjgelfQ5goYG5SCV5v73vtVjbRSx17BruQuZEgFERE3ApLZvies/eXxtjpprPAtc pvfgCxtPidUG8+wUSnH755Xm1szoegLLvI1D2dV0PW3/aTA9CI+F41vcQFXp6JeqfOjM FNPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=yh5qGmFfyAdxUhginfqSwvpZh7NZc2bU9oaq/HJVFyc=; b=dppLeyN6S9IofihHzc7yKWpRC6e53BMHXt+euxqdCVm5gRR81iWkkLcVSPOYVJgQYP 5pt2/SpA/jmPZACtvVBsU0Yaq9ZMsDXwOFjuuKAUiublTsp5//CJalsRmtWr/d0haYN+ kU+r63S191GRfYEA0Pqs2eEQsMexcqy/gRHcNrSfLUmufsOpVr1Tnns5VGEVZ7qTV5Y9 1g+fMwM7I9P3xqoDMOodOT5BGTVcLFap8KOli4IDzkaMOHH7Hjr4xZxMaqcxAQ8s9cX0 SXYm6snjWiFFJrZt/nlPYj8CIqCWEeCKR5X0vvpiMd/FiSyWIZf3mEv4vMnUwwGUgWrj N+cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Zk57gVDE; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk5-20020a17090308c500b001a6fe4a8fc3si1887674plb.373.2023.04.20.06.16.03; Thu, 20 Apr 2023 06:16:28 -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=Zk57gVDE; 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 S231657AbjDTNNq (ORCPT + 99 others); Thu, 20 Apr 2023 09:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231529AbjDTNNa (ORCPT ); Thu, 20 Apr 2023 09:13:30 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5966271C; Thu, 20 Apr 2023 06:13:29 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KAp0eZ010289; Thu, 20 Apr 2023 13:13:27 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; s=qcppdkim1; bh=yh5qGmFfyAdxUhginfqSwvpZh7NZc2bU9oaq/HJVFyc=; b=Zk57gVDEj2jF63ugEBLSLwPTHUl/X8wCEjajv9Oq3hJfECTCFOzzcKzjy9p33PxLU8g7 3rWJBJXT0jobYYpzRN8iZld+n5yqniCxeq0uwwVOgcSV/7SkMIi9cMe/FguqW9uQITyD A31lhtmZemJUrunptLjvJ5m4jG6cPNbr6K+Qfcg6nTHQvwDFyF/arCgrLtG+QWoJZYvq SJU4wkgLQPtXiXzw7jkqFii5rdTHcYg5CZ08Bo0iUBjCLJAjnlInD11Bih1x/CUoCJUm MxF0uZ9vvq/96hSgzR4xiQGFiwkkL8q0BEcoTqipbNo6FbcueF9b+MYvcQorV/IuOSLE hg== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q31t1rp9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 13:13:26 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 33KDDNcq012098; Thu, 20 Apr 2023 13:13:23 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3pyn0kkgqf-1; Thu, 20 Apr 2023 13:13:23 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33KDDKvS012063; Thu, 20 Apr 2023 13:13:23 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-vnivarth-hyd.qualcomm.com [10.213.111.166]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 33KDDN7d012089; Thu, 20 Apr 2023 13:13:23 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3994820) id 64F1847A4; Thu, 20 Apr 2023 18:43:22 +0530 (+0530) From: Vijaya Krishna Nivarthi To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, cros-qcom-dts-watchers@chromium.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_msavaliy@quicinc.com, dianders@chromium.org, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com, Vijaya Krishna Nivarthi Subject: [PATCH v4 4/5] arm64: dts: qcom: sdm845: Add stream-id of qspi to iommus Date: Thu, 20 Apr 2023 18:43:13 +0530 Message-Id: <1681996394-13099-5-git-send-email-quic_vnivarth@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> References: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: GGLKq-gPSFtl1xXwX-tmfstCR_dxCTLS X-Proofpoint-GUID: GGLKq-gPSFtl1xXwX-tmfstCR_dxCTLS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-20_09,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 mlxlogscore=576 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304200107 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763701255008833473?= X-GMAIL-MSGID: =?utf-8?q?1763701255008833473?= As part of DMA mode support to qspi driver. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index 9042444..cde3019 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -3890,6 +3890,7 @@ qspi: spi@88df000 { compatible = "qcom,sdm845-qspi", "qcom,qspi-v1"; reg = <0 0x088df000 0 0x600>; + iommus = <&apps_smmu 0x160 0x0>; #address-cells = <1>; #size-cells = <0>; interrupts = ; From patchwork Thu Apr 20 13:13:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijaya Krishna Nivarthi X-Patchwork-Id: 85905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp327541vqo; Thu, 20 Apr 2023 06:16:28 -0700 (PDT) X-Google-Smtp-Source: AKy350ZXGFyZIuXb7Pi+7BVDS3gOrNQrEBi4awkwEQn6QXihzciNcj1XaxryT1K7R1DSyik+tusZ X-Received: by 2002:a17:90a:5a08:b0:246:c5d8:c070 with SMTP id b8-20020a17090a5a0800b00246c5d8c070mr1504162pjd.23.1681996588244; Thu, 20 Apr 2023 06:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681996588; cv=none; d=google.com; s=arc-20160816; b=R/8BBAt9AIq2ga2iZFRjWZulKsEqnzLm7w737gGdmnO99nMf17LSj1eQOws+uQety5 llXH1Af9X5rdO43DiEtID/GMpvcN5OfJJw2SrOPHQg8gKaCLPDIjpOGkVqOMRKNwV0xP DUYGfmfu5IUoruzUWKZX54kAv8JcaEhb9G1Kwm0vIIXGJQ3thrVk3t0pVHyfi0Y4/wKt yJc8w/O2+3AyrshNn6SkBfNShPTki2xTJaD3nhxAdmAdBmuyNY2BUQiSVQWxAnvx6Wal ottj9JITxn5iGQoHTEAr5o9eON18/ipTSkFhy09WVUyuf/ZOEtdAGVJipwKbre0E/yGD U//Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=LSVFkzHp53JdjdIRtR4Ld29cKRUHA+kvEcJ/DxAiCIY=; b=hs84EHQ99qNvTfB471cA04jFVst+OCi7vPKCHfeKHWduoXze5Sebyj52V0H46DY4CW uXMw5EfBndCDbBY6/X/dzPtNPkY5K2TWvggWHJrS3qM0TvID85TBRtUzl2z7NI8Dp6h5 jA2v0Jl+d+mXun3P5clbUHKjq9DyFPR1brH9ZtF8rLGY7CW1OAdPAkrsrMKNjJ6F8S85 QV6nBKB/w1lHzeAxz7AFkdCMfRo7N+mlVvQbM7TlSIDN2EepE1BR2SSV7AlzMO9SqH/e 0JuOYn618LU5ggD2J3SZ93v8X9meeuNFO/x8nN0gfuD+21npAAutAPI9z/Bv05l5KvTm gKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DnBNtlpT; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a17090a6a8600b002478b610a39si4592083pjj.75.2023.04.20.06.16.04; Thu, 20 Apr 2023 06:16:28 -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=DnBNtlpT; 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 S231668AbjDTNNv (ORCPT + 99 others); Thu, 20 Apr 2023 09:13:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231607AbjDTNNf (ORCPT ); Thu, 20 Apr 2023 09:13:35 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F40522117; Thu, 20 Apr 2023 06:13:32 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KCqJrX032492; Thu, 20 Apr 2023 13:13:29 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; s=qcppdkim1; bh=LSVFkzHp53JdjdIRtR4Ld29cKRUHA+kvEcJ/DxAiCIY=; b=DnBNtlpTK1bVu5fUpK6TjaBdYK5SLtlL/b6xI9uXMxYkHeGZmiSRDjQKhxqJ9mnbM8Gt VuO53AyikKdLbqXo4VtCs5ovzjhjua7z+H4cTpNvTfXjpAT7KfcOGlQMzEq1QV6Gzw+E j0DqRQe4Fa9EzvCXnd32O0EQuMwAkUcz9ygrorxxsTJqL4O9wItxMCoaztdiX8pjtn6E HMgmklwMWIQJGnPnMKcea5VHGn9awW+0zDCphx7rB9HISHGbGyvfbRKnWVwTGd82cP7E tW7BWZ1xuxv5azZ8modrZaRDw8p0JQOEMBuvyoOpyBuGMPOlvKI14EWiKE+RMhaeE+F2 VA== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q32cnrh4h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 13:13:28 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 33KDDOdq012146; Thu, 20 Apr 2023 13:13:24 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3pyn0kkgqm-1; Thu, 20 Apr 2023 13:13:24 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33KDDOoQ012106; Thu, 20 Apr 2023 13:13:24 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-vnivarth-hyd.qualcomm.com [10.213.111.166]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 33KDDODB012105; Thu, 20 Apr 2023 13:13:24 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3994820) id 78F9647A4; Thu, 20 Apr 2023 18:43:23 +0530 (+0530) From: Vijaya Krishna Nivarthi To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, cros-qcom-dts-watchers@chromium.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_msavaliy@quicinc.com, dianders@chromium.org, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com, Vijaya Krishna Nivarthi Subject: [PATCH v4 5/5] spi: spi-qcom-qspi: Add DMA mode support Date: Thu, 20 Apr 2023 18:43:14 +0530 Message-Id: <1681996394-13099-6-git-send-email-quic_vnivarth@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> References: <1681996394-13099-1-git-send-email-quic_vnivarth@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: m5tjl_7uMSO7-qNJMovX9JEUJZn7HSJA X-Proofpoint-ORIG-GUID: m5tjl_7uMSO7-qNJMovX9JEUJZn7HSJA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-20_09,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 clxscore=1015 malwarescore=0 suspectscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304200107 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763701254538074176?= X-GMAIL-MSGID: =?utf-8?q?1763701254538074176?= Current driver supports only PIO mode. HW supports DMA, so add DMA mode support to the driver for better performance for larger xfers. Signed-off-by: Vijaya Krishna Nivarthi --- v3 -> v4: - corrected tabs spacing - dropped dma data descriptors - dropped INVALID from xfer_mode enum - qspi_buswidth_to_iomode() to return iomode without shifting - dropped non-functional change in qcom_qspi_set_speed() - drop redundant call to wmb() - fallback to pio if dma fails to setup - use dmam_pool_create() the devm version - thus drop dma_pool_destroy() - set dma_alignment field in probe() - other minor changes v2 -> v3: - dropped Reported-by tag v1 -> v2: - modified commit message - addressed kernel test robot error - correct placement of header file includes - added more comments - coding style related changes - renamed variables - used u32/u8 instead of uint32_t/8_t - removed unnecessary casting - retain same MSTR_CONFIG as PIO for DMA - unset fragment bit only for last cmd_desc of last xfer --- drivers/spi/spi-qcom-qspi.c | 292 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 265 insertions(+), 27 deletions(-) diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index fab1553..879c293 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -2,6 +2,8 @@ // Copyright (c) 2017-2018, The Linux foundation. All rights reserved. #include +#include +#include #include #include #include @@ -62,6 +64,7 @@ #define WR_FIFO_FULL BIT(10) #define WR_FIFO_OVERRUN BIT(11) #define TRANSACTION_DONE BIT(16) +#define DMA_CHAIN_DONE BIT(31) #define QSPI_ERR_IRQS (RESP_FIFO_UNDERRUN | HRESP_FROM_NOC_ERR | \ WR_FIFO_OVERRUN) #define QSPI_ALL_IRQS (QSPI_ERR_IRQS | RESP_FIFO_RDY | \ @@ -108,6 +111,10 @@ #define RD_FIFO_RESET 0x0030 #define RESET_FIFO BIT(0) +#define NEXT_DMA_DESC_ADDR 0x0040 +#define CURRENT_DMA_DESC_ADDR 0x0044 +#define CURRENT_MEM_ADDR 0x0048 + #define CUR_MEM_ADDR 0x0048 #define HW_VERSION 0x004c #define RD_FIFO 0x0050 @@ -120,6 +127,17 @@ enum qspi_dir { QSPI_WRITE, }; +struct qspi_cmd_desc { + u32 data_address; + u32 next_descriptor; + u32 direction:1; + u32 multi_io_mode:3; + u32 reserved1:4; + u32 fragment:1; + u32 reserved2:7; + u32 length:16; +}; + struct qspi_xfer { union { const void *tx_buf; @@ -137,11 +155,29 @@ enum qspi_clocks { QSPI_NUM_CLKS }; +enum qspi_xfer_mode { + QSPI_FIFO, + QSPI_DMA +}; + +/* + * Number of entries in sgt returned from spi framework that- + * will be supported. Can be modified as required. + * In practice, given max_dma_len is 64KB, the number of + * entries is not expected to exceed 1. + */ +#define QSPI_MAX_SG 5 + struct qcom_qspi { void __iomem *base; struct device *dev; struct clk_bulk_data *clks; struct qspi_xfer xfer; + struct dma_pool *dma_cmd_pool; + dma_addr_t dma_cmd_desc[QSPI_MAX_SG]; + void *virt_cmd_desc[QSPI_MAX_SG]; + unsigned int n_cmd_desc; + enum qspi_xfer_mode xfer_mode; struct icc_path *icc_path_cpu_to_qspi; unsigned long last_speed; /* Lock to protect data accessed by IRQs */ @@ -153,21 +189,22 @@ static u32 qspi_buswidth_to_iomode(struct qcom_qspi *ctrl, { switch (buswidth) { case 1: - return SDR_1BIT << MULTI_IO_MODE_SHFT; + return SDR_1BIT; case 2: - return SDR_2BIT << MULTI_IO_MODE_SHFT; + return SDR_2BIT; case 4: - return SDR_4BIT << MULTI_IO_MODE_SHFT; + return SDR_4BIT; default: dev_warn_once(ctrl->dev, "Unexpected bus width: %u\n", buswidth); - return SDR_1BIT << MULTI_IO_MODE_SHFT; + return SDR_1BIT; } } static void qcom_qspi_pio_xfer_cfg(struct qcom_qspi *ctrl) { u32 pio_xfer_cfg; + u32 iomode; const struct qspi_xfer *xfer; xfer = &ctrl->xfer; @@ -179,7 +216,8 @@ static void qcom_qspi_pio_xfer_cfg(struct qcom_qspi *ctrl) else pio_xfer_cfg |= TRANSFER_FRAGMENT; pio_xfer_cfg &= ~MULTI_IO_MODE_MSK; - pio_xfer_cfg |= qspi_buswidth_to_iomode(ctrl, xfer->buswidth); + iomode = qspi_buswidth_to_iomode(ctrl, xfer->buswidth); + pio_xfer_cfg |= iomode << MULTI_IO_MODE_SHFT; writel(pio_xfer_cfg, ctrl->base + PIO_XFER_CFG); } @@ -223,6 +261,16 @@ static void qcom_qspi_handle_err(struct spi_master *master, spin_lock_irqsave(&ctrl->lock, flags); writel(0, ctrl->base + MSTR_INT_EN); ctrl->xfer.rem_bytes = 0; + + if (ctrl->xfer_mode == QSPI_DMA) { + int i; + + /* free cmd descriptors */ + for (i = 0; i < ctrl->n_cmd_desc; i++) + dma_pool_free(ctrl->dma_cmd_pool, ctrl->virt_cmd_desc[i], + ctrl->dma_cmd_desc[i]); + ctrl->n_cmd_desc = 0; + } spin_unlock_irqrestore(&ctrl->lock, flags); } @@ -242,7 +290,7 @@ static int qcom_qspi_set_speed(struct qcom_qspi *ctrl, unsigned long speed_hz) } /* - * Set BW quota for CPU as driver supports FIFO mode only. + * Set BW quota for CPU. * We don't have explicit peak requirement so keep it equal to avg_bw. */ avg_bw_cpu = Bps_to_icc(speed_hz); @@ -258,6 +306,120 @@ static int qcom_qspi_set_speed(struct qcom_qspi *ctrl, unsigned long speed_hz) return 0; } +#define QSPI_ALIGN_REQ 32 + +static int qcom_qspi_alloc_desc(struct qcom_qspi *ctrl, dma_addr_t dma_ptr, + uint32_t n_bytes) +{ + struct qspi_cmd_desc *virt_cmd_desc, *prev; + dma_addr_t dma_cmd_desc; + + /* allocate for dma cmd descriptor */ + virt_cmd_desc = (struct qspi_cmd_desc *)dma_pool_alloc(ctrl->dma_cmd_pool, + GFP_KERNEL, &dma_cmd_desc); + if (!virt_cmd_desc) { + dev_err(ctrl->dev, + "Could not allocate for cmd_desc\n"); + return -ENOMEM; + } + ctrl->virt_cmd_desc[ctrl->n_cmd_desc] = virt_cmd_desc; + ctrl->dma_cmd_desc[ctrl->n_cmd_desc] = dma_cmd_desc; + ctrl->n_cmd_desc++; + + /* setup cmd descriptor */ + virt_cmd_desc->data_address = dma_ptr; + virt_cmd_desc->next_descriptor = 0; + virt_cmd_desc->direction = ctrl->xfer.dir; + virt_cmd_desc->multi_io_mode = qspi_buswidth_to_iomode(ctrl, ctrl->xfer.buswidth); + virt_cmd_desc->reserved1 = 0; + virt_cmd_desc->fragment = ctrl->xfer.is_last ? 0 : 1; + virt_cmd_desc->reserved2 = 0; + virt_cmd_desc->length = n_bytes; + + /* update previous descriptor */ + if (ctrl->n_cmd_desc >= 2) { + prev = (ctrl->virt_cmd_desc)[ctrl->n_cmd_desc - 2]; + prev->next_descriptor = dma_cmd_desc; + prev->fragment = 1; + } + + return 0; +} + +static int qcom_qspi_setup_dma_desc(struct qcom_qspi *ctrl, + struct spi_transfer *xfer) +{ + int ret; + struct sg_table *sgt; + unsigned int sg_total_len = 0; + dma_addr_t dma_ptr_sg; + unsigned int dma_len_sg; + int i; + + if (ctrl->n_cmd_desc) { + dev_err(ctrl->dev, "Remnant dma buffers n_cmd_desc-%d\n", ctrl->n_cmd_desc); + return -EIO; + } + + sgt = (ctrl->xfer.dir == QSPI_READ) ? &xfer->rx_sg : &xfer->tx_sg; + if (!sgt->nents || sgt->nents > QSPI_MAX_SG) { + dev_err(ctrl->dev, "Cannot handle %d entries in scatter list\n", sgt->nents); + return -EAGAIN; + } + + for (i = 0; i < sgt->nents; i++) { + dma_ptr_sg = sg_dma_address(sgt->sgl + i); + if (!IS_ALIGNED(dma_ptr_sg, QSPI_ALIGN_REQ)) { + dev_err(ctrl->dev, "dma address-%pad not aligned to %d\n", + &dma_ptr_sg, QSPI_ALIGN_REQ); + return -EAGAIN; + } + sg_total_len += sg_dma_len(sgt->sgl + i); + } + + if (sg_total_len != xfer->len) { + dev_err(ctrl->dev, "Data lengths mismatch\n"); + return -EAGAIN; + } + + for (i = 0; i < sgt->nents; i++) { + dma_ptr_sg = sg_dma_address(sgt->sgl + i); + dma_len_sg = sg_dma_len(sgt->sgl + i); + + ret = qcom_qspi_alloc_desc(ctrl, dma_ptr_sg, dma_len_sg); + if (ret) + goto cleanup; + } + return 0; + +cleanup: + dev_err(ctrl->dev, "ERROR cleanup in setup_dma_desc\n"); + + for (i = 0; i < ctrl->n_cmd_desc; i++) + dma_pool_free(ctrl->dma_cmd_pool, ctrl->virt_cmd_desc[i], + ctrl->dma_cmd_desc[i]); + ctrl->n_cmd_desc = 0; + return ret; +} + +static void qcom_qspi_dma_xfer(struct qcom_qspi *ctrl) +{ + /* Setup new interrupts */ + writel(DMA_CHAIN_DONE, ctrl->base + MSTR_INT_EN); + + /* kick off transfer */ + writel((u32)((ctrl->dma_cmd_desc)[0]), ctrl->base + NEXT_DMA_DESC_ADDR); +} + +/* Switch to DMA if transfer length exceeds this */ +#define QSPI_MAX_BYTES_FIFO 64 + +static bool qcom_qspi_can_dma(struct spi_controller *ctlr, + struct spi_device *slv, struct spi_transfer *xfer) +{ + return xfer->len > QSPI_MAX_BYTES_FIFO; +} + static int qcom_qspi_transfer_one(struct spi_master *master, struct spi_device *slv, struct spi_transfer *xfer) @@ -266,6 +428,7 @@ static int qcom_qspi_transfer_one(struct spi_master *master, int ret; unsigned long speed_hz; unsigned long flags; + u32 mstr_cfg; speed_hz = slv->max_speed_hz; if (xfer->speed_hz) @@ -276,6 +439,7 @@ static int qcom_qspi_transfer_one(struct spi_master *master, return ret; spin_lock_irqsave(&ctrl->lock, flags); + mstr_cfg = readl(ctrl->base + MSTR_CONFIG); /* We are half duplex, so either rx or tx will be set */ if (xfer->rx_buf) { @@ -290,8 +454,37 @@ static int qcom_qspi_transfer_one(struct spi_master *master, ctrl->xfer.is_last = list_is_last(&xfer->transfer_list, &master->cur_msg->transfers); ctrl->xfer.rem_bytes = xfer->len; + + if (xfer->rx_sg.nents || xfer->tx_sg.nents) { + /* do DMA transfer */ + ctrl->xfer_mode = QSPI_DMA; + if (!(mstr_cfg & DMA_ENABLE)) { + mstr_cfg |= DMA_ENABLE; + writel(mstr_cfg, ctrl->base + MSTR_CONFIG); + } + + ret = qcom_qspi_setup_dma_desc(ctrl, xfer); + if (ret) { + if (ret == -EAGAIN) { + dev_err_once(ctrl->dev, "DMA failure, falling back to PIO"); + goto do_pio; + } + spin_unlock_irqrestore(&ctrl->lock, flags); + return ret; + } + qcom_qspi_dma_xfer(ctrl); + goto end; + } + +do_pio: + ctrl->xfer_mode = QSPI_FIFO; + if (mstr_cfg & DMA_ENABLE) { + mstr_cfg &= ~DMA_ENABLE; + writel(mstr_cfg, ctrl->base + MSTR_CONFIG); + } qcom_qspi_pio_xfer(ctrl); +end: spin_unlock_irqrestore(&ctrl->lock, flags); /* We'll call spi_finalize_current_transfer() when done */ @@ -328,6 +521,17 @@ static int qcom_qspi_prepare_message(struct spi_master *master, return 0; } +static int qcom_qspi_alloc_dma(struct qcom_qspi *ctrl) +{ + /* allocate for cmd descriptors pool */ + ctrl->dma_cmd_pool = dmam_pool_create("qspi cmd desc pool", + ctrl->dev, sizeof(struct qspi_cmd_desc), 0, 0); + if (!ctrl->dma_cmd_pool) + return -ENOMEM; + + return 0; +} + static irqreturn_t pio_read(struct qcom_qspi *ctrl) { u32 rd_fifo_status; @@ -426,27 +630,48 @@ static irqreturn_t qcom_qspi_irq(int irq, void *dev_id) int_status = readl(ctrl->base + MSTR_INT_STATUS); writel(int_status, ctrl->base + MSTR_INT_STATUS); - if (ctrl->xfer.dir == QSPI_WRITE) { - if (int_status & WR_FIFO_EMPTY) - ret = pio_write(ctrl); - } else { - if (int_status & RESP_FIFO_RDY) - ret = pio_read(ctrl); - } - - if (int_status & QSPI_ERR_IRQS) { - if (int_status & RESP_FIFO_UNDERRUN) - dev_err(ctrl->dev, "IRQ error: FIFO underrun\n"); - if (int_status & WR_FIFO_OVERRUN) - dev_err(ctrl->dev, "IRQ error: FIFO overrun\n"); - if (int_status & HRESP_FROM_NOC_ERR) - dev_err(ctrl->dev, "IRQ error: NOC response error\n"); - ret = IRQ_HANDLED; - } - - if (!ctrl->xfer.rem_bytes) { - writel(0, ctrl->base + MSTR_INT_EN); - spi_finalize_current_transfer(dev_get_drvdata(ctrl->dev)); + switch (ctrl->xfer_mode) { + case QSPI_FIFO: + if (ctrl->xfer.dir == QSPI_WRITE) { + if (int_status & WR_FIFO_EMPTY) + ret = pio_write(ctrl); + } else { + if (int_status & RESP_FIFO_RDY) + ret = pio_read(ctrl); + } + + if (int_status & QSPI_ERR_IRQS) { + if (int_status & RESP_FIFO_UNDERRUN) + dev_err(ctrl->dev, "IRQ error: FIFO underrun\n"); + if (int_status & WR_FIFO_OVERRUN) + dev_err(ctrl->dev, "IRQ error: FIFO overrun\n"); + if (int_status & HRESP_FROM_NOC_ERR) + dev_err(ctrl->dev, "IRQ error: NOC response error\n"); + ret = IRQ_HANDLED; + } + + if (!ctrl->xfer.rem_bytes) { + writel(0, ctrl->base + MSTR_INT_EN); + spi_finalize_current_transfer(dev_get_drvdata(ctrl->dev)); + } + break; + case QSPI_DMA: + if (int_status & DMA_CHAIN_DONE) { + int i; + + writel(0, ctrl->base + MSTR_INT_EN); + + for (i = 0; i < ctrl->n_cmd_desc; i++) + dma_pool_free(ctrl->dma_cmd_pool, ctrl->virt_cmd_desc[i], + ctrl->dma_cmd_desc[i]); + ctrl->n_cmd_desc = 0; + + ret = IRQ_HANDLED; + spi_finalize_current_transfer(dev_get_drvdata(ctrl->dev)); + } + break; + default: + dev_err(ctrl->dev, "Unknown xfer mode:%d", ctrl->xfer_mode); } spin_unlock(&ctrl->lock); @@ -517,7 +742,14 @@ static int qcom_qspi_probe(struct platform_device *pdev) return ret; } + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); + if (ret) + return dev_err_probe(dev, ret, "could not set DMA mask\n"); + master->max_speed_hz = 300000000; + master->max_dma_len = 65536; /* as per HPG */ + /* intimate protocal drivers about alignment requirement */ + master->dma_alignment = QSPI_ALIGN_REQ; master->num_chipselect = QSPI_NUM_CS; master->bus_num = -1; master->dev.of_node = pdev->dev.of_node; @@ -528,6 +760,7 @@ static int qcom_qspi_probe(struct platform_device *pdev) master->prepare_message = qcom_qspi_prepare_message; master->transfer_one = qcom_qspi_transfer_one; master->handle_err = qcom_qspi_handle_err; + master->can_dma = qcom_qspi_can_dma; master->auto_runtime_pm = true; ret = devm_pm_opp_set_clkname(&pdev->dev, "core"); @@ -540,6 +773,11 @@ static int qcom_qspi_probe(struct platform_device *pdev) return ret; } + /* allocate for DMA descriptor pools */ + ret = qcom_qspi_alloc_dma(ctrl); + if (ret) + return ret; + pm_runtime_use_autosuspend(dev); pm_runtime_set_autosuspend_delay(dev, 250); pm_runtime_enable(dev);