[PATCH 1/4] binman: Add support for align argument to mkimage tool

Simon Glass sjg at chromium.org
Thu Jan 19 17:20:40 CET 2023


Hi Jonas,

On Thu, 19 Jan 2023 at 05:40, Jonas Karlman <jonas at kwiboo.se> wrote:
>
> Hi Simon,
>
> On 2023-01-18 20:42, Simon Glass wrote:
> > Hi Jonas,
> >
> > On Tue, 17 Jan 2023 at 15:54, Jonas Karlman <jonas at kwiboo.se> wrote:
> >>
> >> Add support to indicate what alignment to use for the FIT and its
> >> external data. Pass the alignment to mkimage via the -B flag.
> >>
> >> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
> >> ---
> >>  tools/binman/btool/mkimage.py | 5 ++++-
> >>  tools/binman/etype/fit.py     | 8 ++++++++
> >>  2 files changed, 12 insertions(+), 1 deletion(-)
> >
> > This looks good to me but please update docs at the top of fit.py,
> > regenerate entries.rst  and add a test to ftest.py here, as this
> > causes a test-coverage failure:
>
> I will take a look and send a v2 series that includes tests,
> updated entries.rst and is rebased on top of dm-pull-18jan23.
>
>
> I have noticed that the generated FIT configuration node is not fully
> matching the old script, it uses firmware = "u-boot" instead of "atf-1".
> So TF-A is never initialized with the new FIT.
>
> I made a quick attempt of a fix using the the diff below.
>
> Now with binman:
> firmware = "u-boot";
> loadables = "atf-1", "atf-2", ...;
>
> With old script:
> firmware = "atf-1";
> loadables = "u-boot", "atf-2", ...;
>
> With the diff below:
> firmware = "atf-1";
> loadables = "u-boot", "atf-1", "atf-2", ...;
>
> Should I send patches with something like this? Or do you have something else in mind?

Yes please!

>
> Regards,
> Jonas
>
>
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> index 1449657e0a..1e8333753e 100644
> --- a/arch/arm/dts/rockchip-u-boot.dtsi
> +++ b/arch/arm/dts/rockchip-u-boot.dtsi
> @@ -116,8 +116,8 @@
>                                 @config-SEQ {
>                                         description = "NAME.dtb";
>                                         fdt = "fdt-SEQ";
> -                                       firmware = "u-boot";
> -                                       fit,loadables;
> +                                       firmware = "atf-1";
> +                                       fit,loadables = "u-boot";
>                                 };
>                         };
>                 };
> diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
> index 51b122962f..21ec9e5cc7 100644
> --- a/tools/binman/etype/fit.py
> +++ b/tools/binman/etype/fit.py
> @@ -525,7 +525,13 @@ class Entry_fit(Entry_section):
>                      with fsw.add_node(node_name):
>                          for pname, prop in node.props.items():
>                              if pname == 'fit,loadables':
> -                                val = '\0'.join(self._loadables) + '\0'
> +                                if type(prop.value) is str:
> +                                    val = [prop.value]
> +                                elif type(prop.value) is list:
> +                                    val = prop.value
> +                                else:
> +                                    val = []
> +                                val = '\0'.join(val + self._loadables) + '\0'
>                                  fsw.property('loadables', val.encode('utf-8'))
>                              elif pname == 'fit,operation':
>                                  pass
>
>
>
> >
> > $ binman test -T
> > ...
> > tools/binman/etype/fit.py                                 224      1    99%
> > tools/binman/btool/mkimage.py                              23      1    96%
> >
> > Regards,
> > Simon
>

Regards,
Simon


More information about the U-Boot mailing list