Message ID | 1b48e737aa14f5b5539cbf04d473182121d5b1ad.1686126439.git.quic_varada@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp173006vqr; Wed, 7 Jun 2023 04:08:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IkLn5GX8lqIA58gt7OHCaM0ABDy5rwicxmE/ky9Pzi39NQWdDTsGxeyJNKAjGhSwsbAW8 X-Received: by 2002:a92:c52d:0:b0:338:bcd8:933c with SMTP id m13-20020a92c52d000000b00338bcd8933cmr4798785ili.21.1686136126046; Wed, 07 Jun 2023 04:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686136126; cv=none; d=google.com; s=arc-20160816; b=uNontByMa5N1fcVFvzNPzKccS7h8GdfhZCVEevV5zCHRWazOF2tUzYcGvHdoVcYFwF 7Kby/Wa6Sv6dh6R/6cVRoS9B6MptSN+PnQp2i5k7Pb9tULrNkKaXTlhK6Qw8VyLTcpDH nxCTGHRdqnpFUlv3FXy5AuJdQkbOt6pvFT1gW6fnIBAQDMNTRE+dGfeSBn/5zhY9TvuC KdwejrD39gIguu9OFo5FgyNzUDRLmo2LpdgePByOaABUvzCtYkdxPHM8Hn5RFFafiAxa uzv7NxXDMDH/S0+K/SzuTpfKCHcwQ5rs5tyB91sO6Tp+VUwPzimhDLZT0CJs9En0KE7I /+lg== 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=6+Brloyw+/LWMk2UGIbQJRX8f8AAjIfvA4t4+7wtWm8=; b=ZCyga8mLhkUMxtWTWODIANjQVeQ1T8AGOIZYXxIEd+xKa/L4ZZO2KUpCWmPi8F3Wbi cnNKrLEq3AIBj7wHfTLG2zmIWxI8/7mrBq4af6UPyR5AnmicdnnLO/JVMjCfv+z1xzg2 C65z1zrYwUo0XmZbl8NlQ+WOjimKb8VarUpvKiesyy1Yha7RVN8zOeZVCClfmcvbosNU FLm5vQnmWADcFGy3OexouT72jXF7IifhhrUrufcFwhxoqxxXZJBVxyNUgJK58y/4nsK1 Khy0aDaMyuPYV4VspeQM8crBcsZRAg9cJjc2jixEyBNdFNAFP8pTf8xNVFBIi1Uqlc/W zOwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=T2UUnjvu; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l186-20020a6388c3000000b0050bd4b86169si564673pgd.414.2023.06.07.04.08.21; Wed, 07 Jun 2023 04:08:46 -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=T2UUnjvu; 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 S239212AbjFGLAy (ORCPT <rfc822;literming00@gmail.com> + 99 others); Wed, 7 Jun 2023 07:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240581AbjFGLAU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Jun 2023 07:00:20 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BC112103; Wed, 7 Jun 2023 03:59:06 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 357AV1RF015795; Wed, 7 Jun 2023 10:57:33 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=6+Brloyw+/LWMk2UGIbQJRX8f8AAjIfvA4t4+7wtWm8=; b=T2UUnjvuBEImEWyu+B47ZByWIWn3/pBSrRrwF57lRPJHh4SpOHnaaiGtwU0bSS1vHD8H mOO55n/jJf4BjEZqoRDojXio4NTk9wSuZ4ISv1OgDwDmeTbFHMi8/vAHCwN6BZqjkPTL BLuXW6kLAy0rm0Z7aDSlXLo5XVwb+cw57LNKYBng15HX7BZw5rweuoQhGWhxpMhrip8W ouMXpX+mHJZbubVfJrFAjNHvRfuDhse+5Pukjl/pDhYDozc5lT48cidnwsEEWqgXEiyg LVLIS7pV3ROWIxXSC1z018m0EWvc3cor1MX4eebsUGj+9TSRIqhr96rNpusg+jhCGmPX Tg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3r2a769kyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jun 2023 10:57:32 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 357AvVcs007553 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Jun 2023 10:57:31 GMT Received: from varda-linux.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Wed, 7 Jun 2023 03:57:22 -0700 From: Varadarajan Narayanan <quic_varada@quicinc.com> To: <agross@kernel.org>, <andersson@kernel.org>, <konrad.dybcio@linaro.org>, <vkoul@kernel.org>, <kishon@kernel.org>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <gregkh@linuxfoundation.org>, <catalin.marinas@arm.com>, <will@kernel.org>, <mturquette@baylibre.com>, <sboyd@kernel.org>, <p.zabel@pengutronix.de>, <arnd@arndb.de>, <geert+renesas@glider.be>, <neil.armstrong@linaro.org>, <nfraprado@collabora.com>, <broonie@kernel.org>, <rafal@milecki.pl>, <quic_srichara@quicinc.com>, <quic_varada@quicinc.org>, <quic_wcheng@quicinc.com>, <linux-arm-msm@vger.kernel.org>, <linux-phy@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-clk@vger.kernel.org> CC: Varadarajan Narayanan <quic_varada@quicinc.com> Subject: [PATCH 7/9] arm64: dts: qcom: ipq5332: Add USB related nodes Date: Wed, 7 Jun 2023 16:26:11 +0530 Message-ID: <1b48e737aa14f5b5539cbf04d473182121d5b1ad.1686126439.git.quic_varada@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <cover.1686126439.git.quic_varada@quicinc.com> References: <cover.1686126439.git.quic_varada@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: wGiNh1LmL-Dy0sEa44e8UYzQmKaTnO7f X-Proofpoint-GUID: wGiNh1LmL-Dy0sEa44e8UYzQmKaTnO7f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-07_06,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxlogscore=831 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306070089 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768041874780637795?= X-GMAIL-MSGID: =?utf-8?q?1768041874780637795?= |
Series |
Enable IPQ5332 USB2
|
|
Commit Message
Varadarajan Narayanan
June 7, 2023, 10:56 a.m. UTC
Add USB phy and controller nodes
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
Comments
On 07/06/2023 13:56, Varadarajan Narayanan wrote: > Add USB phy and controller nodes > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > --- > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > index c2d6cc65..3183357 100644 > --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi > +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > @@ -383,6 +383,61 @@ > status = "disabled"; > }; > }; > + > + usb_0_m31phy: hs_m31phy@7b000 { > + compatible = "qcom,ipq5332-m31-usb-hsphy"; > + reg = <0x0007b000 0x12C>, > + <0x08af8800 0x400>; > + reg-names = "m31usb_phy_base", > + "qscratch_base"; > + phy_type= "utmi"; > + > + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; > + reset-names = "usb2_phy_reset"; > + > + status = "okay"; > + }; > + > + usb2: usb2@8a00000 { > + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + > + reg = <0x08af8800 0x100>; > + > + clocks = <&gcc GCC_USB0_MASTER_CLK>, > + <&gcc GCC_SNOC_USB_CLK>, > + <&gcc GCC_USB0_SLEEP_CLK>, > + <&gcc GCC_USB0_MOCK_UTMI_CLK>; Please indent these values. > + > + clock-names = "core", > + "iface", > + "sleep", > + "mock_utmi"; Please indent these values. > + > + interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; No PHY IRQs? > + interrupt-names = "pwr_event"; > + > + resets = <&gcc GCC_USB_BCR>; > + > + qcom,select-utmi-as-pipe-clk; > + > + usb2_0_dwc: usb@8a00000 { > + compatible = "snps,dwc3"; > + reg = <0x08a00000 0xe000>; > + clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; > + clock-names = "ref"; > + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; > + usb-phy = <&usb_0_m31phy>; > + tx-fifo-resize; > + snps,is-utmi-l1-suspend; > + snps,hird-threshold = /bits/ 8 <0x0>; > + snps,dis_u2_susphy_quirk; > + snps,dis_u3_susphy_quirk; > + snps,ref-clock-period-ns = <21>; > + }; > + }; > }; > > timer {
On 7.06.2023 12:56, Varadarajan Narayanan wrote: > Add USB phy and controller nodes > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > --- > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > index c2d6cc65..3183357 100644 > --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi > +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > @@ -383,6 +383,61 @@ > status = "disabled"; > }; > }; > + > + usb_0_m31phy: hs_m31phy@7b000 { > + compatible = "qcom,ipq5332-m31-usb-hsphy"; > + reg = <0x0007b000 0x12C>, random uppercase hex > + <0x08af8800 0x400>; > + reg-names = "m31usb_phy_base", > + "qscratch_base"; > + phy_type= "utmi"; Missing space before '=' > + > + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; > + reset-names = "usb2_phy_reset"; > + > + status = "okay"; If you're only defining the node, it's enabled by default In this case, you'd probably want to disable it by default. > + }; > + > + usb2: usb2@8a00000 { > + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; Please push these 3 properties to the end And add status = "disabled" below them. > + > + reg = <0x08af8800 0x100>; > + > + clocks = <&gcc GCC_USB0_MASTER_CLK>, > + <&gcc GCC_SNOC_USB_CLK>, > + <&gcc GCC_USB0_SLEEP_CLK>, > + <&gcc GCC_USB0_MOCK_UTMI_CLK>; > + Please remove this newline. > + clock-names = "core", > + "iface", > + "sleep", > + "mock_utmi"; Please align this, and all other similar lists. > + > + interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; interrupts-extended is unnecessary with just a single interrupt source.. you can make it `interrupts` and drop the GIC reference. It would also be nice to push the interrupt properties below 'reg'. We're working on documenting and automating checking the preferred property order. > + interrupt-names = "pwr_event"; > + > + resets = <&gcc GCC_USB_BCR>; > + > + qcom,select-utmi-as-pipe-clk; > + > + usb2_0_dwc: usb@8a00000 { > + compatible = "snps,dwc3"; > + reg = <0x08a00000 0xe000>; > + clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; > + clock-names = "ref"; > + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; > + usb-phy = <&usb_0_m31phy>; > + tx-fifo-resize; > + snps,is-utmi-l1-suspend; > + snps,hird-threshold = /bits/ 8 <0x0>; > + snps,dis_u2_susphy_quirk; > + snps,dis_u3_susphy_quirk; > + snps,ref-clock-period-ns = <21>; 1/21 is 0.0476.. that doesn't seem to correspond to the ref clk frequency? Konrad > + }; > + }; > }; > > timer {
On 07/06/2023 12:56, Varadarajan Narayanan wrote: > Add USB phy and controller nodes > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > --- > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > index c2d6cc65..3183357 100644 > --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi > +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > @@ -383,6 +383,61 @@ > status = "disabled"; > }; > }; > + > + usb_0_m31phy: hs_m31phy@7b000 { Node names should be generic. See also explanation and list of examples in DT specification: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation > + compatible = "qcom,ipq5332-m31-usb-hsphy"; > + reg = <0x0007b000 0x12C>, > + <0x08af8800 0x400>; Lowercase hex only. > + reg-names = "m31usb_phy_base", > + "qscratch_base"; > + phy_type= "utmi"; > + > + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; > + reset-names = "usb2_phy_reset"; > + > + status = "okay"; It's by default. Drop. > + }; > + > + usb2: usb2@8a00000 { It does not look like you tested the DTS against bindings. Please run `make dtbs_check` (see Documentation/devicetree/bindings/writing-schema.rst for instructions). Node names should be generic. See also explanation and list of examples in DT specification: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation > + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + > + reg = <0x08af8800 0x100>; reg is always after compatible. Ranges is third. Then you will spot that address is wrong. > + > + clocks = <&gcc GCC_USB0_MASTER_CLK>, > + <&gcc GCC_SNOC_USB_CLK>, > + <&gcc GCC_USB0_SLEEP_CLK>, > + <&gcc GCC_USB0_MOCK_UTMI_CLK>; Fix alignment. > + > + clock-names = "core", > + "iface", > + "sleep", > + "mock_utmi"; Fix alignment. > + > + interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names = "pwr_event"; > + Best regards, Krzysztof
On Wed, Jun 07, 2023 at 02:23:20PM +0300, Dmitry Baryshkov wrote: > On 07/06/2023 13:56, Varadarajan Narayanan wrote: > >Add USB phy and controller nodes > > > >Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > >--- > > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ > > 1 file changed, 55 insertions(+) > > > >diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > >index c2d6cc65..3183357 100644 > >--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi > >+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > >@@ -383,6 +383,61 @@ > > status = "disabled"; > > }; > > }; > >+ > >+ usb_0_m31phy: hs_m31phy@7b000 { > >+ compatible = "qcom,ipq5332-m31-usb-hsphy"; > >+ reg = <0x0007b000 0x12C>, > >+ <0x08af8800 0x400>; > >+ reg-names = "m31usb_phy_base", > >+ "qscratch_base"; > >+ phy_type= "utmi"; > >+ > >+ resets = <&gcc GCC_QUSB2_0_PHY_BCR>; > >+ reset-names = "usb2_phy_reset"; > >+ > >+ status = "okay"; > >+ }; > >+ > >+ usb2: usb2@8a00000 { > >+ compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; > >+ #address-cells = <1>; > >+ #size-cells = <1>; > >+ ranges; > >+ > >+ reg = <0x08af8800 0x100>; > >+ > >+ clocks = <&gcc GCC_USB0_MASTER_CLK>, > >+ <&gcc GCC_SNOC_USB_CLK>, > >+ <&gcc GCC_USB0_SLEEP_CLK>, > >+ <&gcc GCC_USB0_MOCK_UTMI_CLK>; > > Please indent these values. Ok. > >+ > >+ clock-names = "core", > >+ "iface", > >+ "sleep", > >+ "mock_utmi"; > > Please indent these values. Ok. > >+ > >+ interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; > > No PHY IRQs? Will add. Thanks Varada > >+ interrupt-names = "pwr_event"; > >+ > >+ resets = <&gcc GCC_USB_BCR>; > >+ > >+ qcom,select-utmi-as-pipe-clk; > >+ > >+ usb2_0_dwc: usb@8a00000 { > >+ compatible = "snps,dwc3"; > >+ reg = <0x08a00000 0xe000>; > >+ clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; > >+ clock-names = "ref"; > >+ interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; > >+ usb-phy = <&usb_0_m31phy>; > >+ tx-fifo-resize; > >+ snps,is-utmi-l1-suspend; > >+ snps,hird-threshold = /bits/ 8 <0x0>; > >+ snps,dis_u2_susphy_quirk; > >+ snps,dis_u3_susphy_quirk; > >+ snps,ref-clock-period-ns = <21>; > >+ }; > >+ }; > > }; > > timer { > > -- > With best wishes > Dmitry >
On Wed, Jun 07, 2023 at 08:24:04PM +0200, Konrad Dybcio wrote: > > > On 7.06.2023 12:56, Varadarajan Narayanan wrote: > > Add USB phy and controller nodes > > > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > > --- > > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ > > 1 file changed, 55 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > > index c2d6cc65..3183357 100644 > > --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi > > +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > > @@ -383,6 +383,61 @@ > > status = "disabled"; > > }; > > }; > > + > > + usb_0_m31phy: hs_m31phy@7b000 { > > + compatible = "qcom,ipq5332-m31-usb-hsphy"; > > + reg = <0x0007b000 0x12C>, > random uppercase hex Ok. > > + <0x08af8800 0x400>; > > + reg-names = "m31usb_phy_base", > > + "qscratch_base"; > > + phy_type= "utmi"; > Missing space before '=' Ok. > > + > > + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; > > + reset-names = "usb2_phy_reset"; > > + > > + status = "okay"; > If you're only defining the node, it's enabled by default > > In this case, you'd probably want to disable it by default. Ok. > > + }; > > + > > + usb2: usb2@8a00000 { > > + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges; > Please push these 3 properties to the end > > And add status = "disabled" below them. Ok. > > + > > + reg = <0x08af8800 0x100>; > > + > > + clocks = <&gcc GCC_USB0_MASTER_CLK>, > > + <&gcc GCC_SNOC_USB_CLK>, > > + <&gcc GCC_USB0_SLEEP_CLK>, > > + <&gcc GCC_USB0_MOCK_UTMI_CLK>; > > + > Please remove this newline. > > > + clock-names = "core", > > + "iface", > > + "sleep", > > + "mock_utmi"; > Please align this, and all other similar lists. Ok. > > + > > + interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; > interrupts-extended is unnecessary with just a single interrupt > source.. you can make it `interrupts` and drop the GIC reference. > > It would also be nice to push the interrupt properties below 'reg'. > We're working on documenting and automating checking the preferred > property order. Ok. > > + interrupt-names = "pwr_event"; > > + > > + resets = <&gcc GCC_USB_BCR>; > > + > > + qcom,select-utmi-as-pipe-clk; > > + > > + usb2_0_dwc: usb@8a00000 { > > + compatible = "snps,dwc3"; > > + reg = <0x08a00000 0xe000>; > > + clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; > > + clock-names = "ref"; > > + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; > > + usb-phy = <&usb_0_m31phy>; > > + tx-fifo-resize; > > + snps,is-utmi-l1-suspend; > > + snps,hird-threshold = /bits/ 8 <0x0>; > > + snps,dis_u2_susphy_quirk; > > + snps,dis_u3_susphy_quirk; > > + snps,ref-clock-period-ns = <21>; > 1/21 is 0.0476.. that doesn't seem to correspond to the ref > clk frequency? dwc3_ref_clk_period() prefers ref clock's rate over ref-clock-period-ns. Since ref clock is available this is not used. Will remove this. Thanks Varada > Konrad > > + }; > > + }; > > }; > > > > timer {
On Wed, Jun 07, 2023 at 08:35:09PM +0200, Krzysztof Kozlowski wrote: > On 07/06/2023 12:56, Varadarajan Narayanan wrote: > > Add USB phy and controller nodes > > > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> > > --- > > arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ > > 1 file changed, 55 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > > index c2d6cc65..3183357 100644 > > --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi > > +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi > > @@ -383,6 +383,61 @@ > > status = "disabled"; > > }; > > }; > > + > > + usb_0_m31phy: hs_m31phy@7b000 { > > Node names should be generic. See also explanation and list of examples > in DT specification: > https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation Ok. > > + compatible = "qcom,ipq5332-m31-usb-hsphy"; > > + reg = <0x0007b000 0x12C>, > > + <0x08af8800 0x400>; > > Lowercase hex only. Ok. > > + reg-names = "m31usb_phy_base", > > + "qscratch_base"; > > + phy_type= "utmi"; > > + > > + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; > > + reset-names = "usb2_phy_reset"; > > + > > + status = "okay"; > > It's by default. Drop. Ok. > > + }; > > + > > + usb2: usb2@8a00000 { > > It does not look like you tested the DTS against bindings. Please run > `make dtbs_check` (see > Documentation/devicetree/bindings/writing-schema.rst for instructions). > > Node names should be generic. See also explanation and list of examples > in DT specification: > https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation Ok. > > + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges; > > + > > + reg = <0x08af8800 0x100>; > > reg is always after compatible. Ranges is third. Then you will spot that > address is wrong. Ok. > > + > > + clocks = <&gcc GCC_USB0_MASTER_CLK>, > > + <&gcc GCC_SNOC_USB_CLK>, > > + <&gcc GCC_USB0_SLEEP_CLK>, > > + <&gcc GCC_USB0_MOCK_UTMI_CLK>; > > Fix alignment. Ok. > > + > > + clock-names = "core", > > + "iface", > > + "sleep", > > + "mock_utmi"; > > Fix alignment. Ok. > > + > > + interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; > > + interrupt-names = "pwr_event"; > > + Thanks Varada > Best regards, > Krzysztof >
diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi index c2d6cc65..3183357 100644 --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi @@ -383,6 +383,61 @@ status = "disabled"; }; }; + + usb_0_m31phy: hs_m31phy@7b000 { + compatible = "qcom,ipq5332-m31-usb-hsphy"; + reg = <0x0007b000 0x12C>, + <0x08af8800 0x400>; + reg-names = "m31usb_phy_base", + "qscratch_base"; + phy_type= "utmi"; + + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; + reset-names = "usb2_phy_reset"; + + status = "okay"; + }; + + usb2: usb2@8a00000 { + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + reg = <0x08af8800 0x100>; + + clocks = <&gcc GCC_USB0_MASTER_CLK>, + <&gcc GCC_SNOC_USB_CLK>, + <&gcc GCC_USB0_SLEEP_CLK>, + <&gcc GCC_USB0_MOCK_UTMI_CLK>; + + clock-names = "core", + "iface", + "sleep", + "mock_utmi"; + + interrupts-extended = <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "pwr_event"; + + resets = <&gcc GCC_USB_BCR>; + + qcom,select-utmi-as-pipe-clk; + + usb2_0_dwc: usb@8a00000 { + compatible = "snps,dwc3"; + reg = <0x08a00000 0xe000>; + clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; + clock-names = "ref"; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + usb-phy = <&usb_0_m31phy>; + tx-fifo-resize; + snps,is-utmi-l1-suspend; + snps,hird-threshold = /bits/ 8 <0x0>; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + snps,ref-clock-period-ns = <21>; + }; + }; }; timer {