Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp747073rdg; Wed, 11 Oct 2023 04:37:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvcHXYBhPj33CpOlpHoFSaW1xW8XXCAapRYjHOBMUeRf0iUsSa0QX+P6JISbSCb+2dtEAl X-Received: by 2002:a05:6a00:a08:b0:691:2d4:23a2 with SMTP id p8-20020a056a000a0800b0069102d423a2mr23728573pfh.31.1697024252886; Wed, 11 Oct 2023 04:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697024252; cv=none; d=google.com; s=arc-20160816; b=0otMvT3b04glfRv5lz6UST42JxThfpE2YRsYEngDuptA3wG7zpE0SW4f3RAWd6Zqng AH20pXSKu+stQ9hBf94hGY5yHC/9ldYSR2FgRHYTwLqeaFhk+KPb+507l8nvj1afAQre KOAjyIdOXp1jdMOMQ6MQU5OETwev40TWCTbXLYqRrk81y6Nk2aqzQsM/nTCeRKeyakSo 7KBKXvHGuwx6K+MRSpUNAFrIXQXrEQGSdYNGyE0LsyQTPPLbvAjQSMNrNBa0QL9dvdaO gc6keC2GzJxSmGjzBk0hebsfxgPs6HVMVfFqqwBPPNOd+yN7LXux6LYu0h1nZkJnEi+1 j0Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ADnQSRKfiE11Fw6NWJPg4jyr5BhP2bgI5UYJpaw9Vtc=; fh=IZuTdfVE9+MDHIE2+mUtKVRk/a4C0R77k0CMucvWHqA=; b=ARbowaSKAgHNhpfcb4STS2jHue5tFSF1Q5NskiukjdbY2D+np5csiVS/3V7CZqB8cJ czgRRo5b4OxJhYZsNV0FcsX8hf8WQTefKNV95crZ+qySOX1eD+nfThd8sDI2DwSfMiDk V6KDcqJCSFMRg3i42j0hJI8v3ejxRzVADqwnU6hhUSB7MoVb/FZgSiUpIvpJ71jObzLr OjC2Hltr8hiDOSDziXUHdJHHcPF2ksWq69LG/XshmXKYDYIdY8CzD4acfFakYHB2MX+1 3oEisExTw+BDTvW1+q78qwNEgqHVFfj90tIN5cFXoW6Oh5x7vH4sAeCYEaAMFeJCM+uM 2I7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DSI5lwUw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id eb13-20020a056a004c8d00b0068e26b4cd71si12029596pfb.179.2023.10.11.04.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:37:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DSI5lwUw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 67C95801BAE0; Wed, 11 Oct 2023 04:37:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345936AbjJKLhN (ORCPT + 99 others); Wed, 11 Oct 2023 07:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234772AbjJKLhM (ORCPT ); Wed, 11 Oct 2023 07:37:12 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 803439E for ; Wed, 11 Oct 2023 04:37:09 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-59f82ad1e09so83910137b3.0 for ; Wed, 11 Oct 2023 04:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697024228; x=1697629028; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ADnQSRKfiE11Fw6NWJPg4jyr5BhP2bgI5UYJpaw9Vtc=; b=DSI5lwUwDGyERG61xBXpUKSy3GvB/kfAiO+etSzyzwvKW7xInaTSA5mMhXMj4UTCGj 56ph2HQPIykn15aWXu4RdNCQ6i6VnEbzP9NZV6mqxkNXck8kJd7F8BQXN+Ug4RM3FeE2 OkXA5YAVaHycYoGtI8kUGVIR42GEyf4RQzfTY3JTBW6a84+wuHiIV9Ju5ZIXmFdrvhnR +8pHhBHViQZNAWFR6NIwlC8sBhI1oDJaBRLkyV2T7rLbbHeCLKAKDsed9qIUkKfZ9vLG wJbHF5vecCFG0w4mzYWYIy6rFyUZl8fB+6goZHXEtnjFpS3LsAhbvojpFkW6pUduu4zg NCUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697024228; x=1697629028; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ADnQSRKfiE11Fw6NWJPg4jyr5BhP2bgI5UYJpaw9Vtc=; b=o0U+jJw0pD/IPw0P9OJJ+bWnFnDyP9GTb0YoLXPt2gIoXItlgf86XYkUvYkcWTP9eU AxgiEvy9BemDg1TlnJjIblIuPdE/3XZn6Gr04Vct+S3fKbV7TzmU6JYGtZ59XsVTQGK8 2oS3aU8ObQAz1n9hEAy0J7jPwUsI2MOeYRTntmpmM5GRdD7wjZiHEG0/lZtdU3XX5MVr I8lOGhNODu+AP0JJblOUdkXkaUVcAcc+tWNkfFxxJnzZd3PaK5mXZ/EFcepHVV1D6u0u YILT4+75UHXARL4AOEFEiDoAIKerZMCkOCqqtALz0rfz7p+ilvGE7aofg2ZHhyhIYEJ4 KoTg== X-Gm-Message-State: AOJu0YzDDYJ4/VS/MWYYyV2vkk9opBwbUaLCkX8YgOrJWsGuJhgJJT0e ka2zr5o+FJ2fm2uz4jw55if38M8uuwi24Y+NwVgKtg== X-Received: by 2002:a5b:20d:0:b0:d15:7402:f7cd with SMTP id z13-20020a5b020d000000b00d157402f7cdmr19392771ybl.27.1697024228604; Wed, 11 Oct 2023 04:37:08 -0700 (PDT) MIME-Version: 1.0 References: <1697023109-23671-1-git-send-email-quic_msarkar@quicinc.com> <1697023109-23671-3-git-send-email-quic_msarkar@quicinc.com> In-Reply-To: <1697023109-23671-3-git-send-email-quic_msarkar@quicinc.com> From: Dmitry Baryshkov Date: Wed, 11 Oct 2023 14:36:55 +0300 Message-ID: Subject: Re: [PATCH v2 2/4] phy: qcom-qmp-pcie: add endpoint support for sa8775p To: Mrinmay Sarkar Cc: agross@kernel.org, andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, konrad.dybcio@linaro.org, mani@kernel.org, quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, robh@kernel.org, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_parass@quicinc.com, Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Vinod Koul , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-phy@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:37:30 -0700 (PDT) X-Spam-Level: ** 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? > + 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 > + > +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? > + > 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 > -- With best wishes Dmitry