Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp757018rdg; Wed, 11 Oct 2023 04:56:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSR5FKRlK2Knu05GGUn5bu3bU+KtrIIQHsUMzscrkY/oisdRZApGkqfN2lIQ4y9CGBKKj5 X-Received: by 2002:a05:6358:722:b0:14b:9537:b18e with SMTP id e34-20020a056358072200b0014b9537b18emr21767187rwj.7.1697025418575; Wed, 11 Oct 2023 04:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697025418; cv=none; d=google.com; s=arc-20160816; b=0JiDN644+KZrgDNdinbbXgTGgPh3n7MgQnEd5NJnFJs2EFD5bpRCDhn0O/ZN92XlNC RdwzwpBNdYl5XvdxsU/BgENxHZc1Nwez9LwHQeIUqlT7Y+3Idt5wgf9veEVTapo987sj 6XFX5oPcU2Gl8Om6N/awsfqqLuTUTJ3half3ru1ZaY0pac7KdlbfXm4fLzXzTSYDDu7N hIHugTgoMzoUFBYyNfF2x22ssrD2YYpJw+AJqVrq9LnJFPclbC/Ud8FzKZDbyY0v/zjL I8oMO2pesQ6gm8e65pijfJKO/PvmjDabi6cvCaknIsV1oVkB5xkV0AIDNThn1pzkBZzt nq1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yWDYgFmR3DLE3mMSw9m4g0WmA/jghMlKyUvasAzQv5Y=; fh=HJphBGqbv9wkGiT7McsRE8iv2609cGsFCFDruFZQC2E=; b=UNEWvVkR71kffitAKE7bYPDhk22Oelb/AejG5lHgRMYggD815lx/r9cZReEdUxm4le ZZlnc2E518LgwCen43+lsdo8wvzs5Nay5BRwzEUuZry1EI81w5JfhUG8Q13CVHItOrNS f5nqMgBIvDNCDuaG5CGnzpcAsfkRHnqY6snWQDbgFrP7LaClsP803jX8oV/SFKaAVTF8 LCZDMgYM6yu9cwJh56jtOWZRRnqzF6bJ1FCGDsNPCuuEV+JLPw4+wgeMT7//Pct94fcb f3WU8YGvvx10L9RVptN8id6PJtTTq+x/x1mLEA4nrxxRPp1Z0TMoyssOuuJx1V6/7pIZ swww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DlaG+xwp; 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 fb12-20020a056a002d8c00b00691004e7db0si1378265pfb.170.2023.10.11.04.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:56:58 -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=DlaG+xwp; 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 81B78807D406; Wed, 11 Oct 2023 04:56:55 -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 S231970AbjJKL4o (ORCPT + 99 others); Wed, 11 Oct 2023 07:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjJKL4m (ORCPT ); Wed, 11 Oct 2023 07:56:42 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B9EF93; Wed, 11 Oct 2023 04:56:39 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39B8XXaR025256; Wed, 11 Oct 2023 11:56:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=yWDYgFmR3DLE3mMSw9m4g0WmA/jghMlKyUvasAzQv5Y=; b=DlaG+xwpNJQFvmVHQvRcB642pvbeJtCyliiGr+V4JJuEHq5cEk6UaLM2j8OLCxw7l+yF cocAif6EIJKV2XVlfUchYUXYcGpSNR9ibtQo02MbR5Ap0vViFQryHD3uSfqJ0buQzEBq +hC0RApBnvfJzAYHvmYNxkaYl1l3dj2ajUWhaHFYonssAXmUhfozz6YXs/746Ve6Opi3 V6oZlVSXsEhfJ6oOCIKdQ0VRdM//pv9fX1SUopFYkWBfn7dUGi02MpIekhCKKbJCUINS r+5O2gl4SAhf8CAnw2oNisQDqn4nkJMt9rPPpp40eB3bw+FM8neyZO+rYrFqkBd+wg7q qA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tnnvw8rrb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Oct 2023 11:56:24 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39BBu4IR032535 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Oct 2023 11:56:04 GMT Received: from [10.216.52.55] (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; Wed, 11 Oct 2023 04:55:56 -0700 Message-ID: <6531b333-b978-6b97-5cb4-59562d775ac3@quicinc.com> Date: Wed, 11 Oct 2023 17:25:53 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 2/4] phy: qcom-qmp-pcie: add endpoint support for sa8775p Content-Language: en-US To: Dmitry Baryshkov CC: , , , , , , , , , , , , , , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Kishon Vijay Abraham I , Vinod Koul , , , , , , References: <1697023109-23671-1-git-send-email-quic_msarkar@quicinc.com> <1697023109-23671-3-git-send-email-quic_msarkar@quicinc.com> From: Mrinmay Sarkar In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-ORIG-GUID: ZEzDn50P4KEQEOAKHA4Ysiu6xzJT-5a3 X-Proofpoint-GUID: ZEzDn50P4KEQEOAKHA4Ysiu6xzJT-5a3 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-11_09,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 phishscore=0 clxscore=1015 spamscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110105 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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]); Wed, 11 Oct 2023 04:56:55 -0700 (PDT) On 10/11/2023 5:06 PM, Dmitry Baryshkov wrote: > On Wed, 11 Oct 2023 at 14:19, Mrinmay Sarkar wrote: >> Add support for dual lane end point mode PHY found on sa8755p platform. >> >> Signed-off-by: Mrinmay Sarkar >> --- >> drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 41 ++++++++++++++++++++++++++++++ >> drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5.h | 2 ++ >> 2 files changed, 43 insertions(+) > Two minor questions. > >> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c >> index a63ca74..962b4a1 100644 >> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c >> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c >> @@ -2147,6 +2147,38 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_rc_serdes_alt_tbl[] >> QMP_PHY_INIT_CFG(QSERDES_V5_COM_CLK_SELECT, 0x34), >> }; >> >> +static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl[] = { >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_BG_TIMER, 0x02), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYS_CLK_CTRL, 0x07), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_CP_CTRL_MODE0, 0x27), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_CP_CTRL_MODE1, 0x0a), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_RCTRL_MODE0, 0x17), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_RCTRL_MODE1, 0x19), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_CCTRL_MODE0, 0x00), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_CCTRL_MODE1, 0x03), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYSCLK_EN_SEL, 0x00), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN0_MODE0, 0xfb), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN1_MODE0, 0x01), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN0_MODE1, 0xfb), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN1_MODE1, 0x01), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_CMN_MODE, 0x14), > I should check whether we miss QSERDES_V5_COM_CMN_MODE in > sm8450_qmp_gen4x2_pcie_ep_serdes_tbl, which is otherwise nearly > identical. > Also do you need to set QSERDES_V5_COM_CORE_CLK_EN here? QSERDES_V5_COM_CORE_CLK_EN is common for both RC and EP so we are using it in sa8775p_qmp_gen4x2_pcie_serdes_alt_tbl -Mrinmay >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP1_MODE0, 0xff), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE0, 0x04), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP1_MODE1, 0xff), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE1, 0x09), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_DEC_START_MODE0, 0x19), >> + QMP_PHY_INIT_CFG(QSERDES_V5_COM_DEC_START_MODE1, 0x28), >> +}; >> + >> +static const struct qmp_phy_init_tbl sa8775p_qmp_gen4_pcie_ep_pcs_misc_tbl[] = { >> + QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5, 0x08), >> +}; > This is the same as sm8450_qmp_gen4x2_pcie_ep_pcs_misc_tbl so you want me to use sm8450_qmp_gen4x2_pcie_ep_pcs_misc_tbl instead of creating new one for sa8775? -Mrinmay >> + >> +static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl[] = { >> + QMP_PHY_INIT_CFG(QPHY_V5_PCS_INSIG_MX_CTRL7, 0x00), >> + QMP_PHY_INIT_CFG(QPHY_V5_PCS_INSIG_SW_CTRL7, 0x00), >> +}; > Could you please confirm that these registers belong to the V5 > namespace rather than V5_20 one? may I know difference between V5 and V5_20 namespace can't we use V5 namespace here? -Mrinmay >> + >> struct qmp_pcie_offsets { >> u16 serdes; >> u16 pcs; >> @@ -3043,6 +3075,15 @@ static const struct qmp_phy_cfg sa8775p_qmp_gen4x2_pciephy_cfg = { >> .pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl), >> }, >> >> + .tbls_ep = &(const struct qmp_phy_cfg_tbls) { >> + .serdes = sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl, >> + .serdes_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl), >> + .pcs_misc = sa8775p_qmp_gen4_pcie_ep_pcs_misc_tbl, >> + .pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_ep_pcs_misc_tbl), >> + .pcs = sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl, >> + .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl), >> + }, >> + >> .reset_list = sdm845_pciephy_reset_l, >> .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), >> .vreg_list = qmp_phy_vreg_l, >> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5.h >> index 36cc80b..6ee1c33 100644 >> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5.h >> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5.h >> @@ -11,6 +11,8 @@ >> #define QPHY_V5_PCS_PCS_STATUS1 0x014 >> #define QPHY_V5_PCS_POWER_DOWN_CONTROL 0x040 >> #define QPHY_V5_PCS_START_CONTROL 0x044 >> +#define QPHY_V5_PCS_INSIG_SW_CTRL7 0x060 >> +#define QPHY_V5_PCS_INSIG_MX_CTRL7 0x07c >> #define QPHY_V5_PCS_LOCK_DETECT_CONFIG1 0x0c4 >> #define QPHY_V5_PCS_LOCK_DETECT_CONFIG2 0x0c8 >> #define QPHY_V5_PCS_LOCK_DETECT_CONFIG3 0x0cc >> -- >> 2.7.4 >> >