Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp160924lqp; Sun, 9 Jun 2024 22:46:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVc314oZOlvvJpu42Z7b0Z674JBuWOFq7jZF1btq5/FLGJ+IzOPkI84tHErEpntK+JbZUOJGrCQs0vEr/ofHmCt4qM410nvPOmiy6ihyg== X-Google-Smtp-Source: AGHT+IHlip5L5A/3fAIh8MEG7Ih5MohpHvSBRaaJ7v5G63/WQo1j9q++SE1zorMGunaOt688HqWg X-Received: by 2002:aa7:888e:0:b0:705:9992:d8ad with SMTP id d2e1a72fcca58-7059992e592mr1271462b3a.19.1717998417675; Sun, 09 Jun 2024 22:46:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717998417; cv=pass; d=google.com; s=arc-20160816; b=ZqXspOQjMM/k/aXJjXCH/PPbBbCcFb3ugHTJpI5U9dzeA8L2ArTsDwqdAeM/8MgfRv GWUIzYcxglPh9ycSJ/tNSkop5TbEmqC8fmeNEmfesGuaO/UaibwGkfmy/1cI1DvXpSti IacUq6kkwjYkiFjlNVYFtZ28lC9WRHyw7yguhfm6dwRa+AZkjNVAjk5izrNBIUeQIpkr cOotXx4mRq3zxnFZggnn01L/HL21TMpH79atHCG8mlHTHaoFyXMcoOlH2VPEFgDfg7fH KCE2PoIimH+ET9JhI0FF/UAaReqU5XFsOLuCZhOZIEzsQtFHo/w+MJ1tV32YptLWdA35 1l4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=8+R3FfBVHH53yF1hEFqLmkirCoKue9yVbij80F+66XQ=; fh=67s/DWfzIS/8/OpSnWKHUiOAj4lE6pRVKDEffwAshoo=; b=iz8fjLGdP6uICTOpYzf1WH11mjgaBBfqQBHaWj2b10PpOZGsKYqQPlmviUcyGInaSp KVU7LQljzV9hmK3K1y0mlE8Ykn03Eqii9npJvP3JJmki0xNpB2NtjUL8TJFZfHRYfnDq m/2vFm/5LCdTfz2k7QasHaeIMAjyhNlU/2YM/P4bySmS9dW5shFp2SLlKG/4+i0WIkwG 1uurPCrn86sVOKyHfrj74y/g1aNJVUXLxitQo7UogVZMxDaRCpL04IgWuQBpp6K2BxY6 ediB5iQRAF6wL+3s/UmyKUJqvCII3vkFKuy7EZvRJa/zCEASWjZABAKUVFtr84+n11cI l6UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="jM/6Mk4L"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-207661-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70431a73cdbsi2493400b3a.245.2024.06.09.22.46.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 22:46:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207661-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="jM/6Mk4L"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-207661-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ABE9C281127 for ; Mon, 10 Jun 2024 05:46:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10A8A12E48; Mon, 10 Jun 2024 05:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jM/6Mk4L" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43A6217F6; Mon, 10 Jun 2024 05:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717998407; cv=none; b=lb8R8yC0p599inAaOV3yaKh/E9mo68ogX0aP373C1MnhvoDAWddRYbq/e+WlmlbUmFSgLgWH5U4sVZMHj40/gMv9Ulwx2rk0DlClnvNKIUoVL8aimOc6in1vdtUsTRhzy4ZfHb16oFGfd3rL9tzl/q4cTdUpDu6cBudAzENFrIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717998407; c=relaxed/simple; bh=XbhYBwVPqpt29+w0LmozsqSODlI6R8kdk85kSFDG0ek=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=jyqJMVNZdUdjmecakZwdhZkico1dwTZVVBnBjccSju9WAj9xdiqjz0XlVQwaqqfbQaTmflXbLfxzOBXXSyayrssX70ljqOs29m/BlzZPwAzqsqs0zv5Z5CUt8g7J9IM6g83UP+PaU8EQxvCNzWMTjIhucBvEAqWGeSSOSc9LT34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=jM/6Mk4L; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45A3ObdG002331; Mon, 10 Jun 2024 05:46:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 8+R3FfBVHH53yF1hEFqLmkirCoKue9yVbij80F+66XQ=; b=jM/6Mk4L6Xe53e2n 8MTasK+YKlzCfP/QfkbAciKjBUL+5Jg+4Ru5KjyeD1PjrYrUPJ8C863Ddg6ufD/E gsL+CdSAWM5lC1kHiJNJg4BAKm9Y5KmllN6TeGE6FnrfH7a1qxKBnKv7VEA2foJj SSIhGbyLofSaHT1bkvtuF2UCinl298q7zq0+j53eatqDvrEP/tG8+4nFLRw/Zgih yMpAOlretpcWhquwpkUvaw4ecEXFXM1mUCgHwV8VkW5VBVOMWrreGfVkdgjdbpvD 98wfQlkmKlb5pEfBw4rhG3jNnWyIa4S8v3mKnBBGe5wJwpineSBvhtA2mZ7eMBdl x9P7zQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ymfcv2ncg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jun 2024 05:46:20 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45A5kJQF024800 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jun 2024 05:46:19 GMT Received: from [10.50.54.237] (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.1544.9; Sun, 9 Jun 2024 22:46:05 -0700 Message-ID: Date: Mon, 10 Jun 2024 11:15:55 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V5 6/6] PCI: qcom: Add support for IPQ9574 To: Manivannan Sadhasivam CC: , , , , , , , , , , , , , , , References: <20240512082858.1806694-1-quic_devipriy@quicinc.com> <20240512082858.1806694-7-quic_devipriy@quicinc.com> <20240530144730.GG2770@thinkpad> Content-Language: en-US From: Devi Priya In-Reply-To: <20240530144730.GG2770@thinkpad> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: ZlnDledWP7shLPwQ7xvLG6ZXuzoG-dz1 X-Proofpoint-GUID: ZlnDledWP7shLPwQ7xvLG6ZXuzoG-dz1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-10_02,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 lowpriorityscore=0 clxscore=1011 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406100043 On 5/30/2024 8:17 PM, Manivannan Sadhasivam wrote: > On Sun, May 12, 2024 at 01:58:58PM +0530, devi priya wrote: >> The IPQ9574 platform has 4 Gen3 PCIe controllers: >> two single-lane and two dual-lane based on SNPS core 5.70a >> >> The Qcom IP rev is 1.27.0 and Synopsys IP rev is 5.80a >> Added a new compatible 'qcom,pcie-ipq9574' and 'ops_1_27_0' >> which reuses all the members of 'ops_2_9_0' except for the post_init >> as the SLV_ADDR_SPACE_SIZE configuration differs between 2_9_0 >> and 1_27_0. >> >> Reviewed-by: Dmitry Baryshkov >> Reviewed-by: Manivannan Sadhasivam >> Co-developed-by: Anusha Rao >> Signed-off-by: Anusha Rao >> Signed-off-by: devi priya >> --- >> Changes in V5: >> - Rebased on top of the below series which adds support for fetching >> clocks from the device tree >> https://lore.kernel.org/linux-pci/20240417-pci-qcom-clk-bulk-v1-1-52ca19b3d6b2@linaro.org/ >> >> drivers/pci/controller/dwc/pcie-qcom.c | 36 +++++++++++++++++++++++--- >> 1 file changed, 32 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c >> index 3d2eeff9a876..af36a29c092e 100644 >> --- a/drivers/pci/controller/dwc/pcie-qcom.c >> +++ b/drivers/pci/controller/dwc/pcie-qcom.c >> @@ -106,6 +106,7 @@ >> >> /* PARF_SLV_ADDR_SPACE_SIZE register value */ >> #define SLV_ADDR_SPACE_SZ 0x10000000 >> +#define SLV_ADDR_SPACE_SZ_1_27_0 0x08000000 > > Can you please explain what this value corresponds to? Even though there is an > old value, I didn't get much info earlier on what it is. The PARF_SLV_ADDR_SPACE_SIZE register indicates the range of RC accesses to the EP's memory space. Default PoR value is 16MB, which seems to be sufficient for IPQ9574 SoC. As per the memory map, the memory space corresponding to each PCIe region is 128Mb. As the older value corresponds to 256Mb we see PCIe enumeration failures. This register should either be updated to 128Mb(0x8000000) or left at the PoR value 16Mb (0x1000000). Thanks, Devi Priya > > - Mani > >> >> /* PARF_MHI_CLOCK_RESET_CTRL register fields */ >> #define AHB_CLK_EN BIT(0) >> @@ -1095,16 +1096,13 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) >> return clk_bulk_prepare_enable(res->num_clks, res->clks); >> } >> >> -static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) >> +static int qcom_pcie_post_init(struct qcom_pcie *pcie) >> { >> struct dw_pcie *pci = pcie->pci; >> u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); >> u32 val; >> int i; >> >> - writel(SLV_ADDR_SPACE_SZ, >> - pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); >> - >> val = readl(pcie->parf + PARF_PHY_CTRL); >> val &= ~PHY_TEST_PWR_DOWN; >> writel(val, pcie->parf + PARF_PHY_CTRL); >> @@ -1144,6 +1142,22 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) >> return 0; >> } >> >> +static int qcom_pcie_post_init_1_27_0(struct qcom_pcie *pcie) >> +{ >> + writel(SLV_ADDR_SPACE_SZ_1_27_0, >> + pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); >> + >> + return qcom_pcie_post_init(pcie); >> +} >> + >> +static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) >> +{ >> + writel(SLV_ADDR_SPACE_SZ, >> + pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); >> + >> + return qcom_pcie_post_init(pcie); >> +} >> + >> static int qcom_pcie_link_up(struct dw_pcie *pci) >> { >> u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); >> @@ -1297,6 +1311,15 @@ static const struct qcom_pcie_ops ops_2_9_0 = { >> .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, >> }; >> >> +/* Qcom IP rev.: 1.27.0 Synopsys IP rev.: 5.80a */ >> +static const struct qcom_pcie_ops ops_1_27_0 = { >> + .get_resources = qcom_pcie_get_resources_2_9_0, >> + .init = qcom_pcie_init_2_9_0, >> + .post_init = qcom_pcie_post_init_1_27_0, >> + .deinit = qcom_pcie_deinit_2_9_0, >> + .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, >> +}; >> + >> static const struct qcom_pcie_cfg cfg_1_0_0 = { >> .ops = &ops_1_0_0, >> }; >> @@ -1334,6 +1357,10 @@ static const struct qcom_pcie_cfg cfg_sc8280xp = { >> .no_l0s = true, >> }; >> >> +static const struct qcom_pcie_cfg cfg_1_27_0 = { >> + .ops = &ops_1_27_0, >> +}; >> + >> static const struct dw_pcie_ops dw_pcie_ops = { >> .link_up = qcom_pcie_link_up, >> .start_link = qcom_pcie_start_link, >> @@ -1603,6 +1630,7 @@ static const struct of_device_id qcom_pcie_match[] = { >> { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, >> { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, >> { .compatible = "qcom,pcie-ipq8074-gen3", .data = &cfg_2_9_0 }, >> + { .compatible = "qcom,pcie-ipq9574", .data = &cfg_1_27_0 }, >> { .compatible = "qcom,pcie-msm8996", .data = &cfg_2_3_2 }, >> { .compatible = "qcom,pcie-qcs404", .data = &cfg_2_4_0 }, >> { .compatible = "qcom,pcie-sa8540p", .data = &cfg_sc8280xp }, >> -- >> 2.34.1 >> >