From patchwork Tue Jan 16 01:10:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 763434 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 334F220DC4 for ; Tue, 16 Jan 2024 01:11:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="j/zy1lKo" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2cd1232a2c7so114465451fa.0 for ; Mon, 15 Jan 2024 17:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705367475; x=1705972275; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gvN59bcYauRfvTOIrHhbS9eyPkcywNo1pcI7+S2IrzY=; b=j/zy1lKoC1/gagk5pDKFAw5MLV/6MyDL7TP8kOQ90fixb5l73JYMqUbXclHRCZIez9 Rx71a71VfmTSKTprTPiihzHmSJusqLZWxR0G+2WxtKwyoG+GKtYdQwVvzquduqqGTcaB M3Vr9NcdX48YYXR2uYOBrTOnnevAgYyFsDVx6I9dFHWZS08yAuX04M+rhWZCgIlYvaZm ssKrylNep5YarWeg81M8uyFjOftu7cotLMCgOVcaaGgHm2QvfKn3+wyeQxV0pk6I6JAo MHwswcEXrhx+Vv9+tIZbs1+Kzm5gDDh0anoGP3B1pslMOp0n4VQx0FkY8OImio5xs76q RBRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705367475; x=1705972275; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gvN59bcYauRfvTOIrHhbS9eyPkcywNo1pcI7+S2IrzY=; b=HFCgLexybXeH/zwijwGlnHwg1+FH3xHBI9zry/PiQQy6pkd89ZxE0YQXpqv/+j2YXF oiCSYnqNpw/Ee+OCs4viz2lsPv3e0auh053XLgcl/80DTm8x53VknGRiMeMD/rvCUVyb 3Qad9j4QG9czJt69Ra+rX7t7Zk8LaftzkiDE3bfby5KopLIOGWt9MrU+zvXF8GV3jxq0 Kk9RCUjMpk8b74uRAjtSepQsHq1XUUkMSd02t+rrMCVJ9KlJbXBqSA5E6npkcdStCOK6 wM2gIBF9YRfm7ZnmLmphV5yiQFgonuBrYWI2wr4cDZcBznhCYJfgNsDmJXuynqW/ifGh xG/g== X-Gm-Message-State: AOJu0YxYaqUWPvS/JfJFcETqHiOxVSN7Z0SbhBFcYEQzRGVEzRZi9Xxy +Wefrygi7dtQWcveH6SCOx3paP2Jn0DmtQ== X-Google-Smtp-Source: AGHT+IHuLop8vp8Yhjr/JyMmyHuy4+5jnRd9Vu0nqA3dQer4A3K45OZgXQ7xEchn2oUM8YV8FCOdcw== X-Received: by 2002:a2e:83cd:0:b0:2cd:7ac4:f9b7 with SMTP id s13-20020a2e83cd000000b002cd7ac4f9b7mr2863336ljh.4.1705367475387; Mon, 15 Jan 2024 17:11:15 -0800 (PST) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q15-20020a2e84cf000000b002cc7a2f7a9asm1513414ljh.98.2024.01.15.17.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 17:11:15 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 16 Jan 2024 03:10:55 +0200 Subject: [PATCH 1/4] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: support SDM660 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240116-sdm660-usb3-support-v1-1-2fbd683aea77@linaro.org> References: <20240116-sdm660-usb3-support-v1-0-2fbd683aea77@linaro.org> In-Reply-To: <20240116-sdm660-usb3-support-v1-0-2fbd683aea77@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1027; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=zYn9443fSl+U0zoJ7ooRMTFtK4x8618NHGGtAH7cW2Y=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ+rS6xs/CbF+t0hhSvU6EK225eV1lyWcPFNdmVq2n3eOU mMMmyTYyWjMwsDIxSArpsjiU9AyNWZTctiHHVPrYQaxMoFMYeDiFICJyE7gYFh0Ysm3Hxr/Tnzu npB5fDm/tLdHwd9sW44/T/UEt2zi+m7IXFb6J0lxtW2lyOL1m+KK1Rs4qxobzViyb5Yqd67ju10 9N9zUzL57fc8a5rjUxmX5L8SVjCexPbiVr3TPK+5d1ssfia2Z+aw729oDkwuST7UmCjom81We95 /KdOBO9wGd/9k/z4VvW3uv+a1g4B2Zux4s06QWTXvr3Js2i2Vyz0SzyWG7H5gunMUQcXLdhd9qJ kXyW7ueKp4U7HRcafCI/2SjEw93W+yMJ3b9PRLmKVeuf2p8lHT2MJNpY2nTN8N+b45ddp4tGeuW HlFbk7xk0R5WTg2Bh6FOR1bvvMKwzqyHaWKBkLFBceZxAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Declare the USB-C QMP PHY present on the Qualcomm SDM660 / SDM630 platforms. Signed-off-by: Dmitry Baryshkov --- Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml index 140843347d1e..f1f4e4f83352 100644 --- a/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml @@ -18,6 +18,7 @@ properties: enum: - qcom,msm8998-qmp-usb3-phy - qcom,qcm2290-qmp-usb3-phy + - qcom,sdm660-qmp-usb3-phy - qcom,sm6115-qmp-usb3-phy reg: @@ -95,6 +96,7 @@ allOf: contains: enum: - qcom,msm8998-qmp-usb3-phy + - qcom,sdm660-qmp-usb3-phy then: properties: clocks: From patchwork Tue Jan 16 01:10:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 763433 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEC9D20DCE for ; Tue, 16 Jan 2024 01:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZGtM+g3E" Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2cd2f472665so97906891fa.2 for ; Mon, 15 Jan 2024 17:11:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705367477; x=1705972277; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RStsOu+xacQMgJbS/MXyR2aPxlxf4VUezrxj/3wNsBo=; b=ZGtM+g3EZe7jEsisf1riGT5iM06fUtIRW/nD2vbvNQV+Q0FnOCg3IBF0rAqo1LyE92 t8rmiu4QpIZ3faUsa8U/GHwyA9kHMg1q0OxZTPgUCFkWRB8NyfknQs1y4bWmj0B+8zP9 sTyXancP0tecfLfluncGzb6sgge04uv44TUhcSd/zzOhuOlaIRlczQiKdMl3AkCp7TTs G+JbmUwL7F6ifJtXxHexuZzr5tMX6OEdg1RwIDGbDau8TivjF+ORqBiQeuqbmAlYIZJJ 5wns+SHS6Bw2Fql2HyxrHQrTDMKeLWV8LGY2DjY/NJCtDxYq3qbjK2WhQVxWqDc24KIx qKEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705367477; x=1705972277; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RStsOu+xacQMgJbS/MXyR2aPxlxf4VUezrxj/3wNsBo=; b=WlKF2GjP+j7bJ8VQsawlT68cU8JGog3ovyKGZjpklm9RMYYIF2kmyzNxQutQOp6/x/ qwpcJDxczfpBJsm9XHAhEdbAIXoCLkNMxITEA9ZHhh8vYg0Sg72ZEhHw8Me7jQ792cUV 0MPUWj9W9TExBIONGN+XkQAjLVdPP3pwau/Mm1LeO3KE+e+igDzTipbiHRw4/V9IAnEg VFoax3VIsFR6qiZDTZOYuYE/vV+sO+XsYv4gCLWCAppaVAya8JE7K+c/4b/nU/wtPmNu ZQOs1yQTcrby1/Re5YfyHGa0DOHt9KRgfWY5UxUHAmCDtGb/0EAGf84codcerscRiNN4 s1vw== X-Gm-Message-State: AOJu0Yzp5hIiKcRaekpezSW1A+pCtolqY4dJiQdLyXL53HPnj3JXwICZ GHLb0CtvAQY+AgwVUYzLVUBChmNtcL7G0g== X-Google-Smtp-Source: AGHT+IF9QTTC5raiMne+yAWfQBinTWrTQZS+iMZiQlovjnYcHgehvOq/I4moxnNElTukvTobtkTSNg== X-Received: by 2002:a2e:8e68:0:b0:2cc:6d87:9a91 with SMTP id t8-20020a2e8e68000000b002cc6d879a91mr2614457ljk.72.1705367477059; Mon, 15 Jan 2024 17:11:17 -0800 (PST) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q15-20020a2e84cf000000b002cc7a2f7a9asm1513414ljh.98.2024.01.15.17.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 17:11:16 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 16 Jan 2024 03:10:57 +0200 Subject: [PATCH 3/4] arm64: dts: qcom: sdm630: add USB QMP PHY support Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240116-sdm660-usb3-support-v1-3-2fbd683aea77@linaro.org> References: <20240116-sdm660-usb3-support-v1-0-2fbd683aea77@linaro.org> In-Reply-To: <20240116-sdm660-usb3-support-v1-0-2fbd683aea77@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=4024; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=vROuTM9nsbcJ2159YURKAEnKyZKiaf/PSfxNouUCVmU=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBlpdex4RZUyTpfyKAR0l1z9mtwjfi8RAfh3fnpQ i2EL6HKaaSJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZaXXsQAKCRCLPIo+Aiko 1RL9B/4q7I8AvvEE5rhJD8I+RlFZpuAGL8KtxWu/fIt3Mi7wRKBiALt44Pk/zwNDYTCG1sfCKLH xDl6ESkv7X5HGAqUwszMQ2qZL/s+lb2Zi5gM7Q2g6qT1MuWK/Wf1El8a9e03GSmUI6zZzOi7cYu THZTZY4eyWYEnJt5oo1mfj9dqAI3cMxFamNheWkzzq4FLo4jokTo/yTGCMh+JAfzwvN7B7lomCo doPShrWy5ZUX3Kym+yimdeEdatoW8XE3s0YTCGVl3ivVugDW7F9iskso+RMf9bsHG7IKxEw9b04 mCWxg7B8S/fM8Izmn52q4SgOOYR0O78KC7sG2wWIo8aALEpi X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Define USB3 QMP PHY presend on the SDM630 / SDM660 platforms. Enable it by default in the USB3 host, but (for compatibility), force USB 2.0 mode for all defined boards. The boards should opt-in to enable USB 3.0 support. Signed-off-by: Dmitry Baryshkov --- .../arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts | 6 ++++ .../boot/dts/qcom/sdm630-sony-xperia-nile.dtsi | 6 ++++ arch/arm64/boot/dts/qcom/sdm630.dtsi | 36 +++++++++++++++++----- .../arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 6 ++++ 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts index 2ed39d402d3f..90118f133961 100644 --- a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts +++ b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts @@ -454,10 +454,16 @@ &usb2_dwc3 { }; &usb3 { + qcom,select-utmi-as-pipe-clk; + status = "okay"; }; &usb3_dwc3 { + maximum-speed = "high-speed"; + phys = <&qusb2phy0>; + phy-names = "usb2-phy"; + dr_mode = "peripheral"; extcon = <&extcon_usb>; }; diff --git a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi index 87d0293c728d..f06a9f0cf97c 100644 --- a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi @@ -658,10 +658,16 @@ cam_vdig_default: cam-vdig-default-state { }; &usb3 { + qcom,select-utmi-as-pipe-clk; + status = "okay"; }; &usb3_dwc3 { + maximum-speed = "high-speed"; + phys = <&qusb2phy0>; + phy-names = "usb2-phy"; + dr_mode = "peripheral"; extcon = <&extcon_usb>; }; diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi index 513fe5e76b68..28489fb58b20 100644 --- a/arch/arm64/boot/dts/qcom/sdm630.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi @@ -1286,7 +1286,6 @@ usb3: usb@a8f8800 { interrupt-names = "hs_phy_irq", "ss_phy_irq"; power-domains = <&gcc USB_30_GDSC>; - qcom,select-utmi-as-pipe-clk; resets = <&gcc GCC_USB_30_BCR>; @@ -1297,17 +1296,38 @@ usb3_dwc3: usb@a800000 { snps,dis_u2_susphy_quirk; snps,dis_enblslpm_quirk; - /* - * SDM630 technically supports USB3 but I - * haven't seen any devices making use of it. - */ - maximum-speed = "high-speed"; - phys = <&qusb2phy0>; - phy-names = "usb2-phy"; + phys = <&qusb2phy0>, <&usb3_qmpphy>; + phy-names = "usb2-phy", "usb3-phy"; snps,hird-threshold = /bits/ 8 <0>; }; }; + usb3_qmpphy: phy@c010000 { + compatible = "qcom,sdm660-qmp-usb3-phy"; + reg = <0x0c010000 0x1000>; + + clocks = <&gcc GCC_USB3_PHY_AUX_CLK>, + <&gcc GCC_USB3_CLKREF_CLK>, + <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_USB3_PHY_PIPE_CLK>; + clock-names = "aux", + "ref", + "cfg_ahb", + "pipe"; + clock-output-names = "usb3_phy_pipe_clk_src"; + #clock-cells = <0>; + #phy-cells = <0>; + + resets = <&gcc GCC_USB3_PHY_BCR>, + <&gcc GCC_USB3PHY_PHY_BCR>; + reset-names = "phy", + "phy_phy"; + + qcom,tcsr-reg = <&tcsr_regs_1 0x6b244>; + + status = "disabled"; + }; + qusb2phy0: phy@c012000 { compatible = "qcom,sdm660-qusb2-phy"; reg = <0x0c012000 0x180>; diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts index 3c47410ba94c..7167f75bced3 100644 --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts @@ -413,10 +413,16 @@ &tlmm { }; &usb3 { + qcom,select-utmi-as-pipe-clk; + status = "okay"; }; &usb3_dwc3 { + maximum-speed = "high-speed"; + phys = <&qusb2phy0>; + phy-names = "usb2-phy"; + dr_mode = "peripheral"; extcon = <&extcon_usb>; };