Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2260998rwr; Fri, 21 Apr 2023 06:42:21 -0700 (PDT) X-Google-Smtp-Source: AKy350Zzgl7mgPA0NqD4gzETYgIFcRnPUYTiLGJpXNEUhMpkZXLg5nL+KnnyOuP6eBu+SLg6rFPp X-Received: by 2002:a17:902:da88:b0:1a2:175a:6153 with SMTP id j8-20020a170902da8800b001a2175a6153mr6445784plx.1.1682084541371; Fri, 21 Apr 2023 06:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682084541; cv=none; d=google.com; s=arc-20160816; b=UTfoc8W6RxmWpObun4LOA0ufwUjFvfh/eHNRxB96db3HF9ge715jw7D6E+4YIUw/Q4 rc3jzY7+KHy6F4aoXklR7VwsHfee+doWC+Za5YCWXvbqUDYjKrU+LAowX6GcDHUfsNkJ tlt/vnyChlN+CvgxzMD/MJepPYj2V8OlPqz9spFHKfFifNYYz0e0xjkO8GSPwzSZybpK 9Xtvg8/qCvlZE7/1UB4GkkHOpDve1VWV40E/M48Yn5NVLdhV+oNESPHoU4jMx65hV0Ja n1flW6VEbIfjvmIPVux109NQn2eqK/DbcOnJ5gRfs8opRYXepWlkIZuX2H1oylkb18q8 O1wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=J91yt9ZBueiLcdiAxGXxuwDz+kOd9xP2j2gF7v3lo1o=; b=Xg0yUym2vuMkjp96H31gQEWW1d6WT7H3XXJPiM3TB28U4ZVBxPY8cJq3CkOMq5/Dk0 6yi2Vtv9IXlC5It/1Fq6B2HSI2ph9Qe04+v00DSlnMTBazKFk8l1LDBnk6SnnRp1Ltac G+SKMfHshDEVkyNr2uhgfXjXbBoFS3UCjTdlW4a5X6ttc1TpoMxv/0mrlDXnYwrjxe4B u2AVB+y0V6UlPJQGoWRBcdswWwubj36x3OYpTO/0/aj49wnIDDKOzC0CpJXZ3AKO/ZtY LJ0qSHmUrtnKfrML/d9XPKQFFc9MEhVKsRfXHZpNkbTH+FlXgG7oYPGfebCXwxztrYi1 TNLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nNF1Jz04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020a170902ec8f00b001a217a73d56si4926759plg.161.2023.04.21.06.42.07; Fri, 21 Apr 2023 06:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nNF1Jz04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232539AbjDUNlG (ORCPT + 99 others); Fri, 21 Apr 2023 09:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232447AbjDUNk7 (ORCPT ); Fri, 21 Apr 2023 09:40:59 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF7DB125BF; Fri, 21 Apr 2023 06:40:43 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33LD9H2X009635; Fri, 21 Apr 2023 13:40:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=J91yt9ZBueiLcdiAxGXxuwDz+kOd9xP2j2gF7v3lo1o=; b=nNF1Jz04b5Bn0OGDoAderPjYWslJrq2ITNpSm+L+aMLCCDBx7lQKgHMC1sn/coWkY7Ql G0+0ne45zfoh6w4Qb6AGfRSD6/PUfZjokhhosdTRn7Cf5z5bNVroiwS40/JqITf8uj6U 1MHWr1EI+T1Ku1fFuX6kjc/8364xKg4R07W3AlFYJEbjg/cQgPpBTad25NhxCXqItZl8 vOzJ0ZukgbWhFz9YgWza8jc72ovUz3Ds0OlNVbZAUWePH/sJ/Nl2B2i5UJWBPNpMyNob O71Bo2H+owkeePhFBt8GXyi+VIVmAqxAj1wDA0giTX0zbOzJyB56APqaZHQD/kbaTVxN kA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q3e34sm1m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Apr 2023 13:40:37 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33LDeaNt028544 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Apr 2023 13:40:36 GMT Received: from hu-shazhuss-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 21 Apr 2023 06:40:31 -0700 From: Shazad Hussain To: , , , CC: Shazad Hussain , Konrad Dybcio , Vinod Koul , "Kishon Vijay Abraham I" , Greg Kroah-Hartman , Wesley Cheng , , , , , Subject: [PATCH v1 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy Date: Fri, 21 Apr 2023 19:09:19 +0530 Message-ID: <20230421133922.8520-5-quic_shazhuss@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230421133922.8520-1-quic_shazhuss@quicinc.com> References: <20230421133922.8520-1-quic_shazhuss@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: KxfDOrGAkP6U6ocGGKp6-9uG9kUAvUEF X-Proofpoint-GUID: KxfDOrGAkP6U6ocGGKp6-9uG9kUAvUEF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-21_06,2023-04-21_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 clxscore=1015 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304210119 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SA8775P platform has 5nm USB3 UNI phy attached to the USB0 and USB1 controllers. Add QMP PHY config, pcs entries and support for the new compatible for SA8775P platform. Signed-off-by: Shazad Hussain --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c index a49711c5a63d..5c039bbbe036 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -1408,6 +1408,26 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG1, 0xc4), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG2, 0x89), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG3, 0x20), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG6, 0x13), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_EQ_CONFIG1, 0x4b), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_EQ_CONFIG5, 0x10), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), +}; + struct qmp_usb_offsets { u16 serdes; u16 pcs; @@ -1629,6 +1649,28 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { .has_phy_dp_com_ctrl = true, }; +static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = { + .lanes = 1, + + .offsets = &qmp_usb_offsets_v5, + + .serdes_tbl = sc8280xp_usb3_uniphy_serdes_tbl, + .serdes_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_serdes_tbl), + .tx_tbl = sc8280xp_usb3_uniphy_tx_tbl, + .tx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_tx_tbl), + .rx_tbl = sc8280xp_usb3_uniphy_rx_tbl, + .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), + .pcs_tbl = sa8775p_usb3_uniphy_pcs_tbl, + .pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl), + .clk_list = qmp_v4_phy_clk_l, + .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), + .reset_list = qcm2290_usb3phy_reset_l, + .num_resets = ARRAY_SIZE(qcm2290_usb3phy_reset_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), + .regs = qmp_v5_usb3phy_regs_layout, +}; + static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .lanes = 2, @@ -2597,6 +2639,9 @@ static const struct of_device_id qmp_usb_of_match_table[] = { }, { .compatible = "qcom,qcm2290-qmp-usb3-phy", .data = &qcm2290_usb3phy_cfg, + }, { + .compatible = "qcom,sa8775p-qmp-usb3-uni-phy", + .data = &sa8775p_usb3_uniphy_cfg, }, { .compatible = "qcom,sc7180-qmp-usb3-phy", .data = &sc7180_usb3phy_cfg, -- 2.17.1