Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp325537lqt; Thu, 18 Apr 2024 17:12:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWA2QrOt5sOuRe3jNd/J4O6tGAY+FEPHQ23zVKvvNWPXA3yzYPT0aF/9gqOqQKPI0nj/f8H13Li0SthKSB6tpcjEC4h13sM3HsLMdx1cg== X-Google-Smtp-Source: AGHT+IGZ/J3oPYdE7/ONANJEFm+tFrHMo/0832/Y5JaR8uTeWlAYdA1QqPL6gPmi6+dEWAyZMQnJ X-Received: by 2002:a05:620a:c4f:b0:78d:6eef:7d69 with SMTP id u15-20020a05620a0c4f00b0078d6eef7d69mr861981qki.51.1713485541783; Thu, 18 Apr 2024 17:12:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713485541; cv=pass; d=google.com; s=arc-20160816; b=fZhorP7Sff64gxJLnRPg9SHTvicBhINxbVnsk/uom7cPgRgoEWF5E/2ZXBhvcsBaCB JYHTG3ecBt346AumXIdROSSGsnRkBfL0lAGkYqck4OZzL7q5Q8YAkYOQSdjcqL9H9zxG ZIRn2jlpyOyP42l3phvgaDESg/vpESPebUBxBqDQhoXnvu3ftqB4sdr+jamX8qqaegv1 9ab8y3hUWmiVsAvdWoWjkYJBuxJW0S5NO1SKzifF0vWfwi2mYA8TTm/vLo+9/4iRSEU7 h5/IGxyFETkTzgZf8MjJ12WTnWJ/YOJ5Ztojf0pcXbQhHOjccjFfKGzapB1YmGLhw54J uuqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=E+MUUFF9nUQU8Lod6cFIwRusIEFGRZulrqTCSTn2l4E=; fh=Z+P4OQYSQhunKfdoNFj3UgTp4A8FlNpimpM/tUp69Co=; b=I04bbuQ8sVG1EKFclHoMF3G/AUy1c3KvrmkOw1glUWEF87Y5lien+k5hnTKslnv8UK XeTz/R3/2SoBtC88atf4PtSLUX00BrxkchcfmQaaua9kZgSOrtnsYyshJ3yZpxxR8l6c B6l1lRCRcfmGgXk1OonSTit7ipyIhexx+KLKTHhSeGaa6E/jT1C/neiT1FH7Gx9D5k3P MiH4tex2Aphw6QkJ/N+LXVw/TQT04e60rIfQHSE3vGOWH0hWD8Ux5SlRixeAtJu/KDey nOJGZZJgwCZM66WNNladL0tDpOZ3qNUL+k+i7i3WV5FpJU8HCP61Xn+fw3xBEiyqcvWL bXFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DDGWCZ53; 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-150878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vu24-20020a05620a561800b0078d6245a065si2617002qkn.526.2024.04.18.17.12.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 17:12:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DDGWCZ53; 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-150878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150878-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 73EFF1C21548 for ; Fri, 19 Apr 2024 00:12:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9F06A5F; Fri, 19 Apr 2024 00:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DDGWCZ53" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 AC961DDD5; Fri, 19 Apr 2024 00:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713485449; cv=none; b=DSZLbeB+OH+ZA4t6unMwH7F8Ar5ZKLI3P2IneCvB6Xdkzc9AeF4MwSE0xDjnIQdh0Lvs0VzbSyoW01/If2YaCARd9h+zvc6mSe8jlXH1VrkH2FoSBLK4igeyujuC80KD2X5xEcnLxHLnE63QOGHNB0PGbhx0nPJfjEsmOq9F9GE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713485449; c=relaxed/simple; bh=vt9o9pMYCW7hhpcZsv8ddcoj4OiStUOgb8ev/ufEpqU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=EZlwS1zAEjAotvtMPMQvoIyPfgRzYnH2gXUbtckMotqmmHJ/UquTDB3d8oen0X1G87obIHP0J5yYgxQoLWUZsqreqNZf8i9gEjzUlNQqrgyY9QukvuB9kK261FF1u5rb5R4Jt7HmEMovvvVBC+Gf5gDII02V+cwQyBrcPr45eIk= 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=DDGWCZ53; arc=none smtp.client-ip=205.220.168.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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43INbfPi004091; Fri, 19 Apr 2024 00:10:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=E+MUUFF 9nUQU8Lod6cFIwRusIEFGRZulrqTCSTn2l4E=; b=DDGWCZ53FhT+QCfVKD32aYt i0jfb2R8cKDlrQ5IsA28ZWUdPjARYcZ/ht64cUfJnVTPmQbfMe8a/fxYLvgrh4TW EWxAbxjegTtGHWAV23EAabMwfOfF6FNX4R1IgSzpHUOuGKJcEmm5/7GLohFmNJ7d SiimyCaZ+KWR8nNQDBl0e49rdBf7eLYrk4up5Q4gjq570Ak+oUzMU6uc2oO7b0hp 6HeK51qxYIF1jzS1hQnenwyacpIuxCGJHc3VTBgtgy4dSF5RAyMOarun6knvANkg BO2lRVz0dUjtV42JsonoHJPsNwCIDX4yDmbzNH4zwFYP+xNXX7LnR0E0/Nnfong= = Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xjx54j9dd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Apr 2024 00:10:33 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43J0AWOg015865 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Apr 2024 00:10:32 GMT Received: from adas-linux5.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.1544.9; Thu, 18 Apr 2024 17:10:31 -0700 From: Shashank Babu Chinta Venkata To: , , , CC: , , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Yoshihiro Shimoda , Serge Semin , Conor Dooley , , , Subject: [PATCH v3 0/3] Add 16GT/s equalization and margining settings Date: Thu, 18 Apr 2024 17:09:33 -0700 Message-ID: <20240419001013.28788-1-quic_schintav@quicinc.com> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: CgrkrAVWo0boEGpqahhkjGnIaLHOEfu2 X-Proofpoint-ORIG-GUID: CgrkrAVWo0boEGpqahhkjGnIaLHOEfu2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-18_21,2024-04-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=764 bulkscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404190000 Add 16GT/s specific equalization and rx lane margining settings. These settings are inline with respective PHY settings for 16GT/s operation. In addition, current QCOM EP and RC drivers do not share common codebase which would result in code duplication. Hence, adding common files for code reusability among RC and EP drivers. v2 -> v3: - Replaced FIELD_GET/FIELD_PREP macros for bit operations. - Renamed cmn to common. - Avoided unnecessary argument validations. - Addressed review comments from Konrad and Mani. v1 -> v2: - Capitilized commit message to be inline with history - Dropped stubs from header file. - Moved Designware specific register offsets and masks to pcie-designware.h header file. - Applied settings based on bus data rate rather than link generation. - Addressed review comments from Bjorn and Frank. Shashank Babu Chinta Venkata (3): PCI: qcom: Refactor common code PCI: qcom: Add equalization settings for 16GT/s PCI: qcom: Add rx margining settings for 16GT/s drivers/pci/controller/dwc/Kconfig | 5 + drivers/pci/controller/dwc/Makefile | 1 + drivers/pci/controller/dwc/pcie-designware.h | 30 ++++ drivers/pci/controller/dwc/pcie-qcom-common.c | 129 ++++++++++++++++++ drivers/pci/controller/dwc/pcie-qcom-common.h | 14 ++ drivers/pci/controller/dwc/pcie-qcom-ep.c | 44 ++---- drivers/pci/controller/dwc/pcie-qcom.c | 72 ++-------- 7 files changed, 201 insertions(+), 94 deletions(-) create mode 100644 drivers/pci/controller/dwc/pcie-qcom-common.c create mode 100644 drivers/pci/controller/dwc/pcie-qcom-common.h -- 2.43.2