Exposing NAND chip information

Artem Bityutskiy dedekind1 at gmail.com
Sun Apr 22 10:44:50 EDT 2012


On Sun, 2012-04-15 at 23:20 +0000, Tom Isaacson wrote:
> Hi,
> 
> Our production software needs to record the NAND chip type used in
> production so we have a record in case we get problems later. The
> information we need is printed out by nand_get_flash_type(), e.g.:
>   NAND device: Manufacturer ID: 0x98, Chip ID: 0xd1 (Toshiba NAND
> 128MiB 3,3V 8-bit)
> My plan is to add some files to the /sys tree to expose this
> information. But the only part of that information stored is the
> device name, in mtd_info.name. Is there any reason why I shouldn't add
> the manufacturer name and ID and the chip ID to mtd_info so they can
> be accessed later on? Or should I add them to mxd_mtd_s (in
> nand_base.c) and keep it local?
> 
If you have a need to have them in mtd_info - probably you can add
those. Just add/document a way to detect that the chip does not have
this data. E.g., all zeroes or -1. I mean, NORs might not have the IDs.

> Also, when I add the files to the /sys tree is there any naming
> convention I should follow? I was going to copy the way the eMMC
> device does it:
>   manfid - Manufacturer ID
>   devid - Chip ID
>   manf_name - Manufacturer name
>   dev_name - Chip name

Should we put all ID's to the same file instead? Or at lease
manfid/manf_name and devid/dev_name pairs to waste less RAM because each
sysfs file cunsumes several KiBs of RAM AFAIR (struct inode alone is
several KiB). Also if you add sysfs files - do not forget to document
them id Documentation/ABI and CC Greg KH.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120422/d6521c0c/attachment.sig>


More information about the linux-mtd mailing list