From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: minyard@acm.org, Tomer Maimon <tmaimon77@gmail.com>
Cc: Avi Fishman <avifishman70@gmail.com>,
Tali Perry <tali.perry1@gmail.com>, Joel Stanley <joel@jms.id.au>,
Patrick Venture <venture@google.com>,
Nancy Yuen <yuenn@google.com>,
Benjamin Fair <benjaminfair@google.com>,
Jonathan Cameron <jic23@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
OpenBMC Maillist <openbmc@lists.ozlabs.org>,
openipmi-developer@lists.sourceforge.net,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
devicetree <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2] dt-binding: ipmi: add fallback to npcm845 compatible
Date: Mon, 8 Aug 2022 09:23:13 +0300 [thread overview]
Message-ID: <cb3c24e7-e207-e114-d256-ddfa45259312@linaro.org> (raw)
In-Reply-To: <20220807121138.GL3834@minyard.net>
On 07/08/2022 14:11, Corey Minyard wrote:
> On Sun, Aug 07, 2022 at 11:03:56AM +0300, Tomer Maimon wrote:
>> Hi Corey,
>>
>> Thanks for your comment.
>>
>> On Fri, 5 Aug 2022 at 14:58, Corey Minyard <minyard@acm.org> wrote:
>>>
>>> On Thu, Aug 04, 2022 at 09:18:00PM +0300, Tomer Maimon wrote:
>>>> Add to npcm845 KCS compatible string a fallback to npcm750 KCS compatible
>>>> string becuase NPCM845 and NPCM750 BMCs are using identical KCS modules.
>>>>
>>>> Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
>>>> ---
>>>> Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt b/Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt
>>>> index cbc10a68ddef..4fda76e63396 100644
>>>> --- a/Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt
>>>> +++ b/Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt
>>>> @@ -7,7 +7,7 @@ used to perform in-band IPMI communication with their host.
>>>> Required properties:
>>>> - compatible : should be one of
>>>> "nuvoton,npcm750-kcs-bmc"
>>>> - "nuvoton,npcm845-kcs-bmc"
>>>> + "nuvoton,npcm845-kcs-bmc", "nuvoton,npcm750-kcs-bmc"
>>>
>>> This is just wrong. The compatible is supposed to identify the device,
>>> not the board the device is on. I think compatible here should be
>>> "npcm7xx-kcs-bmc", and just use that everywhere. It's fine if that is
>>> used on a board named npcm845.
>> The NPCM8XX is not a board, The Nuvoton NPCM8XX is a fourth-generation
>> BMC SoC device family.
>
> Ok, but same principle applies.
>
> If the device is exactly the same, then you would only use one of the
> "npcm7xx-kcs-bmc" and put that in both device trees. You can use
> "nuvoton,npcm750-kcs-bmc", it's really not that important. Or even
> "nuvoton,npcm-kcs-bmc"
No, because it is too generic. Compatibles must be specific.
>
> If the device has a minor difference that can be expressed in a
> parameter, then create a parameter for it.
>
> If the device has enough differences that a parameter or two doesn't
> cover it, then you put either nuvoton,npcm750-kcs-bmc or
> nuvoton,npcm750-kcs-bmc in the device tree. Not both. Then you need
> two entries in the of_device_id array and you use the data field or
> something to express the difference.
It's quite common to have generic and specific compatibles for
compatible devices and a driver which can match to both of them. I don't
understand where is exactly the problem here?
>
> Since there appears to be no difference, just put
> "nuvoton,npcm750-kcs-bmc" in the npcm845 and I will drop the patch
> adding all this. T
Again no, because recommended (also writing bindings document) is always
to have a specific compatible.
> hen a patch can be added saying it applies to both
> the 7xx and 8xx series of BMC SOCs. If you want to change the name,
> then a patch will be needed for that, but then you will need multiple
> entries in your device tree, but you would not document it as such, as
> there would only be one that applies for this kernel.
>
> I'm pretty sure the only reason to have muliple compatible entries in a
> device tree is to cover multiple kernels where the name changed.
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-08-08 6:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 18:18 [PATCH v2] dt-binding: ipmi: add fallback to npcm845 compatible Tomer Maimon
2022-08-04 18:18 ` Tomer Maimon
2022-08-05 6:36 ` Krzysztof Kozlowski
2022-08-07 7:51 ` Tomer Maimon
2022-08-07 7:51 ` Tomer Maimon
2022-08-08 6:26 ` Krzysztof Kozlowski
2022-08-08 7:40 ` Tomer Maimon
2022-08-08 7:40 ` Tomer Maimon
2022-08-05 11:58 ` Corey Minyard
2022-08-05 11:58 ` Corey Minyard
2022-08-07 8:03 ` Tomer Maimon
2022-08-07 8:03 ` Tomer Maimon
2022-08-07 12:11 ` Corey Minyard
2022-08-07 12:11 ` Corey Minyard
2022-08-07 14:54 ` Tomer Maimon
2022-08-07 14:54 ` Tomer Maimon
2022-08-07 16:05 ` Corey Minyard
2022-08-07 16:05 ` Corey Minyard
2022-08-08 6:25 ` Krzysztof Kozlowski
2022-08-08 6:24 ` Krzysztof Kozlowski
2022-08-08 6:23 ` Krzysztof Kozlowski [this message]
2022-08-08 6:20 ` Krzysztof Kozlowski
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=cb3c24e7-e207-e114-d256-ddfa45259312@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=joel@jms.id.au \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minyard@acm.org \
--cc=openbmc@lists.ozlabs.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=robh+dt@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.