From patchwork Sat Nov 11 02:33:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mrinmay Sarkar X-Patchwork-Id: 164057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp7893vqg; Fri, 10 Nov 2023 18:33:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmvdEIsgnXnS0Wp4yyHEZKQIUR/xgQBZxNLzKHiEIMBAlSJdWu8bd/pYibUEtt6/op2Mpi X-Received: by 2002:a05:6808:3c9a:b0:3b6:a812:4fb4 with SMTP id gs26-20020a0568083c9a00b003b6a8124fb4mr1379533oib.11.1699670033690; Fri, 10 Nov 2023 18:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699670033; cv=none; d=google.com; s=arc-20160816; b=xdK3XLa4cb13Osn6aVq8U5OriPnMvmpsF4IUXUN+KIY5ADfsDwmnfU4gNwfYQ2nZmJ E9TomAYt8Wy6SxHg4ns+ole5caUTB1h+3JsjbKOp3I4+++sinmh/bnQXxJA/GePVzdNI +NbsHGC4XqQV/elTStZZzWwwKg0QGe95+Yo11CHP6zurQ/XvxjxaCAxr26FfhW39ZeXM zLviyEGM2KW/YVPrYSRVrPQyN1HVVnE6m7KBZdxMJEZpPvJsW32DFGC+vJG11vJfByx8 6yVJ32rxWp9qolJO9a8lUD58tMBlH4K0EwkaJykvORaPWQFO/T1icluymbcViHPsraUD wwog== 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=L+fF3hgqLHb46EI5QVUjzTAW9m4R+rMW+jHzIcGlZaA=; fh=+viStRW9RfADMxlke3U5kSnZUvtp2pM32acnEU+HesA=; b=ZvXyZHzSrTuJUzTdS9zAEMg6rmaxGCXmOADBsI+Wtan8cy9zNmrU2tr49VM+0Jtfzr ZghpPLTe6SWQS2oUW12JOrGbGQJ1LhY7LLVRfGsW32ZhmwagW0XrzJZ3Ae3ZVguyOXe6 P0lJBFLTHgiLCggkKK4j3+ZJZXcCGG90gDTncZH9WHWG0Dqd7sY2cvJ7QnC1FWD4HrMg n8b2t/OZQooPRq5jgCBi3/6wYLcmT2TWUcA6ywJhJapGYDMot6FIALOlXbjDpCwGSJjG a9CyScFYJGfkl79Jyn5URDoCoK6kIabT2JQHXP63iyWTunxJR5p8AKZLsc3bs9jTvINT ltSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=juFyTZTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id d1-20020a056a0010c100b006bec127d3e5si854473pfu.316.2023.11.10.18.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 18:33:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=juFyTZTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 4C8B5803A5A3; Fri, 10 Nov 2023 18:33:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345560AbjKKCdj (ORCPT + 29 others); Fri, 10 Nov 2023 21:33:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345504AbjKKCdb (ORCPT ); Fri, 10 Nov 2023 21:33:31 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC0EC3C0E; Fri, 10 Nov 2023 18:33:27 -0800 (PST) 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 3AB0xMsI030118; Sat, 11 Nov 2023 02:33:17 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=L+fF3hgqLHb46EI5QVUjzTAW9m4R+rMW+jHzIcGlZaA=; b=juFyTZTxDuAHzhM0B5SnF8zx0ii/xfFSR7wuNq+ABaKscdkdyCj4CehQEikkqQmZezMG L675tZ8x14gv1YpRVb/wIgvk3nnw6QS9veYiyCzZpg7OJEIzYl8KhoHXJxsm/cdj0v2r yqhiMzKxZVGC4sEUwT8EoadLZL6Y0WrquvmM7k6Z7MG0vatAMFWffFNOlcxb8uZTi6V0 Cav/LO2SH1GQ0TO4nrV3rKxgd19AicKD84t6C22MbG1uAiGAaDev5O9Nx+h/2zMnPNjp 6EB64j/4oRPhwp6PwJeq8NsTpSE7xEl8xIF8eD5Iv/tWoXaBqVfXSxJ+D4/oFXe3jEaY uA== 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 3u9f3k2j7d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 11 Nov 2023 02:33:16 +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 3AB2XDow021758; Sat, 11 Nov 2023 02:33:13 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3u5f1mjp4v-1; Sat, 11 Nov 2023 02:33:13 +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 3AB2XDkc021753; Sat, 11 Nov 2023 02:33:13 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 3AB2XC9I021752; Sat, 11 Nov 2023 02:33:13 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 3891782) id C92FE2C83; Sat, 11 Nov 2023 08:03:11 +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, robh+dt@kernel.org Cc: quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, dmitry.baryshkov@linaro.org, robh@kernel.org, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_parass@quicinc.com, quic_schintav@quicinc.com, quic_shijjose@quicinc.com, Mrinmay Sarkar , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Kishon Vijay Abraham I , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev Subject: [PATCH v8 4/5] PCI: epf-mhi: Add support for SA8775P Date: Sat, 11 Nov 2023 08:03:00 +0530 Message-Id: <1699669982-7691-5-git-send-email-quic_msarkar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1699669982-7691-1-git-send-email-quic_msarkar@quicinc.com> References: <1699669982-7691-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-ORIG-GUID: U5UF0bXalUmuTOsUNS_Jz8Czp0BmgJf0 X-Proofpoint-GUID: U5UF0bXalUmuTOsUNS_Jz8Czp0BmgJf0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_21,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 impostorscore=0 adultscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 phishscore=0 clxscore=1015 mlxlogscore=747 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311110018 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, URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 10 Nov 2023 18:33:44 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782233205157887370 X-GMAIL-MSGID: 1782233205157887370 Add support for Qualcomm Snapdragon SA8775P SoC to the EPF driver. SA8775P is currently reusing the PID 0x0306 (the default one hardcoded in the config space header) as the unique PID is not yet allocated. But the host side stack works fine with the default PID. It will get updated once the PID is finalized. Currently, it has no fixed PCI class, so it is being advertised as "PCI_CLASS_OTHERS". Signed-off-by: Mrinmay Sarkar Reviewed-by: Manivannan Sadhasivam --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 5b0515a..68801c2 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -114,6 +114,22 @@ 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, /* FIXME: Update deviceid for sa8775p EP */ + .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, +}; + struct pci_epf_mhi { const struct pci_epc_features *epc_features; const struct pci_epf_mhi_ep_info *info; @@ -677,6 +693,7 @@ static int pci_epf_mhi_probe(struct pci_epf *epf, } static const struct pci_epf_device_id pci_epf_mhi_ids[] = { + { .name = "pci_epf_mhi_sa8775p", .driver_data = (kernel_ulong_t)&sa8775p_info }, { .name = "pci_epf_mhi_sdx55", .driver_data = (kernel_ulong_t)&sdx55_info }, { .name = "pci_epf_mhi_sm8450", .driver_data = (kernel_ulong_t)&sm8450_info }, {},