From patchwork Tue Feb 15 19:19:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Maheswaram X-Patchwork-Id: 543292 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BF76C433F5 for ; Tue, 15 Feb 2022 19:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbiBOTT6 (ORCPT ); Tue, 15 Feb 2022 14:19:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235134AbiBOTT4 (ORCPT ); Tue, 15 Feb 2022 14:19:56 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8305113DA1; Tue, 15 Feb 2022 11:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644952785; x=1676488785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=VqmqdFqQfU3ky6dw6FWZJiZ19fu4Cs3hMyuJyVnXJtE=; b=QEBlr7lBq/44ak8DiFXdk6jmuM5oDD9EIDLcp/+TgjqB70u2gT99ckGo 2TAp8hSxrhfGn9iZBFUY3VA4wNDSYxsYAoNkru1JSLPYj5zwRP1sywRNQ 6qZPvc7XeMiQ6e7djOcTtYAzTjerQ6/f0DONJMNZVLLezTcqYrXKja0pN M=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 15 Feb 2022 11:19:45 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 11:19:45 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 15 Feb 2022 11:19:44 -0800 Received: from c-sanm-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 15 Feb 2022 11:19:38 -0800 From: Sandeep Maheswaram To: Rob Herring , Krzysztof Kozlowski , Andy Gross , "Bjorn Andersson" , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Wesley Cheng , "Stephen Boyd" , Doug Anderson , "Matthias Kaehlcke" CC: , , , , , , , Sandeep Maheswaram Subject: [PATCH 1/3] dt-bindings: phy: qcom,usb-snps-femto-v2: Add phy override params bindings Date: Wed, 16 Feb 2022 00:49:13 +0530 Message-ID: <1644952755-15527-2-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644952755-15527-1-git-send-email-quic_c_sanm@quicinc.com> References: <1644952755-15527-1-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add support for overriding SNPS phy tuning parameters in device tree bindings. Signed-off-by: Sandeep Maheswaram --- .../devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml b/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml index 0dfe691..44cf3bf 100644 --- a/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml @@ -50,6 +50,22 @@ properties: vdda33-supply: description: phandle to the regulator 3.3V supply node. + qcom,override_x0: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Override value for hs disconnect and squelch detector threshold. + + qcom,override_x1: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Override value for hs amplitude, pre-emphasis duration and amplitude. + + qcom,override_x2: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Override value for hs rise/fall time, cross over voltage, output impedance. + + qcom,override_x3: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Override value for ls/fs output impedance. + required: - compatible - reg From patchwork Tue Feb 15 19:19:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Maheswaram X-Patchwork-Id: 542988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 169CAC433FE for ; Tue, 15 Feb 2022 19:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243699AbiBOTUi (ORCPT ); Tue, 15 Feb 2022 14:20:38 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243649AbiBOTUZ (ORCPT ); Tue, 15 Feb 2022 14:20:25 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E12811596B; Tue, 15 Feb 2022 11:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644952792; x=1676488792; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=+c/sAVWbL+FsYmpW5HTm4iUSXm3Ddt3ihcr9mqI4b2I=; b=fnPR4MITCOhMyOaujZ3EGk7wJQqit/7QW84jqPttvsV+R8XO9acRWROD bqcQdpFmcfXLo8rSc8OSxsV4HAxOCb5r3gtRXsMgj7T1+4bJvBKj0mhwm 9naGo38xxdZKMOmiD1yjdRXrJTjk1ESjCKhMRUClt8hYZtZzEyT4Ol3gf U=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 15 Feb 2022 11:19:51 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 11:19:50 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 15 Feb 2022 11:19:50 -0800 Received: from c-sanm-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 15 Feb 2022 11:19:44 -0800 From: Sandeep Maheswaram To: Rob Herring , Krzysztof Kozlowski , Andy Gross , "Bjorn Andersson" , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Wesley Cheng , "Stephen Boyd" , Doug Anderson , "Matthias Kaehlcke" CC: , , , , , , , Sandeep Maheswaram Subject: [PATCH 2/3] phy: qcom-snps: Add support for overriding phy tuning parameters Date: Wed, 16 Feb 2022 00:49:14 +0530 Message-ID: <1644952755-15527-3-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644952755-15527-1-git-send-email-quic_c_sanm@quicinc.com> References: <1644952755-15527-1-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Added support for overriding x0,x1,x2,x3 params for SNPS PHY. Signed-off-by: Sandeep Maheswaram --- drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c index 7e61202..3cf90fa 100644 --- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c @@ -51,6 +51,12 @@ #define USB2_SUSPEND_N BIT(2) #define USB2_SUSPEND_N_SEL BIT(3) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X0 (0x6c) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X1 (0x70) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X2 (0x74) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X3 (0x78) +#define PARAM_OVRD_MASK 0xFF + #define USB2_PHY_USB_PHY_CFG0 (0x94) #define UTMI_PHY_DATAPATH_CTRL_OVERRIDE_EN BIT(0) #define UTMI_PHY_CMN_CTRL_OVERRIDE_EN BIT(1) @@ -90,6 +96,11 @@ struct qcom_snps_hsphy { bool phy_initialized; enum phy_mode mode; + + u8 override_x0; + u8 override_x1; + u8 override_x2; + u8 override_x3; }; static inline void qcom_snps_hsphy_write_mask(void __iomem *base, u32 offset, @@ -222,6 +233,19 @@ static int qcom_snps_hsphy_init(struct phy *phy) qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_CTRL1, VBUSVLDEXT0, VBUSVLDEXT0); + if (hsphy->override_x0) + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X0, + PARAM_OVRD_MASK, hsphy->override_x0); + if (hsphy->override_x1) + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X1, + PARAM_OVRD_MASK, hsphy->override_x1); + if (hsphy->override_x2) + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X2, + PARAM_OVRD_MASK, hsphy->override_x2); + if (hsphy->override_x3) + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X3, + PARAM_OVRD_MASK, hsphy->override_x3); + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2, VREGBYPASS, VREGBYPASS); @@ -294,6 +318,7 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev) struct phy *generic_phy; int ret, i; int num; + u32 value; hsphy = devm_kzalloc(dev, sizeof(*hsphy), GFP_KERNEL); if (!hsphy) @@ -329,6 +354,26 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev) return ret; } + if (!of_property_read_u32(dev->of_node, "qcom,override_x0", + &value)) { + hsphy->override_x0 = (u8)value; + } + + if (!of_property_read_u32(dev->of_node, "qcom,override_x1", + &value)) { + hsphy->override_x1 = (u8)value; + } + + if (!of_property_read_u32(dev->of_node, "qcom,override_x2", + &value)) { + hsphy->override_x2 = (u8)value; + } + + if (!of_property_read_u32(dev->of_node, "qcom,override_x3", + &value)) { + hsphy->override_x3 = (u8)value; + } + pm_runtime_set_active(dev); pm_runtime_enable(dev); /* From patchwork Tue Feb 15 19:19:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Maheswaram X-Patchwork-Id: 543291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6D72C4332F for ; Tue, 15 Feb 2022 19:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232243AbiBOTU5 (ORCPT ); Tue, 15 Feb 2022 14:20:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233127AbiBOTUf (ORCPT ); Tue, 15 Feb 2022 14:20:35 -0500 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C10811629F; Tue, 15 Feb 2022 11:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644952797; x=1676488797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=XeefgcZDdJ2Av5SJ7ak6HNuzzyBwctIrJ52GfpLMZV0=; b=jSTAsHhtnNtD2G9WE/4V0V65i7INdF8sgGzG2zvePhYtQnvDooR2SMAJ R7FkXTqOiksM03XTst98yOmthW5q64FEZuUPH4DzJZLKtlqkFnPrsd0DF Jdm1oOBmMKkg7uLDUI45TdBY4BzO8x+rdD3WyJqIvWr001xikGO47HIWh s=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 15 Feb 2022 11:19:57 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 11:19:56 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 15 Feb 2022 11:19:56 -0800 Received: from c-sanm-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 15 Feb 2022 11:19:50 -0800 From: Sandeep Maheswaram To: Rob Herring , Krzysztof Kozlowski , Andy Gross , "Bjorn Andersson" , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Wesley Cheng , "Stephen Boyd" , Doug Anderson , "Matthias Kaehlcke" CC: , , , , , , , Sandeep Maheswaram Subject: [PATCH 3/3] arm64: dts: qcom: sc7280: Update SNPS Phy params for SC7280 IDP device Date: Wed, 16 Feb 2022 00:49:15 +0530 Message-ID: <1644952755-15527-4-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644952755-15527-1-git-send-email-quic_c_sanm@quicinc.com> References: <1644952755-15527-1-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Overriding the SNPS Phy tuning parameters for SC7280 IDP device. Signed-off-by: Sandeep Maheswaram --- arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi index ecbf2b8..88ca9d5 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi @@ -317,6 +317,10 @@ vdda-pll-supply = <&vreg_l10c_0p8>; vdda33-supply = <&vreg_l2b_3p0>; vdda18-supply = <&vreg_l1c_1p8>; + qcom,override_x0 = <0xe6>; + qcom,override_x1 = <0x8b>; + qcom,override_x2 = <0x16>; + qcom,override_x3 = <0x03>; }; &usb_1_qmpphy {