Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp694883ybl; Wed, 4 Dec 2019 09:21:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxbdgKqf0SLbVlOlpgdTblrDv6JLA0Yu4nCh93OvBSObhQlaHPEVU+8u496uBuS69iYdbSd X-Received: by 2002:aca:bd42:: with SMTP id n63mr3608575oif.70.1575480102412; Wed, 04 Dec 2019 09:21:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575480102; cv=none; d=google.com; s=arc-20160816; b=nuyPz22PxERF51v74jQOlDKzAm0O8Kmfsrc+sz0xm4iRy5DDkgMHhzWWtkhP3En+re IbvOaO0pOrwl22TvuBi2bWJg5+cWzY/FSd5589ZtU8/9EZ842iTpKFaNjEGirAKCc1tn 6xTrwT0K/z8t1ohdC1riFmyvDUffLt21dqayoFq6WB4oaEk8rP/Xn8d6BLtE4hZHFSr4 3LlUP3M8y+7zAMNOo9hETqNvsvHlou1GQT1eTSK0g24xfAcJwF3rDCnI13UkYlRrA5Ve VW9YQHDrU7/UywcytkukMIPhAU2QgoDtrecdciYjIuxPsjdrlbXZsjWhDfj8Gk/aJlNJ EQWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=nRBilBqMbvpvJT6Q8m19nxiKl+qRQlzXGRIaAJfxjE0=; b=fJ6E4H6qQmjwjaIvuV/Ik3z5xl4T7yqHdfbNbttDRt8hpuFj3lEgGzl1BsAtBCAv0b rLdCZEG5toM7cMLVTAL6mq3asoDFB4euh1KEA57rQY5OsEVSFjKgm3JQOB4mlZs0f+PL Zw35OHNhfrzrpJZtNpGSI6bxoTpEsestZ52Ra9DrHyWNEhWqK1BDotXI9zhWa7q7tKRU GLK+mvXNJpKddmnsafmyf5upMUZ7UtReuBbIlaSKTL12ZToVpSGQv2BR2n+1DMyaO4N6 OSIw0sTxujvc4G6IJ/bmlO/+3KN8cIX/5erfXt9picjzRTEda++TtL3sGcDnfRyh5GLx NG9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g205si3578206oif.178.2019.12.04.09.21.29; Wed, 04 Dec 2019 09:21:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728916AbfLDRAi (ORCPT + 99 others); Wed, 4 Dec 2019 12:00:38 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:49579 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728388AbfLDRAi (ORCPT ); Wed, 4 Dec 2019 12:00:38 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MCska-1iTiJI2YF6-008vVh; Wed, 04 Dec 2019 18:00:36 +0100 Received: by mail-qk1-f182.google.com with SMTP id c124so620287qkg.0; Wed, 04 Dec 2019 09:00:36 -0800 (PST) X-Gm-Message-State: APjAAAV92IBGwtXPI7tNil5GVxY6Zl1hErhGDWZFwLN5fGXVoeRTBaDv 3mGmJFfYxJLsGs7kW78u9/1YRJ5R0cK9BEgcbaU= X-Received: by 2002:a37:84a:: with SMTP id 71mr3947065qki.138.1575478835330; Wed, 04 Dec 2019 09:00:35 -0800 (PST) MIME-Version: 1.0 References: <20191120154148.22067-1-orson.zhai@unisoc.com> <20191120154148.22067-2-orson.zhai@unisoc.com> <20191204163830.GA25135@bogus> In-Reply-To: <20191204163830.GA25135@bogus> From: Arnd Bergmann Date: Wed, 4 Dec 2019 18:00:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2 1/2] dt-bindings: syscon: Add syscon-names to refer to syscon easily To: Rob Herring Cc: Orson Zhai , Lee Jones , Mark Rutland , DTML , "linux-kernel@vger.kernel.org" , kevin.tang@unisoc.com, baolin.wang@unisoc.com, Chunyan Zhang Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:r3y+zLBOHRQgdfAtqoipBPFk9rDdEY3DswcS7DxPYiywq28rt5x KiNnTg0N94OtxOciKlyn2WECD0LfoK7rbllL8vxWPlKQ/NBelQNeG7pVmr9VzBQIicvWcdz eFR0JRWT4gR4I8kNMgLU4XCTpvKw88MiSeNZM+0nL3TuElEdqZibbfaTbOJmqpA41Mm9Rx7 PyU5HnuzEp7MSCMrdjFSw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:I9DA6lRZ5js=:+AZx6ppjpOQjuQ9CSM5rZr S9s6uNN0Sm7NqQOJ1r6gWiJdREfJbgmO/2uZuOGQzwX0XVhw53QUqDDk3oJhwNJRPpOJpAek0 ZA1BB0F6ap+I2FSMMncb+evQLhJQ3pM9pLIAJADfQieLx0DMk/K86aYLzwkv34K+socqPOMJX KRSkWBr1cQR0fg/YAySmbIGwQwdR4JAItXjuSpMk/RBEULbS0yUAm0fRs035c4E1VvlxQ9KxX qPhnblcuZLfjgTZSFMK/qiOkeFlzkD/rogD5tWEr5D+/gIR3N8iWwzQG5yIc9E/+/NbDyBJod d78LRyPVR0m5jcAF5a5AEy5cGP8+0njblnalbihdm/LPZ6lTLj39Pah/owoaZ067Ez7UN3eY3 lfIRmWuua6jVlLrf+PP7DvppfkyYOUPd/t4Ws5rpyVcWfEQcl89GFJj281x76igtkn3Q6mFJw gF8hXfTcy8d4jHSWHQ7rEfq3WEAjaxdiGjpiRKno0FSa84UqQHGKHYFqefmUks6pV/0Zfp3d4 vVwkFSmwLr/R7ISlU5RNgc1FB47H4udaIs47YTpcEPcXSLLtA1QR/oG3itCf59MBLDqxVQnTE s65aypf01eB9HX1yhlA/8T29bs4MA7XVOtN/0iDoDq+W5DaZhoeAQBUBwKSA0AY7aldppB3fg 86NyspZ0jPrRkfvaT8MvQsIVFMXRrjp3IiF/hnUdXcz6vqC2W5g1uVPhHm9TMjfEPRM8cOAVL RBASl+VPrCKNSWlh7qPmqqKRk3voVrA8p1OC6/1CtaehNPdmiywVXW9FCUu2FPjEJj2NRCcsJ Ha3wdbdpblgFgdFYOdkxRqvFY4CXjkTVwEQTcI/wkNTHfSkvF9oqP/CJEX6Swv/z3rClwD4/l BFSeueTPbBrATLXF0ZgA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 4, 2019 at 5:38 PM Rob Herring wrote: > On Wed, Nov 20, 2019 at 11:41:47PM +0800, Orson Zhai wrote: > > Make life easier when syscon consumer want to access multiple syscon > > nodes with dozens of items. > > Add syscon-names and relative properties to help to manage different > > cases when accessing more than one syscon node even with arguments. > > > > Signed-off-by: Orson Zhai > > --- > > .../devicetree/bindings/mfd/syscon.txt | 43 +++++++++++++++++++ > > 1 file changed, 43 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt > > index 25d9e9c2fd53..4c7bdb74bb0a 100644 > > --- a/Documentation/devicetree/bindings/mfd/syscon.txt > > +++ b/Documentation/devicetree/bindings/mfd/syscon.txt > > @@ -30,3 +30,46 @@ hwlock1: hwspinlock@40500000 { > > reg = <0x40500000 0x1000>; > > #hwlock-cells = <1>; > > }; > > + > > + > > + > > +==Syscon Name== > > + > > +Syscon name is a helper to be used in consumer nodes who refer to system > > +controller node. It provides a way to refer to syscon node by names with > > +phandle args in syscon consumer node. It will help people who have a lot > > +of syscon references to be managed. It is not a must feature and has no > > +effect to syscon node itself at all. > > + > > +Required properties: > > +- syscons: List of phandles and any number of arguments if needed. Arguments > > + is specific to differnet vendors and its usage should be described at each > > + vendor's bindings. For example: In Unisoc SoCs, the 1st arg will be treated > > + as register address offset and the 2nd is bit mask. > > + > > +- syscon-names: List of syscon node name strings sorted in the same order as > > + what it represents in property syscons. > > + > > +Optional property: > > +- #.*-cells: Represents the number of arguments in single phandle in syscons > > + list. ".*" is vendor specific. If this property is not set, default value > > + will be 0. > > This breaks the normal pattern of how '#.*-cells' works. While Arnd > suggests removing it, I don't think that works well either with having a > generic 'syscons' property. That means every syscon in a system has to > have the same number of cells. > > I don't really want to see syscon binding expanded. Really, I'd like > 'syscon' to go away. It's nothing more than a flag to create a regmap. Not expanding the syscon binding is the point about not having a #*-cells: In the examples that Orson listed, the cell count would always be specific to the user of the syscon regmap, and not interpreted by the syscon itself. > I think it is better to keep the property names specific to exactly what > the functionality is for each syscon phandle rather than a generic > binding. > > What are the eamples of where you want to use this? I think generally speaking this would be useful for random registers that logically belong to one device but are grouped with other unrelated registers in a syscon, and that are in a different register offset for each chip that has them. Using named properties instead of a list of phandle/arg tuples with names is clearly a simpler alternative and more like we do it today, but I can also see some API simplification with Orson's patch without the binding getting out of hand. > Keep in mind that > this sort of connection should *only* be used for things that have no > other binding and kernel subsystem. +1 Arnd