[PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage

Simon Glass sjg at chromium.org
Mon Jul 6 14:27:03 CEST 2026


Hi Marek,

On Sun, 5 Jul 2026 at 15:26, Marek Vasut <marex at nabladev.com> wrote:
>
> On 7/2/26 1:13 PM, Simon Glass wrote:
>
> [...]
>
> >> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> >> @@ -59,10 +98,52 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
> >> +                # 0x80 ... lookupTable
> >> +                spidata += struct.pack('<I', 0x0818040b)
> >> +                spidata += struct.pack('<I', 0x24043008)
> >
> > Just to check, this LUT is a single-pad fast-read sequence, so should
> > we mention the fixed read command? E.g. if a board uses quad pads,
> > what will happen.
>
> Can you please rephrase this question ? I cannot make any sense of it.

I was trying to figure out what the magic numbers meant.

https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-do-I-properly-define-a-flexspi-LUT-entry/m-p/1016543

So I think you have:

FLEXSPI_LUT_SEQ(CMD_SDR,   FLEXSPI_1PAD, 0x0B, RADDR_SDR, FLEXSPI_1PAD, 0x18),
FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 0x08, READ_SDR,  FLEXSPI_1PAD, 0x04),

so always using a single pad. But you have the nxp,fspi-flashpadtype
property which sems to allow you to select that value, or at least
that is my reading of it. So my point was that people might think they
can change the pad setting using nxp,fspi-flashpadtype but it won't
actually work. Perhaps just a comment would help?

>
> [...]
>
> >> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
> >> @@ -8101,17 +8101,18 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
> >> +        self._DoTestFile('vendor/nxp_imx8m_fspi.dts')
> >> +        self._DoTestFile('vendor/nxp_imx8m_fspi_pass.dts')
> >
> > Since binman now generates the header itself, please can you check the
> > output data in the test, e.g. verify the tag at offset 0 and that the
> > mkimage data starts at 0x1000? That would have caught the padding
> > problem above. Also please use assertIn() on str(e.exception) for each
> > failure case, so the test confirms the expected error rather than any
> > ValueError.
> Sure, if you can provide actual comprehensible example, I can add that.
>
> In the meantime, I skipped this and sent a V4.

For checking the error, see testNxpImx8mCSTFastAuth():

        with terminal.capture() as (_, stderr):
            self._DoTestFile('vendor/nxp_imx8_csf_fast_auth.dts',
                             force_missing_bintools='cst')
        err = stderr.getvalue()
        self.assertRegex(err, "Image 'image'.*missing bintools.*: cst")

For reading the file, if you call _DoReadFile() instead of
_DoTestFile() it returns the output image, so you can then disect it
as you wish. As it is your test checks that the code is exercised, but
not as much about what output is produced.

Regards,
Simon


More information about the U-Boot mailing list