Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2065108rdh; Tue, 26 Sep 2023 11:11:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHH89fsn+6ZtW9f0FrmpPp5elUeExEGZIeH46BC7uxDaF7weI85yROtHYLkqYBHCAQak81z X-Received: by 2002:aa7:88d1:0:b0:68f:efc2:ba3d with SMTP id k17-20020aa788d1000000b0068fefc2ba3dmr9246365pff.33.1695751878717; Tue, 26 Sep 2023 11:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695751878; cv=none; d=google.com; s=arc-20160816; b=MxufkWr64Qd3ZrObKNStMtWCjhbWNQNx6LyuR8Lmwgh6BvdxuCQPtX4xSEwqK+W0zO XjeDlN1lBOj23CQg1+IqHnwbB1hz5lVN+yffWD0//R7N06t39RIMK2bfnYE7Zb+MYLaq dSMOmm3dTQeulYoG5nntu0d9Y971Il4KZdMoqD9hyiQ29BT4Z3+Mam+wZoUvOUcrfJFZ w1pIcu76SCHF5NmnekBv7lBnMqXM/xM26gWK6yrtiXJ0asnC7Rzi/iMzB2B0yspDjpsY xwd9SciQd48J6ezhuQRAp1dKodY5+aSPVoade1jWaGQmEC1HdOGWYg6AIzc1HyPSlUw5 Sc1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=WByilfXcf9fwVRPpSMAIkhXNNnHM8fT1soPbMgZimUo=; fh=TLj8dfDJHSrZPaC5eHef2e+8TWNxp1p8Xj16jMHK0YQ=; b=CXrc4YyZrGMgUMR5iN5lnF1o5x536uVZLrAsy60vzKi1ZAVXDVeYVARysIO/1tQzfh DZmRZKi8F3R5Z4kXp4UJ8pKHVweFiVQDyY7MZi6ZQYw30QV7sYKQULYSm+ZoE0vhyWTT q3RRjiPxU9QlsNimtn26XawY5Zj/QA5iyHsvVORXmjzBik1CWBvBUzLnpwBuEX1Xcgvb 7ATQ7wgqEYPZNzz+yGW/O0uw3c5wkZpyk1C/A3BXa8IDz6Vq3qEE3T7jSuRkGd+NmuJr SZGJ+sO6Y747SOwrnHQ2InfI8s3jIRjFqsBKOsxaawqiqUpS/7qqX91XThkp/rFdRrDC lqkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UByeNvtF; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fa25-20020a056a002d1900b0068fb3451deesi14189162pfb.290.2023.09.26.11.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 11:11:18 -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=@bootlin.com header.s=gm1 header.b=UByeNvtF; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4518F80D0CF7; Tue, 26 Sep 2023 00:48:30 -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 S233673AbjIZHsb (ORCPT + 99 others); Tue, 26 Sep 2023 03:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjIZHsa (ORCPT ); Tue, 26 Sep 2023 03:48:30 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D1BDC; Tue, 26 Sep 2023 00:48:22 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 62FF41BF208; Tue, 26 Sep 2023 07:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695714501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WByilfXcf9fwVRPpSMAIkhXNNnHM8fT1soPbMgZimUo=; b=UByeNvtFKGUJFu1r0cCVg4+6yFQMDRx3wfWvVNZdgBJ5aAZyYTFHXVNk8YXzQ+gqfyu7Vj LwFeBNk0hjpd+S5kuzcJpVl07s4zPh+5PF9MXJAj2J7Cwa6C5nYzJzLTuzC2dwd3i2QCPm uVHFHh9cTFsd1d1qCeS5kRLHIQgpfDahPO/iUmIvFY9drBLH156TnaLMrfj4GgaTWhwSR9 WKswhTyRPBo685G0NmpdIpmxjid0SysKvF7C/Q3nj76ii+vo7WnUVse1GiqN4XO3Uomjp/ x/3dlWrMw2mvxxabewSs/TLI1FpSmlooHgTCL1cYJWL49xPmAS7MJGXg3zof7A== Date: Tue, 26 Sep 2023 09:48:15 +0200 From: Miquel Raynal To: Simon Glass Cc: Rob Herring , 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 Subject: Re: [PATCH] dt-bindings: mtd: Add a schema for binman Message-ID: <20230926094815.5802e184@xps-13> In-Reply-To: References: <20230921124459.1.I91ddcfacf9b234af5cc3eabea4b62edb31153317@changeid> <20230922174649.GA3320366-robh@kernel.org> <20230925092122.0b615f25@xps-13> <20230925164736.5efbf4c0@xps-13> <20230925172447.43dcef88@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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]); Tue, 26 Sep 2023 00:48:30 -0700 (PDT) Hello, > > > > > 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 = fwupd > > > > > using DT to hold the firmware-update information, so I expect it = will > > > > > move to use these bindings too. =20 > > > > > > > > I would definitely use fixed partitions as that's what you need the= n: > > > > 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 la= bel > > > > (which will become the partition name) and we can discuss additional > > > > properties if needed. =20 > > > > > > 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. =20 > > > > Perhaps: > > > > compatible =3D "binman", "fixed-partitions"; > > > > Though I don't understand why binman couldn't just understand what > > "fixed-partitions" means rather than "binman". =20 >=20 > Well so long as we don't add any binman things in here, you are right. >=20 > 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.=20 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. > 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. >=20 > 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. >=20 > > > > =20 > > > So you are suggesting 'label' for the contents. Rob suggested > > > 'compatible' [1], so what should I do? =20 > > > > "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. =20 >=20 > OK so we are agreed that we are going with 'compatible'. Still strongly disagree here. 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"; I don't see why, for the binman schema, we could not constrain the labels? > > > With this schema, would every node be called 'partition@...' or is > > > there flexibility to use other names? =20 > > > > 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). =20 >=20 > OK I suppose this is the problem with starting small. I was hoping to > build up the schema piece by piece but now I am wondering whether > every little detail will get redirected and I'll end up with something > that Binman cannot use. >=20 > So far all I have is that I can add a 'compress' property and a > 'compatible' which describes the contents. I suppose it is a start. I guess defining all you need in one go would be better. At least showing a full and typical example might help. But some items like encoding if you have TF-A or U-Boot in the compatible, I'm far from convinced... Thanks, Miqu=C3=A8l