From patchwork Mon Dec 23 14:30:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11308375 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EE21921 for ; Mon, 23 Dec 2019 14:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DC2020882 for ; Mon, 23 Dec 2019 14:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111464; bh=HbnZQLpmgHXuQZD4rzr1fzFLDl+IaGj4mWYVNAsbNqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2qVRfCH3Se7IQ7Za8YUgsa4ZIHs3J1SJ4fCfSXL+sfRNRYsARsm4JkOdam6tOxVmj eIVfhEfV0lFcr6v7zBujeWYHzZ4jIxvDibTdlsQX2wwjKU0FTqXg8MIN8X5RLE3BWd BiJE4P4CvJlICNwCXqZl3Er3l37QG6En0VnAamwY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726885AbfLWObD (ORCPT ); Mon, 23 Dec 2019 09:31:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:51400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbfLWObD (ORCPT ); Mon, 23 Dec 2019 09:31:03 -0500 Received: from vkoul-mobl.Dlink (unknown [106.51.110.206]) (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 B605020715; Mon, 23 Dec 2019 14:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111463; bh=HbnZQLpmgHXuQZD4rzr1fzFLDl+IaGj4mWYVNAsbNqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hNVaCVZeiTF3YPNzO7IGoU5IepR3bZV0K/2HZ+Hv91LB+uQrhQYYKDDPMB8jnzNen IOfNb1pOzdg2N2TPDHLrJ9TtpMvt61fV+7qj3Tp8JNa8pqzlGOg/h6ngIJklHqOE+Z pA93xoX2rdzKSCyo4FHL3z+y/ic3E3dxiOrL+sm4= From: Vinod Koul To: Kishon Vijay Abraham I Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Vinod Koul , Andy Gross , Can Guo , Jeffrey Hugo , Manu Gautam , linux-kernel@vger.kernel.org Subject: [PATCH v3 1/4] phy: qcom-qmp: Use register defines Date: Mon, 23 Dec 2019 20:00:43 +0530 Message-Id: <20191223143046.3376299-2-vkoul@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191223143046.3376299-1-vkoul@kernel.org> References: <20191223143046.3376299-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We already define register offsets so use them in register layout. Signed-off-by: Vinod Koul Reviewed-by: Manu Gautam Reviewed-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 66f91726b8b2..1196c85aa023 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -166,8 +166,8 @@ static const unsigned int sdm845_ufsphy_regs_layout[] = { }; static const unsigned int sm8150_ufsphy_regs_layout[] = { - [QPHY_START_CTRL] = 0x00, - [QPHY_PCS_READY_STATUS] = 0x180, + [QPHY_START_CTRL] = QPHY_V4_PHY_START, + [QPHY_PCS_READY_STATUS] = QPHY_V4_PCS_READY_STATUS, }; static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = { From patchwork Mon Dec 23 14:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11308377 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26DDB921 for ; Mon, 23 Dec 2019 14:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05FF821569 for ; Mon, 23 Dec 2019 14:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111471; bh=3cUpT0mny7tfDIGYn2V0LDUiAbt2ffFJwm4dcoAsQww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UWi0hbuJ0DpMtQUjOwURitAFXMuz1cV6tLIpcKmrmmll65Nb3+rCZ0dazqzt4kmnb S9aWKhL/T5Afi+3tGMqn28A+gAbiHfh8R4Ree9Gnn63ZpMs2BGzM+XeJQXcI38xUn3 5wuhU6Bb5h8VIFusbx3PWTdZxHXC8571o3iMNAnI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbfLWObJ (ORCPT ); Mon, 23 Dec 2019 09:31:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:51638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbfLWObI (ORCPT ); Mon, 23 Dec 2019 09:31:08 -0500 Received: from vkoul-mobl.Dlink (unknown [106.51.110.206]) (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 D14F52073A; Mon, 23 Dec 2019 14:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111467; bh=3cUpT0mny7tfDIGYn2V0LDUiAbt2ffFJwm4dcoAsQww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mP71U7+bwHXCPh8kzD4jtLNTeggnElMia699oF1a+KgUrxT0I/ZkvNkzZWxyw2MwB Mt3RoYgMTmLkEzqWaPl2pHoBacKGcFqHK4tZ+Dzborinh8XjyHY8IiM8U5Qf0T/cJF ljin2oev0Bk/UOk5D2/4dB0KK1Cg3d76l7+nYBQ8= From: Vinod Koul To: Kishon Vijay Abraham I Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Vinod Koul , Andy Gross , Can Guo , Jeffrey Hugo , Manu Gautam , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/4] phy: qcom-qmp: remove duplicate powerdown write Date: Mon, 23 Dec 2019 20:00:44 +0530 Message-Id: <20191223143046.3376299-3-vkoul@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191223143046.3376299-1-vkoul@kernel.org> References: <20191223143046.3376299-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We already write to QPHY_POWER_DOWN_CONTROL in qcom_qmp_phy_com_init() before invoking qcom_qmp_phy_configure() so remove the duplicate write. Signed-off-by: Vinod Koul Reviewed-by: Manu Gautam Reviewed-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 1196c85aa023..4f2e65c7cf45 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -885,7 +885,6 @@ static const struct qmp_phy_init_tbl msm8998_usb3_pcs_tbl[] = { }; static const struct qmp_phy_init_tbl sm8150_ufsphy_serdes_tbl[] = { - QMP_PHY_INIT_CFG(QPHY_POWER_DOWN_CONTROL, 0x01), QMP_PHY_INIT_CFG(QSERDES_V4_COM_SYSCLK_EN_SEL, 0xd9), QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_SEL, 0x11), QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_HS_SWITCH_SEL, 0x00), From patchwork Mon Dec 23 14:30:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11308391 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F28F9138D for ; Mon, 23 Dec 2019 14:31:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D13E42075B for ; Mon, 23 Dec 2019 14:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111494; bh=cXpw5tyrhRILWYrrExKOFYSPljwmd3fk8wpc94J0Z9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AFJeRCgQmn4EqpqMxLYxAtO+0GDRlqRd0cht0wDjbPFAuCFBSVeUz2mT5NxFQ6QS2 4sLqzCVNfTPJ1HwoK2TwWbCv75lq9I1kF25C8Q0VeNQxBYfj5ao1bKnyIRTK8sncEi 1zrittCWsnASAdhDBkoGT/KYl4HGXyMYR4/uOMI0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727100AbfLWOba (ORCPT ); Mon, 23 Dec 2019 09:31:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:51874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbfLWObM (ORCPT ); Mon, 23 Dec 2019 09:31:12 -0500 Received: from vkoul-mobl.Dlink (unknown [106.51.110.206]) (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 3BDD320715; Mon, 23 Dec 2019 14:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111471; bh=cXpw5tyrhRILWYrrExKOFYSPljwmd3fk8wpc94J0Z9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wU32q3lmWLOwJpvTPjJcVYmnT46STKX8xTsdrBmD2kfNN7MH+fnoRj9PS+crkty9h j4f+c4Tl7CP9392OacW5Sgq2v4/t8EONGrlw8Zn/1oa0ocvsxXA2quuo7JQDBlSJIJ yl5Zeyf4I9Rkl5Neuclkc54k9KTU3JddhFHZVheg= From: Vinod Koul To: Kishon Vijay Abraham I Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Vinod Koul , Andy Gross , Can Guo , Jeffrey Hugo , Manu Gautam , linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] phy: qcom-qmp: remove no_pcs_sw_reset for sm8150 Date: Mon, 23 Dec 2019 20:00:45 +0530 Message-Id: <20191223143046.3376299-4-vkoul@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191223143046.3376299-1-vkoul@kernel.org> References: <20191223143046.3376299-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org SM8150 QMPY phy for UFS and onwards the PHY_SW_RESET is present in PHY's PCS register so we should not mark no_pcs_sw_reset for sm8150 and onwards Signed-off-by: Vinod Koul Reviewed-by: Manu Gautam Reviewed-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 4f2e65c7cf45..ce5e18f188c3 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -1389,7 +1389,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .pwrdn_ctrl = SW_PWRDN, .is_dual_lane_phy = true, - .no_pcs_sw_reset = true, }; static void qcom_qmp_phy_configure(void __iomem *base, From patchwork Mon Dec 23 14:30:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11308383 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECECD921 for ; Mon, 23 Dec 2019 14:31:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB3C42073A for ; Mon, 23 Dec 2019 14:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111481; bh=rKlmP8qCOreILakRYVKDlU4TZ4C5i5QpLwBHZqwKiVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=N92PhbXRZWRhZduU4n9vCQXRbVXjnT0AJlVCi7TMJupa8Pa6vHfL1yqD/FtLqS7oO IA7sRGfgzrseeNyukiXHfzYrhxuGP3t8CuYYP4Vp+ek7JAbaemvsx2aquA8n39S76s KbjEEJPr5UJzo/bBazqqBK+vGcIAE/HUPjQ0QdmM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbfLWObQ (ORCPT ); Mon, 23 Dec 2019 09:31:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:52054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbfLWObQ (ORCPT ); Mon, 23 Dec 2019 09:31:16 -0500 Received: from vkoul-mobl.Dlink (unknown [106.51.110.206]) (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 48EC220709; Mon, 23 Dec 2019 14:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577111475; bh=rKlmP8qCOreILakRYVKDlU4TZ4C5i5QpLwBHZqwKiVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iv+aWzTH8e+kLR0srzVQxgtvQG/L5+1MkVpbPa6869c4GPMk1y2VyMQdaj6XxwQ97 5inRhWzyGxLAEHdYZExPIjrAt1gU4Ba2GNqH9UhIFHtInYML4MYXEBaSLkOgRgzMPV bTqg6sXolOglqqfIQ44c2O+9EuyMm9GHN0+aIY3k= From: Vinod Koul To: Kishon Vijay Abraham I Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Vinod Koul , Andy Gross , Can Guo , Jeffrey Hugo , Manu Gautam , linux-kernel@vger.kernel.org Subject: [PATCH v3 4/4] phy: qcom-qmp: Add SW reset register Date: Mon, 23 Dec 2019 20:00:46 +0530 Message-Id: <20191223143046.3376299-5-vkoul@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191223143046.3376299-1-vkoul@kernel.org> References: <20191223143046.3376299-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org For V4 QMP UFS Phy, we need to assert reset bits, configure the phy and then deassert it, so add the QPHY_SW_RESET register which does this. Signed-off-by: Vinod Koul Reviewed-by: Manu Gautam Reviewed-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index ce5e18f188c3..7db2a94f7a99 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -168,6 +168,7 @@ static const unsigned int sdm845_ufsphy_regs_layout[] = { static const unsigned int sm8150_ufsphy_regs_layout[] = { [QPHY_START_CTRL] = QPHY_V4_PHY_START, [QPHY_PCS_READY_STATUS] = QPHY_V4_PCS_READY_STATUS, + [QPHY_SW_RESET] = QPHY_V4_SW_RESET, }; static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {