From: Christian Marangi <ansuelsmth@gmail.com>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Heiko Schocher <hs@nabladev.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Alexey Charkov <alchark@flipper.net>,
Daniel Golle <daniel@makrotopia.org>,
Aristo Chen <aristo.chen@canonical.com>,
"Lucien.Jheng" <lucienzx159@gmail.com>,
Mehmet Fide <mehmet.fide@screeningeagle.com>,
Casey Connolly <casey.connolly@linaro.org>,
Michal Simek <michal.simek@amd.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Johan Jonker <jbx6244@gmail.com>, Anshul Dalal <anshuld@ti.com>,
Romain Gantois <romain.gantois@bootlin.com>,
Mateus Lima Alves <mateuslima.ti@gmail.com>,
Marcello Sylvester Bauer <marcello.bauer@9elements.com>,
Tan Siewert <tan.siewert@9elements.com>,
Peng Fan <peng.fan@nxp.com>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Yao Zi <me@ziyao.cc>, Heinrich Schuchardt <xypron.glpk@gmx.de>,
Martin Schwan <m.schwan@phytec.de>,
u-boot@lists.u-boot-project.org
Subject: Re: [PATCH v8 7/7] test: dm: Add test for FW Loader feature
Date: Fri, 23 Oct 2026 18:27:21 +0200 [thread overview]
Message-ID: <6adb8aed.4f27db6c.db40d.20b0@mx.google.com> (raw)
In-Reply-To: <CAFLszTg76SRJS3MZNi-OhuXSeaM8Sc4j_zA-CTdCGc04j2LB5A@mail.gmail.com>
On Fri, Oct 23, 2026 at 06:12:38AM -0700, Simon Glass wrote:
> Hi Christian,
>
> On 2026-10-22T19:40:35, Christian Marangi (Ansuel) <ansuelsmth@gmail.com> wrote:
> > test: dm: Add test for FW Loader feature
> >
> > Add basic test for FW Loader feature for the Filesystem way and FIP.
> >
> > Additional MMC testing image are added that loads a dummy firmware.bin in
> > a fat partition or a simple FIP blob.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> >
> > arch/sandbox/dts/test.dts | 38 +++++++
> > configs/sandbox64_defconfig | 2 +
> > configs/sandbox_defconfig | 2 +
> > configs/sandbox_flattree_defconfig | 2 +
> > configs/sandbox_noinst_defconfig | 1 +
> > configs/sandbox_spl_defconfig | 2 +
> > configs/sandbox_vpl_defconfig | 2 +
> > test/dm/Makefile | 1 +
> > test/dm/fw_loader.c | 218 +++++++++++++++++++++++++++++++++++++
> > test/py/tests/fip/test.fip | Bin 0 -> 101 bytes
> > test/py/tests/test_ut.py | 26 +++++
> > 11 files changed, 294 insertions(+)
>
> > diff --git a/test/dm/fw_loader.c b/test/dm/fw_loader.c
> > @@ -0,0 +1,218 @@
> > + ret = request_firmware_into_buf(fw_loader_dev, "firmware.bin",
> > + buf, firmware_size, firmware_size + 1);
> > + ut_asserteq(0, ret);
>
> These tests show that the two loaders behave differently when the
> offset is past the end: FS returns 0 here, but FIP returns -EINVAL for
> the same request (see below). Callers go through the uclass and should
> not need to know which loader is behind the phandle, so please can you
> pick one behaviour for both drivers? I think -EINVAL is better, and
> the cover letter says FIP is meant to match FS anyway.
>
Yes exactly... the problem is that I don't want to cause regression in the
use of FS loader with this change of error handling.
Ok I will change FS loader to return -EINVAL as a separate commit.
> > diff --git a/test/dm/fw_loader.c b/test/dm/fw_loader.c
> > @@ -0,0 +1,218 @@
> > + ret = request_firmware_into_buf(fw_loader_dev,
> > + "45a113ac-c7f2-30b0-90a5-a399ab912716",
> > + buf, firmware_size, firmware_size + 1);
> > + ut_asserteq(-EINVAL, ret);
>
> This is the FIP case mentioned above.
>
> > diff --git a/test/dm/fw_loader.c b/test/dm/fw_loader.c
> > @@ -0,0 +1,218 @@
> > + /* Enable the mmc12 node for this test */
> > + root = oftree_root(oftree_default());
>
> This helper is used for mmc13 too, so the comment should not name a
> specific node.
>
> > diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
> > @@ -685,6 +685,31 @@ def test_ut_dm_init(ubman):
> > + fipfile = os.path.join(ubman.config.source_dir,
> > + 'test/py/tests/fip/test.fip')
>
> Please can you explain in the commit message how test.fip was created
> (e.g. the fiptool command line), so the next person can update it?
> Better still, since the format is just a header plus one ToC entry,
> you could build the 101 bytes in Python here and avoid a binary blob
> in the tree. What do you think?
Ehhhhh I checked and it's a lot of effort on creating a python shim to
simulate the format of a FIP blob. I will check it again but providing the
3kb blob was more practical than polluting the python script with something
used for just one task.
>
> Binman has a atf_fip.py but you can't use that here, unfortunately.
>
> Regards,
> Simon
--
Ansuel
next prev parent reply other threads:[~2026-10-23 16:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 19:40 [PATCH v8 0/7] misc: fs_loader: reorg and split to FS and FW loader + FIP loader Christian Marangi
2026-10-22 19:40 ` [PATCH v8 1/7] misc: fs_loader: fix ubifs not unmounted on dev_get_priv error Christian Marangi
2026-10-22 19:40 ` [PATCH v8 2/7] misc: fs_loader: reorganize and split to FS loader and FW UCLASS Christian Marangi
2026-10-23 13:12 ` Simon Glass
2026-10-23 16:22 ` Christian Marangi
2026-10-22 19:40 ` [PATCH v8 3/7] misc: fw_loader: implement generic get_fw_loader_from_node() Christian Marangi
2026-10-22 19:40 ` [PATCH v8 4/7] misc: fw_loader: implement request_firmware_size() OP Christian Marangi
2026-10-22 19:40 ` [PATCH v8 5/7] misc: fw_loader: introduce FIP loader driver Christian Marangi
2026-10-23 13:12 ` Simon Glass
2026-10-23 16:22 ` Christian Marangi
2026-10-22 19:40 ` [PATCH v8 6/7] doc: dtbinding: Update documentation for Generic Firmware loader Christian Marangi
2026-10-23 13:12 ` Simon Glass
2026-10-22 19:40 ` [PATCH v8 7/7] test: dm: Add test for FW Loader feature Christian Marangi
2026-10-23 13:12 ` Simon Glass
2026-10-23 16:27 ` Christian Marangi [this message]
2026-10-23 13:12 ` [PATCH v8 0/7] misc: fs_loader: reorg and split to FS and FW loader + FIP loader 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=6adb8aed.4f27db6c.db40d.20b0@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=alchark@flipper.net \
--cc=anshuld@ti.com \
--cc=aristo.chen@canonical.com \
--cc=casey.connolly@linaro.org \
--cc=daniel@makrotopia.org \
--cc=hs@nabladev.com \
--cc=jbx6244@gmail.com \
--cc=lucienzx159@gmail.com \
--cc=m.schwan@phytec.de \
--cc=marcello.bauer@9elements.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mateuslima.ti@gmail.com \
--cc=me@ziyao.cc \
--cc=mehmet.fide@screeningeagle.com \
--cc=michal.simek@amd.com \
--cc=mkorpershoek@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=patrice.chotard@foss.st.com \
--cc=peng.fan@nxp.com \
--cc=quentin.schulz@cherry.de \
--cc=romain.gantois@bootlin.com \
--cc=sjg@chromium.org \
--cc=tan.siewert@9elements.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=xypron.glpk@gmx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.