Re: [PATCH 2/5] dt-bindings: mtd: Add lantiq,nor
From: Simon Wunderlich
Date: Tue Nov 17 2026 - 11:45:54 EST
On Tuesday, November 17, 2026 11:35:13 AM Central European Standard Time
Miquel Raynal wrote:
> Hi Simon,
>
> On 14/11/2026 at 11:06:04 +01, Simon Wunderlich <sw@xxxxxxxxxxxxxxxxxx>
wrote:
> > The NOR flash on the External Bus Unit (EBU) of Lantiq SoCs is handled
> > by the lantiq-flash driver and used by danube_easy50712.dts, but its
> > binding was never documented.
> >
> > Add a schema for it, including a new optional lantiq,ebu-swap-check
> > property. Some boot loaders, like the BOSS bootmonitor on the bintec
> > elmeg RS123 and RS353, enable the EBU's own endianness swapping for the
> > flash chip select (EBU_BUSCON0 bit 30), and the flash then appears at
> > its unswapped addresses. Whether that bit can be trusted depends on the
> > SoC: it only works on VR9 (xRX200) from revision 1.2 and on AR10
> > (xRX300), and Falcon has no such register. A board property instead of
> > a list of SoC revisions in the driver was requested in the review of an
> > earlier attempt at this. The property does not state the bit's value,
> > so a board keeps working with either boot loader setting.
> >
> > Link:
> > https://lists.infradead.org/pipermail/linux-mtd/2017-January/071749.html
> > Link:
> > https://lists.infradead.org/pipermail/linux-mtd/2017-January/071818.html
> > Signed-off-by: Simon Wunderlich <sw@xxxxxxxxxxxxxxxxxx>
>
> Let's be honest, I am not very familiar with that MTD area and all the
> legacy content is has, but would it be a lot more work to add lantiq as
> a physmap variant? I don't like much the fact that you describe the
> flash without describing the EBU. Physmap versions typically are matched
> using the more specific compatible (lantiq,ebu?) and the cfi-flash
> fallback. All your tweaks are EBU/machine/integration details, not
> related to the flash itself.
>
> One consequence of not modeling the controller is your need for
> EXPORT_SYMBOL_GPL(ltq_ebu_membase) in patch 3/5, which is quite a hack.
>
> Thanks,
> Miquèl
Hi Miquèl,
thank you for applying patch 1!
About physmap: you were right, and this was actually a great hint. I tested on
the my RS123: with the EBU swap that its boot loader enables, the flash is
simply a plain CFI flash. With compatible = "cfi-flash" and the generic physmap
driver, probing, reads (identical to what lantiq-flash reads, unaligned reads
included), erase and write all work. So this board needs no lantiq-flash change
at all, and I'm dropping patches 2 to 5. There won't be a v2.
Turning lantiq-flash itself into a physmap variant for the boards with the
classic U-Boot setup would probably be the cleaner model, but I don't have
such a board to test it, so I'm leaving that alone for now.
Thank you again!
Simon