aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2024-08-06 17:55:48 +0200
committerVinod Koul <vkoul@kernel.org>2024-08-29 23:48:51 +0530
commit7f7315db3d262298ab33d198d3f0b09cabfa7b6b (patch)
tree6f75218183146208cc0e9312f218f8df724add92
parentdt-bindings: phy: socionext,uniphier: add top-level constraints (diff)
downloadwireguard-linux-7f7315db3d262298ab33d198d3f0b09cabfa7b6b.tar.xz
wireguard-linux-7f7315db3d262298ab33d198d3f0b09cabfa7b6b.zip
phy: airoha: adjust initialization delay in airoha_pcie_phy_init()
Align phy-pcie initialization delay to the vendor sdk in airoha_pcie_phy_init routine and allow the hw to complete required configuration before proceeding Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/8af6f27857619f1e0dd227f08b8584ae8fb22fb2.1722959625.git.lorenzo@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/phy/phy-airoha-pcie.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/phy/phy-airoha-pcie.c b/drivers/phy/phy-airoha-pcie.c
index bd3edaa986c8..1e410eb41058 100644
--- a/drivers/phy/phy-airoha-pcie.c
+++ b/drivers/phy/phy-airoha-pcie.c
@@ -18,6 +18,9 @@
#define LEQ_LEN_CTRL_MAX_VAL 7
#define FREQ_LOCK_MAX_ATTEMPT 10
+/* PCIe-PHY initialization time in ms needed by the hw to complete */
+#define PHY_HW_INIT_TIME_MS 30
+
enum airoha_pcie_port_gen {
PCIE_PORT_GEN1 = 1,
PCIE_PORT_GEN2,
@@ -1181,7 +1184,8 @@ static int airoha_pcie_phy_init(struct phy *phy)
airoha_phy_pma1_set_bits(pcie_phy, REG_PCIE_PMA_SS_DA_XPON_PWDB0,
PCIE_DA_XPON_CDR_PR_PWDB);
- usleep_range(100, 200);
+ /* Wait for the PCIe PHY to complete initialization before returning */
+ msleep(PHY_HW_INIT_TIME_MS);
return 0;
}