linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeffrey Hugo <jhugo@codeaurora.org>
To: Rob Herring <robh@kernel.org>
Cc: mturquette@baylibre.com, sboyd@kernel.org, mark.rutland@arm.com,
	agross@kernel.org, bjorn.andersson@linaro.org,
	marc.w.gonzalez@free.fr, linux-arm-msm@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v8 1/4] dt-bindings: clock: Document external clocks for MSM8998 gcc
Date: Tue, 12 Nov 2019 09:25:41 -0700	[thread overview]
Message-ID: <3e4b1342-7965-2d80-e28d-0cb728037abd@codeaurora.org> (raw)
In-Reply-To: <20191112004417.GA16664@bogus>

On 11/11/2019 5:44 PM, Rob Herring wrote:
> On Fri, Nov 08, 2019 at 04:17:16PM -0700, Jeffrey Hugo wrote:
>> The global clock controller on MSM8998 can consume a number of external
>> clocks.  Document them.
>>
>> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
>> ---
>>   .../devicetree/bindings/clock/qcom,gcc.yaml        | 47 +++++++++++++++-------
>>   1 file changed, 33 insertions(+), 14 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc.yaml
>> index e73a56f..2f3512b 100644
>> --- a/Documentation/devicetree/bindings/clock/qcom,gcc.yaml
>> +++ b/Documentation/devicetree/bindings/clock/qcom,gcc.yaml
>> @@ -40,20 +40,38 @@ properties:
>>          - qcom,gcc-sm8150
>>   
>>     clocks:
>> -    minItems: 1
> 
> 1 or 2 clocks are no longer allowed?

Correct.

The primary reason is that Stephen indicated in previous discussions 
that if the hardware exists, it should be indicated in DT, regardless if 
the driver uses it.  In the 7180 and 8150 case, the hardware exists, so 
these should not be optional.

The secondary reason is I found that the schema was broken anyways.  In 
the way it was written, if you implemented sleep, you could not skip 
xo_ao, however there is a dts that did exactly that.

The third reason was that I couldn't find a way to write valid yaml to 
preserve the original meaning.  when you have an "items" as a subnode of 
"oneOf", you no longer have control over the minItems/maxItems, so all 3 
became required anyways.  I find it disappointing that the "version" of 
Yaml used for DT bindings is not documented, so after several hours of 
trial and error, I just gave up since I found this to work (failed cases 
just gave me an error with no indication of what was wrong, not even a 
line number).

> 
>> -    maxItems: 3
>> -    items:
>> -      - description: Board XO source
>> -      - description: Board active XO source
>> -      - description: Sleep clock source
>> +    oneOf:
>> +      #qcom,gcc-sm8150
>> +      #qcom,gcc-sc7180
> 
> Typically, this would be an if/then schema, but I'm okay with leaving it
> like this. Depends whether you want to check the clocks match the
> compatible.

Is there an example somewhere?  The only thing I found was 
example-schema.yaml which seemed to suggest this way.

> 
>> +      - items:
>> +        - description: Board XO source
>> +        - description: Board active XO source
>> +        - description: Sleep clock source
>> +      #qcom,gcc-msm8998
>> +      - items:
>> +        - description: Board XO source
>> +        - description: USB 3.0 phy pipe clock
>> +        - description: UFS phy rx symbol clock for pipe 0
>> +        - description: UFS phy rx symbol clock for pipe 1
>> +        - description: UFS phy tx symbol clock
>> +        - description: PCIE phy pipe clock
>>   
>>     clock-names:
>> -    minItems: 1
>> -    maxItems: 3
>> -    items:
>> -      - const: bi_tcxo
>> -      - const: bi_tcxo_ao
>> -      - const: sleep_clk
>> +    oneOf:
>> +      #qcom,gcc-sm8150
>> +      #qcom,gcc-sc7180
>> +      - items:
>> +        - const: bi_tcxo
>> +        - const: bi_tcxo_ao
>> +        - const: sleep_clk
>> +      #qcom,gcc-msm8998
>> +      - items:
>> +        - const: xo
>> +        - const: usb3_pipe
>> +        - const: ufs_rx_symbol0
>> +        - const: ufs_rx_symbol1
>> +        - const: ufs_tx_symbol0
>> +        - const: pcie0_pipe
>>   
>>     '#clock-cells':
>>       const: 1
>> @@ -118,6 +136,7 @@ else:
>>         compatible:
>>           contains:
>>             enum:
>> +            - qcom,gcc-msm8998
>>               - qcom,gcc-sm8150
>>               - qcom,gcc-sc7180
>>     then:
>> @@ -179,8 +198,8 @@ examples:
>>       clock-controller@100000 {
>>         compatible = "qcom,gcc-sc7180";
>>         reg = <0x100000 0x1f0000>;
>> -      clocks = <&rpmhcc 0>, <&rpmhcc 1>;
>> -      clock-names = "bi_tcxo", "bi_tcxo_ao";
>> +      clocks = <&rpmhcc 0>, <&rpmhcc 1>, <0>;
>> +      clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk";
> 
> The patch subject says 8998, but this is changing sc7180.

I'm fixing up the example so that it no longer fails checks.  See the 
above comment.

> 
>>         #clock-cells = <1>;
>>         #reset-cells = <1>;
>>         #power-domain-cells = <1>;
>> -- 
>> Qualcomm Technologies, Inc. is a member of the
>> Code Aurora Forum, a Linux Foundation Collaborative Project.
>>


-- 
Jeffrey Hugo
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

  reply	other threads:[~2019-11-12 16:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 23:16 [PATCH v8 0/4] MSM8998 Multimedia Clock Controller Jeffrey Hugo
2019-11-08 23:17 ` [PATCH v8 1/4] dt-bindings: clock: Document external clocks for MSM8998 gcc Jeffrey Hugo
2019-11-12  0:44   ` Rob Herring
2019-11-12 16:25     ` Jeffrey Hugo [this message]
2019-11-12 18:37       ` Rob Herring
2019-11-12 19:38         ` Jeffrey Hugo
2019-11-12 21:18           ` Rob Herring
2019-11-12 22:03             ` Jeffrey Hugo
2019-11-08 23:17 ` [PATCH v8 2/4] dt-bindings: clock: Convert qcom,mmcc to DT schema Jeffrey Hugo
2019-11-12  0:58   ` Rob Herring
2019-11-12 16:11     ` Jeffrey Hugo
2019-11-08 23:17 ` [PATCH v8 3/4] dt-bindings: clock: Add support for the MSM8998 mmcc Jeffrey Hugo
2019-11-12  0:55   ` Rob Herring
2019-11-12 16:07     ` Jeffrey Hugo
2019-11-12  0:59   ` Rob Herring
2019-11-08 23:18 ` [PATCH v8 4/4] clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver Jeffrey Hugo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e4b1342-7965-2d80-e28d-0cb728037abd@codeaurora.org \
    --to=jhugo@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).