From: Johan Hovold <johan+linaro@kernel.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@somainline.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org,
Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH v2 04/14] phy: qcom-qmp-pcie: drop redundant ipq8074 power on
Date: Wed, 12 Oct 2022 10:12:31 +0200 [thread overview]
Message-ID: <20221012081241.18273-5-johan+linaro@kernel.org> (raw)
In-Reply-To: <20221012081241.18273-1-johan+linaro@kernel.org>
The PCS initialisation table for IPQ8074 includes updates of the reset
and start-control registers which is already handled explicitly by the
driver during power on.
Drop the redundant register write from the IPQ8074 configuration table
and along with it the now unused "in-layout" configuration macro and
code.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 42 +++++-------------------
1 file changed, 9 insertions(+), 33 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index de04d8dd5350..fa8bc6aeedf1 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -42,11 +42,6 @@
struct qmp_phy_init_tbl {
unsigned int offset;
unsigned int val;
- /*
- * register part of layout ?
- * if yes, then offset gives index in the reg-layout
- */
- bool in_layout;
/*
* mask of lanes for which this register is written
* for cases when second lane needs different values
@@ -61,14 +56,6 @@ struct qmp_phy_init_tbl {
.lane_mask = 0xff, \
}
-#define QMP_PHY_INIT_CFG_L(o, v) \
- { \
- .offset = o, \
- .val = v, \
- .in_layout = true, \
- .lane_mask = 0xff, \
- }
-
#define QMP_PHY_INIT_CFG_LANE(o, v, l) \
{ \
.offset = o, \
@@ -388,8 +375,6 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_pcs_tbl[] = {
QMP_PHY_INIT_CFG(QPHY_V2_PCS_RX_SIGDET_LVL, 0x99),
QMP_PHY_INIT_CFG(QPHY_V2_PCS_TXDEEMPH_M6DB_V0, 0x15),
QMP_PHY_INIT_CFG(QPHY_V2_PCS_TXDEEMPH_M3P5DB_V0, 0xe),
- QMP_PHY_INIT_CFG_L(QPHY_SW_RESET, 0x0),
- QMP_PHY_INIT_CFG_L(QPHY_START_CTRL, 0x3),
};
static const struct qmp_phy_init_tbl ipq8074_pcie_gen3_serdes_tbl[] = {
@@ -1896,7 +1881,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = {
};
static void qmp_pcie_configure_lane(void __iomem *base,
- const unsigned int *regs,
const struct qmp_phy_init_tbl tbl[],
int num,
u8 lane_mask)
@@ -1911,30 +1895,25 @@ static void qmp_pcie_configure_lane(void __iomem *base,
if (!(t->lane_mask & lane_mask))
continue;
- if (t->in_layout)
- writel(t->val, base + regs[t->offset]);
- else
- writel(t->val, base + t->offset);
+ writel(t->val, base + t->offset);
}
}
static void qmp_pcie_configure(void __iomem *base,
- const unsigned int *regs,
const struct qmp_phy_init_tbl tbl[],
int num)
{
- qmp_pcie_configure_lane(base, regs, tbl, num, 0xff);
+ qmp_pcie_configure_lane(base, tbl, num, 0xff);
}
static void qmp_pcie_serdes_init(struct qmp_phy *qphy, const struct qmp_phy_cfg_tables *tables)
{
- const struct qmp_phy_cfg *cfg = qphy->cfg;
void __iomem *serdes = qphy->serdes;
if (!tables)
return;
- qmp_pcie_configure(serdes, cfg->regs, tables->serdes, tables->serdes_num);
+ qmp_pcie_configure(serdes, tables->serdes, tables->serdes_num);
}
static void qmp_pcie_lanes_init(struct qmp_phy *qphy, const struct qmp_phy_cfg_tables *tables)
@@ -1946,29 +1925,26 @@ static void qmp_pcie_lanes_init(struct qmp_phy *qphy, const struct qmp_phy_cfg_t
if (!tables)
return;
- qmp_pcie_configure_lane(tx, cfg->regs, tables->tx, tables->tx_num, 1);
+ qmp_pcie_configure_lane(tx, tables->tx, tables->tx_num, 1);
if (cfg->lanes >= 2)
- qmp_pcie_configure_lane(qphy->tx2, cfg->regs, tables->tx, tables->tx_num, 2);
+ qmp_pcie_configure_lane(qphy->tx2, tables->tx, tables->tx_num, 2);
- qmp_pcie_configure_lane(rx, cfg->regs, tables->rx, tables->rx_num, 1);
+ qmp_pcie_configure_lane(rx, tables->rx, tables->rx_num, 1);
if (cfg->lanes >= 2)
- qmp_pcie_configure_lane(qphy->rx2, cfg->regs, tables->rx, tables->rx_num, 2);
+ qmp_pcie_configure_lane(qphy->rx2, tables->rx, tables->rx_num, 2);
}
static void qmp_pcie_pcs_init(struct qmp_phy *qphy, const struct qmp_phy_cfg_tables *tables)
{
- const struct qmp_phy_cfg *cfg = qphy->cfg;
void __iomem *pcs = qphy->pcs;
void __iomem *pcs_misc = qphy->pcs_misc;
if (!tables)
return;
- qmp_pcie_configure(pcs, cfg->regs,
- tables->pcs, tables->pcs_num);
- qmp_pcie_configure(pcs_misc, cfg->regs,
- tables->pcs_misc, tables->pcs_misc_num);
+ qmp_pcie_configure(pcs, tables->pcs, tables->pcs_num);
+ qmp_pcie_configure(pcs_misc, tables->pcs_misc, tables->pcs_misc_num);
}
static int qmp_pcie_init(struct phy *phy)
--
2.35.1
next prev parent reply other threads:[~2022-10-12 8:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 8:12 [PATCH v2 00/14] phy: qcom-qmp: further prep cleanups Johan Hovold
2022-10-12 8:12 ` [PATCH v2 01/14] phy: qcom-qmp: drop regulator error message Johan Hovold
2022-10-12 8:12 ` [PATCH v2 02/14] phy: qcom-qmp: drop superfluous comments Johan Hovold
2022-10-12 8:12 ` [PATCH v2 03/14] phy: qcom-qmp-combo: drop unused in-layout configuration Johan Hovold
2022-10-12 8:12 ` Johan Hovold [this message]
2022-10-12 8:12 ` [PATCH v2 05/14] phy: qcom-qmp-pcie-msm8996: " Johan Hovold
2022-10-12 8:12 ` [PATCH v2 06/14] phy: qcom-qmp-ufs: " Johan Hovold
2022-10-12 8:12 ` [PATCH v2 07/14] phy: qcom-qmp-usb: " Johan Hovold
2022-10-12 20:39 ` Dmitry Baryshkov
2022-10-12 8:12 ` [PATCH v2 08/14] phy: qcom-qmp-pcie: drop power-down delay config Johan Hovold
2022-10-12 8:12 ` [PATCH v2 09/14] phy: qcom-qmp-pcie: replace power-down delay Johan Hovold
2022-10-12 20:40 ` Dmitry Baryshkov
2022-10-12 8:12 ` [PATCH v2 10/14] phy: qcom-qmp-pcie-msm8996: drop power-down delay config Johan Hovold
2022-10-12 8:12 ` [PATCH v2 11/14] phy: qcom-qmp-combo: drop sc8280xp power-down delay Johan Hovold
2022-10-12 20:41 ` Dmitry Baryshkov
2022-10-12 8:12 ` [PATCH v2 12/14] phy: qcom-qmp-combo: drop power-down delay config Johan Hovold
2022-10-12 8:12 ` [PATCH v2 13/14] phy: qcom-qmp-usb: drop sc8280xp power-down delay Johan Hovold
2022-10-12 20:41 ` Dmitry Baryshkov
2022-10-12 8:12 ` [PATCH v2 14/14] phy: qcom-qmp-usb: drop power-down delay config Johan Hovold
2022-10-12 12:35 ` [PATCH v2 00/14] phy: qcom-qmp: further prep cleanups Johan Hovold
2022-10-28 12:12 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221012081241.18273-5-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=kishon@ti.com \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).