From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAE66ECAAA1 for ; Tue, 30 Aug 2022 15:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbiH3PCF (ORCPT ); Tue, 30 Aug 2022 11:02:05 -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-Google-Smtp-Source: AA6agR5i7pCzZPQ6g/Em71Ie9JOOQ0sghbZ9CABKEEvmPbaw4YT76PJ933F50vI+A3NC6iw3k/vWog== 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 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