From patchwork Mon Oct 17 14:53:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 3563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1496040wrs; Mon, 17 Oct 2022 08:01:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7pNH+hOV8WU8YTXD6imfjRgvqczVxzxj37UNGuipOvdHjshJeGkVWOLuCmLtAxfFkBwyAB X-Received: by 2002:a50:eb81:0:b0:458:e40e:68d7 with SMTP id y1-20020a50eb81000000b00458e40e68d7mr10560790edr.131.1666018909199; Mon, 17 Oct 2022 08:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666018909; cv=none; d=google.com; s=arc-20160816; b=Eh4bxtztI4bBBPf/4yX7LjqTyo9fVyQgPPtGFkfnYinkKlrFFty+uBKAwC82hyB+lK zrT0tV40wE6vP8mW1kS/1GWv4BAykbJLGH4MRiNgjFWPbqYJYJw6WTuj1LNOM+Ww9Z/t 6Qw1l6eXknu5CbgboT2ETen7q+0erVWxXnZKZdMjKGdnxt3ObEMw9QUp8qz8AREAKo13 wg3K7dv8wFW0kNdj2f2AfaOXkSa5OEw/JQoOGGdA9WV73E7A4xE/R6N2wI3uc1ieGI1R KBqUC5WgH/JtAYnwAbX0KNqPlu5sl5jS7fHA0eUwSF6aeLNjMyo93HMW/nyyKTNbMkX5 nR6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qi/ilhhncFGtZjB7Dt2IJt7CFzSMBfN23GEU1CnkItw=; b=C/z04FTF+XHYjDR3dg+Kccg7jqxsP57Bs2VEGJLcL566Ss5pobsrr0oDBOVB3x6wb8 mbqzmJOgwoKIwKWSdtMa6iKqzJvfauy3QTQL5SKlkQDsWthCAQp1aUfdIYMUaXFYkj4p AwqUOnRl1dQKNxxTCkKp6YqneZtM3Rd+JTFp/8VNmr0fCDIfGK230wK6Q0bu/OvM2Gzl 9v8BZd0LFnJg2RfgHKFkroAFYLhw6EgFhtUwiGRTFZp2AaJVmcVVrIohz7QVKAuoBsHT fQ54cgaiO63BVksto+25hGWSS9E7bW9vs9TiWsW4iHz0KnCBYH+ARWK7wBwE1WHR2cc9 SdbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gf1e18cZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020aa7d893000000b0045cbcf4867bsi7913462edq.318.2022.10.17.08.01.00; Mon, 17 Oct 2022 08:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gf1e18cZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbiJQPAQ (ORCPT + 99 others); Mon, 17 Oct 2022 11:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbiJQO6w (ORCPT ); Mon, 17 Oct 2022 10:58:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520B9696D4; Mon, 17 Oct 2022 07:56:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 31A4FB81901; Mon, 17 Oct 2022 14:54:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE985C433D7; Mon, 17 Oct 2022 14:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666018478; bh=uUpAhLHLLsqhHmSEEexr+AOFrWCWnZ7FhJh+GvHGDVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gf1e18cZXHTce/M3WMeNgU+RwOGYuaCnaFB0iQEQzAN4OLpl2sLosVi6B6ZilL+Sw 3MFwzxOE/cLi3b1FlAWwDu1dPcosBoG+IJeqKXXzsSaa96YemRbD00dKA21DHLIE+s 5zSJYACB3AOw025et8AjhS/zFQ+yO7DfLrPyWE+T/sA5Y//lUkpmXCN1zwqXyorzX7 L7qJ9Y+TLpLW0iRquiyk5cxJfnQIySzgBtlOqC+XyowftjRQdxVfUtt5ZzJbqv9tkN k/HudRjG2zoH78Dndi1iZKvWiJNHfiM7IB/SWtZisYFZuRzvtd28sJt+DaoT/8H8+B rzWGG2zAYzP/g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1okRVd-0005mD-26; Mon, 17 Oct 2022 16:54:29 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 07/15] phy: qcom-qmp-pcie: clean up PHY lane init Date: Mon, 17 Oct 2022 16:53:20 +0200 Message-Id: <20221017145328.22090-8-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017145328.22090-1-johan+linaro@kernel.org> References: <20221017145328.22090-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746947444212787338?= X-GMAIL-MSGID: =?utf-8?q?1746947444212787338?= Clean up the PHY lane initialisation somewhat by adding further temporary variables and programming both tx and rx for the second lane after the first lane. Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index bd946438e3c3..dd7e72424fc0 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1835,18 +1835,19 @@ static void qmp_pcie_lanes_init(struct qmp_pcie *qmp, const struct qmp_phy_cfg_t const struct qmp_phy_cfg *cfg = qmp->cfg; void __iomem *tx = qmp->tx; void __iomem *rx = qmp->rx; + void __iomem *tx2 = qmp->tx2; + void __iomem *rx2 = qmp->rx2; if (!tables) return; qmp_pcie_configure_lane(tx, tables->tx, tables->tx_num, 1); - - if (cfg->lanes >= 2) - qmp_pcie_configure_lane(qmp->tx2, tables->tx, tables->tx_num, 2); - qmp_pcie_configure_lane(rx, tables->rx, tables->rx_num, 1); - if (cfg->lanes >= 2) - qmp_pcie_configure_lane(qmp->rx2, tables->rx, tables->rx_num, 2); + + if (cfg->lanes >= 2) { + qmp_pcie_configure_lane(tx2, tables->tx, tables->tx_num, 2); + qmp_pcie_configure_lane(rx2, tables->rx, tables->rx_num, 2); + } } static void qmp_pcie_pcs_init(struct qmp_pcie *qmp, const struct qmp_phy_cfg_tables *tables)