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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D949ECAAA1 for ; Fri, 9 Sep 2022 07:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VXpMNh8X8np/eR9F05jc7XvUsK8QiqWy4KLFpFiJb9s=; b=vRZ/VFGxTqF5Er 850YsHH2YEJR9cg84xFR0t2dfFQ8YB9A8MBUJr52TC8Bc0L5dmQVid7AH8efZKTDGgJ/ljnaf2f01 s6iGutVswJMlZHjB+V6v5y6OvESIsscufoEtEe+Y2OAChQZYzLPf7bT9iFb6K1zxzSa/9oUbWXg1g WkRU6eq5ELfKfKrkbDC1e50D+aA7TPLWqL9GozhcCUxemIPo+99IIAbjaqRF01hLQM2Ji68DKxtK2 UidxduwXYpgWuFQ4zOXDpRywVhfIFosc4Q/lmKnQHTpEzSlfKXIWTOmg3Ehz7Z4qjxDvCA4aRdPdC mGFI2gJ4660Wk/MJnqMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWYpr-00EBWw-9n; Fri, 09 Sep 2022 07:53:59 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWYlb-00E8Z3-9X for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 07:49:36 +0000 Received: by mail-lf1-x130.google.com with SMTP id x14so1301445lfu.10 for ; Fri, 09 Sep 2022 00:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=YDBePgfxHMfutz0NOj3naynVayDcfl77GYakOLW8o7E=; b=qCMmBKRFPHbwu2S8hKnhP7EaHw+InKOw2AaFu2nCNZqtrNUnx5mG2kvXW8fv3o6EdU HmjscBddTZ7JG8EYKUY6IZqIY5az3xzYNcL0dRvmZOysevItk5YCziYPWTqHgKs4MNqs NFxxHzl1TYnl5NGPd7ARuKnvkDmDgbYKMWw0ZJqH8ktr7gM9ujmgRSm2DQKd/l4tVAqo E6uXn8pHbn4taAhgKls5fMKFXhPzWdFYv2HSx/jglGkL6LIXP/H+UQpp0qKtXRljRr4H pyAwKrkdussq5blChHn2ZmBi8rYB8p3Wu2tJbWI0FExKCfGggkiFGOkeKHmEd0+lQvBQ qZ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=YDBePgfxHMfutz0NOj3naynVayDcfl77GYakOLW8o7E=; b=uIkdudleN2RLmO5enfSmhBXXWvYtGFtZRXmt8ywTUlgxSKNIKbcGz3EVsavacvJhc3 lF+IKDe3FsiKfS+dOBB8bj/uJCGdYAhPtnD5uW+a573J4C/vnMPKIXHmlrzhzV0cExyv 3jGKMoevGBIa8cPHGevmGdtiHA4efKyspKF4DhTqDodvX5ry2XwvN47gnRp+EMOh1Xcn BapOeGfSc1Gd5nnv1KlDp2hohxxF50fQRxuZa0Duzs7unDkiXehtc1vUfhy2iMcpUog3 e7QUj4uBjOkeSceyLS68m3+9oDJxWWww/OrNSdHR1g0X4ZrzfsZsr6bpqazCMV+mKJI9 kT4A== X-Gm-Message-State: ACgBeo2F/J40LvnOnJB/7iy48+q1Z+dc0ZLTVQEqt1/ZBJxoDe3ha0FY lgyV8NoqaRm3zV2ug4pAfaM= X-Google-Smtp-Source: AA6agR6Ub9PFeFp51SJQpsb7FbX/qFqnsfcjp88hbV7D4bfA9NC9QegtgJNFuZKZAOCZUTrd78vo9g== X-Received: by 2002:a05:6512:903:b0:494:8355:baef with SMTP id e3-20020a056512090300b004948355baefmr3795371lft.180.1662709770406; Fri, 09 Sep 2022 00:49:30 -0700 (PDT) Received: from mobilestation ([95.79.140.178]) by smtp.gmail.com with ESMTPSA id s2-20020a19ad42000000b00497ac35ae1esm174238lfd.85.2022.09.09.00.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 00:49:29 -0700 (PDT) Date: Fri, 9 Sep 2022 10:49:27 +0300 From: Serge Semin To: Krzysztof Kozlowski 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 Subject: Re: [PATCH 01/13] dt-bindings: memory: snps: Extend schema with IRQs/resets/clocks props Message-ID: <20220909074927.mt2cjz6fgtyce4rk@mobilestation> 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> <3bb4b2c9-de07-f981-14bd-02c58c9fad35@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3bb4b2c9-de07-f981-14bd-02c58c9fad35@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220909_004935_356100_B3A5B7F9 X-CRM114-Status: GOOD ( 32.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Aug 30, 2022 at 06:01:56PM +0300, Krzysztof Kozlowski wrote: > 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)? As we agreed my device will have dedicated DT-schema referencing this one. The DT-bindings in the subject is the generic IP-core bindings. So some of the lines indeed may be absent depending on the synthesize parameters or the particular platform specifics. My device DT-schema will contain more specific clocks/resets/irqs properties constraints. > > > > >> > >>> + > >>> + 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. I'll replace the number 4 with the IRQ-level triggered macro and drop the flag 0 then. -Sergey > > Best regards, > Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel