Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4346611rwe; Tue, 30 Aug 2022 08:33:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR42wBvl/OuFq3upU7Ahi3G8rqxalLJjL+ZJR0s4MGMilKuTP9P3NQhTSM5ax8uMRK3sqNHW X-Received: by 2002:a63:e156:0:b0:42b:5541:80d4 with SMTP id h22-20020a63e156000000b0042b554180d4mr17991523pgk.183.1661873605894; Tue, 30 Aug 2022 08:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661873605; cv=none; d=google.com; s=arc-20160816; b=0PG04KH5yXj3yN9a70d1/f3n1NpZ9U3nJ6Z3Agwu+E4U14xgb8z0ECzSK/QiztND91 8T3PbOT9u8SdcFJZj6lXC7VOPBhDOfJ+cmkwJG+G+4MWYLGyo+e4r95qbA4uRX0aqcNK 49DnUHdHnhkEHcOf1JrjrIcNu7ELkme5LGppsDhjnRQ7hzNduPdbOLkwUaoYinqTegSz zxUr+Kuv7byt43pvxqkxKN0R9zZtqce5dL2en4TuHvPbhp9O5Ir6hWSjH8w9aYDQ6TMY ChhfeWn8DWbc/p4cuSCzPJmcea6Cc4zIgox2jqM7S+NF6D1xXt9GnODgXecgUO/qdhhY bTgw== 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=vAQhC6sRUDhKjqRWeiE247SQ82Lv+OkFR1WrPTQjkcs=; b=fxdIiXe85/YF6d8nyC8DtfUeku1VPE3ZUQb5zF3GdflF+485nufzHPbpkipygerBLE swrPWJf//jfRd7T7ik4Hvo52TRHvqJRmUG0jZOrSk6AIPz22BBfgNAqISWFsLCeiop/d sZS6uwRiGScjblNCuOdqeagQquq0pB/3tuoXfiFz/NeQyrTcsm6lYAYGS37NNaln7S+D GoKXy8HstCx0h7JYZBjp1l+8bQIsmKBWt96aBAOwpRgqNB7V+peHst3vm7zMHR6SHhSo CQhEdFsS1wzMPNJ84K0TE37ncHn1BS+sfnEWTjdeLmyrg8HNSJE419+rrChaid9W7PNK 8/LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGk0e3Rd; 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 pj14-20020a17090b4f4e00b001fb0eba9988si12734679pjb.3.2022.08.30.08.33.05; Tue, 30 Aug 2022 08:33:25 -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=EGk0e3Rd; 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 S230040AbiH3PCE (ORCPT + 99 others); Tue, 30 Aug 2022 11:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbiH3PCC (ORCPT ); Tue, 30 Aug 2022 11:02:02 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47015107C6E for ; Tue, 30 Aug 2022 08:02:00 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id bt10so15933776lfb.1 for ; Tue, 30 Aug 2022 08:02:00 -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; bh=vAQhC6sRUDhKjqRWeiE247SQ82Lv+OkFR1WrPTQjkcs=; b=EGk0e3Rdu3KRJsoAEPep+jUDfvENxlUTd5ht2qcN8qj/atK2WcVCgRYM80nUX/mO43 7PaL2sMYBDsMR58YgFFh4YzbAVGiagMqFEAkpiAlPCgOrD/PI8DNO6ZK9YUjJ5O0IQ0f S/IZdkbAWbrk0yE+aRgAdtPV/OnRtuAI/SY2aC637yodEteGUH6jsJGiAQJdvyoJMggE 2x0P1m1rbA512TellLunCUZpgHKFzYCuGnMD3sfPQ7oIR/dPBhoh+w1jB1RH7JHbLVJW PfHNZgvvcbqDrm6FIRtRFpFLSUF7uYVugnodj2FWPNPBp4J/8m1MygoAGS2HXUEroqh0 N0MQ== 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; bh=vAQhC6sRUDhKjqRWeiE247SQ82Lv+OkFR1WrPTQjkcs=; b=sitiN6TzMdqEt9mGr8tlFFrcOgT5SlKmItLjmLaAPbhoGTsvSP8a+X/wP4h4ols7Ef ph56Ll3Pq1m28HDM6TgtLfWrsL9fo0TVCuo7oGYytKx7Lmk0lwjYx0bbHTBI4A8jPJrd 8bsASIi9I31XmaxIvjIekK+lNhq947nzMbvL06+f0hK9TNLbTJh2vC5MuXagU2MO4vxR 53i91Pe1bdjes3pp/mG3ym/JSoqSl/0KI6frbX3L4dNVNAt2TbgU+sNXzclYO2pIyAQF 9vdLSG7du/v4PqUQ09RacHgviPmq0oRnr2qVgh9SK9fTCGAg1SSB+K6f7QhHGcc+96Zy AdCw== X-Gm-Message-State: ACgBeo2j9K1WZX/AB1IorCpKWceIJT6s9h5of66aoSSp8fgl12wdslLZ IlyqnBG8TXZjSeStUkXXCJwLmw== X-Received: by 2002:a19:dc4a:0:b0:493:e21:b77d with SMTP id f10-20020a19dc4a000000b004930e21b77dmr7542663lfj.580.1661871718516; Tue, 30 Aug 2022 08:01:58 -0700 (PDT) Received: from [192.168.28.124] (balticom-73-99-134.balticom.lv. [109.73.99.134]) by smtp.gmail.com with ESMTPSA id f6-20020a056512360600b0049288e0bd61sm1647696lfs.58.2022.08.30.08.01.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Aug 2022 08:01:57 -0700 (PDT) Message-ID: <3bb4b2c9-de07-f981-14bd-02c58c9fad35@linaro.org> Date: Tue, 30 Aug 2022 18:01:56 +0300 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 01/13] dt-bindings: memory: snps: Extend schema with IRQs/resets/clocks props 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-2-Sergey.Semin@baikalelectronics.ru> <6a803554-bc1a-9f53-b7e2-7571fffea7e0@linaro.org> <20220826084726.7ra7342pa33bci5h@mobilestation> From: Krzysztof Kozlowski In-Reply-To: <20220826084726.7ra7342pa33bci5h@mobilestation> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 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:47, Serge Semin wrote: >> >>> + >>> + interrupt-names: >>> + minItems: 1 >>> + maxItems: 5 >>> + oneOf: >>> + - description: Common ECC CE/UE/Scrubber/DFI Errors IRQ >>> + items: >>> + - const: ecc >>> + - description: Individual ECC CE/UE/Scrubber/DFI Errors IRQs >>> + items: >>> + enum: [ ecc_ce, ecc_ue, ecc_ap, ecc_sbr, dfi_e ] >>> >>> reg: >>> maxItems: 1 >>> >>> + clocks: >>> + description: >>> + A standard set of the clock sources contains CSRs bus clock, AXI-ports >>> + reference clock, DDRC core clock, Scrubber standalone clock >>> + (synchronous to the DDRC clock). >>> + minItems: 1 >>> + maxItems: 4 >> > >> I expect list to be strictly defined, not flexible. > > Some of the clock sources might be absent or tied up to another one > (for instance pclk, aclk and sbr can be clocked from a single core > clock source). It depends on the IP-core synthesize parameters. Yet still your device has clock lines - clock inputs, right? Therefore still 4 clocks will be going there or you want to say that the pin is not connected (or pulled down)? > >> >>> + >>> + clock-names: >>> + minItems: 1 >>> + maxItems: 4 >>> + items: >>> + enum: [ pclk, aclk, core, sbr ] >>> + >>> + resets: >>> + description: >>> + Each clock domain can have separate reset signal. >>> + minItems: 1 >>> + maxItems: 4 >>> + >>> + reset-names: >>> + minItems: 1 >>> + maxItems: 4 >>> + items: >>> + enum: [ prst, arst, core, sbr ] >> > >> The same. > > The same as for the clock. > >> >>> + >>> required: >>> - compatible >>> - reg >>> @@ -48,4 +92,15 @@ examples: >>> interrupt-parent = <&gic>; >>> interrupts = <0 112 4>; >>> }; >>> + - | >>> + memory-controller@fd070000 { >>> + compatible = "snps,ddrc-3.80a"; >>> + reg = <0x3d400000 0x400000>; >>> + >>> + interrupts = <0 147 4>, <0 148 4>, <0 149 4>, <0 150 4>; >> > >> Use proper defines. > > What do you mean? Which defines do you think would be proper? If you > meant the IRQ DT-bindings macros, then what difference does it make > for a generic device in the DT-binding example? The macros/defines representing these numbers. > Note since the device > is defined as generic it can be placed on different platforms with > different interrupt controller requirements. So what do you mean by > "proper" in this case? Proper means text instead of hard-coded number. This piece of code has meaning in a specific context, because you used interrupts matching some specific interrupt controllers. In that controller context, the "4" has a meaning. Just like "0". You cannot say that this piece of code is interrupt-controller-independent, because it is not. 4 has meaning. If you want it to be independent, drop all the flags... If you use flags from a specific implementation, then use proper defines matching them, not hard-coded numbers. Best regards, Krzysztof