Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2045295rdh; Tue, 26 Sep 2023 10:35:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9V5AV3CS9de2KPeqHQKGuHtBOYxR6FOQF0UHNCMMKbR6nbGMlfs9eP/G0bTYKbnygy3zq X-Received: by 2002:a05:6a20:9714:b0:14c:6cd9:bf9d with SMTP id hr20-20020a056a20971400b0014c6cd9bf9dmr6626203pzc.35.1695749738534; Tue, 26 Sep 2023 10:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695749738; cv=none; d=google.com; s=arc-20160816; b=O9BzuIN7U1YGgO6+wwszluDpuq51mPYgaNhLhFD5WCgLEx4V7+gnveoky7v2/I9L4b +iiOBxpzXW793pt/OcheNh+uuy7BftRQRf4LtVHihek6ekNjXDI2sMtolwtTcBTIiI+L 7EviNSzCtY/4dsLr6Ip+3HxZ/hqzHmu9IUcotubnV0tQMWEkzZLBfvhP+UgdJnzbLjXC zgrKqcCVzdnsdj1fUBzxwXZONcu1bsN+Y8cu4tdvittoO3hedSE5pIygW4t65Cpe886B W1AYxujdambrccLJodHwFjcH53gw2EyNTGwDS4QJAgl6A/riF+Ce2DSWrtB7FqQCw9NB kSng== 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=YDIyUv3z7uA3xfnlO4AhNzdT2MmnSc4M6du5MA8Ub+Y=; fh=qV9g4dl/5wZ+VzNecNnsYsQUyWiMHL24EUPrELGeKQs=; b=yiCYF/93Ig53ydlCH48y35SNOGF0fcJTwDAu2KTvHDd8Igthl/uY34MrMIgxETN0Uu uB/TMwXiks7t4dT4FvY8r5aLGJinh9w9W0bRwyIqq2CJoA4C4nvuAJA5Be4VbCiRhALY HG8yt3JT4bYKNzoHl6mRLahqRtb1ns48wfmMYCsRwJQoGOBpEbJCzn0o9rCNmt/MYKvu Nqlaj28rLDwTRwWpsnbRUPwDsJVKncSnReOdsXi28lG6L/4krOJCnMYH3EWCnmMfuitP 2Vic2CdrMCKRjgkC2kYHXlDexPj1ci9azK4/NuMDx6CX/nnLt3laRHIG167QIiLsw8em qubg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLKAuoY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n5-20020a63f805000000b00565ecee8793si12789596pgh.875.2023.09.26.10.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 10:35:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLKAuoY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id F0E61805F5FD; Tue, 26 Sep 2023 10:29:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233837AbjIZR3a (ORCPT + 99 others); Tue, 26 Sep 2023 13:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233977AbjIZR32 (ORCPT ); Tue, 26 Sep 2023 13:29:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58639124 for ; Tue, 26 Sep 2023 10:29:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7CF0C433C7; Tue, 26 Sep 2023 17:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695749359; bh=qrBeQ51Dvxv01D+MaeOf5SpdgRWicIvEOSKVURSSzjA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jLKAuoY9Tq+nBCfB3Rsekoz5TWyvDE4Cz2iyx889195Ydz/Bm/vK+0uAblBSwOgyT 4HO5gJ2LGgExjKXjYF0WDHcIHP6HAV8q6MsvQH2Fa1ungePnpAHr10Ac/tnY6eflVJ wjq7Vx2X7c2MBRDvXAl3jvH6oNjT60/1eozlWbuwyWY/AoV1eIJTb8yOWAOzl/ioDN MrsGgHSHIjl/waRnu0LdfdrngFegEjL6CM/V1e5yav3vZ07wwDPy3N3UER3Udxb7Cp AzFdLBUnvAPAvadGS6HFaFsJ2/0UvPysGZzaf6YxRMh6z8Lbfna7ZlsIvtG+t06sZa NCCbbM6N4VJlQ== Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5041335fb9cso14979399e87.0; Tue, 26 Sep 2023 10:29:19 -0700 (PDT) X-Gm-Message-State: AOJu0YwkSIYyPqCqIonIGl6/fKZIjNMmviVPvhJPb3yU7v53OgUfVk0z E5SvC6A7lNNsEZhuoN3w542LYqNiTxVNKlS34g== X-Received: by 2002:a05:6512:2520:b0:500:8022:3dc7 with SMTP id be32-20020a056512252000b0050080223dc7mr9331056lfb.10.1695749358093; Tue, 26 Sep 2023 10:29:18 -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> <20230926094815.5802e184@xps-13> In-Reply-To: <20230926094815.5802e184@xps-13> From: Rob Herring Date: Tue, 26 Sep 2023 12:29:03 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: mtd: Add a schema for binman To: Miquel Raynal , Simon Glass Cc: 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 10:29:30 -0700 (PDT) On Tue, Sep 26, 2023 at 2:48=E2=80=AFAM Miquel Raynal wrote: > > Hello, > > > > > > > These are firmware bindings, as indicated, but I > > > > > > took them out of the /firmware node since that is for a differe= nt > > > > > > purpose. Rob suggested that partitions was a good place. We hav= e fwupd > > > > > > using DT to hold the firmware-update information, so I expect i= t will > > > > > > move to use these bindings too. > > > > > > > > > > I would definitely use fixed partitions as that's what you need t= hen: > > > > > registering where everything starts and ends. If you have "in-ban= d" > > > > > 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 additio= nal > > > > > 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". > > > > Well so long as we don't add any binman things in here, you are right. > > > > But the eventual goal is parity with current Binman functionality, > > which writes the entire (augmented) description to the DT, allowing > > tools to rebuild / repack / replace pieces later, maintaining the same > > alignment constraints, etc. I am assuming that properties like 'align > > =3D <16>' would not fit with fixed-partitions. > > I am personally not bothered by this kind of properties. But if we plan > on adding too much properties, I will advise to indeed use another name > than fixed-partitions (or add the "binman" secondary compatible) > otherwise it's gonna be hard to support in the code while still > restraining as much as we can the other partition schema. Agreed. It's a trade off. I think we need enough to understand the problem (not just presented with a solution), agree on the general solution/direction, and then discuss specific additions. > > But if we don't preserve > > these properties then Binman cannot do repacking reliably. Perhaps for > > now I could put the augmented DT in its own section somewhere, but I > > am just not sure if that will work in a real system. E.g. with VBE the > > goal is to use the DT to figure out how to access the firmware, update > > it, etc. VBE? > > Is it not possible to have my own node with whatever things Binman > > needs in it (subject to review of course)? i.e. could we discuss how > > to encode it, but argue less about whether things are needed? I > > kind-of feel I know what is needed, since I wrote the tool. What we don't need is the same information in 2 places for the DTB used at runtime. If the binman node is removed, do whatever you want. If you want to keep it at runtime, then it's got to extend what we already have. I don't think anyone is disagreeing about whether specific information is needed or not. > > > > 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. > > > > OK so we are agreed that we are going with 'compatible'. > > Still strongly disagree here. Miquel is right. I was confused here. "label" is still pretty much used for what the image is. Though we do have "u-boot,env" for both it seems. My position on "label" stands. To the extent we have images for common components, I think we should standardize the names. Certainly if tools rely on the names, then they should be documented. > My understanding is that a compatible carries how the content is > organized, and how this maybe specific (like you have in-band meta data > data that needs to be parsed in a specific way or in your case > additional specific properties in the DT which give more context about > how the data is stored). But the real content of the partition, ie. if > it contains a firmware, the kernel or some user data does not belong to > the compatible. > > I.e: > - The first byte of my partition gives the compression algorithm: > -> compatible =3D "compressed-partition-foo"; > or > -> compatible =3D "fixed-partitions" + compression-algorithm =3D "foo"; > - The partition contains a picture of my dog: > -> label =3D "my dog is beautiful" > but certainly not > -> compatible =3D "my-dog"; IMO, compatible in this case should convey "JPEG image" or similar. > I don't see why, for the binman schema, we could not constrain the > labels? Yes, but those should follow what we already have. "u-boot" for example rather than "data,u-boot" which I think Simon had in some version of this. Rob