devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Simon Glass <sjg@chromium.org>
Cc: "Rob Herring" <robh@kernel.org>,
	devicetree@vger.kernel.org,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	linux-mtd@lists.infradead.org, "Tom Rini" <trini@konsulko.com>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Dhruva Gole" <d-gole@ti.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: mtd: Add a schema for binman
Date: Mon, 25 Sep 2023 17:24:47 +0200	[thread overview]
Message-ID: <20230925172447.43dcef88@xps-13> (raw)
In-Reply-To: <CAPnjgZ3YCQHJ-eXuX8rYx2Qb6QEL+XviFmXYTON6M-sGPWSBBg@mail.gmail.com>

Hi Simon,

> > > > > > > > > I was assuming that I should create a top-level compatible = "binman"
> > > > > > > > > node, with subnodes like compatible = "binman,bl31-atf", for example.
> > > > > > > > > I should use the compatible string to indicate the contents, right?  
> > > > > > > >
> > > > > > > > Yes for subnodes, and we already have some somewhat standard 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 something missing
> > > > > > in the existing partition schemas.  
> > > > >
> > > > > OK I sent a patch with that.
> > > > >  
> > > > > >  
> > > > > > > So perhaps I should start by defining a new binman,bl31-atf 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 should 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 of 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 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".  
> 
> 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 automatically.
> > > > Do I get this right? I don't get why you would need new compatibles 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. See
> > > 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. 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/Binman_-_A_data-controlled_firmware_packer_for_U-B_pFU3n2K.pdf
> > > [3] https://www.youtube.com/watch?v=L84ujgUXBOQ  
> >  
> 
> Regards,
> Simon


Thanks,
Miquèl

  reply	other threads:[~2023-09-25 15:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 18:45 [PATCH] dt-bindings: mtd: Add a schema for binman Simon Glass
2023-09-22  4:21 ` Rob Herring
2023-09-22  7:01 ` Krzysztof Kozlowski
2023-09-22 15:26   ` Simon Glass
2023-09-22 13:56 ` Alper Nebi Yasak
2023-09-22 15:09   ` Simon Glass
2023-09-22 16:00 ` Rob Herring
2023-09-22 17:01   ` Simon Glass
2023-09-22 17:46     ` Rob Herring
2023-09-22 18:12       ` Simon Glass
2023-09-22 19:43         ` Rob Herring
2023-09-22 19:51           ` Simon Glass
2023-09-25  7:21             ` Miquel Raynal
2023-09-25 12:33               ` Simon Glass
2023-09-25 14:47                 ` Miquel Raynal
2023-09-25 14:53                   ` Simon Glass
2023-09-25 15:24                     ` Miquel Raynal [this message]
2023-09-25 16:25                       ` Simon Glass
2023-09-25 18:49                         ` Rob Herring
2023-09-25 22:25                           ` Simon Glass
2023-09-26  7:48                             ` Miquel Raynal
2023-09-26 17:29                               ` Rob Herring
2023-09-27 16:43                                 ` Simon Glass
2023-09-28 15:20                                   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230925172447.43dcef88@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=d-gole@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=robh@kernel.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).