From patchwork Wed Sep 20 13:55:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mrinmay Sarkar X-Patchwork-Id: 142509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4262078vqi; Wed, 20 Sep 2023 09:24:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRNzgiSu3TcOSmvbIGa0QSKTPqqTvMHFHc95cJCmZBpnOvYqNlokdty9wSEzU2CVsQzjV0 X-Received: by 2002:a05:6870:610f:b0:1b7:27cf:9709 with SMTP id s15-20020a056870610f00b001b727cf9709mr3394820oae.43.1695227094660; Wed, 20 Sep 2023 09:24:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695227094; cv=none; d=google.com; s=arc-20160816; b=eAnhbZDIlft8/YFE2FhMsVg+9Z7/W/qQTwxTqWZz9SOh9xI77choTse7RNKMpAVdDj lnBfUNHZKhDpzNuZJB3FKfxI4FBlYf4TaE3pVtW+5bxXcKKXrFbCTSazxOX4rkZsMWNl Z6KeTQHE8QrINpGIMR281WV74oTB19tsfJLKVPjPtSijqXCcOzK3Lhg6eeuBU/8IjRr8 reCTrpfICfWscmz3AeEqy/z1tWIkzaued3SOKv8dELx2mnLwNxSwotk4nUEV2Fuoms+t cTvmJ1iprttDfXCUZnRo3K+accC2Xro7vp/TeVPYU8FTej5kEerBG5bSSfBjruT0k7G9 Y/9A== 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=G1NiSk7dbZydvhDu2qxwMegcpcoHgjUaFjClTxqGWPA=; fh=8/2vfUA7MWOES13nxpYPH5OUCdymynOzflmEVMN0z8c=; b=r2ePSz2BIEbEXlVmBFkJFm1HE8G1Dtfr6cYtGVWAldJzf0A4TR9PWokZDnRbZhTIyK UlQHR/wvqd429AvzKcOfJ0GiqdE2p0rYgNf41uBcGM2j+F2F57TDwDnsUMryoj3hJRvI zRYorPnmTjL4BcHRHnEwNrH6nv5DjeXzYsyE9ZU6CNbLWYKCYcjRBjHeIIx7538DhuK2 V5hiZ559arc5s9DDSOdQZwPNKUXSjktrtIvvgHx1H3V1vt0r/IqnNrmSehWhiFxfa38l mNbzp1/yl2Q4rHEZir2jZwdgXjyzoH0LA5i4bS/DoM/v0I2URLqQD5H395wJS+jaSvwh ZDGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="g/YfGdnt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b25-20020a630c19000000b0055c7eb53d7fsi12159207pgl.584.2023.09.20.09.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 09:24:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="g/YfGdnt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 58001826C0E1; Wed, 20 Sep 2023 06:57:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236650AbjITN5T (ORCPT + 26 others); Wed, 20 Sep 2023 09:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236570AbjITNzz (ORCPT ); Wed, 20 Sep 2023 09:55:55 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E1D4186; Wed, 20 Sep 2023 06:55:49 -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 38KD1Swb026760; Wed, 20 Sep 2023 13:55: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=G1NiSk7dbZydvhDu2qxwMegcpcoHgjUaFjClTxqGWPA=; b=g/YfGdnt1LOl/X64XJbS1yv2VjE5BbLbcWxwydnOBvVknBP7KyQTYkxRzbPPswt5caCa lhou/3sCcUe9aYiRLEO5Dfx8x5LYF6ZE2NKz233Yo7/almaqoFhGHvYxUrEcl01mEvAM GZYYWRUdlysNUtomdAUJs7Ff1f6AvlqnqticZDaWzWb54YAMxqJ+u6a35zFNDxB/fWhQ qCy12iWDirI9/X+POrIOsBPH1x4zoW16RnDAD06r1AtN0gyQm7M43YlSug3XYtwXiSxj eHthM3jOxAZM4ZC/sFDf3/+4gPPt1d+FJyZrQFJzedvTTYavJDUnIKS6tQJMDmh6/71N qg== 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 3t7amnb3cn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Sep 2023 13:55:29 +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 38KDtQL0008251; Wed, 20 Sep 2023 13:55:26 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3t55ekk8pb-1; Wed, 20 Sep 2023 13:55:26 +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 38KDtPqb008245; Wed, 20 Sep 2023 13:55:26 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-msarkar-hyd.qualcomm.com [10.213.111.194]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 38KDtPvi008243; Wed, 20 Sep 2023 13:55:25 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3891782) id 2E3434070; Wed, 20 Sep 2023 19:25:25 +0530 (+0530) From: Mrinmay Sarkar To: agross@kernel.org, andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, konrad.dybcio@linaro.org, mani@kernel.org Cc: quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_parass@quicinc.com, Mrinmay Sarkar , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Kishon Vijay Abraham I , Vinod Koul , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-phy@lists.infradead.org Subject: [PATCH v1 4/5] PCI: epf-mhi: Add support for SA8775P Date: Wed, 20 Sep 2023 19:25:11 +0530 Message-Id: <1695218113-31198-5-git-send-email-quic_msarkar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1695218113-31198-1-git-send-email-quic_msarkar@quicinc.com> References: <1695218113-31198-1-git-send-email-quic_msarkar@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: vq6l8cMg1aEbu5m2I4lr4qRfMvJkv3Gq X-Proofpoint-ORIG-GUID: vq6l8cMg1aEbu5m2I4lr4qRfMvJkv3Gq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-20_05,2023-09-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=697 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309200114 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=no 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 06:57:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777574446324115904 X-GMAIL-MSGID: 1777574446324115904 Add support for Qualcomm Snapdragon SA8775P SoC to the EPF driver. SA8775P has the PID (0x0306) and supports HDMA. Currently, it has no fixed PCI class, so it is being advertised as "PCI_CLASS_OTHERS". Signed-off-by: Mrinmay Sarkar --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index b7b9d3e..4b349fd 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -114,6 +114,23 @@ static const struct pci_epf_mhi_ep_info sm8450_info = { .flags = MHI_EPF_USE_DMA, }; +static struct pci_epf_header sa8775p_header = { + .vendorid = PCI_VENDOR_ID_QCOM, + .deviceid = 0x0306, + .baseclass_code = PCI_CLASS_OTHERS, + .interrupt_pin = PCI_INTERRUPT_INTA, +}; + +static const struct pci_epf_mhi_ep_info sa8775p_info = { + .config = &mhi_v1_config, + .epf_header = &sa8775p_header, + .bar_num = BAR_0, + .epf_flags = PCI_BASE_ADDRESS_MEM_TYPE_32, + .msi_count = 32, + .mru = 0x8000, + .flags = MHI_EPF_USE_DMA, +}; + struct pci_epf_mhi { const struct pci_epc_features *epc_features; const struct pci_epf_mhi_ep_info *info; @@ -677,6 +694,7 @@ static int pci_epf_mhi_probe(struct pci_epf *epf, } static const struct pci_epf_device_id pci_epf_mhi_ids[] = { + { .name = "sa8775p", .driver_data = (kernel_ulong_t)&sa8775p_info }, { .name = "sdx55", .driver_data = (kernel_ulong_t)&sdx55_info }, { .name = "sm8450", .driver_data = (kernel_ulong_t)&sm8450_info }, {},