Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1485342rdh; Mon, 25 Sep 2023 14:27:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcHbaCIKx0jjuov+vK77hH+iFs9jwdnyVucrcc1Dc6BTXJAtf+Q5BmKQz9NVIMAUwHd17k X-Received: by 2002:a05:6358:341b:b0:140:e78e:c5cc with SMTP id h27-20020a056358341b00b00140e78ec5ccmr4890291rwd.15.1695677255020; Mon, 25 Sep 2023 14:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695677254; cv=none; d=google.com; s=arc-20160816; b=DsVb29RNFEsctCYT1ThQliOX8XunaRa9CmzbFnavXu9Np2N+TRhz/8htIWOaE+wA4w /iK2LKkeEze7Nubktj4AHhASUIdUE4miL/6kb8tpG6b8f0tNFPFjsexu32ITTclOQBP3 OrAcUGiMk39tCUbODeNEy8RveAI68BaGx61R7fBvfQoEcyg06natR/cKt585SF3nbHQk ZLNOkUxSfLD7UEGBfJ4P1UxfCM3Tj2fK1HGKjN+JgjAjXtfQe0ILqhW0UZbzzerzIqvU oPZF/WtjM+9eGlPFx2LV34ZfjhXOspS41UGKylyAfrWWPAajUBGs5P3ThXrxgV+Oht2m sFQw== 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=8FBXEqtw7DtSRFjTe9aE3nB/Na/ZFvYNCCbHQx6230o=; fh=TLj8dfDJHSrZPaC5eHef2e+8TWNxp1p8Xj16jMHK0YQ=; b=euBQc+VD1WxG/Xrj+Bzlre6VbNpvj87wSAUar1zCpgBxCkhB+sfrMzKzZg4IiMFTYA 6BR97gvfogEMqR/lRENmE4cYQmBiP4poh3ighFKZh5v1SyHZ0BvcUBlz22APgA+Jqm/M d/1ppsUdkCF8kQCZiQP1UlmKinPg9zXAtuOMm0wM8Girny+n3tcDAnkg5r1ONHLqiteK IwPldqTninMwOQGDHCzcBBKF4WVXkdrLH9K2ZLnj5pZEz5ntEHnopXQ6mncT9PAhnjT2 Txyg4StB5+E8ZsM/2/dKgH6qtWeVBlxevNgWcDjxQJ726G0wov9BKWPw6mwft8Tcu/Nl uhAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=If4ToL4J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m71-20020a633f4a000000b00578af609d05si10354920pga.244.2023.09.25.14.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:27:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=If4ToL4J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 7162080C038C; Mon, 25 Sep 2023 08:25:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbjIYPZC (ORCPT + 99 others); Mon, 25 Sep 2023 11:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232744AbjIYPZA (ORCPT ); Mon, 25 Sep 2023 11:25:00 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 392FE111; Mon, 25 Sep 2023 08:24:53 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 663B2E000D; Mon, 25 Sep 2023 15:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695655491; 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=8FBXEqtw7DtSRFjTe9aE3nB/Na/ZFvYNCCbHQx6230o=; b=If4ToL4JciFWlhP8QB7i+HGNSQ5PjcAOqXalI0QhDdwFmD9BgkOWXyqN7Hy81uKwoPVKXs imuh8ohuDBbA0kcCFlNI0xLlVk5LycsG2WRP3R+2CNd2Gtw0eacRVNIvVDD2ApbaEV7ryo Hsl7TpFluI+3ww7z1C37hmr0AYtvWDXPuycrfnkhoIB4RQd1+WLC2egYWWhxTluCHzEgxR 1lsJcbGFxGq8nWKbFRsHOCWpJMFYp8rU9u4IbPdmzrxWvUpXm1du4Qt5hB0QIp+SZMsAj5 YzideTKlcCvf34tYWU/LfWdvvmGj1P7UfPY4H916H/cNJEp2t+HosA/1whxyWA== Date: Mon, 25 Sep 2023 17:24:47 +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: <20230925172447.43dcef88@xps-13> In-Reply-To: References: <20230921124459.1.I91ddcfacf9b234af5cc3eabea4b62edb31153317@changeid> <20230922174649.GA3320366-robh@kernel.org> <20230925092122.0b615f25@xps-13> <20230925164736.5efbf4c0@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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:25:09 -0700 (PDT) Hi Simon, > > > > > > > > > I was assuming that I should create a top-level compatibl= e =3D "binman" > > > > > > > > > node, with subnodes like compatible =3D "binman,bl31-atf"= , for example. > > > > > > > > > I should use the compatible string to indicate the conten= ts, right? =20 > > > > > > > > > > > > > > > > Yes for subnodes, and we already have some somewhat standar= d ones for > > > > > > > > "u-boot" and "u-boot-env". Though historically, "label" was= used. =20 > > > > > > > > > > > > > > Binman has common properties for all entries, including "comp= ress" > > > > > > > which sets the compression algorithm. =20 > > > > > > > > > > > > I see no issue with adding that. It seems useful and something = missing > > > > > > in the existing partition schemas. =20 > > > > > > > > > > OK I sent a patch with that. > > > > > =20 > > > > > > =20 > > > > > > > So perhaps I should start by defining a new binman,bl31-atf w= hich has > > > > > > > common properties from an "binman,entry" definition? =20 > > > > > > > > > > > > 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. =20 > > > > > > > > > > Are you suggesting just "atf-bl31", or "arm,atf-bl31" ? Or should= we > > > > > change it to "tfa-bl31"? =20 > > > > > > > > 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? =20 > > > > > > Binman needs to know what to put in there, which is the purpose of the > > > compatible string. =20 > > > > 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 the > > 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 mean: > > "here is how to handle that specific portion of the flash/here is how > > the flash is organized". =20 >=20 > But I thought that the compatible string was for that purpose? See for > 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 binman > > > > generates an image, you want to flash this image and you would like= the > > > > tool to generate the corresponding (partition) DT snippet automatic= ally. > > > > Do I get this right? I don't get why you would need new compatibles= for > > > > that. =20 > > > > > > 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. See > > > the references for more information. =20 > > > > Maybe I fail to see why you would want these description to be > > introduced here, if they are not useful to the OS. =20 >=20 > Well I was asked to send them to Linux since they apparently don't > belong in dt-schema. 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. 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. > > > [1] https://u-boot.readthedocs.io/en/latest/develop/package/index.html > > > [2] https://pretalx.com/media/osfc2019/submissions/Y7EN9V/resources/B= inman_-_A_data-controlled_firmware_packer_for_U-B_pFU3n2K.pdf > > > [3] https://www.youtube.com/watch?v=3DL84ujgUXBOQ =20 > > =20 >=20 > Regards, > Simon Thanks, Miqu=C3=A8l