Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp45911pxk; Tue, 15 Sep 2020 17:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6jDt9xBsKnCOZc5TAIyjp82tfB/OX9fGjSjHNQNluLiLzDGnQFqtQlD7BWpsnAZuuG6Lf X-Received: by 2002:a17:906:e18:: with SMTP id l24mr22715125eji.334.1600215596617; Tue, 15 Sep 2020 17:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600215596; cv=none; d=google.com; s=arc-20160816; b=T7pfS2z7HIMvmdkDWYFqDszkKDV+jZ5Jd+YfN1UYuP73i324HtrEgm7jG+mmp+kcHw 0HDTdCwVbFVaIf8pS4oal920Vd/5XFXWnyZDXfmJcJ+VvPjJGuQafHE0VV1F3pOGR9rj 8MohNnjxq/X5GqGGR9YYkfZpDNsLEpuDD0hY4JOSQUMlsAcO2JIAbtu7Oy4STtT+uj2V Ae21EjPNIXw9lciz5DBs/FaNKhz0/+1LPhbxh1k1D46tXFkWDPXSvYkwc1dW4cBRfvub hqy32eT+YmQ6BjxXwgBUyp9Mg7ZIECDQpqugI6UD5/uo4y8aa/AkwZ0QNJ8hgzmD6duD JBuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DTQGs1fSSbkifGf3iJaKr2EkSik8yFQjMjNK7yrPxqs=; b=GLuCVINDExWumzCvzR5eIHk12qCZ6zVg/NYcK+E0A5b9tGbyezNgulzdSJkz3uymmy xb4YwCNW0o2oeKJBzMqN0aLdgd499EjLV1X8WT7knzBMFTBgKnTQbZhYuP83VOfGVARG FsApusBV/hFZqUrLIUOJjvj2i0IPt5Koyqabi3Y5+ouAdXKrt7VLE8Ti2Ux7K2zMmTI1 P+QWfkIJ0VxBF9zcQdXiORZ6f5YrC118TfINAg3OhBGUlUootpCOP5qzh2D3J4nadqJO j1Q+mFHwwD18wTAoe3TQGDlHwbagGBSK8F6gpR2s+A2Hu+sb8S8D0Pp52Cs3MdWOHAq/ PYgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WZj9tVXu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx23si10327266ejb.355.2020.09.15.17.19.34; Tue, 15 Sep 2020 17:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WZj9tVXu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727300AbgIPASu (ORCPT + 99 others); Tue, 15 Sep 2020 20:18:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:34640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbgIOOWr (ORCPT ); Tue, 15 Sep 2020 10:22:47 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 379CD22286; Tue, 15 Sep 2020 14:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179468; bh=riLVx3JTdnHNB76EjOjB6sBcKEKA36yNufDKIv31q2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WZj9tVXutMEvg+/HY9BWHdrMRAmytMH2Qr7lbDIYtDAtVJfnu/3p+CgZ5P2rI84qz stx44Ej66Lc1m6vN6sD8jIlj6LN+tvQF+gbPyECH4YO7KenDJqKYqCFh+Ij82XBYkN o5UVKXbzSbN0BQT988prpjmmzfcGe6Hoft1roxqo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Selvam Sathappan Periakaruppan , Sivaprakash Murugesan , Vinod Koul Subject: [PATCH 4.19 72/78] phy: qcom-qmp: Use correct values for ipq8074 PCIe Gen2 PHY init Date: Tue, 15 Sep 2020 16:13:37 +0200 Message-Id: <20200915140637.190662014@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sivaprakash Murugesan commit afd55e6d1bd35b4b36847869011447a83a81c8e0 upstream. There were some problem in ipq8074 Gen2 PCIe phy init sequence. 1. Few register values were wrongly updated in the phy init sequence. 2. The register QSERDES_RX_SIGDET_CNTRL is a RX tuning parameter register which is added in serdes table causing the wrong register was getting updated. 3. Clocks and resets were not added in the phy init. Fix these to make Gen2 PCIe port on ipq8074 devices to work. Fixes: eef243d04b2b6 ("phy: qcom-qmp: Add support for IPQ8074") Cc: stable@vger.kernel.org Co-developed-by: Selvam Sathappan Periakaruppan Signed-off-by: Selvam Sathappan Periakaruppan Signed-off-by: Sivaprakash Murugesan Link: https://lore.kernel.org/r/1596036607-11877-4-git-send-email-sivaprak@codeaurora.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/phy/qualcomm/phy-qcom-qmp.c | 16 +++++++++------- drivers/phy/qualcomm/phy-qcom-qmp.h | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -311,8 +311,8 @@ static const struct qmp_phy_init_tbl ipq QMP_PHY_INIT_CFG(QSERDES_COM_BG_TRIM, 0xf), QMP_PHY_INIT_CFG(QSERDES_COM_LOCK_CMP_EN, 0x1), QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_MAP, 0x0), - QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0x1f), - QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x3f), + QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0xff), + QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x1f), QMP_PHY_INIT_CFG(QSERDES_COM_CMN_CONFIG, 0x6), QMP_PHY_INIT_CFG(QSERDES_COM_PLL_IVCO, 0xf), QMP_PHY_INIT_CFG(QSERDES_COM_HSCLK_SEL, 0x0), @@ -338,7 +338,6 @@ static const struct qmp_phy_init_tbl ipq QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN1_MODE0, 0x0), QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN0_MODE0, 0x80), QMP_PHY_INIT_CFG(QSERDES_COM_BIAS_EN_CTRL_BY_PSM, 0x1), - QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_CTRL, 0xa), QMP_PHY_INIT_CFG(QSERDES_COM_SSC_EN_CENTER, 0x1), QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER1, 0x31), QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER2, 0x1), @@ -347,7 +346,6 @@ static const struct qmp_phy_init_tbl ipq QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE1, 0x2f), QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE2, 0x19), QMP_PHY_INIT_CFG(QSERDES_COM_CLK_EP_DIV, 0x19), - QMP_PHY_INIT_CFG(QSERDES_RX_SIGDET_CNTRL, 0x7), }; static const struct qmp_phy_init_tbl ipq8074_pcie_tx_tbl[] = { @@ -355,6 +353,8 @@ static const struct qmp_phy_init_tbl ipq QMP_PHY_INIT_CFG(QSERDES_TX_LANE_MODE, 0x6), QMP_PHY_INIT_CFG(QSERDES_TX_RES_CODE_LANE_OFFSET, 0x2), QMP_PHY_INIT_CFG(QSERDES_TX_RCV_DETECT_LVL_2, 0x12), + QMP_PHY_INIT_CFG(QSERDES_TX_EMP_POST1_LVL, 0x36), + QMP_PHY_INIT_CFG(QSERDES_TX_SLEW_CNTL, 0x0a), }; static const struct qmp_phy_init_tbl ipq8074_pcie_rx_tbl[] = { @@ -365,7 +365,6 @@ static const struct qmp_phy_init_tbl ipq QMP_PHY_INIT_CFG(QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4, 0xdb), QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x4b), QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN, 0x4), - QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN_HALF, 0x4), }; static const struct qmp_phy_init_tbl ipq8074_pcie_pcs_tbl[] = { @@ -818,6 +817,9 @@ static const struct qmp_phy_cfg msm8996_ .mask_pcs_ready = PHYSTATUS, }; +static const char * const ipq8074_pciephy_clk_l[] = { + "aux", "cfg_ahb", +}; /* list of resets */ static const char * const ipq8074_pciephy_reset_l[] = { "phy", "common", @@ -835,8 +837,8 @@ static const struct qmp_phy_cfg ipq8074_ .rx_tbl_num = ARRAY_SIZE(ipq8074_pcie_rx_tbl), .pcs_tbl = ipq8074_pcie_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(ipq8074_pcie_pcs_tbl), - .clk_list = NULL, - .num_clks = 0, + .clk_list = ipq8074_pciephy_clk_l, + .num_clks = ARRAY_SIZE(ipq8074_pciephy_clk_l), .reset_list = ipq8074_pciephy_reset_l, .num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l), .vreg_list = NULL, --- a/drivers/phy/qualcomm/phy-qcom-qmp.h +++ b/drivers/phy/qualcomm/phy-qcom-qmp.h @@ -77,6 +77,8 @@ #define QSERDES_COM_CORECLK_DIV_MODE1 0x1bc /* Only for QMP V2 PHY - TX registers */ +#define QSERDES_TX_EMP_POST1_LVL 0x018 +#define QSERDES_TX_SLEW_CNTL 0x040 #define QSERDES_TX_RES_CODE_LANE_OFFSET 0x054 #define QSERDES_TX_DEBUG_BUS_SEL 0x064 #define QSERDES_TX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN 0x068