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

phy: qcom-qusb2: add QUSB2 support for IPQ6018

Add the phy init sequence for the Super Speed ports found
on IPQ6018.

Signed-off-by: Kathiravan T <kathirav@codeaurora.org>
[baruch: add ipq6018_regs_layout[], drop binding change]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Link: https://lore.kernel.org/r/b8c22dddf1f70d89e135fe1ae705ddc68e295ebb.1611756920.git.baruch@tkos.co.il
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Kathiravan T and committed by
Vinod Koul
2cfbe676 4d1a6404

+44
+44
drivers/phy/qualcomm/phy-qcom-qusb2.c
··· 22 22 23 23 #include <dt-bindings/phy/phy-qcom-qusb2.h> 24 24 25 + #define QUSB2PHY_PLL 0x0 25 26 #define QUSB2PHY_PLL_TEST 0x04 26 27 #define CLK_REF_SEL BIT(7) 27 28 ··· 134 133 QUSB2PHY_PORT_TEST2, 135 134 QUSB2PHY_PORT_POWERDOWN, 136 135 QUSB2PHY_INTR_CTRL, 136 + }; 137 + 138 + static const struct qusb2_phy_init_tbl ipq6018_init_tbl[] = { 139 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL, 0x14), 140 + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE1, 0xF8), 141 + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0xB3), 142 + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE3, 0x83), 143 + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE4, 0xC0), 144 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_TUNE, 0x30), 145 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_USER_CTL1, 0x79), 146 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_USER_CTL2, 0x21), 147 + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE5, 0x00), 148 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00), 149 + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TEST2, 0x14), 150 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_TEST, 0x80), 151 + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_AUTOPGM_CTL1, 0x9F), 152 + }; 153 + 154 + static const unsigned int ipq6018_regs_layout[] = { 155 + [QUSB2PHY_PLL_STATUS] = 0x38, 156 + [QUSB2PHY_PORT_TUNE1] = 0x80, 157 + [QUSB2PHY_PORT_TUNE2] = 0x84, 158 + [QUSB2PHY_PORT_TUNE3] = 0x88, 159 + [QUSB2PHY_PORT_TUNE4] = 0x8C, 160 + [QUSB2PHY_PORT_TUNE5] = 0x90, 161 + [QUSB2PHY_PORT_TEST1] = 0x98, 162 + [QUSB2PHY_PORT_TEST2] = 0x9C, 163 + [QUSB2PHY_PORT_POWERDOWN] = 0xB4, 164 + [QUSB2PHY_INTR_CTRL] = 0xBC, 137 165 }; 138 166 139 167 static const unsigned int msm8996_regs_layout[] = { ··· 303 273 .se_clk_scheme_default = true, 304 274 .autoresume_en = BIT(0), 305 275 .update_tune1_with_efuse = true, 276 + }; 277 + 278 + static const struct qusb2_phy_cfg ipq6018_phy_cfg = { 279 + .tbl = ipq6018_init_tbl, 280 + .tbl_num = ARRAY_SIZE(ipq6018_init_tbl), 281 + .regs = ipq6018_regs_layout, 282 + 283 + .disable_ctrl = POWER_DOWN, 284 + .mask_core_ready = PLL_LOCKED, 285 + /* autoresume not used */ 286 + .autoresume_en = BIT(0), 306 287 }; 307 288 308 289 static const struct qusb2_phy_cfg qusb2_v2_phy_cfg = { ··· 874 833 875 834 static const struct of_device_id qusb2_phy_of_match_table[] = { 876 835 { 836 + .compatible = "qcom,ipq6018-qusb2-phy", 837 + .data = &ipq6018_phy_cfg, 838 + }, { 877 839 .compatible = "qcom,ipq8074-qusb2-phy", 878 840 .data = &msm8996_phy_cfg, 879 841 }, {