Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1911818rdb; Tue, 3 Oct 2023 05:11:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGq3F/tJZe90XmVyWslLuzpqeEwXnBUF9tRBcVKh5QPSisoKx+gbKQRcCUWB5ZwOnNfknm7 X-Received: by 2002:a05:6a00:178f:b0:68e:2eed:5ab0 with SMTP id s15-20020a056a00178f00b0068e2eed5ab0mr15875958pfg.7.1696335074475; Tue, 03 Oct 2023 05:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696335074; cv=none; d=google.com; s=arc-20160816; b=OIRaIsXaT3pxpuPHax3cXR3MXgXGOtzpjPHkj87fJEN43k5z9OB4auHS7lsLUfpd1q 9eTEODH3+kzp1/hMf+qw+X5vbFPAXU+ZonJOrx8lFM9BFPedFS0Cohg0z8lcnl+hn+Gs qvvlGMGm0VbuUe2ZC8XmK+73w8NDW2IEPuDyTHy8PgUCqgNGCr5lrXT53E4AVZvA9vAb AJ4U0pFOwvZm0py7cqBit8+MHILx2wty8EN801pCTHskHT8GGmbh3O3aYZ2xRDD2Nuu7 nlu4nDfrkr7n8qqNJ27Zkc6Da8D/sptFXR4B/x2j77VYCrnsPR9JO2ZKgUGT0beE/Bv4 5dkA== 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=kcK9fwNnCVhn1NcsB6NCBvKc+/efmmK7YFzYf4XEEf4=; fh=sCSg7c5oZzOKvkAE/k1CXGnleTs7TTFIkJvjcEIAWms=; b=KCms0dWwSa7lQ7IqzQ3X3kgxCfEIhLiCJuQn1D2G4UUSjlzRnnAuldIqQLwLI4XeBW WYsxN9jUBxiItb2Gt8HfAHBDPj2v/V53dSFcAPWqm5w/AddaAeqmdXdx1ULgor4zCenx NZpEK+mwneU/WR5bFoeVpZb51ZWt/RfcNjrFmYh2pDshbxy8JGh5I7kBRebh7mqSoixd V53mzcDg/mM6ZmV4P3oeivKB8PR/iyUsPnjnEvcJyrzTR2Ur7dJaAfJ122SDSn/r0qsb 0LkIhsJZ/75zfHkOSrvbcP7N8TDRuqjf6lUNTJ4Z2cQ0exlCg3f5gH9geSnL7/Y8GMUA tzYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MVSckyyp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id k10-20020aa788ca000000b00690f886b1bcsi1391044pff.392.2023.10.03.05.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 05:11:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MVSckyyp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id D6DDC807C5E2; Tue, 3 Oct 2023 05:10:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbjJCMKF (ORCPT + 99 others); Tue, 3 Oct 2023 08:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232449AbjJCMKD (ORCPT ); Tue, 3 Oct 2023 08:10:03 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99966DA; Tue, 3 Oct 2023 05:09:56 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 393BAF1d003104; Tue, 3 Oct 2023 12:09:45 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=kcK9fwNnCVhn1NcsB6NCBvKc+/efmmK7YFzYf4XEEf4=; b=MVSckyypMcAxYTe9vX6X4rXDzx75qrN6K2mWvi3fED5h1kdt1S2hOO6AeQRGgbFWHV9r Zn5f7FNpiaYB5UGkvtSm1ROQ8RvhvRKBmEi9NAoueiNu/uxxGqTMhqZdZujttW83iO2p X2Tryww7FRadATSZmegq/9j9kgHF6at8uBcZgBole5Ndx9wkaW/kWRs/sTJhXywipwXK Xtg2VoNIWTdN4cEe9qTGQkPhipgS3dl53w3zu7+S/X9jyrThSN8i0T/XlCUPHyFJ1gjk qVGoHmpXKysyqLiTMfCFvbqfHek7lDtnVQ5C/miNkkCpKZ7Q/61Kzl4V8bz50tb74cxT DQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tghsjr4e8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Oct 2023 12:09:44 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 393C9hTR017407 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Oct 2023 12:09:43 GMT Received: from nsekar-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 3 Oct 2023 05:09:35 -0700 From: Nitheesh Sekar To: , , , , , , , , , , , , , , , , , , , , , CC: Anusha Rao , Devi Priya Subject: [PATCH 4/6] PCI: qcom: Add support for IPQ5018 Date: Tue, 3 Oct 2023 17:38:44 +0530 Message-ID: <20231003120846.28626-5-quic_nsekar@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231003120846.28626-1-quic_nsekar@quicinc.com> References: <20231003120846.28626-1-quic_nsekar@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 nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Kt-S5F3Gf0td6HRNtu1AImlZtU7ElVS7 X-Proofpoint-ORIG-GUID: Kt-S5F3Gf0td6HRNtu1AImlZtU7ElVS7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-03_08,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310030087 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 05:10:18 -0700 (PDT) Added a new compatible 'qcom,pcie-ipq5018' and modified get_resources of 'ops 2_9_0' to get the clocks from the device-tree. Co-developed-by: Anusha Rao Signed-off-by: Anusha Rao Co-developed-by: Devi Priya Signed-off-by: Devi Priya Signed-off-by: Nitheesh Sekar --- drivers/pci/controller/dwc/pcie-qcom.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index e2f29404c84e..bb0717190920 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -197,10 +197,10 @@ struct qcom_pcie_resources_2_7_0 { struct reset_control *rst; }; -#define QCOM_PCIE_2_9_0_MAX_CLOCKS 5 struct qcom_pcie_resources_2_9_0 { - struct clk_bulk_data clks[QCOM_PCIE_2_9_0_MAX_CLOCKS]; + struct clk_bulk_data *clks; struct reset_control *rst; + int num_clks; }; union qcom_pcie_resources { @@ -1048,17 +1048,10 @@ static int qcom_pcie_get_resources_2_9_0(struct qcom_pcie *pcie) struct qcom_pcie_resources_2_9_0 *res = &pcie->res.v2_9_0; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; - int ret; - res->clks[0].id = "iface"; - res->clks[1].id = "axi_m"; - res->clks[2].id = "axi_s"; - res->clks[3].id = "axi_bridge"; - res->clks[4].id = "rchng"; - - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); - if (ret < 0) - return ret; + res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); + if (res->num_clks < 0) + return res->num_clks; res->rst = devm_reset_control_array_get_exclusive(dev); if (IS_ERR(res->rst)) @@ -1071,7 +1064,7 @@ static void qcom_pcie_deinit_2_9_0(struct qcom_pcie *pcie) { struct qcom_pcie_resources_2_9_0 *res = &pcie->res.v2_9_0; - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(res->num_clks, res->clks); } static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) @@ -1100,7 +1093,7 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) usleep_range(2000, 2500); - return clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); + return clk_bulk_prepare_enable(res->num_clks, res->clks); } static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) @@ -1605,6 +1598,7 @@ static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-apq8064", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-apq8084", .data = &cfg_1_0_0 }, { .compatible = "qcom,pcie-ipq4019", .data = &cfg_2_4_0 }, + { .compatible = "qcom,pcie-ipq5018", .data = &cfg_2_9_0 }, { .compatible = "qcom,pcie-ipq6018", .data = &cfg_2_9_0 }, { .compatible = "qcom,pcie-ipq8064", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, -- 2.17.1