Message ID | 20230510132816.108820-2-minda.chen@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3629337vqo; Wed, 10 May 2023 06:36:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6J/GSTQlIoXBxtlC1O+R+SlkZrgqkj90aVARNZtBp4aSU8HE+WG3+VBknO21w0WqbjmpT3 X-Received: by 2002:a17:90a:9b15:b0:250:54a0:c6b5 with SMTP id f21-20020a17090a9b1500b0025054a0c6b5mr14008560pjp.43.1683725787592; Wed, 10 May 2023 06:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683725787; cv=none; d=google.com; s=arc-20160816; b=JRJ1H1uRvguPYKLVGS2U2/H/1PMz2j11WFShzXN6tZR/u4sE0E20RrKInqh5YF6vza 47j0Q5eGDu2Oz3L+7wwTuYsvmVlAgo8X/CnHnAgVjv+O4i0HpDb5o7DwNl36A9qZ9fGh 1IaLC4T2HP+p+lppng8ZHnXSZHWVy5WLk/qaHCv+NQgDJUdczj5vpRqzG96GpSmhyd3g eNa9mnv40MskJPgpfD8b8OWBmF5UcD6XfjI2Y4JhUi7NBtL7XRHzz7Jyzcy254NVW6fg eT8P7k5kFsay9e3rEeNibqY3AR2MDRoMTTC1xy5k6J1CRdGGeDad1asKciOsu8KJYO5G 0kRg== 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; bh=LGEXP+3/WuwSWAxOXNWbYZp4j1IisJ1deBO12iuGOm8=; b=G2C/0MkCFSRVrmoZSL/BS9loRvhTRKJKmfMLYLTtFvCo+7Hhe4ROWRnZGrqJiMavo0 YIX18Qtcf7xEAd58s5Tcyz8QaQZ2pZHopW9r9epqMCVLO03Lpum1b+FXsb+OMJBJ6BHh gephDQfnBC4RKQUSBKrqP62uLrATf3Z6cWEJ3+yNstOgJavOkbeX0t59Bh9bc8HSsGHP QBtvv8YxTPX8LKayvZQUs0IgdNB9QjDEfNoIyTEMfV6eGxjZYiGSceIxgXQF6whA067E kD9DDACM+ZX1prss7XmmcZAbfPxJWClXVCGddoujUb/kLMTJFVKKRE+T8aaEJ8+w4o/T spDg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me14-20020a17090b17ce00b0023fbb212145si31691165pjb.175.2023.05.10.06.36.14; Wed, 10 May 2023 06:36:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237098AbjEJN2e (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Wed, 10 May 2023 09:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237082AbjEJN2c (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 10 May 2023 09:28:32 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0CB861B2; Wed, 10 May 2023 06:28:22 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id D411D24E143; Wed, 10 May 2023 21:28:18 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 10 May 2023 21:28:18 +0800 Received: from ubuntu.localdomain (183.27.98.219) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 10 May 2023 21:28:17 +0800 From: Minda Chen <minda.chen@starfivetech.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Pawel Laszczak <pawell@cadence.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Peter Chen <peter.chen@kernel.org>, Roger Quadros <rogerq@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de> CC: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>, Minda Chen <minda.chen@starfivetech.com> Subject: [PATCH v2 1/2] dt-bindings: cdns,usb3: Add clock and reset Date: Wed, 10 May 2023 21:28:15 +0800 Message-ID: <20230510132816.108820-2-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230510132816.108820-1-minda.chen@starfivetech.com> References: <20230510132816.108820-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.98.219] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1765514451458231475?= X-GMAIL-MSGID: =?utf-8?q?1765514451458231475?= |
Series |
Add clock and reset in cdns3 platform
|
|
Commit Message
Minda Chen
May 10, 2023, 1:28 p.m. UTC
To support generic clock and reset init in Cadence USBSS
controller, add clock and reset dts configuration.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
---
.../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Comments
On 10/05/2023 15:28, Minda Chen wrote: > To support generic clock and reset init in Cadence USBSS > controller, add clock and reset dts configuration. > > Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > --- > .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml > index cae46c4982ad..623c6b34dee3 100644 > --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml > +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml > @@ -42,6 +42,18 @@ properties: > - const: otg > - const: wakeup > > + clocks: > + minItems: 1 > + maxItems: 8 > + description: > + USB controller clocks. You need to list the items. And why is it variable? Your clock choice in the example is poor, I doubt it is real. > + > + resets: > + minItems: 1 > + maxItems: 8 > + description: > + USB controller generic resets. Here as well. You had one clock last time, thus the review was - drop the names. Now you changed it to 8 clocks... I don't understand. Best regards, Krzysztof
On 11/05/2023 12:26, Krzysztof Kozlowski wrote: > On 10/05/2023 15:28, Minda Chen wrote: >> To support generic clock and reset init in Cadence USBSS >> controller, add clock and reset dts configuration. >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >> --- >> .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >> index cae46c4982ad..623c6b34dee3 100644 >> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >> @@ -42,6 +42,18 @@ properties: >> - const: otg >> - const: wakeup >> >> + clocks: >> + minItems: 1 >> + maxItems: 8 >> + description: >> + USB controller clocks. > > You need to list the items. And why is it variable? Your clock choice in > the example is poor, I doubt it is real. > >> + >> + resets: >> + minItems: 1 >> + maxItems: 8 >> + description: >> + USB controller generic resets. > > Here as well. > > You had one clock last time, thus the review was - drop the names. Now > you changed it to 8 clocks... I don't understand. > Different platforms may have different number of clocks/resets or none. So I don't think minItems/maxItems should be specified.
On 11/05/2023 14:16, Roger Quadros wrote: > > > On 11/05/2023 12:26, Krzysztof Kozlowski wrote: >> On 10/05/2023 15:28, Minda Chen wrote: >>> To support generic clock and reset init in Cadence USBSS >>> controller, add clock and reset dts configuration. >>> >>> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >>> --- >>> .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ >>> 1 file changed, 14 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>> index cae46c4982ad..623c6b34dee3 100644 >>> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>> @@ -42,6 +42,18 @@ properties: >>> - const: otg >>> - const: wakeup >>> >>> + clocks: >>> + minItems: 1 >>> + maxItems: 8 >>> + description: >>> + USB controller clocks. >> >> You need to list the items. And why is it variable? Your clock choice in >> the example is poor, I doubt it is real. >> >>> + >>> + resets: >>> + minItems: 1 >>> + maxItems: 8 >>> + description: >>> + USB controller generic resets. >> >> Here as well. >> >> You had one clock last time, thus the review was - drop the names. Now >> you changed it to 8 clocks... I don't understand. >> > > Different platforms may have different number of clocks/resets or none. > So I don't think minItems/maxItems should be specified. Yeah, but we want the clocks to be specific per platform. Not anything anywhere. Best regards, Krzysztof
On 2023/5/11 22:49, Krzysztof Kozlowski wrote: > On 11/05/2023 14:16, Roger Quadros wrote: >> >> >> On 11/05/2023 12:26, Krzysztof Kozlowski wrote: >>> On 10/05/2023 15:28, Minda Chen wrote: >>>> To support generic clock and reset init in Cadence USBSS >>>> controller, add clock and reset dts configuration. >>>> >>>> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >>>> --- >>>> .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ >>>> 1 file changed, 14 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>> index cae46c4982ad..623c6b34dee3 100644 >>>> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>> @@ -42,6 +42,18 @@ properties: >>>> - const: otg >>>> - const: wakeup >>>> >>>> + clocks: >>>> + minItems: 1 >>>> + maxItems: 8 >>>> + description: >>>> + USB controller clocks. >>> >>> You need to list the items. And why is it variable? Your clock choice in >>> the example is poor, I doubt it is real. >>> >>>> + >>>> + resets: >>>> + minItems: 1 >>>> + maxItems: 8 >>>> + description: >>>> + USB controller generic resets. >>> >>> Here as well. >>> >>> You had one clock last time, thus the review was - drop the names. Now >>> you changed it to 8 clocks... I don't understand. >>> >> >> Different platforms may have different number of clocks/resets or none. >> So I don't think minItems/maxItems should be specified. > > Yeah, but we want the clocks to be specific per platform. Not anything > anywhere. > > Best regards, > Krzysztof > I can change like these. Are these changes can be approved? lpm , bus clock and "pwrup" reset can be specific cases. (The changes are from snps,dwc3.yaml.) clocks: description: In general the core supports two types of clocks. bus is a SoC Bus Clock(AHB/AXI/APB). lpm is a link power management clock. But particular cases may differ from that having less or more clock sources with another names. clock-names: contains: anyOf: - enum: [bus, lpm] - true resets: description: In general the core supports controller power-up reset. Also clock and other resets can be added. Particular cases may differ from that having less or more resets with another names. reset-names: contains: anyOf: - const: pwrup - true
On 11/05/2023 17:49, Krzysztof Kozlowski wrote: > On 11/05/2023 14:16, Roger Quadros wrote: >> >> >> On 11/05/2023 12:26, Krzysztof Kozlowski wrote: >>> On 10/05/2023 15:28, Minda Chen wrote: >>>> To support generic clock and reset init in Cadence USBSS >>>> controller, add clock and reset dts configuration. >>>> >>>> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >>>> --- >>>> .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ >>>> 1 file changed, 14 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>> index cae46c4982ad..623c6b34dee3 100644 >>>> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>> @@ -42,6 +42,18 @@ properties: >>>> - const: otg >>>> - const: wakeup >>>> >>>> + clocks: >>>> + minItems: 1 >>>> + maxItems: 8 >>>> + description: >>>> + USB controller clocks. >>> >>> You need to list the items. And why is it variable? Your clock choice in >>> the example is poor, I doubt it is real. >>> >>>> + >>>> + resets: >>>> + minItems: 1 >>>> + maxItems: 8 >>>> + description: >>>> + USB controller generic resets. >>> >>> Here as well. >>> >>> You had one clock last time, thus the review was - drop the names. Now >>> you changed it to 8 clocks... I don't understand. >>> >> >> Different platforms may have different number of clocks/resets or none. >> So I don't think minItems/maxItems should be specified. > > Yeah, but we want the clocks to be specific per platform. Not anything > anywhere. > Agreed. So we don't specify min/maxItems at top level but use conditional constraints per platform? Which means we will need to add platform specific compatibles as well.
On 12/05/2023 12:22, Minda Chen wrote: > > > On 2023/5/11 22:49, Krzysztof Kozlowski wrote: >> On 11/05/2023 14:16, Roger Quadros wrote: >>> >>> >>> On 11/05/2023 12:26, Krzysztof Kozlowski wrote: >>>> On 10/05/2023 15:28, Minda Chen wrote: >>>>> To support generic clock and reset init in Cadence USBSS >>>>> controller, add clock and reset dts configuration. >>>>> >>>>> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >>>>> --- >>>>> .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ >>>>> 1 file changed, 14 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>>> index cae46c4982ad..623c6b34dee3 100644 >>>>> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>>> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>>> @@ -42,6 +42,18 @@ properties: >>>>> - const: otg >>>>> - const: wakeup >>>>> >>>>> + clocks: >>>>> + minItems: 1 >>>>> + maxItems: 8 >>>>> + description: >>>>> + USB controller clocks. >>>> >>>> You need to list the items. And why is it variable? Your clock choice in >>>> the example is poor, I doubt it is real. >>>> >>>>> + >>>>> + resets: >>>>> + minItems: 1 >>>>> + maxItems: 8 >>>>> + description: >>>>> + USB controller generic resets. >>>> >>>> Here as well. >>>> >>>> You had one clock last time, thus the review was - drop the names. Now >>>> you changed it to 8 clocks... I don't understand. >>>> >>> >>> Different platforms may have different number of clocks/resets or none. >>> So I don't think minItems/maxItems should be specified. >> >> Yeah, but we want the clocks to be specific per platform. Not anything >> anywhere. >> >> Best regards, >> Krzysztof >> > > I can change like these. Are these changes can be approved? > lpm , bus clock and "pwrup" reset can be specific cases. (The changes are from snps,dwc3.yaml.) > > clocks: > description: > In general the core supports two types of clocks. bus is a SoC Bus > Clock(AHB/AXI/APB). lpm is a link power management clock. But particular > cases may differ from that having less or more clock sources with > another names. > > clock-names: > contains: > anyOf: > - enum: [bus, lpm] > - true > No because this does not solve my concern. You allow here anything, which is not desired. The device bindings should specify what clocks (and resets) you have here. Order is also fixed (with exceptions). Now, if this is generic IP block used by different SoC vendors and it has different clocks in different implementations, it means one compatible for all of them is not enough anymore. Best regards, Krzysztof
On 12/05/2023 13:08, Roger Quadros wrote: > > > On 11/05/2023 17:49, Krzysztof Kozlowski wrote: >> On 11/05/2023 14:16, Roger Quadros wrote: >>> >>> >>> On 11/05/2023 12:26, Krzysztof Kozlowski wrote: >>>> On 10/05/2023 15:28, Minda Chen wrote: >>>>> To support generic clock and reset init in Cadence USBSS >>>>> controller, add clock and reset dts configuration. >>>>> >>>>> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >>>>> --- >>>>> .../devicetree/bindings/usb/cdns,usb3.yaml | 14 ++++++++++++++ >>>>> 1 file changed, 14 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>>> index cae46c4982ad..623c6b34dee3 100644 >>>>> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>>> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml >>>>> @@ -42,6 +42,18 @@ properties: >>>>> - const: otg >>>>> - const: wakeup >>>>> >>>>> + clocks: >>>>> + minItems: 1 >>>>> + maxItems: 8 >>>>> + description: >>>>> + USB controller clocks. >>>> >>>> You need to list the items. And why is it variable? Your clock choice in >>>> the example is poor, I doubt it is real. >>>> >>>>> + >>>>> + resets: >>>>> + minItems: 1 >>>>> + maxItems: 8 >>>>> + description: >>>>> + USB controller generic resets. >>>> >>>> Here as well. >>>> >>>> You had one clock last time, thus the review was - drop the names. Now >>>> you changed it to 8 clocks... I don't understand. >>>> >>> >>> Different platforms may have different number of clocks/resets or none. >>> So I don't think minItems/maxItems should be specified. >> >> Yeah, but we want the clocks to be specific per platform. Not anything >> anywhere. >> > > Agreed. So we don't specify min/maxItems at top level but use conditional > constraints per platform? > Which means we will need to add platform specific compatibles as well. Yes, exactly. This can be done here in this binding or through some re-usable common part and then multiple bindings using it and customizing. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml index cae46c4982ad..623c6b34dee3 100644 --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml @@ -42,6 +42,18 @@ properties: - const: otg - const: wakeup + clocks: + minItems: 1 + maxItems: 8 + description: + USB controller clocks. + + resets: + minItems: 1 + maxItems: 8 + description: + USB controller generic resets. + dr_mode: enum: [host, otg, peripheral] @@ -98,5 +110,7 @@ examples: interrupt-names = "host", "peripheral", "otg"; maximum-speed = "super-speed"; dr_mode = "otg"; + clocks = <&clk 1>, <&clk 2>, <&clk 3>; + resets = <&rst 1>, <&rst 2>, <&rst 3>; }; };