Commit f8b64114 authored by Johan Hovold's avatar Johan Hovold Committed by Vinod Koul
Browse files

phy: qcom-qmp-pcie: clean up PHY lane init



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.

Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221105145939.20318-8-johan+linaro@kernel.org


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 63bf101a
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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)