Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lorenzo Bianconi and committed by
Vinod Koul
7f7315db 45a4237b

+5 -1
+5 -1
drivers/phy/phy-airoha-pcie.c
··· 18 18 #define LEQ_LEN_CTRL_MAX_VAL 7 19 19 #define FREQ_LOCK_MAX_ATTEMPT 10 20 20 21 + /* PCIe-PHY initialization time in ms needed by the hw to complete */ 22 + #define PHY_HW_INIT_TIME_MS 30 23 + 21 24 enum airoha_pcie_port_gen { 22 25 PCIE_PORT_GEN1 = 1, 23 26 PCIE_PORT_GEN2, ··· 1184 1181 airoha_phy_pma1_set_bits(pcie_phy, REG_PCIE_PMA_SS_DA_XPON_PWDB0, 1185 1182 PCIE_DA_XPON_CDR_PR_PWDB); 1186 1183 1187 - usleep_range(100, 200); 1184 + /* Wait for the PCIe PHY to complete initialization before returning */ 1185 + msleep(PHY_HW_INIT_TIME_MS); 1188 1186 1189 1187 return 0; 1190 1188 }