mtd, nand, omap2: how to pass the NAND device name to mtdparts ?

Roger Quadros rogerq at ti.com
Mon Dec 19 03:11:48 PST 2016


Hi,

On 19/12/16 11:30, Leto, Enrico wrote:
> Hello All,
> 
> I'm trying to port some projects to kernel 4.4. It crashes because the driver name given by mtdparts (omap2-nand.0) is no more accepted. It's running fine if I replace it with the device name (e.g. S34ML04G1).

What crashes? Is it a user space application? If it is then it shouldn't be
depending on the platform device name for anything.

The mtd_dev_info has the mtd device name but I don't think it contains
the chip name. Rather it will contain MTD type and partition name.

The chip names are cryptic and mean nothing to user space. Why do you
want user space to depend on chip names?

> 
> We use different NANDs from different manufacturers. I'm searching for a convenient solution to pass the device name to mtdparts.
> 
> Should I read the device name from u-boot and to pass it to mtdparts?

Kernel can also read the chip model so we don't need to depend on u-boot.

> Or some other suggestion or recommendation how to do that ?

As the kernel mtd driver (nand/spi/etc) already knows this information, it is
a matter of just providing it to userspace. Maybe adding another sysfs parameter
like modelname or something will do.

But as this was not yet done there might be a good reason why the model name was
not provided to user space. Maybe Brian/Boris can comment.

cheers,
-roger



More information about the linux-mtd mailing list