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 8F638C38145 for ; Fri, 2 Sep 2022 17:05:59 +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=C5C7n220rKDBhYpB4gOU+n5/Q8mM7NccwiU7cR4dJEs=; b=io4+tBURP+GjqQ KjXjiXc031rvyEo0NYIBxjyholjo2kGrGEhblmzKMeKddq2BFuFvdGmTEoQKxfzeLb1VP1kPGz5GL XZ/SO55Fn3Q8TsC0KtLxTuhtfimsBltrsZfnqvSDmItvCnZty+2kKo94Repaua1Wk5UAhDm5MO6U+ 0HXA5cawFlecefc5oIhvpmM37c7WVR4sPx9G9MzazRIm6BII+xVPa6bTaX/F+2H3bTUzuCNYpABfP n8Ho/JB8BTApO4aPn6G4raNx+cTWaQ2e9BlxXu4WTWjYICLFXui/5GgOlAvoeOjC7TqU0NEZho2uM cGTvx32u8t3Rl8Vpqm5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUA66-007eDV-5Y; Fri, 02 Sep 2022 17:04:50 +0000 Received: from mail-oa1-f53.google.com ([209.85.160.53]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUA61-007e7y-7x for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 17:04:49 +0000 Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-11f11d932a8so6224569fac.3 for ; Fri, 02 Sep 2022 10:04:43 -0700 (PDT) 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=wYZ6v+E+gcaj843yCuPCzJk2EjReC7fODq6r4wpL8VU=; b=p25UWz02yERnuxH72JfeCrMNvGKtVCbF6zU2VaRbYWwFJYJOLTgjOqXqd6espg8L0z oJHb/1HPj4awkjdfUUaNROGffT7u08+64zAKmVn9965JR2lIWwm/JHZvzkZs1sdHIAL4 eiYERxOQnzsGmV79cff6b/33rsJRGz3ZZIJ+ZB2zH0/Ke47FtKv2gJlH3/5bcY1aFZgD JpeyNBOxhcnz1drMqAsODqEobJTxzO+cyZU7lDio/w4t3+DYfqsOuxfA3HOYBK+gE+0X QHZU2PCIusbtx8PiHnaZjEOBlPgDIRcevHTqnyM92Gj1UyvqV13QV0Vuy6fWxQWbZurC ZVUg== X-Gm-Message-State: ACgBeo1BvPcrFvEXKqdnBjz8yydx91zuZHdr05OqtRw6xTWJTaxSAenk LN35k0o+7uLPRJlD7Uvjn84etFDTIw== X-Google-Smtp-Source: AA6agR5twtq/Ml4e+nWk6xzMYxvoXTHjEt3iX+fMN5f/iS/3OQ73FAuUMZH1R2VzVkLajJW6pr/Jng== X-Received: by 2002:a05:6870:c696:b0:125:691b:d212 with SMTP id cv22-20020a056870c69600b00125691bd212mr1033954oab.26.1662138282953; Fri, 02 Sep 2022 10:04:42 -0700 (PDT) Received: from robh.at.kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id 34-20020a9d0c25000000b006370abdc976sm1194995otr.58.2022.09.02.10.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 10:04:42 -0700 (PDT) Received: (nullmailer pid 58129 invoked by uid 1000); Fri, 02 Sep 2022 17:04:41 -0000 Date: Fri, 2 Sep 2022 12:04:41 -0500 From: Rob Herring To: Mark Kettenis Cc: linux@armlinux.org.uk, krzysztof.kozlowski@linaro.org, arnd@arndb.de, lee@kernel.org, linus.walleij@linaro.org, alyssa@rosenzweig.io, asahi@lists.linux.dev, brgl@bgdev.pl, marcan@marcan.st, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, sven@svenpeter.dev, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org Subject: Re: [PATCH 1/6] dt-bindings: mfd: add binding for Apple Mac System Management Controller Message-ID: <20220902170441.GA52527-robh@kernel.org> References: <426469c1-13cc-178b-4904-09439d7788e8@linaro.org> <928ddeff-efac-920c-7bbf-dda35a942b93@linaro.org> <2fedff34-6a20-f1ce-a756-2bd8671fcd52@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_100445_336991_855D918E X-CRM114-Status: GOOD ( 48.42 ) 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 Fri, Sep 02, 2022 at 04:49:37PM +0200, Mark Kettenis wrote: > > From: Rob Herring > > Date: Thu, 1 Sep 2022 17:26:18 -0500 > > > > On Thu, Sep 1, 2022 at 10:56 AM Russell King (Oracle) > > wrote: > > > > > > On Thu, Sep 01, 2022 at 06:45:52PM +0300, Krzysztof Kozlowski wrote: > > > > On 01/09/2022 18:24, Russell King (Oracle) wrote: > > > > > On Thu, Sep 01, 2022 at 06:15:46PM +0300, Krzysztof Kozlowski wrote: > > > > >> On 01/09/2022 18:12, Russell King (Oracle) wrote: > > > > >>>>> + compatible: > > > > >>>>> + items: > > > > >>>>> + - enum: > > > > >>>>> + - apple,t8103-smc > > > > >>>> > > > > >>>> You miss two spaces of indentation on this level. > > > > >>> > > > > >>> Should that be picked up by the dt checker? > > > > I have a problem that Krzysztof is quicker. ;) Maybe I should stop > > screening the emails (for the times I break things mostly). > > > > > > >> > > > > >> I think yamllint complains about it. It is not a hard-dependency, so > > > > >> maybe you don't have it installed. > > > > >> > > > > >>> > > > > >>>>> + - apple,t8112-smc > > > > >>>>> + - apple,t6000-smc > > > > >>>> > > > > >>>> Bring some order here - either alphabetical or by date of release (as in > > > > >>>> other Apple schemas). I think t6000 was before t8112, so it's none of > > > > >>>> that orders. > > > > >>> > > > > >>> Ok. > > > > >>> > > > > >>>>> + - const: apple,smc > > > > >>>>> + > > > > >>>>> + reg: > > > > >>>>> + description: Two regions, one for the SMC area and one for the SRAM area. > > > > >>>> > > > > >>>> You need constraints for size/order, so in this context list with > > > > >>>> described items. > > > > >>> > > > > >>> How do I do that? I tried maxItems/minItems set to 2, but the dt checker > > > > >>> objected to it. > > > > >> > > > > >> One way: > > > > >> reg: > > > > >> items: > > > > >> - description: SMC area > > > > >> - description: SRAM area > > > > >> > > > > >> but actually this is very similar what you wrote for reg-names - kind of > > > > >> obvious, so easier way: > > > > >> > > > > >> reg: > > > > >> maxItems: 2 > > > > > > > > > > Doesn't work. With maxItems: 2, the example fails, yet it correctly lists > > > > > two regs which are 64-bit address and 64-bit size - so in total 8 32-bit > > > > > ints. > > > > > > > > > > Documentation/devicetree/bindings/mfd/apple,smc.example.dtb: smc@23e400000: reg: [[2, 1044381696], [0, 16384], [2, 1071644672], [0, 1048576]] is too long > > > > > From schema: /home/rmk/git/linux-rmk/Documentation/devicetree/bindings/mfd/apple,smc.yaml > > > > > > > > > > Hence, I originally had maxItems: 2, and ended up deleting it because of > > > > > the dt checker. > > > > > > > > > > With the two descriptions, it's the same failure. > > > > > > > > Yeah, they should create same result. > > > > > > > > > > > > > > I think the problem is that the checker has no knowledge in the example > > > > > of how big each address and size element of the reg property is. So, > > > > > it's interpreting it as four entries of 32-bit address,size pairs > > > > > instead of two entries of 64-bit address,size pairs. Yep, that's it, > > > > > if I increase the number of "- description" entries to four then it's > > > > > happy. > > > > > > > > > > So, what's the solution? > > > > > > > > > > > > > If you open generated DTS examples (in your > > > > kbuild-output/Documentation/devicetree/bindings/mfd/) you will see which > > > > address/size cells are expected. By default it is I think address/size > > > > cells=1, so you need a bus node setting it to 2. > > > > > > Thanks, that works. The patch with all those points addressed now looks > > > like: > > > > > > 8<=== > > > From: "Russell King (Oracle)" > > > Subject: [PATCH] dt-bindings: mfd: add binding for Apple Mac System Management > > > Controller > > > > > > Add a DT binding for the Apple Mac System Management Controller. > > > > > > Signed-off-by: Russell King (Oracle) > > > --- > > > .../devicetree/bindings/mfd/apple,smc.yaml | 61 +++++++++++++++++++ > > > 1 file changed, 61 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/mfd/apple,smc.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/mfd/apple,smc.yaml b/Documentation/devicetree/bindings/mfd/apple,smc.yaml > > > new file mode 100644 > > > index 000000000000..168f237c2962 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/mfd/apple,smc.yaml > > > @@ -0,0 +1,61 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/mfd/apple,smc.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Apple Mac System Management Controller > > > + > > > +maintainers: > > > + - Hector Martin > > > + > > > +description: > > > + Apple Mac System Management Controller implements various functions > > > + such as GPIO, RTC, power, reboot. > > > + > > > +properties: > > > + compatible: > > > + items: > > > + - enum: > > > + - apple,t6000-smc > > > + - apple,t8103-smc > > > + - apple,t8112-smc > > > + - const: apple,smc > > > + > > > + reg: > > > + items: > > > + - description: SMC area > > > + - description: SRAM area > > > > Based on the disjoint addresses, is this really one device? Perhaps > > the SRAM area should use mmio-sram binding? That already supports > > sub-dividing the sram for different uses. I'll comment more on the > > full example. > > To me it does look as if the SRAM is part of the SMC coprocessor > block. It is probably part of a larger SRAM on the side of the SMC > coprocessor. There is a gap, but the addresses are close. The only > thing in between is the SMC mailbox, which is represented by a > separate node. Okay, fair enough. Let's keep them together. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel