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

Marek Vasut marex at denx.de
Thu Sep 16 19:40:12 CEST 2021


On 9/16/21 5:16 PM, Marek Behún wrote:
> On Wed, 15 Sep 2021 01:06:22 +0200
> Marek Vasut <marex at denx.de> 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.
> 
> CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0" is defined for
> configs/am65x_evm_a53_defconfig and
> configs/am65x_hs_evm_a53_defconfig
> 
> both using device tree arch/arm/dts/k3-am654-base-board.dts
> 
> where you have defined DT node flash at 0.
> 
> Just add partition subnodes, and then you won't need mtdparts.
> 
> This can be done for most users of mtdparts, and we won't to convert
> mtdpart to OF and get rid of it.

You are assuming that every system is capable of updating either DT or 
env, that is not always the case.


More information about the U-Boot mailing list