[PATCH] mtd: spi-nor: Fix SF MTDIDS when registering multiple MTDs with DM enabled

Heiko Schocher hs at denx.de
Wed Sep 15 06:23:11 CEST 2021


Hi Marek,

On 15.09.21 01:06, Marek Vasut wrote:
> The flash->mtd.name used to be nor%d before, now it is the type of the
> SPI NOR like e.g. mt25ql02g. It is possible to find plenty of examples
> of the former in U-Boot configs by searching for MTDIDS.*nor.*spi, while
> the later is ambiguous if there are multiple flashes of the same type in
> the system and breaks existing environments.
> 
> This does no longer get recognized when running 'mtdparts' for example:
> CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0"
> 
> Fix this by setting the correct mtd.name to nor%d.
> 
> Fixes: b7f060565e3 ("mtd: spi-nor: allow registering multiple MTDs when DM is enabled")
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Heiko Schocher <hs at denx.de>
> Cc: Jagan Teki <jagan at amarulasolutions.com>
> Cc: Marek Behún <marek.behun at nic.cz>
> Cc: Miquel Raynal <miquel.raynal at bootlin.com>
> Cc: Pali Rohár <pali at kernel.org>
> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
> Cc: Patrick Delaunay <patrick.delaunay at st.com>
> Cc: Priyanka Jain <priyanka.jain at nxp.com>
> Cc: Simon Glass <sjg at chromium.org>
> ---
>  drivers/mtd/spi/sf_mtd.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Seem fixes the same problem as Patrick already posted here:

https://patchwork.ozlabs.org/project/uboot/patch/20210913095742.v2.1.I73dae4b93f0587dc130e512e95a1f4794e0b0233@changeid/

I find your approach cleaner, so:

Acked-by: Heiko Schocher <hs at denx.de>

@Patrick: Could you test this patch please?

Thanks!

bye,
Heiko

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list