devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH 0/3] dt-bindings: arm: qcom: define schema, not devices
Date: Mon, 25 Jul 2022 19:25:23 +0200	[thread overview]
Message-ID: <91c01704-c3ef-06f3-ed6c-c35408c93b7c@linaro.org> (raw)
In-Reply-To: <CAA8EJpratkeg3wpHZxsXavDzO-Gq9wnumVw6dwy7Qa6+YRdhUg@mail.gmail.com>

On 25/07/2022 19:13, Dmitry Baryshkov wrote:
> On Mon, 25 Jul 2022 at 19:18, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 24/07/2022 00:50, Dmitry Baryshkov wrote:
>>> On Sat, 23 Jul 2022 at 20:48, Krzysztof Kozlowski
>>> <krzysztof.kozlowski@linaro.org> wrote:
>>>>
>>>> On 23/07/2022 11:09, Dmitry Baryshkov wrote:
>>>>> Describing each compatible board in DT schema seems wrong to me. It
>>>>> means that each new board is incompatible by default, until added to the DT
>>>>> schema.
>>>
>>> s/incompatible/non-valid/
>>>
>>>>
>>>> The bindings do not document something because it is or it is no
>>>> compatible. They document the compatible. Your patch essentially removes
>>>> the documentation, so there is no point in having compatibles in board
>>>> at all...
>>>
>>> I do not quite agree here. Please correct me if I'm wrong.
>>> Schema defines which DT files are correct and which are not. Which
>>> properties are required, which values are valid, etc. So far so good.
>>
>> Schema is a tool, we create here bindings. The bindings document what
>> you wrote above, plus compatibles and any other pieces mentioned in DT spec.
>>
>>> For the device nodes it declares (or is willing to declare) all
>>> possible compatibility strings. There is a sensible number of on-chip
>>> IP blocks, external chips, etc. Each and every new chip (or new IP
>>> block) we are going to have a yaml file describing its usage. Perfect.
>>> For the machine compatibility lists the arm,qcom schema declares which
>>> machine compat strings are valid. And this looks like a problem. Now
>>> for the DT to be fully valid against DT schema, we have to define its
>>> machine compat string.
>>
>> Although one of goals is to have schema compliance, that is not the
>> reason why we document compatibles. Compatibles were documented long
>> time ago before DT schema came, because the bindings require it.
>>
>> Bindings define the interface between the DTS and software which uses
>> it. SW is kernel, bootloaders, user-space and some more.
> 
> I completely agree here.
> 
> From the point of HW/SW interfaces maybe the following compat lists
> would make more sense:
> - "xiaomi,msm8996-phone", "qcom,msm8996"
> - "qcom,qrb5165-iot-platform", "qcom,sm8250"
> - "qcom,sda845-iot-platform", "qcom,sdm845"
> - "inforce,sda660-sbc", "qcom,sda660"
> 
> etc. IOW, describing the kind of the device, not the exact name/model of it.

With a specific compatible (covered by pattern), this could work,
although not sure what would be the benefit. Other components, like some
user-space or bootloader might still need the specific compatible.

And if anyone needs a specific compatible, it means it should be documented.

>> To summarize, you propose to not document board compatibles. This is not
>> what we want, because then the next step is - let's don't document SoCs.
>> If you do not document it, means anyone can uniliteraly change it, e.g.
>> in kernel DTS, which will break all other users (e.g. user-space or
>> bootloaders) parsing the compatibles. And before you say - no one parses
>> the board compatibles - let me just say that several user-space
>> (embedded/closed) parse them, bootloaders parse them (U-Boot, Google's
>> Chromebooks and others)
> 
> Yes, I know. And in the case of e.g. Google ChromeOS bootloader it
> might make sense to declare compatibles using patterns rather than
> enumeration.

Patterns would simplify here a lot but also would allow (thus not
validate) incorrect combinations. Consider Ssytem-on-Modules:

oneOf:
 - items:
   - {}
   - foo,som-msm8996
   - qcom,msm8996
 - items:
   - {}
   - qcom,msm8996

what stops anyone to have a DTS:
"xiaomi,msm8996-phone", "foo,som-msm8996", "qcom,msm8996"
? even though it does not contain that SoM from company Foo?

For DT schema it would be a perfectly valid combination, even though it
would not make any sense. We document valid machines/compatibles as
documentation of the interface but the schema also allows us - with that
documentation - to actually check if DTS is correct.

One more use case are the the qcom,board-id and msm-id properties. They
might once be restricted to specific board compatibles, because maybe
only the closed-bootloader platforms need them. We don't want these
properties in general, thus we might decide to prohibit to use them in
open platforms (e.g. using open bootloader). Without board compatibles
we won't be able to do it.


> Anyway, thank you for your comments, let's continue with documenting
> all the devices until something changes.
> 


Best regards,
Krzysztof

  reply	other threads:[~2022-07-25 17:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23  9:09 [PATCH 0/3] dt-bindings: arm: qcom: define schema, not devices Dmitry Baryshkov
2022-07-23  9:09 ` [PATCH 1/3] dt-bindings: arm: qcom: stop describing individual boards Dmitry Baryshkov
2022-07-23 17:49   ` Krzysztof Kozlowski
2022-07-23  9:09 ` [PATCH 2/3] dt-bindings: arm: qcom: merge simple platform definitions Dmitry Baryshkov
2022-07-23 17:50   ` Krzysztof Kozlowski
2022-07-23  9:09 ` [PATCH 3/3] dt-bindings: arm: qcom: drop individual descriptions of Google devices Dmitry Baryshkov
2022-07-23 17:51   ` Krzysztof Kozlowski
2022-07-23 17:48 ` [PATCH 0/3] dt-bindings: arm: qcom: define schema, not devices Krzysztof Kozlowski
2022-07-23 22:50   ` Dmitry Baryshkov
2022-07-25 16:18     ` Krzysztof Kozlowski
2022-07-25 17:13       ` Dmitry Baryshkov
2022-07-25 17:25         ` Krzysztof Kozlowski [this message]
2022-07-25 16:25     ` Doug Anderson
2022-07-25 16:41       ` Krzysztof Kozlowski
2022-07-25 16:54         ` Doug Anderson
2022-07-25 17:07           ` Krzysztof Kozlowski
2022-07-25 17:09             ` Doug Anderson
2022-07-25 17:14               ` Krzysztof Kozlowski
2022-07-25 17:22                 ` Doug Anderson
2022-07-25 17:29                   ` Krzysztof Kozlowski
2022-07-25 17:35                     ` Doug Anderson
2022-07-25 16:56         ` Krzysztof Kozlowski
2022-07-25 17:30     ` Rob Herring

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=91c01704-c3ef-06f3-ed6c-c35408c93b7c@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robh+dt@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).