Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1409026rdh; Mon, 25 Sep 2023 11:49:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGC9AJ4QRvPfFWKn+wmVKRUfO2XqQdbKo5kHRu9fi8wpjEJwDu68vcszdh7/Mc2JBu+qay/ X-Received: by 2002:a05:6358:6f12:b0:143:8af4:229e with SMTP id r18-20020a0563586f1200b001438af4229emr7882374rwn.9.1695667783781; Mon, 25 Sep 2023 11:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695667783; cv=none; d=google.com; s=arc-20160816; b=G893gwUlKTob79qyOgZvOZeC9UKtfRgSVpmipStm62OXpHVzOHz2hXHI5mVIllU55D URh4cclLFap3fXF7DXHuXe+ZZTr7Sovn82+fPd+nrFBwyyqfqKlmpjkYtXl9OoFtSnje DC8yuUIGWBfdGujgSBvx4t2XCLHF+0vCx9aCEel5UN72OyDZXho06shgi35P6ion/w2d hirakLJv+yJeTeAsQAkwiLIdnWg7ngC3hjst5QrqXk/jPwe3Z3XkP9aLRV3M8vxmmivO NxAcJw4HNafpGn7MnfE8SyFXf1SVl1LO6ik7AhRz2s3K25gm3J42qDK4cWRiIGyJWuqX HDhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+rcy4oYAhba9wCyLwGbxX2HdccPNPodqOPJo6IEv+Zs=; fh=dmpHsdh6RdNQyc81JzSKuvr8YLt8vMMGBbMVzjTymrA=; b=vOq54Hb8XSixGSoQsU4cZXM6Fc3x/uS5w7lhjRoTuOz2F+XWeiGCpFvgRZJb+I+q1U KhmhWjGIIx3YETRWipxQsm7wR3aJz43XiaL4ZC5ABXuAyG0nWPx9JdzSmEgWF9cCyYYu yuUMQsBdxOYbLPpNHiambdGRSzXqbKQ3bHI/wq09wNUNOdn9+5Q+45x1Uqt4lIVhVws6 uZkoee+PUu6nmAEsQgpXa8r8Jp+Z1duA1ZCI9T9Z/AcFw5cWt5ikOJesV3mB6e05Lqxp DXXqpEWvUtYUDvWc5brOijrtRrpTsBF3lDIoWTEfVIZ6gnn3lMoIpMYKb5S7BXfqJ6P/ Hr/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="h8HpK/K+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bs10-20020a63280a000000b00565f4166f4bsi10198810pgb.284.2023.09.25.11.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 11:49:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="h8HpK/K+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 00F2782072E4; Mon, 25 Sep 2023 11:49:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232126AbjIYStl (ORCPT + 99 others); Mon, 25 Sep 2023 14:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbjIYStj (ORCPT ); Mon, 25 Sep 2023 14:49:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEBEB8 for ; Mon, 25 Sep 2023 11:49:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56B09C433D9; Mon, 25 Sep 2023 18:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695667772; bh=+rcy4oYAhba9wCyLwGbxX2HdccPNPodqOPJo6IEv+Zs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=h8HpK/K+JNku8lmwmMNxoufWJOItCjPCi/g42NpWdooJcaidgyNGKIyEraqlT0b3B KkemmWKJLU+NVACs0fBZL2AxSWBntKOybYk+3ljPvdwkaj2KH9fFwSeFsE+gcI4Fgx TPvIfgMPJCh3AL2cqLbcEaKK0NXtoWjawqQAdacQE84+Trqyo1DLdTBiCMWoWiden0 pS3BZAbkXTFe2kL4ShpESGqZrGvS7XX/T2mDFiKl2Ntf1BkDuuEtdKfPtrXCdUUC+R 4s5+peO5db482uGrgAUQbwcwqzSjAbefuvnVvCJ0Ja4B0xR8c2uvBI0eAw+KIJd4C9 Q/kOQXKuQovTg== Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5042f391153so8339805e87.1; Mon, 25 Sep 2023 11:49:32 -0700 (PDT) X-Gm-Message-State: AOJu0YwMBvEsBTPJCUPPCx2Mq2aXLJXRgVXyt198zK4bJ/NIzXr4Ut/k WsTsG6ok9kVi+iMRC9JR+HRc40Qzo20pfLiA0g== X-Received: by 2002:a05:6512:1598:b0:503:a1b:d0c5 with SMTP id bp24-20020a056512159800b005030a1bd0c5mr215163lfb.14.1695667770401; Mon, 25 Sep 2023 11:49:30 -0700 (PDT) MIME-Version: 1.0 References: <20230921124459.1.I91ddcfacf9b234af5cc3eabea4b62edb31153317@changeid> <20230922174649.GA3320366-robh@kernel.org> <20230925092122.0b615f25@xps-13> <20230925164736.5efbf4c0@xps-13> <20230925172447.43dcef88@xps-13> In-Reply-To: From: Rob Herring Date: Mon, 25 Sep 2023 13:49:17 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: mtd: Add a schema for binman To: Simon Glass Cc: Miquel Raynal , devicetree@vger.kernel.org, U-Boot Mailing List , linux-mtd@lists.infradead.org, Tom Rini , Conor Dooley , Dhruva Gole , Krzysztof Kozlowski , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 11:49:41 -0700 (PDT) On Mon, Sep 25, 2023 at 11:25=E2=80=AFAM Simon Glass wro= te: > > Hi Miquel, > > On Mon, 25 Sept 2023 at 09:24, Miquel Raynal = wrote: > > > > Hi Simon, > > > > > > > > > > > > > I was assuming that I should create a top-level compa= tible =3D "binman" > > > > > > > > > > > node, with subnodes like compatible =3D "binman,bl31-= atf", for example. > > > > > > > > > > > I should use the compatible string to indicate the co= ntents, right? > > > > > > > > > > > > > > > > > > > > Yes for subnodes, and we already have some somewhat sta= ndard ones for > > > > > > > > > > "u-boot" and "u-boot-env". Though historically, "label"= was used. > > > > > > > > > > > > > > > > > > Binman has common properties for all entries, including "= compress" > > > > > > > > > which sets the compression algorithm. > > > > > > > > > > > > > > > > I see no issue with adding that. It seems useful and someth= ing missing > > > > > > > > in the existing partition schemas. > > > > > > > > > > > > > > OK I sent a patch with that. > > > > > > > > > > > > > > > > > > > > > > > > So perhaps I should start by defining a new binman,bl31-a= tf which has > > > > > > > > > common properties from an "binman,entry" definition? > > > > > > > > > > > > > > > > I don't understand the binman prefix. The contents are ATF = (or TF-A > > > > > > > > now). Who wrote it to the flash image is not relevant. > > > > > > > > > > > > > > Are you suggesting just "atf-bl31", or "arm,atf-bl31" ? Or sh= ould we > > > > > > > change it to "tfa-bl31"? > > > > > > > > > > > > I don't really understand the relationship with TF-A here. Can'= t we > > > > > > just have a kind of fixed-partitions with additional properties= like > > > > > > the compression? > > > > > > > > > > Binman needs to know what to put in there, which is the purpose o= f the > > > > > compatible string. > > > > > > > > But "what" should be put inside the partition is part of the input > > > > argument, not the output. You said (maybe I got this wrong) that th= e > > > > schema would apply to the output of binman. If you want to let user > > > > know what's inside, maybe it is worth adding a label, but otherwise= I > > > > don't like the idea of a compatible for that, which for me would me= an: > > > > "here is how to handle that specific portion of the flash/here is h= ow > > > > the flash is organized". > > > > > > But I thought that the compatible string was for that purpose? See fo= r > > > example "brcm,bcm4908-firmware" and "brcm,bcm963xx-imagetag" and > > > "linksys,ns-firmware". > > > > These three examples apparently need specific handling, the partitions > > contain meta-data that a parser needs to check or something like that. > > And finally it looks like partition names are set depending on the > > content that was discovered, so yes, the partition name is likely the > > good location to tell users/OSes what's inside. > > > > > > > > Also, I still don't understand the purpose of this schema. So b= inman > > > > > > generates an image, you want to flash this image and you would = like the > > > > > > tool to generate the corresponding (partition) DT snippet autom= atically. > > > > > > Do I get this right? I don't get why you would need new compati= bles for > > > > > > that. > > > > > > > > > > It is actually the other way around. The schema tells Binman how = to > > > > > build the image (what goes in there and where). Then outputs an > > > > > updated DT which describes where everything ended up, for use by = other > > > > > tools, e.g. firmware update. It is a closed loop in that sense. S= ee > > > > > the references for more information. > > > > > > > > Maybe I fail to see why you would want these description to be > > > > introduced here, if they are not useful to the OS. > > > > > > Well I was asked to send them to Linux since they apparently don't > > > belong in dt-schema. That is not what I said. I said fixed-partitions should be extended. I prefer they are extended in-place before moving them rather than the other way around. > > > These are firmware bindings, as indicated, but I > > > took them out of the /firmware node since that is for a different > > > purpose. Rob suggested that partitions was a good place. We have fwup= d > > > using DT to hold the firmware-update information, so I expect it will > > > move to use these bindings too. > > > > I would definitely use fixed partitions as that's what you need then: > > registering where everything starts and ends. If you have "in-band" > > meta data you might require a compatible, but I don't think you > > do, in this case you should probably carry the content through a label > > (which will become the partition name) and we can discuss additional > > properties if needed. > > I believe I am going to need a compatible string at the 'partitions' > level to indicate that this is the binman scheme. But we can leave > that until later. Perhaps: compatible =3D "binman", "fixed-partitions"; Though I don't understand why binman couldn't just understand what "fixed-partitions" means rather than "binman". > So you are suggesting 'label' for the contents. Rob suggested > 'compatible' [1], so what should I do? "label" is for consumption by humans, not tools/software. Compatible values are documented, label values are not. Though the partition stuff started out using label long ago and it's evolved to preferring compatible. > With this schema, would every node be called 'partition@...' or is > there flexibility to use other names? The preference is to use generic names. Do you mean without a unit-address or different from "partition"? The need for the input side of binman to have dynamic addresses seems like the biggest issue. That's allowed in other cases with "partition-N" or "partition-foo" IIRC. I don't think we want to allow that for "fixed-partitions" at least in the DTB (i.e. the output side of binman). Rob