Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2946668rwb; Mon, 5 Sep 2022 04:14:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xikmdElLZVmfVcmVXXeIA+WXdPrb0O/1npm86hnOcG7++q3QzOluHAjMUe5JW4S+zCcPz X-Received: by 2002:a17:90a:940d:b0:1fe:39c5:4ce1 with SMTP id r13-20020a17090a940d00b001fe39c54ce1mr19524792pjo.74.1662376454205; Mon, 05 Sep 2022 04:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662376454; cv=none; d=google.com; s=arc-20160816; b=FtXqNM26zMxmQ8UZp5/OlIiWiSKvNtrX5yMYfXgiZOXT/KCA5okLMndHXQOXyntnNF Jh0Go12soXD21piT3X9C05tANhfkct0nTbfJ8RcmSzJcmq5FxLWEenZqKqoIQMaoo/ma iUBZZM/IWr3CB7wpDZ4n9xpRgBdbbua7RCgVVkMR8NH6xbc6kVLuWn2LtoYxbhVR2Y3a dmASr4PPqjsWuHCuojJqaXSx75xVvbMD5elNgVHpXHmVBNlewS0HXYDYov3NWddcRIM5 3eJfgLkltl79IVMYqfgR9rK1MtK+C1WKvj0+jVZq0L3Z86MBFlK3j1gT4gjzMgMjV6ss P1yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=krr00gq+2rnnQjH2jiDEWmx4uGy3f7Je/Uzv5Nqwo9w=; b=fBus57K4I3FBASt6+Ex2z76y7YaRqx2k86nzsYJNDR+6qNDF9z3yfWsKZHO6IMroBX NxuPy/DesZJZJ8JLPU7SJxlPGDSr5+PMagFqcwI0BSlPMJWsZSDoUCME1hEAdXHHBVfv YZlqF8YSjz58XnOPr7IZcnakNPjdA189v6O56uwVr1nTomPxmjZ10xrKEKTpfSk0lddI aeBvXKgn3J9u+Oi7r0m2rx/g95AL4lc5+7V1AMxg5y34dKN+BIB8MoSOD/N5aWHFuX5U 9LVCo5FD7F4Y9pMPQHUKG+NxuMioQhhwJdQOVvKuUFzG4Pc8o8Pct1iDVGGomLQ2S31M +rsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mwaIK5uc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020a63b21a000000b0041d7e787be6si11528933pge.170.2022.09.05.04.13.53; Mon, 05 Sep 2022 04:14:14 -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; dkim=pass header.i=@linaro.org header.s=google header.b=mwaIK5uc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237714AbiIEKQ0 (ORCPT + 99 others); Mon, 5 Sep 2022 06:16:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237783AbiIEKQF (ORCPT ); Mon, 5 Sep 2022 06:16:05 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D60B93 for ; Mon, 5 Sep 2022 03:14:25 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id z23so8757529ljk.1 for ; Mon, 05 Sep 2022 03:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=krr00gq+2rnnQjH2jiDEWmx4uGy3f7Je/Uzv5Nqwo9w=; b=mwaIK5ucn4NK+Emo4I4RNSP1OMgJjPAaZkgPI3hgHJCCTZ57pDEdIghsHLA4ob2pVz fFG4DNOJAG50HsaiGoG2bEZEj36GRNNjqjxs36+pJfqMbomer3i83S6HPkhFzrQnRXWj x9Tu425Of/dPX4NXWV/3M6zftLrzDebI2zELrjMDuLF+N/a3WV7sLsV5eedFhSwCQQLS kNkMc58C4a+iKeXiSnvVKjknTcVAnD5NBM9AdbqGEGAKeyOXVVa1iQ5R/Dffz5Ch8YNY Um2ZwaojYKOQM/oG/gEObStXDB5F8zS4m2E3JdCExsMLf5MpQt5uyahpe3mLfySt80L1 MrXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=krr00gq+2rnnQjH2jiDEWmx4uGy3f7Je/Uzv5Nqwo9w=; b=Z9VEFFDmPvPE+MxGPrMiP5n2U3gD0v0PcCEQPgNPNk6/lF9dHQrQ1nnxh/sLXHurHz EdpTK0j4AjJ1gzgenOTQZ9HNcNEJVgTqZ6/5m14gQGxxjDw1a55GDqg9EQGqFD2sP4IK kMIYHHEl88Tm2k5JYT8crkfBOElLAo0IXcFKcmekv6yzthiBmrJXwgG+x+bcc8QLFDO9 CadIAfz2p+2WygUscyozysGNMkzvdR8QMRCD/Tmi6ePkw7k9eBPacC6Zv8PW+KfIQgsg GIfkvoHVrqHXnhQ3COGDr9r9mC7hohgBcpLI9FBpsF0KUHxKdBZdQkOWCQO31rVX4ZMJ WREg== X-Gm-Message-State: ACgBeo2diILx0L8xSUwAdspC0rg1L63HTdINyPN0EPr/cV4vLhHPj05t oOGOWS9IZA27c443khzcpZI3yQ== X-Received: by 2002:a2e:a9a0:0:b0:268:5e62:acfb with SMTP id x32-20020a2ea9a0000000b002685e62acfbmr7929456ljq.326.1662372863427; Mon, 05 Sep 2022 03:14:23 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id y10-20020a05651c106a00b0025e42f8e771sm1353110ljm.34.2022.09.05.03.14.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Sep 2022 03:14:22 -0700 (PDT) Message-ID: <36b2b6d9-9ab4-a4bc-6476-bd5b5d3ef77e@linaro.org> Date: Mon, 5 Sep 2022 12:14:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH 02/13] dt-bindings: memory: snps: Add Baikal-T1 DDRC support Content-Language: en-US To: Serge Semin Cc: Serge Semin , Michal Simek , Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , Rob Herring , Manish Narani , Alexey Malahov , Michail Ivanov , Pavel Parkhomenko , Punnaiah Choudary Kalluri , Dinh Nguyen , James Morse , Robert Richter , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220822191957.28546-1-Sergey.Semin@baikalelectronics.ru> <20220822191957.28546-3-Sergey.Semin@baikalelectronics.ru> <0bda4ff9-fc08-77f2-0e06-7469dcaec6d8@linaro.org> <20220826095447.qxfvty6xq4tufe75@mobilestation> From: Krzysztof Kozlowski In-Reply-To: <20220826095447.qxfvty6xq4tufe75@mobilestation> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org 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. > + > +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. Best regards, Krzysztof