Re: [RFC PATCH v1 9/9] tools: Add tool to create Renesas SPKG images

Pali Rohár
2022-08-09T16:07:10Z

Hello!

On Tuesday 09 August 2022 11:54:30 Ralph Siemsen wrote:
> Hi Pali,
>
> On Tuesday 09 August 2022 15:03:48 Pali Rohár wrote:
> >
> > Hello! You can use for example config file, like it has kwbimage.c which
> > is integrated into mkimage and has support for NAND ECC settings.
>
> Thank you, I was unaware of this config file approach. From a quick
> look at doc/README.kwbimage it seems quite reasonable for
> device-specific parameters.

This documentation is not probably up-to-date. List of all kwbimage
config options can be visible in kwbimage_generate_config() function.

> On Tue, Aug 9, 2022 at 9:07 AM Pali Rohár <pali@kernel.org> wrote:
> >
> > Or another option could be to extend mkimage tool to accept new argument
> > for specifying NAND settings. As we can see more image formats have
> > support for it, so some abstraction in mkimage makes sense here.
>
> In principle I agree. But practically speaking I see two problems:
> 1) mkimage already has far too many options

I know. But for nand there can be just --nand suboption1,suboption2,...
format. For other non-nand vendor specific option it would be an issue.
Maybe something like --vendor option or --image-options ... could be
used?

> 2) covering all possible vendor-specific values/encodings of NAND
> parameters would be quite a task

Yea, it is problematic. But... is not everything related to NAND just
common to what can be specified in device tree properties for nand node?
And de-facto already known and well-defined?

Because I cannot imagine what else for what there is not already device
tree binding, could be required for vendor bootrom. (But maybe I just do
not see it...)

> So I am inclined to keep it simple for now, and try using a config file.
>
> Ralph

Keep it simple is the best option!

In the worst case, in the future, some of the options introduced by your
config file format, would be possible to specify also via command line
arguments. So I do not see any issue with this config file approach.

Just one suggestion: It is a good idea to also implement "verify_header"
mkimage callback. Build process then use it to verify that generated
image is really correct.