Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Michal Simek <michal.simek@xilinx.com>,
	Borislav Petkov <bp@alien8.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tony Luck <tony.luck@intel.com>, Rob Herring <robh+dt@kernel.org>,
	Manish Narani <manish.narani@xilinx.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Michail Ivanov <Michail.Ivanov@baikalelectronics.ru>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Punnaiah Choudary Kalluri <punnaiah.choudary.kalluri@xilinx.com>,
	Dinh Nguyen <dinguyen@kernel.org>,
	James Morse <james.morse@arm.com>,
	Robert Richter <rric@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/13] dt-bindings: memory: snps: Add Baikal-T1 DDRC support
Date: Thu, 8 Sep 2022 12:46:31 +0300	[thread overview]
Message-ID: <20220908094307.civtqiwxadas3ys3@mobilestation> (raw)
In-Reply-To: <36b2b6d9-9ab4-a4bc-6476-bd5b5d3ef77e@linaro.org>

On Mon, Sep 05, 2022 at 12:14:21PM +0200, Krzysztof Kozlowski wrote:
> On 26/08/2022 11:54, Serge Semin wrote:
> > On Tue, Aug 23, 2022 at 11:12:28AM +0300, Krzysztof Kozlowski wrote:
> >> On 22/08/2022 22:19, Serge Semin wrote:
> >>> Baikal-T1 DDR controller is based on the DW uMCTL2 DDRC IP-core v2.51a
> >>> with up to DDR3 protocol capability and 32-bit data bus + 8-bit ECC. There
> >>> are individual IRQs for each ECC and DFI events.The dedicated scrubber
> >>
> > 
> >> Missing space before "The".
> > 
> > Ok. Thanks.
> > 
> >>
> >>> clock source is absent since it's fully synchronous to the core clock.
> >>
> > 
> >> You need allOf:if-then restricting this per variant.
> > 
> > I really don't like the allOf-if-if-etc pattern because it gets to be
> > very bulky if all the vendor-specific and generic platform
> > peculiarities are placed in there. I am more keen of having a
> > generic DT-schema which would be then allOf-ed by the vendor-specific
> > device bindings. What do you think I'd provide such design in this
> > case too?
> 
> Sure, it would work.
> 
> > 
> > But I'll need to move the compatible property definition to the
> > "select" property. Like this:
> > 
> > Documentation/devicetree/bindings/memory-controllers/snps,dw-umctl2-ddrc.yaml:
> > +[...]
> > +# Please create a separate DT-schema for your DW uMCTL2 DDR controller
> > +# and make sure it's assigned with the vendor-specific compatible string.
> > +select:
> > +  properties:
> > +    compatible:
> > +      oneOf:
> > +        - deprecated: true
> > +          description: Synopsys DW uMCTL2 DDR controller v3.80a
> > +          const: snps,ddrc-3.80a
> > +        - description: Synopsys DW uMCTL2 DDR controller
> > +          const: snps,dw-umctl2-ddrc
> > +        - description: Xilinx ZynqMP DDR controller v2.40a
> > +          const: xlnx,zynqmp-ddrc-2.40a
> > +  required:
> > +    - compatible
> 

> Not entirely. If you need select, then add it with compatibles, but all
> descriptions and deprecated are staying in properties.

Ok. But note in such case the compatible string constraints will get
to be opened for any non-common string. Like this:

+ properties:
+   compatible:
+     oneOf:
+       - const: snps,ddrc-3.80a
+       - {}

It's required for the DT-schemas referencing the common one, otherwise
they will fail DT-nodes evaluation due to the "compatible" property
missing the vendor-specific string.

> 
> 
> > +
> > +properties:
> > +  compatible: true
> > +[...]
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +additionalProperties: true
> > 
> > After that the "snps,dw-umctl2-ddrc.yaml" schema can be referenced in the
> > allOf composition. Like this:
> > 
> > Documentation/devicetree/bindings/memory-controllers/baikal,bt1-ddrc.yaml:
> > +[...]
> > +allOf:
> > +  - $ref: /schemas/memory-controllers/snps,dw-umctl2-ddrc.yaml#
> > +[...]
> > 
> > At the same time the generic DT-schema will be used to evaluate the
> > "snps,ddrc-3.80a", "snps,dw-umctl2-ddrc" and "xlnx,zynqmp-ddrc-2.40a"
> > device nodes as before. What do you think about that?
> > 
> > One big positive side of this that even though the generic schema
> > can't define the IRQ/resets/clocks phandlers order because various
> > platforms may have different external signals setup, the
> > vendor-specific schema can and should. So I'll be able to describe the
> > Baikal-T1 DDRC specific properties (clocks, clock-names, interrupts,
> > interrupt-names, etc) in much more details including the reference
> > signals order what you asked in the previous patch review.
> 

> It's ok. You need then second schema for your device, because something
> must end with additional/unevaluatedProperties false.

Right. I'll add a separate DT-schema for my device.

-Sergey

> 
> Best regards,
> Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-09-08  9:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 19:19 [PATCH 00/13] EDAC/synopsys: Add generic resources and Baikal-T1 support Serge Semin
2022-08-22 19:19 ` [PATCH 01/13] dt-bindings: memory: snps: Extend schema with IRQs/resets/clocks props Serge Semin
2022-08-23  8:11   ` Krzysztof Kozlowski
2022-08-26  8:47     ` Serge Semin
2022-08-30 15:01       ` Krzysztof Kozlowski
2022-09-09  7:49         ` Serge Semin
2022-08-22 19:19 ` [PATCH 02/13] dt-bindings: memory: snps: Add Baikal-T1 DDRC support Serge Semin
2022-08-23  8:12   ` Krzysztof Kozlowski
2022-08-26  9:54     ` Serge Semin
2022-09-05 10:14       ` Krzysztof Kozlowski
2022-09-08  9:46         ` Serge Semin [this message]
2022-09-08  9:58           ` Krzysztof Kozlowski
2022-09-08 15:08             ` Serge Semin
2022-09-08 15:27               ` Krzysztof Kozlowski
2022-09-08 15:40                 ` Serge Semin
2022-08-30 18:00   ` Rob Herring
2022-09-09 12:57     ` Serge Semin
2022-08-22 19:19 ` [PATCH 03/13] EDAC/synopsys: Add multi-ranked memory support Serge Semin
2022-08-22 19:19 ` [PATCH 04/13] EDAC/synopsys: Add optional ECC Scrub support Serge Semin
2022-08-22 19:19 ` [PATCH 05/13] EDAC/synopsys: Drop ECC poison address from private data Serge Semin
2022-08-22 19:19 ` [PATCH 06/13] EDAC/synopsys: Add data poisoning disable support Serge Semin
2022-08-22 19:19 ` [PATCH 07/13] EDAC/synopsys: Split up ECC UE/CE IRQs handler Serge Semin
2022-08-22 19:19 ` [PATCH 08/13] EDAC/synopsys: Add individual named ECC IRQs support Serge Semin
2022-08-22 19:19 ` [PATCH 09/13] EDAC/synopsys: Add DFI alert_n IRQ support Serge Semin
2022-08-22 19:19 ` [PATCH 10/13] EDAC/synopsys: Add reference clocks support Serge Semin
2022-08-22 19:19 ` [PATCH 11/13] EDAC/synopsys: Add ECC Scrubber support Serge Semin
2022-08-22 19:19 ` [PATCH 12/13] EDAC/synopsys: Drop vendor-specific arch dependency Serge Semin
2022-08-22 19:19 ` [PATCH 13/13] EDAC/synopsys: Add Baikal-T1 DDRC support Serge Semin

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=20220908094307.civtqiwxadas3ys3@mobilestation \
    --to=fancer.lancer@gmail.com \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Michail.Ivanov@baikalelectronics.ru \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=bp@alien8.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=james.morse@arm.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manish.narani@xilinx.com \
    --cc=mchehab@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=punnaiah.choudary.kalluri@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=rric@kernel.org \
    --cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox